|
|
@@ -12,6 +12,7 @@ import com.sckw.core.utils.*;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.model.EntCertificateInfo;
|
|
|
+import com.sckw.system.api.model.dto.req.RegisterReqDto;
|
|
|
import com.sckw.system.api.model.dto.res.REnterpriseVo;
|
|
|
import com.sckw.system.api.model.dto.res.*;
|
|
|
import com.sckw.system.dao.*;
|
|
|
@@ -137,7 +138,7 @@ public class KwsEnterpriseService {
|
|
|
|
|
|
/**
|
|
|
* @param id 主键id
|
|
|
- * @return KwsEntCertificate
|
|
|
+ * @return KwsEntCertificate
|
|
|
* @desc: 查资质
|
|
|
* @author: czh
|
|
|
* @date: 2023/7/26
|
|
|
@@ -365,7 +366,6 @@ public class KwsEnterpriseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
kwsEntCertificate.setStatus(ApprovalEnum.OK.getCode() == status ? Global.NO : Global.YES);
|
|
|
kwsEntCertificateDao.update(kwsEntCertificate);
|
|
|
|
|
|
@@ -389,10 +389,11 @@ public class KwsEnterpriseService {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
}
|
|
|
|
|
|
- /*第一次审批通过(非更新资质审批通过),构建机构角色等*/
|
|
|
- if (ApprovalEnum.OK.getCode() == status) {
|
|
|
- commonService.updateEntCertificate(entId, BeanUtils.copyToList(kwsEntCertificates, EntCertificateInfo.class));
|
|
|
- if (ApprovalEnum.PROCESS.getCode() == currentApproval) {
|
|
|
+ KwsEntDept kwsEntDept = kwsEntDeptDao.selectByEntId(entId);
|
|
|
+ //主体机构不用走后面的流程
|
|
|
+ if (Objects.isNull(kwsEntDept)) {
|
|
|
+ /*第一次审批通过(非更新资质审批通过),构建机构角色等*/
|
|
|
+ if (ApprovalEnum.OK.getCode() == status && ApprovalEnum.PROCESS.getCode() == currentApproval) {
|
|
|
/*审批通过,绑定角色*/
|
|
|
FindManagePojo findManagePojo = kwsEnterpriseDao.findManageInfoByEntIdBeforeApproval(entId);
|
|
|
if (Objects.isNull(findManagePojo)) {
|
|
|
@@ -405,6 +406,7 @@ public class KwsEnterpriseService {
|
|
|
kwsUserService.fillUserRole(String.valueOf(findManagePojo.getRoleId()), userByAccount.getId(), SystemTypeEnum.COMPANY.getCode());
|
|
|
}
|
|
|
}
|
|
|
+ commonService.updateEntCertificate(entId, BeanUtils.copyToList(kwsEntCertificates, EntCertificateInfo.class));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -505,48 +507,36 @@ public class KwsEnterpriseService {
|
|
|
*/
|
|
|
@Transactional(rollbackFor = {})
|
|
|
public void addEntSettle(AddEntSettleReqVo reqVo) throws SystemException {
|
|
|
-
|
|
|
checkAddEntSettleParam(reqVo);
|
|
|
-
|
|
|
-// /*1、存用户信息*/
|
|
|
-// RegisterReqDto registerReqDto = new RegisterReqDto();
|
|
|
-// registerReqDto.setEntName(reqVo.getFirmName());
|
|
|
-// registerReqDto.setName(reqVo.getContacts());
|
|
|
-// registerReqDto.setPhone(reqVo.getPhone());
|
|
|
-// registerReqDto.setIsMain(Global.YES);
|
|
|
-// registerReqDto.setSystemType(SystemTypeEnum.COMPANY.getCode());
|
|
|
-// RegisterResDto register = kwsUserService.register(registerReqDto);
|
|
|
-
|
|
|
- KwsEnterprise kwsEnterprise = new KwsEnterprise();
|
|
|
- long entId = new IdWorker(1L).nextId();
|
|
|
- kwsEnterprise.setId(entId);
|
|
|
- kwsEnterprise.setCode("");
|
|
|
- kwsEnterprise.setFirmName(reqVo.getFirmName());
|
|
|
- kwsEnterprise.setApproval(ApprovalEnum.NO.getCode());
|
|
|
- kwsEnterprise.setContacts(reqVo.getContacts());
|
|
|
- kwsEnterprise.setPhone(reqVo.getPhone());
|
|
|
- kwsEnterprise.setCreateBy(LoginUserHolder.getUserId());
|
|
|
- kwsEnterprise.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- if (kwsEnterpriseDao.insert(kwsEnterprise) <= 0) {
|
|
|
- throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /*2、认证*/
|
|
|
- EntRegisterReqVo entRegisterReqVo = new EntRegisterReqVo();
|
|
|
- BeanUtils.copyProperties(reqVo, entRegisterReqVo);
|
|
|
- entRegisterReqVo.setEntId(entId);
|
|
|
- register(entRegisterReqVo);
|
|
|
-
|
|
|
-
|
|
|
+ Long entId = new IdWorker(1L).nextId();
|
|
|
//运营端新增企业入驻,直接通过
|
|
|
if (Objects.isNull(reqVo.getEntPid())) {
|
|
|
+ RegisterReqDto registerReqDto = new RegisterReqDto();
|
|
|
+ registerReqDto.setEntName(reqVo.getFirmName());
|
|
|
+ registerReqDto.setName(reqVo.getContacts());
|
|
|
+ registerReqDto.setPhone(reqVo.getPhone());
|
|
|
+ registerReqDto.setIsMain(Global.YES);
|
|
|
+ registerReqDto.setSystemType(SystemTypeEnum.COMPANY.getCode());
|
|
|
+ kwsUserService.register(registerReqDto);
|
|
|
+
|
|
|
+ /*2、认证*/
|
|
|
+ EntRegisterReqVo entRegisterReqVo = new EntRegisterReqVo();
|
|
|
+ BeanUtils.copyProperties(reqVo, entRegisterReqVo);
|
|
|
+ entRegisterReqVo.setEntId(entId);
|
|
|
+ register(entRegisterReqVo);
|
|
|
+
|
|
|
ApprovalReqVo approvalReqVo = new ApprovalReqVo();
|
|
|
- approvalReqVo.setEntId(entRegisterReqVo.getEntId());
|
|
|
+ approvalReqVo.setEntId(entId);
|
|
|
approvalReqVo.setStatus(ApprovalEnum.OK.getCode());
|
|
|
approval(approvalReqVo);
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
+ //主体机构
|
|
|
+ EntRegisterReqVo entRegisterReqVo = new EntRegisterReqVo();
|
|
|
+ BeanUtils.copyProperties(reqVo, entRegisterReqVo);
|
|
|
+ entRegisterReqVo.setEntId(entId);
|
|
|
+ register(entRegisterReqVo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -845,7 +835,7 @@ public class KwsEnterpriseService {
|
|
|
* @author: czh
|
|
|
* @date: 2023/8/1
|
|
|
*/
|
|
|
- private String getCooperateType (List<KwsEntType> kwsEntTypeList) {
|
|
|
+ private String getCooperateType(List<KwsEntType> kwsEntTypeList) {
|
|
|
if (CollectionUtils.isEmpty(kwsEntTypeList)) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -877,7 +867,7 @@ public class KwsEnterpriseService {
|
|
|
|
|
|
/**
|
|
|
* @param entId 企业ID
|
|
|
- * @desc 企业详情(企业登录/司机登录)
|
|
|
+ * @desc 企业详情(企业登录 / 司机登录)
|
|
|
* @author zk
|
|
|
* @date 2023/8/10
|
|
|
**/
|
|
|
@@ -897,9 +887,13 @@ public class KwsEnterpriseService {
|
|
|
//企业类型
|
|
|
List<KwsEntType> entTypes = kwsEntTypeDao.findListByEntId(entId);
|
|
|
enterpriseVo.setEntTypes(entTypes != null ? String.join(Global.COMMA, entTypes.stream().map(KwsEntType::getType).map(String::valueOf).distinct().toList()) : null);
|
|
|
- enterpriseVo.setEntTypeNames(enterpriseVo.getEntTypes() != null ?EntTypeEnum.getNames(enterpriseVo.getEntTypes()) : null);
|
|
|
+ enterpriseVo.setEntTypeNames(enterpriseVo.getEntTypes() != null ? EntTypeEnum.getNames(enterpriseVo.getEntTypes()) : null);
|
|
|
|
|
|
- Map<String, Object> queryParams = new HashMap(){{put("isMain", Global.YES); put("entId", entId); put("systemType", SystemTypeEnum.COMPANY.getCode());}};
|
|
|
+ Map<String, Object> queryParams = new HashMap() {{
|
|
|
+ put("isMain", Global.YES);
|
|
|
+ put("entId", entId);
|
|
|
+ put("systemType", SystemTypeEnum.COMPANY.getCode());
|
|
|
+ }};
|
|
|
List<KwsUserResVo> users = kwsUserService.findPage(queryParams);
|
|
|
KwsUserResVo user = users != null && users.size() > 0 ? users.get(Global.NUMERICAL_ZERO) : null;
|
|
|
enterpriseVo.setMainId(user != null ? user.getId() : null);
|