|
|
@ -8,15 +8,23 @@ import com.esotericsoftware.minlog.Log; |
|
|
import com.zdxt.enforcementcode.common.config.SiqConfig; |
|
|
import com.zdxt.enforcementcode.common.config.SiqConfig; |
|
|
import com.zdxt.enforcementcode.common.util.StringUtils; |
|
|
import com.zdxt.enforcementcode.common.util.StringUtils; |
|
|
import com.zdxt.enforcementcode.common.util.siq.SIQHttpUtil; |
|
|
import com.zdxt.enforcementcode.common.util.siq.SIQHttpUtil; |
|
|
|
|
|
import com.zdxt.enforcementcode.domain.EnterpriseInformation; |
|
|
|
|
|
import com.zdxt.enforcementcode.domain.EnterpriseUser; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.SIQMsgParamBo; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.SIQMsgParamBo; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.SIQSendMsgBo; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.SIQSendMsgBo; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.ToUserMetaBo; |
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.ToUserMetaBo; |
|
|
|
|
|
import com.zdxt.enforcementcode.domain.bo.thirdparty.YuGaoMsgParamBo; |
|
|
|
|
|
import com.zdxt.enforcementcode.domain.vo.EnterpriseUserRefVo; |
|
|
import com.zdxt.enforcementcode.domain.vo.siq.*; |
|
|
import com.zdxt.enforcementcode.domain.vo.siq.*; |
|
|
|
|
|
import com.zdxt.enforcementcode.mapper.EnterpriseInformationMapper; |
|
|
|
|
|
import com.zdxt.enforcementcode.mapper.EnterpriseUserMapper; |
|
|
|
|
|
import com.zdxt.enforcementcode.service.IEnterpriseUserRefService; |
|
|
import com.zdxt.enforcementcode.service.thirdparty.ISIQService; |
|
|
import com.zdxt.enforcementcode.service.thirdparty.ISIQService; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.dromara.common.core.exception.base.BaseException; |
|
|
import org.dromara.common.core.exception.base.BaseException; |
|
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
@ -34,6 +42,22 @@ public class SIQServiceImpl implements ISIQService { |
|
|
|
|
|
|
|
|
@Resource |
|
|
@Resource |
|
|
private SiqConfig siqConfig; |
|
|
private SiqConfig siqConfig; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 企业信息Mapper |
|
|
|
|
|
*/ |
|
|
|
|
|
private EnterpriseInformationMapper enterpriseInformationMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 企业用户Mapper |
|
|
|
|
|
*/ |
|
|
|
|
|
private EnterpriseUserMapper enterpriseUserMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 企业用户关联Service |
|
|
|
|
|
*/ |
|
|
|
|
|
private IEnterpriseUserRefService enterpriseUserRefService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public SIQTemplateVo getTemplateById(String templateId) { |
|
|
public SIQTemplateVo getTemplateById(String templateId) { |
|
|
try{ |
|
|
try{ |
|
|
@ -49,6 +73,36 @@ public class SIQServiceImpl implements ISIQService { |
|
|
throw new BaseException("获取模板详情失败"); |
|
|
throw new BaseException("获取模板详情失败"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 发送预告消息 |
|
|
|
|
|
* @param paramBo |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
@Async |
|
|
|
|
|
public void sendYuGaoMsg(YuGaoMsgParamBo paramBo) { |
|
|
|
|
|
String enterpriseId = paramBo.getEnterpriseId(); |
|
|
|
|
|
|
|
|
|
|
|
List<EnterpriseUserRefVo> userRefList = enterpriseUserRefService.queryListByEnterpriseId(enterpriseId); |
|
|
|
|
|
if (CollectionUtil.isEmpty(userRefList)) { |
|
|
|
|
|
log.warn("企业[{}]下未找到关联用户,无法发送预告消息", enterpriseId); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (EnterpriseUserRefVo userRef : userRefList) { |
|
|
|
|
|
SIQMsgParamBo siqMsgParamBo = new SIQMsgParamBo(); |
|
|
|
|
|
siqMsgParamBo.setCreateBy(paramBo.getCreateByName()); |
|
|
|
|
|
siqMsgParamBo.setReceiveAccount(String.valueOf(userRef.getLoginName())); |
|
|
|
|
|
Map<String, String> variables = new HashMap<>(); |
|
|
|
|
|
variables.put("enterName", paramBo.getEnterpriseName()); |
|
|
|
|
|
variables.put("dept", paramBo.getDeptName()); |
|
|
|
|
|
variables.put("time", paramBo.getEnforceDate()); |
|
|
|
|
|
siqMsgParamBo.setAdditionalData(variables); |
|
|
|
|
|
sendMsg(siqMsgParamBo); |
|
|
|
|
|
} |
|
|
|
|
|
log.info("企业[{}]预告消息发送完成,共发送{}条", enterpriseId, userRefList.size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void sendMsg(SIQMsgParamBo paramBo) { |
|
|
public void sendMsg(SIQMsgParamBo paramBo) { |
|
|
try { |
|
|
try { |
|
|
|