|
@@ -1,4 +1,5 @@
|
|
|
package com.sckw.system.service;
|
|
package com.sckw.system.service;
|
|
|
|
|
+
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
@@ -333,19 +334,19 @@ public class KwsEnterpriseService {
|
|
|
}
|
|
}
|
|
|
Arrays.stream(reqVo.getEntTypes().split(",")).toList().forEach(item -> {
|
|
Arrays.stream(reqVo.getEntTypes().split(",")).toList().forEach(item -> {
|
|
|
//if (!finalTypeList.contains(Integer.parseInt(item))) {
|
|
//if (!finalTypeList.contains(Integer.parseInt(item))) {
|
|
|
- KwsEntType kwsEntType = new KwsEntType();
|
|
|
|
|
- kwsEntType.setEntId(entId);
|
|
|
|
|
- kwsEntType.setType(Integer.parseInt(item));
|
|
|
|
|
- kwsEntType.setId(new IdWorker(1).nextId());
|
|
|
|
|
- kwsEntType.setStatus(Global.NO);
|
|
|
|
|
- kwsEntType.setCreateBy(userId);
|
|
|
|
|
- kwsEntType.setCreateTime(date);
|
|
|
|
|
- kwsEntType.setUpdateBy(userId);
|
|
|
|
|
- kwsEntType.setUpdateTime(date);
|
|
|
|
|
- kwsEntType.setDelFlag(Global.NO);
|
|
|
|
|
- if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
|
|
|
|
|
- throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ KwsEntType kwsEntType = new KwsEntType();
|
|
|
|
|
+ kwsEntType.setEntId(entId);
|
|
|
|
|
+ kwsEntType.setType(Integer.parseInt(item));
|
|
|
|
|
+ kwsEntType.setId(new IdWorker(1).nextId());
|
|
|
|
|
+ kwsEntType.setStatus(Global.NO);
|
|
|
|
|
+ kwsEntType.setCreateBy(userId);
|
|
|
|
|
+ kwsEntType.setCreateTime(date);
|
|
|
|
|
+ kwsEntType.setUpdateBy(userId);
|
|
|
|
|
+ kwsEntType.setUpdateTime(date);
|
|
|
|
|
+ kwsEntType.setDelFlag(Global.NO);
|
|
|
|
|
+ if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
|
|
|
|
|
+ throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
|
|
+ }
|
|
|
//}
|
|
//}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -383,9 +384,9 @@ public class KwsEnterpriseService {
|
|
|
map.put("entName", kwsEnterprise.getFirmName());
|
|
map.put("entName", kwsEnterprise.getFirmName());
|
|
|
map.put("createByName", kwsEnterprise.getContacts());
|
|
map.put("createByName", kwsEnterprise.getContacts());
|
|
|
commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(userId).setEntId(entId)),
|
|
commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(userId).setEntId(entId)),
|
|
|
- MessageEnum.ENT_CERTIFICATE,
|
|
|
|
|
- map,
|
|
|
|
|
- entCertificateUrl);
|
|
|
|
|
|
|
+ MessageEnum.ENT_CERTIFICATE,
|
|
|
|
|
+ map,
|
|
|
|
|
+ entCertificateUrl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -412,7 +413,7 @@ public class KwsEnterpriseService {
|
|
|
for (KwsEntCertificate kwsEntCertificate : kwsEntCertificateList) {
|
|
for (KwsEntCertificate kwsEntCertificate : kwsEntCertificateList) {
|
|
|
//先把旧的作废
|
|
//先把旧的作废
|
|
|
List<KwsEntCertificate> previous = kwsEntCertificateDao.findByEntType(kwsEntCertificate.getEntId(), kwsEntCertificate.getType());
|
|
List<KwsEntCertificate> previous = kwsEntCertificateDao.findByEntType(kwsEntCertificate.getEntId(), kwsEntCertificate.getType());
|
|
|
- previous = previous.stream().filter(item -> item.getId().compareTo(kwsEntCertificate.getId()) != 0).toList();
|
|
|
|
|
|
|
+ previous = previous.stream().filter(item -> !item.getId().equals(kwsEntCertificate.getId())).toList();
|
|
|
if (!CollectionUtils.isEmpty(previous)) {
|
|
if (!CollectionUtils.isEmpty(previous)) {
|
|
|
for (KwsEntCertificate kwsEntCertificate1 : previous) {
|
|
for (KwsEntCertificate kwsEntCertificate1 : previous) {
|
|
|
kwsEntCertificate1.setDelFlag(Global.YES);
|
|
kwsEntCertificate1.setDelFlag(Global.YES);
|
|
@@ -533,6 +534,10 @@ public class KwsEnterpriseService {
|
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_NOT_EXISTS);
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_NOT_EXISTS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ kwsEntCertificates = kwsEntCertificates.stream().filter(item -> item.getStatus().equals(Global.NO)).toList();
|
|
|
|
|
+ if (CollectionUtils.isEmpty(kwsEntCertificates)) {
|
|
|
|
|
+ throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_NOT_EXISTS);
|
|
|
|
|
+ }
|
|
|
/*拼装返参*/
|
|
/*拼装返参*/
|
|
|
List<CertificateResVo> list = new ArrayList<>();
|
|
List<CertificateResVo> list = new ArrayList<>();
|
|
|
kwsEntCertificates.forEach(item -> {
|
|
kwsEntCertificates.forEach(item -> {
|
|
@@ -778,6 +783,10 @@ public class KwsEnterpriseService {
|
|
|
}
|
|
}
|
|
|
EntDetailResVo entDetailResVo = new EntDetailResVo();
|
|
EntDetailResVo entDetailResVo = new EntDetailResVo();
|
|
|
BeanUtils.copyProperties(kwsEnterprise, entDetailResVo);
|
|
BeanUtils.copyProperties(kwsEnterprise, entDetailResVo);
|
|
|
|
|
+ FindManagePojo manageInfoByEntId = kwsEnterpriseDao.findManageInfoByEntId(kwsEnterprise.getId());
|
|
|
|
|
+ if (Objects.nonNull(manageInfoByEntId)) {
|
|
|
|
|
+ entDetailResVo.setContactsId(manageInfoByEntId.getUserId());
|
|
|
|
|
+ }
|
|
|
List<KwsEntType> listByEntIds = kwsEntTypeDao.findListByEntIds(Collections.singletonList(kwsEnterprise.getId()));
|
|
List<KwsEntType> listByEntIds = kwsEntTypeDao.findListByEntIds(Collections.singletonList(kwsEnterprise.getId()));
|
|
|
if (CollectionUtils.isNotEmpty(listByEntIds)) {
|
|
if (CollectionUtils.isNotEmpty(listByEntIds)) {
|
|
|
entDetailResVo.setEntTypes(String.join(Global.COMMA, listByEntIds.stream().map(KwsEntType::getType).map(String::valueOf).distinct().toList()));
|
|
entDetailResVo.setEntTypes(String.join(Global.COMMA, listByEntIds.stream().map(KwsEntType::getType).map(String::valueOf).distinct().toList()));
|
|
@@ -786,8 +795,8 @@ public class KwsEnterpriseService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc 企业联系人信息
|
|
|
|
|
* @param id 企业信息
|
|
* @param id 企业信息
|
|
|
|
|
+ * @desc 企业联系人信息
|
|
|
* @author zk
|
|
* @author zk
|
|
|
* @date 2023/9/1
|
|
* @date 2023/9/1
|
|
|
**/
|
|
**/
|