@@ -108,15 +108,4 @@ public class BeanConfig { | |||
.setRetryHandler(new DefaultHttpRequestRetryHandler(2, true)) | |||
.build(); | |||
} | |||
@Bean | |||
public ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){ | |||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); | |||
threadPoolTaskExecutor.setCorePoolSize(5); | |||
threadPoolTaskExecutor.setKeepAliveSeconds(200); | |||
threadPoolTaskExecutor.setMaxPoolSize(10); | |||
threadPoolTaskExecutor.setQueueCapacity(20); | |||
threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); | |||
return threadPoolTaskExecutor; | |||
} | |||
} |
@@ -24,11 +24,12 @@ public interface RegionConst { | |||
* 丽水行政区划编码 | |||
*/ | |||
String RC_LS = "331100"; | |||
//丽水开发区 | |||
String LS_KF = "331118"; | |||
String LS_KF_IRS = "331151"; | |||
String RC_LS_SBJ_IRS = "331101"; | |||
//遂昌县 | |||
String RC_SC = "331123"; | |||
//丽水开发区 | |||
String LS_KF = "331118"; | |||
String LS_KF_NAME = "开发区"; | |||
/** | |||
@@ -89,6 +89,11 @@ public class DingInfoPullController { | |||
organizationBatchGetTask.organizationGetSubs(orgCode); | |||
} | |||
@GetMapping("/organization-sub/{orgCode}") | |||
public void organizationSubGetOrgs(@PathVariable String orgCode) { | |||
organizationBatchGetTask.organizationSubGetOrgs(orgCode); | |||
} | |||
@GetMapping("/employeeByRegionCode/{regionCode}") | |||
public void employeeBatchGetByRegionCode(@PathVariable String regionCode) { | |||
employeeBatchGetTask.batchGetEmployeeTaskByRegionCode(regionCode); | |||
@@ -223,8 +223,8 @@ public class EmployeeBatchGetTask { | |||
String employeeCode = dingEmployeeInfo.getEmployeeCode(); | |||
DingEmployeeInfo employeeInfo = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||
.eq(DingEmployeeInfo::getEmpPosUnitCode, dingEmployeeInfo.getEmpPosUnitCode()) | |||
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode)); | |||
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode) | |||
.last(BizConst.LIMIT_1)); | |||
if (Objects.isNull(employeeInfo)) { | |||
iDingEmployeeInfoService.save(dingEmployeeInfo); | |||
} else { | |||
@@ -261,6 +261,12 @@ public class EmployeeBatchGetTask { | |||
iUserInfoService.save(userInfo); | |||
}else{ | |||
userInfo.setAvatar(dingEmployeeInfo.getAvatar()); | |||
userInfo.setEmpPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode()); | |||
if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){ | |||
DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode()); | |||
userInfo.setEmpPosUnitName(dingOrganization.getOrganizationName()); | |||
userInfo.setRegionCode(dingOrganization.getDivisionCode()); | |||
} | |||
iUserInfoService.updateById(userInfo); | |||
} | |||
} | |||
@@ -45,6 +45,9 @@ public class OrganizationBatchGetTask { | |||
@Autowired | |||
private IDingOrganizationService iDingOrganizationService; | |||
@Autowired | |||
private EmployeeBatchGetTask employeeBatchGetTask; | |||
/** | |||
* 获取浙政钉组织架构 | |||
*/ | |||
@@ -115,17 +118,28 @@ public class OrganizationBatchGetTask { | |||
.eq(DingOrganization::getOrganizationCode, orgCode) | |||
.last(BizConst.LIMIT_1)); | |||
// 顶级组织code | |||
List<String> topOrgCodes = Lists.newArrayList(orgCode); | |||
GenericResult<List<DingOrgInfoDTO>> listGenericResult = zwddClient.listOrganizationsByCodes(topOrgCodes); | |||
log.info("listGenericResult: {}" + JSON.toJSONString(listGenericResult)); | |||
List<DingOrgInfoDTO> dingOrgInfoDtos = listGenericResult.getData(); | |||
GenericResult<PageSubOrganizationCodeDTO> subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 100, orgCode); | |||
log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); | |||
PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); | |||
List<String> subOrganizationCodeList = data.getSubOrganizationCodeList(); | |||
if(Objects.isNull(subOrganizationCodeList)){ | |||
log.info("subOrganizationCodeList为null"); | |||
return; | |||
} | |||
for(DingOrgInfoDTO dingOrgInfo : dingOrgInfoDtos){ | |||
employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode); | |||
for(String subOrganizationCode : subOrganizationCodeList){ | |||
GenericResult<DingOrgInfoDTO> organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); | |||
DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); | |||
DingOrganization old = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) | |||
.eq(DingOrganization::getOrganizationCode, dingOrgInfo.getOrganizationCode()) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.nonNull(old)){ | |||
log.info("该单位已经存在 :{}",old.getOrganizationName()); | |||
organizationGetSubs(dingOrgInfo.getOrganizationCode()); | |||
// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode()); | |||
continue; | |||
} | |||
@@ -142,11 +156,36 @@ public class OrganizationBatchGetTask { | |||
organization.setGmtCreate(LocalDateTime.now()); | |||
organization.setInstitutionLevelCode(dingOrgInfo.getInstitutionLevelCode()); | |||
organization.setParentName(dingOrgInfo.getParentName()); | |||
iDingOrganizationService.save(organization); | |||
if(iDingOrganizationService.save(organization)){ | |||
organizationGetSubs(organization.getOrganizationCode()); | |||
// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode()); | |||
} | |||
} | |||
log.info("----拉取浙政钉组织子单位结束---,顶级code:" + orgCode); | |||
} | |||
/** | |||
* 查看下 当前的子单位信息 | |||
* @param orgCode | |||
*/ | |||
public void organizationSubGetOrgs(String orgCode) { | |||
// 顶级组织code | |||
GenericResult<PageSubOrganizationCodeDTO> subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 100, orgCode); | |||
log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); | |||
PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); | |||
List<String> subOrganizationCodeList = data.getSubOrganizationCodeList(); | |||
if(Objects.isNull(subOrganizationCodeList)){ | |||
log.info("subOrganizationCodeList为null"); | |||
return; | |||
} | |||
for(String subOrganizationCode : subOrganizationCodeList){ | |||
GenericResult<DingOrgInfoDTO> organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); | |||
DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); | |||
log.info("dingOrgInfo :{}",JSON.toJSONString(dingOrgInfo)); | |||
} | |||
} | |||
private void buildSaveRecordList(List<DingOrgInfoTreeDTO> treeDTOList, List<DingOrganization> saveRecordList) { | |||
@@ -18,7 +18,6 @@ public class ReqCompanyFiscalCodeAndSealSnPO { | |||
@ApiModelProperty("组织编码(需传入用户任职单位code)") | |||
private String organizationCode; | |||
@NotBlank(message = "财政编码 不能为空") | |||
@ApiModelProperty("财政编码") | |||
private String fiscalCode; | |||
@@ -6,6 +6,7 @@ import com.ningdatech.pmapi.gov.contants.BizProjectContant; | |||
import com.ningdatech.pmapi.gov.model.dto.*; | |||
import com.ningdatech.pmapi.gov.model.req.*; | |||
import com.ningdatech.pmapi.gov.model.vo.*; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Collections; | |||
import java.util.List; | |||
@@ -47,6 +48,17 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
public static ProjectPushReq convertWithConvertPdf(GovBizProjectDetailVO vo) { | |||
ProjectPushReq req = new ProjectPushReq(); | |||
req.setBaseinfo(convertBaseVo(vo.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE)); | |||
req.setApply(convertApplyVoWithConvertPdf(vo.getApply())); | |||
req.setApprove(convertApproveVoWithConvertPdf(vo.getApprove())); | |||
req.setCimplement(convertCimplementVoWithConvertPdf(vo.getCimplement())); | |||
req.setMimplement(convertMimplementVoWithConvertPdf(vo.getMimplement())); | |||
req.setProcures(convertProcuresVoWithConvertPdf(vo.getProcures())); | |||
return req; | |||
} | |||
private static List<ProjectProcureReq> convertProcures(List<GovBizProjectProcureDTO> procures) { | |||
if(CollUtil.isEmpty(procures)){ | |||
return Collections.emptyList(); | |||
@@ -81,6 +93,26 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
private static List<ProjectProcureReq> convertProcuresVoWithConvertPdf(List<GovBizProjectProcureVO> procures) { | |||
if(CollUtil.isEmpty(procures)){ | |||
return Collections.emptyList(); | |||
} | |||
List<ProjectProcureReq> req = procures.stream() | |||
.map(p -> { | |||
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | |||
r.setBiddingFile(StringUtils.isNotBlank(p.getBiddingFilePdf()) ? p.getBiddingFilePdf() : | |||
p.getBiddingFile()); | |||
r.setPurchaseFile(StringUtils.isNotBlank(p.getPurchaseFilePdf()) ? p.getPurchaseFilePdf() : | |||
p.getPurchaseFile()); | |||
r.setPurchaseContract(StringUtils.isNotBlank(p.getPurchaseContractPdf()) ? p.getPurchaseContractPdf() : | |||
p.getPurchaseContract()); | |||
return r; | |||
}) | |||
.collect(Collectors.toList()); | |||
return req; | |||
} | |||
private static ProjectMimplementReq convertMimplement(GovBizProjectMimplementDTO mimplement) { | |||
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class); | |||
return req; | |||
@@ -91,6 +123,31 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
private static ProjectMimplementReq convertMimplementVoWithConvertPdf(GovBizProjectMimplementVO mimplement) { | |||
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class); | |||
req.setBaseUserConsFile(StringUtils.isNotBlank(mimplement.getBaseUserConsFilePdf()) ? mimplement.getBaseUserConsFilePdf() : | |||
mimplement.getBaseUserConsFile()); | |||
req.setBaseChanFile(StringUtils.isNotBlank(mimplement.getBaseChanFilePdf()) ? mimplement.getBaseChanFilePdf() : | |||
mimplement.getBaseChanFile()); | |||
req.setBasePasswAssessFile(StringUtils.isNotBlank(mimplement.getBasePasswAssessFilePdf()) ? mimplement.getBasePasswAssessFilePdf() : | |||
mimplement.getBasePasswAssessFile()); | |||
req.setBaseInforLevelFile(StringUtils.isNotBlank(mimplement.getBaseInforLevelFilePdf()) ? mimplement.getBaseInforLevelFilePdf() : | |||
mimplement.getBaseInforLevelFile()); | |||
req.setBaseEngineerPostpoFile(StringUtils.isNotBlank(mimplement.getBaseEngineerPostpoFilePdf()) ? mimplement.getBaseEngineerPostpoFilePdf() : | |||
mimplement.getBaseEngineerPostpoFile()); | |||
req.setBaseEstaSummFile(StringUtils.isNotBlank(mimplement.getBaseEstaSummFilePdf()) ? mimplement.getBaseEstaSummFilePdf() : | |||
mimplement.getBaseEstaSummFile()); | |||
req.setBaseFinalExpertOpinionFile(StringUtils.isNotBlank(mimplement.getBaseFinalExpertOpinionFilePdf()) ? mimplement.getBaseFinalExpertOpinionFilePdf() : | |||
mimplement.getBaseFinalExpertOpinionFile()); | |||
req.setBaseThirdAcceptFile(StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFilePdf()) ? mimplement.getBaseThirdAcceptFilePdf() : | |||
mimplement.getBaseThirdAcceptFile()); | |||
req.setBaseOperatMaintenSummFile(StringUtils.isNotBlank(mimplement.getBaseOperatMaintenSummFilePdf()) ? mimplement.getBaseOperatMaintenSummFilePdf() : | |||
mimplement.getBaseOperatMaintenSummFile()); | |||
req.setBaseEngineerAlterFile(StringUtils.isNotBlank(mimplement.getBaseEngineerAlterFilePdf()) ? mimplement.getBaseEngineerAlterFilePdf() : | |||
mimplement.getBaseEngineerAlterFile()); | |||
return req; | |||
} | |||
public static ProjectCimplementReq convertCimplement(GovBizProjectCimplementDTO cimplement) { | |||
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class); | |||
return req; | |||
@@ -101,6 +158,39 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
public static ProjectCimplementReq convertCimplementVoWithConvertPdf(GovBizProjectCimplementVO cimplement) { | |||
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class); | |||
req.setBaseChangeFormFile(StringUtils.isNotBlank(cimplement.getBaseChangeFormFilePdf()) ? cimplement.getBaseChangeFormFilePdf() : | |||
cimplement.getBaseChangeFormFile()); | |||
req.setBaseUserConsFile(StringUtils.isNotBlank(cimplement.getBaseUserConsFilePdf()) ? cimplement.getBaseUserConsFilePdf() : | |||
cimplement.getBaseUserConsFile()); | |||
req.setBaseCheckFile(StringUtils.isNotBlank(cimplement.getBaseCheckFilePdf()) ? cimplement.getBaseCheckFilePdf() : | |||
cimplement.getBaseCheckFile()); | |||
req.setBaseChanFile(StringUtils.isNotBlank(cimplement.getBaseChanFilePdf()) ? cimplement.getBaseChanFilePdf() : | |||
cimplement.getBaseChanFile()); | |||
req.setBaseSummReportFile(StringUtils.isNotBlank(cimplement.getBaseSummReportFilePdf()) ? cimplement.getBaseSummReportFilePdf() : | |||
cimplement.getBaseSummReportFile()); | |||
req.setBasePasswAssessFile(StringUtils.isNotBlank(cimplement.getBasePasswAssessFilePdf()) ? cimplement.getBasePasswAssessFilePdf() : | |||
cimplement.getBasePasswAssessFile()); | |||
req.setBaseInforLevelFile(StringUtils.isNotBlank(cimplement.getBaseInforLevelFilePdf()) ? cimplement.getBaseInforLevelFilePdf() : | |||
cimplement.getBaseInforLevelFile()); | |||
req.setBaseEngineerPostpoFile(StringUtils.isNotBlank(cimplement.getBaseEngineerPostpoFilePdf()) ? cimplement.getBaseEngineerPostpoFilePdf() : | |||
cimplement.getBaseEngineerPostpoFile()); | |||
req.setBaseEstaSummFile(StringUtils.isNotBlank(cimplement.getBaseEstaSummFilePdf()) ? cimplement.getBaseEstaSummFilePdf() : | |||
cimplement.getBaseEstaSummFile()); | |||
req.setBaseFinanlAuditFile(StringUtils.isNotBlank(cimplement.getBaseFinanlAuditFilePdf()) ? cimplement.getBaseFinanlAuditFilePdf() : | |||
cimplement.getBaseFinanlAuditFile()); | |||
req.setBaseFinalExpertOpinionFile(StringUtils.isNotBlank(cimplement.getBaseFinalExpertOpinionFilePdf()) ? cimplement.getBaseFinalExpertOpinionFilePdf() : | |||
cimplement.getBaseFinalExpertOpinionFile()); | |||
req.setBaseThirdAcceptFile(StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFilePdf()) ? cimplement.getBaseThirdAcceptFilePdf() : | |||
cimplement.getBaseThirdAcceptFile()); | |||
req.setBaseInitialOpinionFile(StringUtils.isNotBlank(cimplement.getBaseInitialOpinionFilePdf()) ? cimplement.getBaseInitialOpinionFilePdf() : | |||
cimplement.getBaseInitialOpinionFile()); | |||
req.setBaseIrsTestRunFile(StringUtils.isNotBlank(cimplement.getBaseIrsTestRunFilePdf()) ? cimplement.getBaseIrsTestRunFilePdf() : | |||
cimplement.getBaseIrsTestRunFile()); | |||
return req; | |||
} | |||
public static ProjectApproveReq convertApprove(GovBizProjectApproveDTO approve) { | |||
ProjectApproveReq req = new ProjectApproveReq(); | |||
if(Objects.isNull(approve)){ | |||
@@ -151,6 +241,34 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
public static ProjectApproveReq convertApproveVoWithConvertPdf(GovBizProjectApproveVO approve) { | |||
ProjectApproveReq req = new ProjectApproveReq(); | |||
if(Objects.isNull(approve)){ | |||
return req; | |||
} | |||
req.setBaseProjId(approve.getBaseProjId()); | |||
req.setBaseProjName(approve.getBaseProjName()); | |||
req.setOp(approve.getOp()); | |||
req.setApprovalFile(StringUtils.isNotBlank(approve.getApprovalFilePdf()) ? approve.getApprovalFilePdf() : | |||
approve.getApprovalFile()); | |||
req.setBaseReviewCommentsFile(StringUtils.isNotBlank(approve.getBaseReviewCommentsFilePdf()) ? approve.getBaseReviewCommentsFilePdf(): | |||
approve.getBaseReviewCommentsFile()); | |||
req.setPreliminaryDesignFile(StringUtils.isNotBlank(approve.getPreliminaryDesignFilePdf()) ? approve.getPreliminaryDesignFilePdf() : | |||
approve.getPreliminaryDesignFile()); | |||
req.setAreaCode(approve.getAreaCode()); | |||
req.setBaseDevelopCode(approve.getBaseDevelopCode()); | |||
req.setBaseExpertTotalMoney(String.valueOf(approve.getBaseExpertTotalMoney())); | |||
req.setBaseExpertYearMoney(String.valueOf(approve.getBaseExpertYearMoney())); | |||
req.setReleaseYearMoney(String.valueOf(approve.getReleaseYearMoney())); | |||
req.setBaseInitialReviewTotalMoney(String.valueOf(approve.getBaseInitialReviewTotalMoney())); | |||
req.setBaseReviewOpinion(approve.getBaseReviewOpinion()); | |||
req.setBaseReviewResults(approve.getBaseReviewResults()); | |||
req.setEqualProtectionLevel(approve.getEqualProtectionLevel()); | |||
req.setPreliminaryDesignScheme(approve.getPreliminaryDesignScheme()); | |||
req.setSetProjCodeFinan(approve.getSetProjCodeFinan()); | |||
return req; | |||
} | |||
public static ProjectApplyReq convertApply(GovBizProjectApplyDTO apply) { | |||
ProjectApplyReq req = new ProjectApplyReq(); | |||
if(Objects.isNull(apply)){ | |||
@@ -231,6 +349,51 @@ public class ProjectConvert { | |||
return req; | |||
} | |||
public static ProjectApplyReq convertApplyVoWithConvertPdf(GovBizProjectApplyVO apply) { | |||
ProjectApplyReq req = new ProjectApplyReq(); | |||
if(Objects.isNull(apply)){ | |||
return req; | |||
} | |||
req.setOp(apply.getOp()); | |||
req.setBaseProjId(apply.getBaseProjId()); | |||
req.setBaseProjName(apply.getBaseProjName()); | |||
req.setAreaCode(apply.getAreaCode()); | |||
req.setBaseAccountAppName(apply.getBaseAccountAppName()); | |||
req.setBaseBasisEstablish(apply.getBaseBasisEstablish()); | |||
req.setBaseCoreBusiness(apply.getBaseCoreBusiness()); | |||
req.setBaseCoreBusinessCode(apply.getBaseCoreBusinessCode()); | |||
req.setBaseBrainName(apply.getBaseBrainName()); | |||
req.setBaseDevelopCode(apply.getBaseDevelopCode()); | |||
req.setBaseLowestLevel(apply.getBaseLowestLevel()); | |||
req.setBaseHistorProjId(apply.getBaseHistorProjId()); | |||
req.setBaseHistorProjName(apply.getBaseHistorProjName()); | |||
req.setBaseOperatMaintenFile(StringUtils.isNotBlank(apply.getBaseOperatMaintenFilePdf()) ? apply.getBaseOperatMaintenFilePdf() : | |||
apply.getBaseOperatMaintenFile()); | |||
req.setBaseProjApplyFile(StringUtils.isNotBlank(apply.getBaseProjApplyFilePdf()) ? apply.getBaseProjApplyFilePdf() : | |||
apply.getBaseProjApplyFile()); | |||
req.setBaseProjBasisFile(StringUtils.isNotBlank(apply.getBaseProjBasisFilePdf()) ? apply.getBaseProjBasisFilePdf() : | |||
apply.getBaseProjBasisFile()); | |||
req.setBaseProjOtherFile(StringUtils.isNotBlank(apply.getBaseProjOtherFilePdf()) ? apply.getBaseProjOtherFilePdf() : | |||
apply.getBaseProjOtherFile()); | |||
req.setBaseResearchReportFile(StringUtils.isNotBlank(apply.getBaseResearchReportFilePdf()) ? apply.getBaseResearchReportFilePdf() : | |||
apply.getBaseResearchReportFile()); | |||
req.setBaseProjConsClass(apply.getBaseProjConsClass()); | |||
req.setBaseProjDuration(String.valueOf(apply.getBaseProjDuration())); | |||
req.setBaseProjIntro(apply.getBaseProjIntro()); | |||
req.setBaseProjStartTime(String.valueOf(apply.getBaseProjStartTime())); | |||
req.setBaseProjEndTime(String.valueOf(apply.getBaseProjEndTime())); | |||
req.setBaseProjSetYear(apply.getBaseProjSetYear()); | |||
req.setBaseProjSys(apply.getBaseProjSys()); | |||
req.setBaseProjSysCode(apply.getBaseDevelopCode()); | |||
req.setBaseProjDeclAmount(String.valueOf(apply.getBaseProjDeclAmount())); | |||
req.setBaseProjTotalAmount(String.valueOf(apply.getBaseProjTotalAmount())); | |||
req.setBaseBasisAmountOri(apply.getBaseBasisAmountOri()); | |||
req.setBaseProjAmountOri(apply.getBaseProjAmountOri()); | |||
req.setBaseProjRemark(apply.getBaseProjRemark()); | |||
req.setBeseExpectedResults(apply.getBeseExpectedResults()); | |||
return req; | |||
} | |||
public static ProjectBaseInfoReq convertBase(GovBizProjectBaseinfoDTO baseinfo,String isEffective) { | |||
ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo,ProjectBaseInfoReq.class); | |||
req.setIsEffective(isEffective); | |||
@@ -31,20 +31,19 @@ import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; | |||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import com.ningdatech.pmapi.wps.manage.WpsConvertManage; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.apache.poi.ss.formula.functions.T; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.http.HttpEntity; | |||
import org.springframework.http.HttpHeaders; | |||
import org.springframework.http.MediaType; | |||
import org.springframework.http.ResponseEntity; | |||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import org.springframework.web.client.RestTemplate; | |||
import java.io.BufferedOutputStream; | |||
import java.io.File; | |||
import java.io.FileOutputStream; | |||
@@ -86,7 +85,7 @@ public class GovProjectCollectionManage { | |||
private final WpsConvertManage wpsConvertManage; | |||
private final ThreadPoolTaskExecutor threadPoolTaskExecutor; | |||
private final ThreadPoolTaskScheduler threadPoolTaskScheduler; | |||
@Value("${project.push-url}") | |||
private String pushUrl; | |||
@@ -441,7 +440,7 @@ public class GovProjectCollectionManage { | |||
saveApply.setUpdateBy(user.getUsername()); | |||
saveApply.setUpdateOn(LocalDateTime.now()); | |||
if(projectApplyService.saveOrUpdate(saveApply)){ | |||
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); | |||
} | |||
} | |||
@@ -466,7 +465,7 @@ public class GovProjectCollectionManage { | |||
saveApprove.setUpdateBy(user.getUsername()); | |||
saveApprove.setUpdateOn(LocalDateTime.now()); | |||
if(approveService.saveOrUpdate(saveApprove)){ | |||
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); | |||
} | |||
} | |||
@@ -492,7 +491,7 @@ public class GovProjectCollectionManage { | |||
saveCimplement.setUpdateBy(user.getUsername()); | |||
saveCimplement.setUpdateOn(LocalDateTime.now()); | |||
if(cimplementService.saveOrUpdate(saveCimplement)){ | |||
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); | |||
} | |||
} | |||
@@ -521,31 +520,40 @@ public class GovProjectCollectionManage { | |||
saveMimplement.setBizTime(LocalDateTime.now()); | |||
saveMimplement.setUpdateBy(user.getUsername()); | |||
saveMimplement.setUpdateOn(LocalDateTime.now()); | |||
mimplementService.saveOrUpdate(saveMimplement); | |||
if(mimplementService.saveOrUpdate(saveMimplement)){ | |||
threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssMimplement(mimplement,oldMimplement,saveMimplement)); | |||
} | |||
} | |||
// 6.保存 采购信息 | |||
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures(); | |||
Integer index = 1; | |||
if(Objects.nonNull(procures)){ | |||
procureService.remove(Wrappers.lambdaQuery(GovBizProjectProcure.class) | |||
.eq(GovBizProjectProcure::getBaseProjId,baseProjId)); | |||
for(GovBizProjectProcureDTO procure : procures){ | |||
procure.setBaseProjId(baseProjId); | |||
procure.setBaseProjName(baseProjName); | |||
procure.setBaseBidCode(baseProjId + StrPool.DASH + index); | |||
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); | |||
saveProcure.setBaseProjId(baseProjId); | |||
saveProcure.setId(null); | |||
saveProcure.setAreaCode(RegionConst.RC_LS); | |||
saveProcure.setTongTime(LocalDateTime.now()); | |||
saveProcure.setBizTime(LocalDateTime.now()); | |||
saveProcure.setUpdateBy(user.getUsername()); | |||
saveProcure.setUpdateOn(LocalDateTime.now()); | |||
procureService.save(saveProcure); | |||
index++; | |||
} | |||
String finalBaseProjId = baseProjId; | |||
UserInfoDetails finalUser = user; | |||
threadPoolTaskScheduler.execute(() -> { | |||
Integer index = 1; | |||
for(GovBizProjectProcureDTO procure : procures){ | |||
procure.setBaseProjId(finalBaseProjId); | |||
procure.setBaseProjName(baseProjName); | |||
procure.setBaseBidCode(finalBaseProjId + StrPool.DASH + index); | |||
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); | |||
saveProcure.setBaseProjId(finalBaseProjId); | |||
saveProcure.setId(null); | |||
saveProcure.setAreaCode(RegionConst.RC_LS); | |||
saveProcure.setTongTime(LocalDateTime.now()); | |||
saveProcure.setBizTime(LocalDateTime.now()); | |||
saveProcure.setUpdateBy(finalUser.getUsername()); | |||
saveProcure.setUpdateOn(LocalDateTime.now()); | |||
if(procureService.save(saveProcure)){ | |||
uploadFileToProvincialOssProcure(procure,null,saveProcure); | |||
} | |||
index++; | |||
} | |||
}); | |||
} | |||
//7. 推送数据(改为定时推送了) | |||
@@ -751,7 +759,7 @@ public class GovProjectCollectionManage { | |||
} | |||
public void pushProjectVo(GovBizProjectDetailVO vo) { | |||
String url = pushUrl; | |||
ProjectPushReq req = ProjectConvert.convert(vo); | |||
ProjectPushReq req = ProjectConvert.convertWithConvertPdf(vo); | |||
try{ | |||
log.info("推送消息体 {} ,{},{}",vo.getBaseProjId(),url, JSON.toJSONString(req)); | |||
HttpHeaders headers = new HttpHeaders(); | |||
@@ -914,6 +922,72 @@ public class GovProjectCollectionManage { | |||
cimplementService.updateById(saveCimplement); | |||
} | |||
private void uploadFileToProvincialOssMimplement(GovBizProjectMimplementDTO mimplement, GovBizProjectMimplement oldMimplement, GovBizProjectMimplement saveMimplement) { | |||
if(checkFieldHas(mimplement.getBaseChanFile(),oldMimplement,"baseChanFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseChanFile()); | |||
saveMimplement.setBaseChanFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseInforLevelFile(),oldMimplement,"baseInforLevelFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseInforLevelFile()); | |||
saveMimplement.setBaseInforLevelFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBasePasswAssessFile(),oldMimplement,"basePasswAssessFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBasePasswAssessFile()); | |||
saveMimplement.setBasePasswAssessFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseThirdAcceptFile(),oldMimplement,"baseThirdAcceptFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseThirdAcceptFile()); | |||
saveMimplement.setBaseThirdAcceptFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseEstaSummFile(),oldMimplement,"baseEstaSummFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseEstaSummFile()); | |||
saveMimplement.setBaseEstaSummFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseUserConsFile(),oldMimplement,"baseUserConsFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseUserConsFile()); | |||
saveMimplement.setBaseUserConsFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseOperatMaintenSummFile(),oldMimplement,"baseOperatMaintenSummFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseOperatMaintenSummFile()); | |||
saveMimplement.setBaseOperatMaintenSummFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseFinalExpertOpinionFile(),oldMimplement,"baseFinalExpertOpinionFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseFinalExpertOpinionFile()); | |||
saveMimplement.setBaseFinalExpertOpinionFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseEngineerPostpoFile(),oldMimplement,"baseEngineerPostpoFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseEngineerPostpoFile()); | |||
saveMimplement.setBaseEngineerPostpoFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(mimplement.getBaseEngineerAlterFile(),oldMimplement,"baseEngineerAlterFile")){ | |||
StringJoiner sj = convertAndUpload(mimplement.getBaseEngineerAlterFile()); | |||
saveMimplement.setBaseEngineerAlterFilePdf(sj.toString()); | |||
} | |||
mimplementService.updateById(saveMimplement); | |||
} | |||
/** | |||
* 采购文件处理 | |||
* @param procure | |||
* @param o | |||
* @param saveProcure | |||
*/ | |||
private void uploadFileToProvincialOssProcure(GovBizProjectProcureDTO procure, Object o, GovBizProjectProcure saveProcure) { | |||
if(checkFieldHas(procure.getPurchaseFile(),o,"purchaseFile")){ | |||
StringJoiner sj = convertAndUpload(procure.getPurchaseFile()); | |||
saveProcure.setPurchaseFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(procure.getBiddingFile(),o,"biddingFile")){ | |||
StringJoiner sj = convertAndUpload(procure.getBiddingFile()); | |||
saveProcure.setBiddingFilePdf(sj.toString()); | |||
} | |||
if(checkFieldHas(procure.getPurchaseContract(),o,"purchaseContract")){ | |||
StringJoiner sj = convertAndUpload(procure.getPurchaseContract()); | |||
saveProcure.setPurchaseContractPdf(sj.toString()); | |||
} | |||
procureService.updateById(saveProcure); | |||
} | |||
private StringJoiner convertAndUpload(String baseProjBasisFile) { | |||
String[] baseProjBasisFileArr = baseProjBasisFile.split(";"); | |||
StringJoiner sj = new StringJoiner(";"); | |||
@@ -55,6 +55,9 @@ public class GovBizProjectBaseinfoDTO implements Serializable { | |||
@ApiModelProperty("上级主管单位钉id") | |||
private String baseProvManDeprtDing; | |||
@ApiModelProperty("是否省级 1省级 2非省级") | |||
private Integer baseProvManDeprtType; | |||
@ApiModelProperty("本级主管单位") | |||
private String baseManDeprt; | |||
@@ -57,6 +57,9 @@ public class GovBizProjectBaseinfo implements Serializable { | |||
@ApiModelProperty("信息是否有效") | |||
private String isEffective; | |||
@ApiModelProperty("是否省级 1省级 2非省级") | |||
private Integer baseProvManDeprtType; | |||
@ApiModelProperty("上级主管单位") | |||
private String baseProvManDeprt; | |||
@@ -34,6 +34,10 @@ public class GovBizProjectDraft implements Serializable { | |||
private String baseConstructionType; | |||
private String baseProjSetProg; | |||
private String isEffective; | |||
@ApiModelProperty("是否省级 1省级 2非省级") | |||
private Integer baseProvManDeprtType; | |||
private String baseProvManDeprt; | |||
private String baseProvManDeprtDing; | |||
private String baseManDeprt; | |||
@@ -103,4 +103,34 @@ public class GovBizProjectMimplement implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("信息安全等级保护测评报告PDF") | |||
private String baseInforLevelFilePdf; | |||
@ApiModelProperty("商业密码应用评估报告PDF") | |||
private String basePasswAssessFilePdf; | |||
@ApiModelProperty("第三方验收测试报告PDF") | |||
private String baseThirdAcceptFilePdf; | |||
@ApiModelProperty("用户使用报告PDF") | |||
private String baseUserConsFilePdf; | |||
@ApiModelProperty("监理总结报告PDF") | |||
private String baseEstaSummFilePdf; | |||
@ApiModelProperty("运维总结报告PDF") | |||
private String baseOperatMaintenSummFilePdf; | |||
@ApiModelProperty("终审意见PDF") | |||
private String baseFinalExpertOpinionFilePdf; | |||
@ApiModelProperty("项目延期申请表PDF") | |||
private String baseEngineerPostpoFilePdf; | |||
@ApiModelProperty("变更报告PDF") | |||
private String baseEngineerAlterFilePdf; | |||
@ApiModelProperty("变更批复文件PDF") | |||
private String baseChanFilePdf; | |||
} |
@@ -104,4 +104,13 @@ public class GovBizProjectProcure implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("招标(采购)文件PDF") | |||
private String purchaseFilePdf; | |||
@ApiModelProperty("采购合同PDF") | |||
private String purchaseContractPdf; | |||
@ApiModelProperty("中标(成交)通知书PDF") | |||
private String biddingFilePdf; | |||
} |
@@ -144,4 +144,19 @@ public class GovBizProjectApplyVO implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("立项依据材料PDF版") | |||
private String baseProjBasisFilePdf; | |||
@ApiModelProperty("项目申报书PDF版") | |||
private String baseProjApplyFilePdf; | |||
@ApiModelProperty("运维方案PDF版") | |||
private String baseOperatMaintenFilePdf; | |||
@ApiModelProperty("可研报告PDF版") | |||
private String baseResearchReportFilePdf; | |||
@ApiModelProperty("其它文件PDF版") | |||
private String baseProjOtherFilePdf; | |||
} |
@@ -94,4 +94,13 @@ public class GovBizProjectApproveVO implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("立项批复文件") | |||
private String approvalFilePdf; | |||
@ApiModelProperty("评审意见附件PDF") | |||
private String baseReviewCommentsFilePdf; | |||
@ApiModelProperty("初步设计方案批复函PDF") | |||
private String preliminaryDesignFilePdf; | |||
} |
@@ -51,6 +51,9 @@ public class GovBizProjectBaseinfoVO implements Serializable { | |||
@ApiModelProperty("信息是否有效") | |||
private String isEffective; | |||
@ApiModelProperty("是否省级 1省级 2非省级") | |||
private Integer baseProvManDeprtType; | |||
@ApiModelProperty("上级主管单位") | |||
private String baseProvManDeprt; | |||
@@ -110,4 +110,46 @@ public class GovBizProjectCimplementVO implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("生产批复文件PDF") | |||
private String baseChanFilePdf; | |||
@ApiModelProperty("初验意见PDF") | |||
private String baseInitialOpinionFilePdf; | |||
@ApiModelProperty("信息安全等级保护测评报告PDF") | |||
private String baseInforLevelFilePdf; | |||
@ApiModelProperty("'商业密码应用评估报告'") | |||
private String basePasswAssessFilePdf; | |||
@ApiModelProperty("第三方验收测试报告PDF") | |||
private String baseThirdAcceptFilePdf; | |||
@ApiModelProperty("建设核查表PDF") | |||
private String baseCheckFilePdf; | |||
@ApiModelProperty("财务审计报告PDF") | |||
private String baseFinanlAuditFilePdf; | |||
@ApiModelProperty("用户使用报告PDF") | |||
private String baseUserConsFilePdf; | |||
@ApiModelProperty("监理总结报告PDF") | |||
private String baseEstaSummFilePdf; | |||
@ApiModelProperty("IRS应用试运行报告PDF") | |||
private String baseIrsTestRunFilePdf; | |||
@ApiModelProperty("项目总结报告PDF") | |||
private String baseSummReportFilePdf; | |||
@ApiModelProperty("终审意见PDF") | |||
private String baseFinalExpertOpinionFilePdf; | |||
@ApiModelProperty("项目延期申请表PDF") | |||
private String baseEngineerPostpoFilePdf; | |||
@ApiModelProperty("变更申请单PDF") | |||
private String baseChangeFormFilePdf; | |||
} |
@@ -98,4 +98,34 @@ public class GovBizProjectMimplementVO implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("信息安全等级保护测评报告PDF") | |||
private String baseInforLevelFilePdf; | |||
@ApiModelProperty("商业密码应用评估报告PDF") | |||
private String basePasswAssessFilePdf; | |||
@ApiModelProperty("第三方验收测试报告PDF") | |||
private String baseThirdAcceptFilePdf; | |||
@ApiModelProperty("用户使用报告PDF") | |||
private String baseUserConsFilePdf; | |||
@ApiModelProperty("监理总结报告PDF") | |||
private String baseEstaSummFilePdf; | |||
@ApiModelProperty("运维总结报告PDF") | |||
private String baseOperatMaintenSummFilePdf; | |||
@ApiModelProperty("终审意见PDF") | |||
private String baseFinalExpertOpinionFilePdf; | |||
@ApiModelProperty("项目延期申请表PDF") | |||
private String baseEngineerPostpoFilePdf; | |||
@ApiModelProperty("变更报告PDF") | |||
private String baseEngineerAlterFilePdf; | |||
@ApiModelProperty("变更批复文件PDF") | |||
private String baseChanFilePdf; | |||
} |
@@ -99,4 +99,13 @@ public class GovBizProjectProcureVO implements Serializable { | |||
@ApiModelProperty("最后修改人") | |||
private String updateBy; | |||
@ApiModelProperty("招标(采购)文件PDF") | |||
private String purchaseFilePdf; | |||
@ApiModelProperty("采购合同PDF") | |||
private String purchaseContractPdf; | |||
@ApiModelProperty("中标(成交)通知书PDF") | |||
private String biddingFilePdf; | |||
} |
@@ -235,10 +235,11 @@ public class AppIrsManage { | |||
"&appKey=" + searchAppKey + "&pageSize=1000&" + | |||
"pageNum=1&areaCode=" + areaCode + | |||
"&deptCode=&name="; | |||
log.info("查询应用目录:{}",url); | |||
RestTemplate restTemplate = new RestTemplate(); | |||
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); | |||
log.info("查询应用目录 : {}", forEntity.getStatusCode()); | |||
log.info("查询应用目录 : {}", forEntity.getBody()); | |||
if (Objects.nonNull(forEntity.getBody())) { | |||
JSONObject body = JSON.parseObject(forEntity.getBody()); | |||
@@ -260,13 +261,15 @@ public class AppIrsManage { | |||
} | |||
/** | |||
* 如果是市本级的 结尾改成01 | |||
* 如果是市本级的 结尾改成01 还要转换开发区的code | |||
* @param areaCode | |||
* @return | |||
*/ | |||
private String convertAreaCode(String areaCode) { | |||
if(RegionConst.RC_LS.equals(areaCode)){ | |||
return RegionConst.RC_LS_SBJ_IRS; | |||
}else if(RegionConst.LS_KF.equals(areaCode)){ | |||
return RegionConst.LS_KF_IRS; | |||
} | |||
return areaCode; | |||
} | |||
@@ -109,7 +109,6 @@ public class PerformanceAppraisalPlanManage { | |||
if(CollUtil.isEmpty(page.getRecords())){ | |||
return PageVo.empty(); | |||
} | |||
List<Long> paIds = page.getRecords().stream().map(PerformanceAppraisal::getId).collect(Collectors.toList()); | |||
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) | |||
.in(PerformanceAppraisalProject::getAppraisalId, paIds)); | |||
@@ -0,0 +1,96 @@ | |||
package com.ningdatech.pmapi.employee; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.AppTests; | |||
import com.ningdatech.pmapi.common.constant.BizConst; | |||
import com.ningdatech.pmapi.common.constant.RegionConst; | |||
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; | |||
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; | |||
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; | |||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import org.junit.Test; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.Objects; | |||
/** | |||
* @Classname EmployeeTest | |||
* @Description | |||
* @Date 2023/9/6 14:34 | |||
* @Author PoffyZhang | |||
*/ | |||
public class EmployeeTest extends AppTests { | |||
@Autowired | |||
private IDingEmployeeInfoService dingEmployeeInfoService; | |||
@Autowired | |||
private IDingOrganizationService dingOrganizationService; | |||
@Autowired | |||
private IUserInfoService userInfoService; | |||
@Autowired | |||
private OrganizationBatchGetTask organizationBatchGetTask; | |||
@Autowired | |||
private EmployeeBatchGetTask employeeBatchGetTask; | |||
@Test | |||
public void test(){ | |||
List<DingEmployeeInfo> employees = dingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||
.eq(DingEmployeeInfo::getEmployeeName, "吴玉斌")); | |||
for(DingEmployeeInfo employee : employees){ | |||
UserInfo user = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | |||
.eq(UserInfo::getEmployeeCode, employee.getEmployeeCode()) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.nonNull(user)){ | |||
DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) | |||
.eq(DingOrganization::getOrganizationCode, employee.getOrganizationCode()) | |||
.last(BizConst.LIMIT_1)); | |||
user.setRegionCode(RegionConst.LS_KF); | |||
user.setEmpPosUnitCode(employee.getEmpPosUnitCode()); | |||
user.setEmpPosUnitName(organization.getOrganizationName()); | |||
userInfoService.updateById(user); | |||
}else{ | |||
DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) | |||
.eq(DingOrganization::getOrganizationCode, employee.getOrganizationCode()) | |||
.last(BizConst.LIMIT_1)); | |||
UserInfo saveUser = new UserInfo(); | |||
saveUser.setRegionCode(RegionConst.LS_KF); | |||
saveUser.setEmpPosUnitCode(employee.getEmpPosUnitCode()); | |||
saveUser.setEmpPosUnitName(organization.getOrganizationName()); | |||
saveUser.setCreateOn(LocalDateTime.now()); | |||
saveUser.setUsername("吴玉斌"); | |||
saveUser.setRealName("吴玉斌"); | |||
saveUser.setUpdateOn(LocalDateTime.now()); | |||
saveUser.setAccountId(employee.getAccountId()); | |||
saveUser.setEmployeeCode(employee.getEmployeeCode()); | |||
userInfoService.save(saveUser); | |||
} | |||
} | |||
} | |||
@Test | |||
public void test2(){ | |||
String orgCode = "GO_4e6be07f25594df88e7bd1b7b7cdf9a8"; | |||
organizationBatchGetTask.organizationGetSubs(orgCode); | |||
} | |||
@Test | |||
public void test3(){ | |||
String orgCode = "GO_1aceac0b3a664afbb31ea0d627189781"; | |||
employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode); | |||
} | |||
} |
@@ -0,0 +1,75 @@ | |||
package com.ningdatech.pmapi.projectCollection; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.pmapi.AppTests; | |||
import com.ningdatech.pmapi.gov.model.dto.GovBizProjectApplyDTO; | |||
import com.ningdatech.pmapi.gov.model.dto.GovBizProjectBaseinfoDTO; | |||
import com.ningdatech.pmapi.gov.model.dto.GovBizProjectSaveDTO; | |||
import com.ningdatech.pmapi.gov.model.entity.*; | |||
import com.ningdatech.pmapi.gov.service.*; | |||
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; | |||
import org.junit.Test; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
/** | |||
* @Classname ProjectCollectionTest | |||
* @Description | |||
* @Date 2023/9/7 15:08 | |||
* @Author PoffyZhang | |||
*/ | |||
public class ProjectCollectionTest extends AppTests { | |||
@Autowired | |||
private IGovBizProjectBaseinfoService baseinfoService; | |||
@Autowired | |||
private IGovBizProjectApplyService applyService; | |||
@Autowired | |||
private IGovBizProjectApproveService approveService; | |||
@Autowired | |||
private IGovBizProjectCimplementService cimplementService; | |||
@Autowired | |||
private IGovBizProjectMimplementService mimplementService; | |||
@Autowired | |||
private IGovBizProjectProcureService procureService; | |||
@Autowired | |||
private GenerateProjectCodeUtil generateProjectCodeUtil; | |||
@Test | |||
public void test(){ | |||
String baseProjId = "33112500020210100003"; | |||
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) | |||
.eq(GovBizProjectBaseinfo::getBaseProjId, baseProjId)); | |||
GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class) | |||
.eq(GovBizProjectApply::getBaseProjId, baseProjId)); | |||
GovBizProjectSaveDTO saveDTO = new GovBizProjectSaveDTO(); | |||
saveDTO.setApply(BeanUtil.copyProperties(apply, GovBizProjectApplyDTO.class)); | |||
saveDTO.setBaseinfo(BeanUtil.copyProperties(baseinfo, GovBizProjectBaseinfoDTO.class)); | |||
String newProjId = generateProjectCodeUtil.generateProjectCode(saveDTO); | |||
baseinfo.setBaseProjId(newProjId); | |||
baseinfoService.updateById(baseinfo); | |||
apply.setBaseProjId(newProjId); | |||
applyService.updateById(apply); | |||
approveService.update(Wrappers.lambdaUpdate(GovBizProjectApprove.class) | |||
.eq(GovBizProjectApprove::getBaseProjId,baseProjId) | |||
.set(GovBizProjectApprove::getBaseProjId,newProjId)); | |||
cimplementService.update(Wrappers.lambdaUpdate(GovBizProjectCimplement.class) | |||
.eq(GovBizProjectCimplement::getBaseProjId,baseProjId) | |||
.set(GovBizProjectCimplement::getBaseProjId,newProjId)); | |||
mimplementService.update(Wrappers.lambdaUpdate(GovBizProjectMimplement.class) | |||
.eq(GovBizProjectMimplement::getBaseProjId,baseProjId) | |||
.set(GovBizProjectMimplement::getBaseProjId,newProjId)); | |||
procureService.update(Wrappers.lambdaUpdate(GovBizProjectProcure.class) | |||
.eq(GovBizProjectProcure::getBaseProjId,baseProjId) | |||
.set(GovBizProjectProcure::getBaseProjId,newProjId)); | |||
} | |||
} |