Browse Source

项目归集 查询debug

tags/24080901
PoffyZhang 1 year ago
parent
commit
a234edef01
9 changed files with 148 additions and 13 deletions
  1. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/constants/DingOrganizationContant.java
  2. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  3. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/constants/ProcDefContant.java
  4. +10
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/ProcDefController.java
  5. +103
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/ProcDefManage.java
  6. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectCollectionManage.java
  7. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/BatchUpdateEmployeeTask.java
  8. +1
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcDefController.java
  9. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java

+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/constants/DingOrganizationContant.java View File

@@ -0,0 +1,13 @@
package com.ningdatech.pmapi.ding.constants;

/**
* @Classname DingOrganizationContant
* @Description
* @Date 2023/7/10 17:58
* @Author PoffyZhang
*/
public interface DingOrganizationContant {

public static final String UNIT_TYPE = "GOV_UNIT";

}

+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java View File

@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.ding.constants.DingOrganizationContant;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
@@ -72,7 +73,7 @@ public class EmployeeBatchGetTask {
public void batchGetEmployeeTask() {
// 获取所有的组织列表用户获取组织下的 用户信息(暂时 只查 单位的类型)
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getTypeCode,"GOV_UNIT"));
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE));
log.info("所有待更新员工的单位数:{}",dingOrganizationList.size());
if (CollUtil.isNotEmpty(dingOrganizationList)) {
//记录任务 单位数
@@ -271,7 +272,7 @@ public class EmployeeBatchGetTask {
*/
public void batchGetEmployeeTaskByRegionCode(String regionCode) {
List<DingOrganization> units = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getTypeCode, "GOV_UNIT")
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE)
.eq(DingOrganization::getDivisionCode, regionCode));




+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/constants/ProcDefContant.java View File

@@ -0,0 +1,13 @@
package com.ningdatech.pmapi.organization.constants;

/**
* @Classname ProcDefContant
* @Description
* @Date 2023/7/11 9:35
* @Author PoffyZhang
*/
public interface ProcDefContant {

public final static String MODELS_ID_PREFIX = "pd";

}

