Преглед на файлове

更新条线信息

tags/24080901
PoffyZhang преди 1 година
родител
ревизия
9798a6ca0d
променени са 2 файла, в които са добавени 29 реда и са изтрити 0 реда
  1. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  2. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/ProcDefManage.java

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java Целия файл

@@ -255,6 +255,12 @@ public class DingInfoPullController {
return "推送失败";
}

@ApiOperation(value = "同步企业信息 条线", notes = "同步企业信息 条线")
@GetMapping("/synchronouOrgBiz")
public String synchronouOrgBiz() {
return procDefManage.synchronouOrgBiz();
}

public static Workbook readExcel(InputStream is, String extString){
Workbook wb = null;



+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/ProcDefManage.java Целия файл

@@ -4,11 +4,14 @@ 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.model.GenericResult;
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.ningdatech.zwdd.client.ZwddClient;
import com.ningdatech.zwdd.model.dto.DingOrgInfoDTO;
import com.wflow.bean.entity.WflowOrgModelHistorys;
import com.wflow.bean.entity.WflowOrgModels;
import com.wflow.enums.ProcessDefTypeEnum;
@@ -16,6 +19,7 @@ import com.wflow.service.OrgProcdefHistoryService;
import com.wflow.service.OrgProcdefService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
@@ -38,6 +42,8 @@ public class ProcDefManage {

private final OrgProcdefHistoryService orgProcdefHistoryService;

private final ZwddClient zwddClient;

/**
* 初始化 单位配置
* @return
@@ -140,4 +146,21 @@ public class ProcDefManage {

return "初始化成功";
}

public String synchronouOrgBiz() {
List<DingOrganization> orgs = organizationService.list();
//同步所有的 企业条线
for(DingOrganization org : orgs){
GenericResult<DingOrgInfoDTO> organization = zwddClient.getOrganizationByCode(org.getOrganizationCode());
if(organization.isSuccess()){
DingOrgInfoDTO data = organization.getData();
String businessStripCodes = data.getBusinessStripCodes();
if(StringUtils.isNotBlank(businessStripCodes)){
org.setBusinessStripCodes(businessStripCodes);
organizationService.updateById(org);
}
}
}
return "更新完成";
}
}

Loading…
Отказ
Запис