|
|
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.organization.manage; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
|
import com.ningdatech.pmapi.ding.constants.DingOrganizationContant; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; |
|
|
@@ -43,7 +44,9 @@ public class ProcDefManage { |
|
|
|
*/ |
|
|
|
public String init() { |
|
|
|
List<DingOrganization> orgs = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE)); |
|
|
|
.in(DingOrganization::getTypeCode, Lists.newArrayList( |
|
|
|
DingOrganizationContant.UNIT_TYPE,DingOrganizationContant.GOV_TEMPORARY |
|
|
|
))); |
|
|
|
|
|
|
|
log.info("需要处理初始化单位配置的企业 数量为{}",orgs.size()); |
|
|
|
|
|
|
@@ -101,4 +104,40 @@ public class ProcDefManage { |
|
|
|
defaultHistory.setVersion(0); |
|
|
|
orgProcdefHistoryService.save(defaultHistory); |
|
|
|
} |
|
|
|
|
|
|
|
public String initByArea(String areaCode) { |
|
|
|
List<DingOrganization> orgs = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.in(DingOrganization::getTypeCode, Lists.newArrayList( |
|
|
|
DingOrganizationContant.UNIT_TYPE,DingOrganizationContant.GOV_TEMPORARY |
|
|
|
)) |
|
|
|
.eq(DingOrganization::getDivisionCode,areaCode)); |
|
|
|
|
|
|
|
log.info("{}地区 需要处理初始化单位配置的企业 数量为{}",areaCode,orgs.size()); |
|
|
|
|
|
|
|
for(DingOrganization org : orgs){ |
|
|
|
log.info("当前是 {}",org.getOrganizationName()); |
|
|
|
String orgCode = org.getOrganizationCode(); |
|
|
|
|
|
|
|
List<WflowOrgModels> models = orgProcdefService.list(Wrappers.lambdaQuery(WflowOrgModels.class) |
|
|
|
.eq(WflowOrgModels::getOrgCode, orgCode)); |
|
|
|
|
|
|
|
log.info("已经有的单位流程 {}", JSON.toJSONString(models)); |
|
|
|
|
|
|
|
List<String> types = models.stream().map(WflowOrgModels::getType).collect(Collectors.toList()); |
|
|
|
//默认流程 |
|
|
|
if(!types.contains(ProcessDefTypeEnum.DEFAULT.name())){ |
|
|
|
saveDef(org,ProcessDefTypeEnum.DEFAULT); |
|
|
|
} |
|
|
|
//盖章流程 |
|
|
|
if(!types.contains(ProcessDefTypeEnum.SEAL.name())){ |
|
|
|
saveDef(org,ProcessDefTypeEnum.SEAL); |
|
|
|
} |
|
|
|
//联审流程 |
|
|
|
if(!types.contains(ProcessDefTypeEnum.JOINT_REVIEW.name())){ |
|
|
|
saveDef(org,ProcessDefTypeEnum.JOINT_REVIEW); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return "初始化成功"; |
|
|
|
} |
|
|
|
} |