|
|
@@ -122,83 +122,14 @@ public class KwsEnterpriseService {
|
|
|
* @date: 2023/6/19
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void update(KwsEnterpriseReqVo reqVo) throws SystemException {
|
|
|
+ public void update(UpdateEntInfoReqVo reqVo) throws SystemException {
|
|
|
/*1、更新企业信息表*/
|
|
|
- long entId = reqVo.getId();
|
|
|
- KwsEnterprise kwsEnterprise = checkKwsEnterpriseById(entId);
|
|
|
+ KwsEnterprise kwsEnterprise = checkKwsEnterpriseById(LoginUserHolder.getEntId());
|
|
|
BeanUtils.copyProperties(reqVo, kwsEnterprise);
|
|
|
if (kwsEnterpriseDao.update(kwsEnterprise) <= 0) {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
}
|
|
|
|
|
|
-// /*2、更新企业类型*/
|
|
|
-// List<KwsEntType> kwsEntTypes = kwsEntTypeDao.findListByEntId(entId);
|
|
|
-// List<String> typeReqList = new ArrayList<>();
|
|
|
-// String entTypes = reqVo.getEntTypes();
|
|
|
-// if (StringUtils.isNotBlank(entTypes)) {
|
|
|
-// typeReqList = Arrays.stream(entTypes.split(",")).toList();
|
|
|
-// }
|
|
|
-//
|
|
|
-// //若入参传来的type在表里面本来就有则不管,没有就新增
|
|
|
-// typeReqList.forEach(item -> {
|
|
|
-// if (CollectionUtils.isEmpty(kwsEntTypes) || kwsEntTypes.stream().anyMatch(x -> x.getType() == Integer.parseInt(item))) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// KwsEntType kwsEntType = new KwsEntType();
|
|
|
-// kwsEntType.setEntId(entId);
|
|
|
-// kwsEntType.setType(Integer.parseInt(item));
|
|
|
-// if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
|
|
|
-// throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
-// }
|
|
|
-// });
|
|
|
-//
|
|
|
-// //若表里的type没有在入参传来的type里则做逻辑删除,有就不管
|
|
|
-// if (CollectionUtils.isNotEmpty(kwsEntTypes)) {
|
|
|
-// List<String> finalTypeReqList = typeReqList;
|
|
|
-// kwsEntTypes.forEach(item -> {
|
|
|
-// if (finalTypeReqList.contains(String.valueOf(item.getType()))) {
|
|
|
-// item.setDelFlag(Global.YES);
|
|
|
-// if (kwsEntTypeDao.update(item) <= 0) {
|
|
|
-// throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// });
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*更新证书信息*/
|
|
|
-// //1、没有传则全部删除
|
|
|
-// List<BusinessLicense> certificates = reqVo.getCertificates();
|
|
|
-// if (CollectionUtils.isEmpty(certificates)) {
|
|
|
-// List<KwsEntCertificate> kwsEntCertificates = kwsEntCertificateDao.selectByEntId(entId);
|
|
|
-// if (!CollectionUtils.isEmpty(kwsEntCertificates)) {
|
|
|
-// kwsEntCertificates.forEach(item -> {
|
|
|
-// item.setDelFlag(Global.YES);
|
|
|
-// if (kwsEntCertificateDao.update(item) <= 0) {
|
|
|
-// throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
-// }
|
|
|
-// });
|
|
|
-// }
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// certificates.forEach(item -> {
|
|
|
-// long id = item.getId();
|
|
|
-// if (Objects.isNull(id)) {
|
|
|
-// KwsEntCertificate kwsEntCertificate = new KwsEntCertificate();
|
|
|
-// kwsEntCertificate.setEntId(entId);
|
|
|
-// BeanUtils.copyProperties(item, kwsEntCertificate);
|
|
|
-// if (kwsEntCertificateDao.insert(kwsEntCertificate) <= 0) {
|
|
|
-// throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
-// }
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// KwsEntCertificate kwsEntCertificate = checkEntCertificate(id);
|
|
|
-// BeanUtils.copyProperties(item, kwsEntCertificate);
|
|
|
-// //不做更新条数校验
|
|
|
-// kwsEntCertificateDao.update(kwsEntCertificate);
|
|
|
-// });
|
|
|
}
|
|
|
|
|
|
/**
|