+ 10
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/ProcDefController.java View File

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.organization.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.organization.manage.ProcDefManage;
import com.wflow.bean.dto.WflowOrgProcdefDto;
import com.wflow.bean.vo.OrgProcdefVo;
import com.wflow.service.OrgProcdefService;
@@ -31,6 +32,8 @@ public class ProcDefController {

private final OrgProcessModelService orgProcessModelService;

private final ProcDefManage procDefManage;

@ApiOperation(value = "单位流程配置列表", notes = "单位流程配置列表")
@GetMapping("/list")
public PageVo<OrgProcdefVo> list(@RequestParam String orgCode, @RequestParam(defaultValue = "1") Integer pageNumber,
@@ -80,4 +83,11 @@ public class ProcDefController {
public Boolean delete(@PathVariable String processDefId) {
return orgProcessModelService.delProcess(processDefId);
}

@ApiOperation(value = "系统流程配置初始化", notes = "系统流程配置初始化")
@PostMapping("/init")
@WebLog("初始化系统配置")
public String init() {
return procDefManage.init();
}
}

+ 103
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/ProcDefManage.java View File

@@ -0,0 +1,103 @@
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.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.ding.constants.DingOrganizationContant;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.organization.constants.ProcDefContant;
import com.wflow.bean.entity.WflowOrgModelHistorys;
import com.wflow.bean.entity.WflowOrgModels;
import com.wflow.enums.ProcessDefTypeEnum;
import com.wflow.service.OrgProcdefHistoryService;
import com.wflow.service.OrgProcdefService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

/**
* @Classname ProcDefManage
* @Description
* @Date 2023/7/10 17:48
* @Author PoffyZhang
*/
@Component
@Slf4j
@AllArgsConstructor
public class ProcDefManage {
private final IDingOrganizationService organizationService;

private final OrgProcdefService orgProcdefService;

private final OrgProcdefHistoryService orgProcdefHistoryService;

/**
* 初始化 单位配置
* @return
*/
public String init() {
List<DingOrganization> orgs = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE));

log.info("需要处理初始化单位配置的企业 数量为{}",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 "初始化成功";
}

private void saveDef(DingOrganization org,ProcessDefTypeEnum defTypeEnum){
WflowOrgModels defaultModel = new WflowOrgModels();
defaultModel.setProcessDefId(ProcDefContant.MODELS_ID_PREFIX + IdUtil.objectId());
defaultModel.setIsStop(Boolean.FALSE);
defaultModel.setProcess(StrPool.BRACE);
defaultModel.setCreated(LocalDateTime.now());
defaultModel.setIsDelete(Boolean.FALSE);
defaultModel.setOrgCode(org.getOrganizationCode());
defaultModel.setOrgName(org.getOrganizationName());
defaultModel.setProcessDefName(defTypeEnum.getDesc());
defaultModel.setType(defTypeEnum.name());
defaultModel.setSort(1);
defaultModel.setVersion(1);
orgProcdefService.save(defaultModel);

WflowOrgModelHistorys defaultHistory = new WflowOrgModelHistorys();
defaultHistory.setProcessDefId(ProcDefContant.MODELS_ID_PREFIX + IdUtil.objectId());
defaultHistory.setProcess(StrPool.BRACE);
defaultHistory.setCreated(LocalDateTime.now());
defaultHistory.setOrgCode(org.getOrganizationCode());
defaultHistory.setOrgName(org.getOrganizationName());
defaultHistory.setProcessDefName(defTypeEnum.getDesc());
defaultHistory.setType(defTypeEnum.name());
defaultHistory.setVersion(0);
orgProcdefHistoryService.save(defaultHistory);
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectCollectionManage.java View File

@@ -61,7 +61,7 @@ public class ProjectCollectionManage {

LambdaQueryWrapper<ProjectCollection> wrapper = Wrappers.lambdaQuery(ProjectCollection.class)
.like(StringUtils.isNotBlank(req.getProjectName()), ProjectCollection::getProjectName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), ProjectCollection::getBuildOrg, req.getBuildOrgName())
.like(StringUtils.isNotBlank(req.getBuildOrg()), ProjectCollection::getBuildOrg, req.getBuildOrg())
.eq(Objects.nonNull(buildOrgCode), ProjectCollection::getBuildOrgCode, buildOrgCode);
//处理 行政区域
if(StringUtils.isNotBlank(req.getRegionCode())){


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/BatchUpdateEmployeeTask.java View File

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.scheduler.task;

import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.ding.constants.DingOrganizationContant;
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
@@ -41,7 +42,7 @@ public class BatchUpdateEmployeeTask {
stopWatch.start();
// 1.查出浙政钉 所有单位
List<DingOrganization> units = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getTypeCode, "GOV_UNIT"));
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE));

log.info("需要更新的 单位数量为 {}",units.size());



+ 1
- 8
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcDefController.java View File

@@ -2,8 +2,6 @@ package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.sys.manage.MenuManage;
import com.wflow.bean.dto.WflowModelHistorysDto;
import com.wflow.bean.vo.WflowModelVo;
import com.wflow.service.ModelGroupService;
@@ -15,8 +13,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
* @Classname SysProcdefController
* @Description
@@ -35,9 +31,6 @@ public class SysProcDefController {

private final ProcessModelService processModelService;

private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;
private final MenuManage menuManage;

@ApiOperation(value = "系统流程配置列表", notes = "系统流程配置列表")
@GetMapping("/list")
public PageVo<WflowModelVo> list(@RequestParam String regionCode, @RequestParam(defaultValue = "1") Integer pageNumber,
@@ -70,6 +63,6 @@ public class SysProcDefController {
@PostMapping("/deploy/{formId}")
@WebLog("系统流程配置发布")
public String deploy(@Validated @PathVariable String formId) {
return processModelService.deployProcess(formId,null);
return processModelService.deployProcess(formId, null);
}
}

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.ding.constants.DingOrganizationContant;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
@@ -139,7 +140,7 @@ public class UserInfoManage {
if (StringUtils.isNotBlank(orgName)) {
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.like(DingOrganization::getOrganizationName, orgName)
.eq(DingOrganization::getTypeCode, "GOV_UNIT")
.eq(DingOrganization::getTypeCode, DingOrganizationContant.UNIT_TYPE)
);

List<String> compliantOrgNameCodeList = dingOrganizationList.stream()


Loading…
Cancel
Save