|
|
@@ -1,7 +1,6 @@
|
|
|
package com.sckw.system.service;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.net.URLEncoder;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.SystemException;
|
|
|
@@ -29,6 +28,7 @@ import com.sckw.system.model.vo.req.*;
|
|
|
import com.sckw.system.model.vo.res.*;
|
|
|
import com.sckw.system.model.vo.res.KwsUserResVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -74,6 +74,9 @@ public class KwsEnterpriseService {
|
|
|
@Autowired
|
|
|
private SysAreaDao sysAreaDao;
|
|
|
|
|
|
+ @Value(value = "${jumpUrl.entCertificate}")
|
|
|
+ private String entCertificateUrl;
|
|
|
+
|
|
|
/**
|
|
|
* @param params 入库
|
|
|
* @desc: 单表入库
|
|
|
@@ -136,7 +139,12 @@ public class KwsEnterpriseService {
|
|
|
public void update(UpdateEntInfoReqVo reqVo) {
|
|
|
/*1、更新企业信息表*/
|
|
|
KwsEnterprise kwsEnterprise = checkKwsEnterpriseById(LoginUserHolder.getEntId());
|
|
|
- commonService.checkEntRepeat(reqVo.getFirmName(), "");
|
|
|
+ List<KwsEnterprise> list = kwsEnterpriseDao.checkEntRepeat(reqVo.getFirmName(), "");
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ if (!list.get(0).getId().equals(kwsEnterprise.getId())) {
|
|
|
+ throw new SystemException(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.ENT_EXISTS);
|
|
|
+ }
|
|
|
+ }
|
|
|
SysArea sysArea = sysAreaDao.selectById(reqVo.getCityCode());
|
|
|
if (Objects.nonNull(sysArea)) {
|
|
|
kwsEnterprise.setCityName(sysArea.getMergerName());
|
|
|
@@ -370,7 +378,7 @@ public class KwsEnterpriseService {
|
|
|
commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(userId).setEntId(entId)),
|
|
|
MessageEnum.ENT_CERTIFICATE,
|
|
|
map,
|
|
|
- "testUrl");
|
|
|
+ entCertificateUrl);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -447,6 +455,29 @@ public class KwsEnterpriseService {
|
|
|
}
|
|
|
}
|
|
|
commonService.updateEntCertificate(entId, BeanUtils.copyToList(kwsEntCertificates, EntCertificateInfo.class));
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("entName", kwsEnterprise.getFirmName());
|
|
|
+ map.put("createByName", LoginUserHolder.getUserName());
|
|
|
+ MessageEnum entCertificatePass;
|
|
|
+ if (Objects.isNull(kwsEntDept)) {
|
|
|
+ entCertificatePass = MessageEnum.ENT_CERTIFICATE_PASS;
|
|
|
+ } else {
|
|
|
+ entCertificatePass = MessageEnum.ENT_DEPT_CERTIFICATE_PASS;
|
|
|
+ }
|
|
|
+ if (reqVo.getStatus().equals(ApprovalEnum.OK.getCode())) {
|
|
|
+
|
|
|
+ commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwsEnterprise.getCreateBy()).setEntId(entId)),
|
|
|
+ MessageEnum.ENT_CERTIFICATE_PASS,
|
|
|
+ map,
|
|
|
+ entCertificateUrl);
|
|
|
+ } else {
|
|
|
+ commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwsEnterprise.getCreateBy()).setEntId(entId)),
|
|
|
+ MessageEnum.ENT_CERTIFICATE_REFUSED,
|
|
|
+ map,
|
|
|
+ entCertificateUrl);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -572,6 +603,13 @@ public class KwsEnterpriseService {
|
|
|
|
|
|
//主体机构
|
|
|
extracted(reqVo, new IdWorker(1L).nextId());
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("entName", reqVo.getFirmName());
|
|
|
+ map.put("createByName", reqVo.getContacts());
|
|
|
+ commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId())),
|
|
|
+ MessageEnum.ENT_DEPT_CERTIFICATE,
|
|
|
+ map,
|
|
|
+ entCertificateUrl);
|
|
|
}
|
|
|
|
|
|
|