diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java index f8fd051..71db295 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java @@ -1,13 +1,14 @@ package com.hz.pm.api.external.controller; +import com.hz.pm.api.common.enumeration.ProjectProcessType; +import com.hz.pm.api.sys.manage.ProcessModelManage; import com.hz.pm.api.user.manage.SyncMhUserOrgManage; +import com.hz.pm.api.user.util.LoginUserUtil; +import com.wflow.bean.entity.WflowModels; import io.swagger.annotations.Api; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -26,6 +27,13 @@ import java.time.LocalDateTime; public class MhSyncController { private final SyncMhUserOrgManage syncMhUserOrgManage; + private final ProcessModelManage processModelManage; + + @GetMapping("/wflow/{type}") + public WflowModels syncWflow(@PathVariable Integer type) { + return processModelManage.getWflowModelsNoNull(ProjectProcessType.getNoNull(type), + LoginUserUtil.loginUserDetail().getMhUnitId()); + } @GetMapping("/users") public void getUsers(@RequestParam(value = "syncTime", required = false) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/ProcessModelManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/ProcessModelManage.java index d3d6474..a712127 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/ProcessModelManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/ProcessModelManage.java @@ -46,6 +46,7 @@ public class ProcessModelManage { List unitIdPathsStr = CollUtils.convert(unitIdPaths, String::valueOf); String orderSql = String.format(" order by field(region_code, %s) desc limit 1", CollUtils.join(unitIdPaths, w -> "'" + w + "'", StrUtil.COMMA)); + log.info("单位ID路径:{}", unitIdPathsStr); return processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getProcessType, processStage.getCode()) .in(WflowModels::getRegionCode, unitIdPathsStr)