Преглед изворни кода

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang пре 1 година
родитељ
комит
d1f54216b4
5 измењених фајлова са 76 додато и 39 уклоњено
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java
  2. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java
  3. +37
    -27
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
  4. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysFormController.java
  5. +11
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java Прегледај датотеку

@@ -54,7 +54,7 @@ public class OrganizationProcdefController {
return orgProcessModelService.saveProcess(wflowOrgProcdefDto);
}

@ApiOperation(value = "单位流程配置保存", notes = "单位流程配置保存")
@ApiOperation(value = "单位流程配置部署", notes = "单位流程配置部署")
@PostMapping("/deploy/{processDefId}")
public String deploy(@Validated @PathVariable String processDefId) {
return orgProcessModelService.deployProcess(processDefId);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java Прегледај датотеку

@@ -1,7 +1,5 @@
package com.ningdatech.pmapi.scheduler.contants;

import java.math.BigDecimal;

/**
* @author PoffyZhang
* @Classname TaskContant
@@ -19,5 +17,7 @@ public interface TaskContant {

class Wflow {
public static final String DEFAULT_FORM_NAME = "丽水申报项目表单";

public static final String[] DEFAULT_PROCESS_LIST = {"单位内部审批流程","项目预审审批流程","部门联合审批流程","建设方案审批流程","验收申报审批流程"};
}
}

+ 37
- 27
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java Прегледај датотеку

@@ -46,7 +46,7 @@ public class InitProcessTask {
private final WflowModelsMapper modelsMapper;

// 定时更新车辆状态
@Scheduled(cron = "0 47 15 28 1 ?")
@Scheduled(cron = "0 52 13 29 1 ?")
public void doTask() throws UnknownHostException {
if (TaskContant.Host.HOST_ZPF.equals(InetAddress.getLocalHost().getHostName())) {
log.info("=========== 初始化丽水二期 系统表单和流程配置 ======== 任务开始");
@@ -106,35 +106,45 @@ public class InitProcessTask {
// continue;
// }

WflowModelHistorys models = new WflowModelHistorys();
models.setCreated(GregorianCalendar.getInstance().getTime());
models.setFormId("wf" + IdUtil.objectId());
models.setVersion(1);
models.setGroupId(1);
models.setProcessDefId("pd" + IdUtil.objectId());
models.setRegionCode(region.getRegionCode());
models.setFormName(TaskContant.Wflow.DEFAULT_FORM_NAME);

WflowModels wflowModels = new WflowModels();
BeanUtil.copyProperties(models, wflowModels);
wflowModels.setFormId(models.getFormId());
wflowModels.setIsDelete(false);
wflowModels.setIsStop(false);
wflowModels.setUpdated(new Date());
wflowModels.setSort(0);
wflowModels.setProcessDefId(models.getProcessDefId());
wflowModels.setFormName(models.getFormName());
String[] processList = TaskContant.Wflow.DEFAULT_PROCESS_LIST;
for(String processName : processList){
WflowModelHistorys models = new WflowModelHistorys();
models.setCreated(GregorianCalendar.getInstance().getTime());
models.setFormId("wf" + IdUtil.objectId());
models.setVersion(1);
models.setGroupId(1);
models.setProcessDefId("pd" + IdUtil.objectId());
models.setFormName(processName);
models.setRegionCode(region.getRegionCode());

WflowModels wflowModels = new WflowModels();
BeanUtil.copyProperties(models, wflowModels);
wflowModels.setFormId(models.getFormId());
wflowModels.setIsDelete(false);
wflowModels.setIsStop(false);
wflowModels.setUpdated(new Date());
wflowModels.setSort(0);
wflowModels.setVersion(1);
wflowModels.setProcessDefId(models.getProcessDefId());
wflowModels.setFormName(models.getFormName());

//留给前端去初始化配置
// wflowModels.setFormItems(JSON.toJSONString(form));
wflowModels.setGroupId(models.getGroupId());
wflowModels.setRegionCode(models.getRegionCode());
wflowModels.setGroupId(models.getGroupId());
wflowModels.setRegionCode(models.getRegionCode());
//留给前端去初始化配置
// model.setProcess();
// model.setSettings();
if(modelHistoriesMapper.insert(models) > 0){
//初始的流程在部署表也存一份,用来查询
modelsMapper.insert(wflowModels);
log.info("当前区域 【{}】 流程数据已经保存成功",region.getName());
}else{
log.info("当前区域 【{}】 流程数据已经保存失败",region.getName());
if(modelHistoriesMapper.insert(models) > 0){
//初始的流程在部署表也存一份,用来查询
if(modelsMapper.insert(wflowModels) > 0){
log.info("当前区域 【{}】 流程名[{}] 流程数据已经保存成功",region.getName(),processName);
}else{
log.info("当前区域 【{}】 流程名[{}] 流程数据保存失败",region.getName(),processName);
}
}else{
log.info("当前区域 【{}】流程名[{}] 流程数据保存失败",region.getName(),processName);
}
}
}



+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysFormController.java Прегледај датотеку

@@ -1,10 +1,35 @@
package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.basic.model.PageVo;
import com.wflow.bean.vo.WflowFormVo;
import com.wflow.bean.vo.WflowModelVo;
import com.wflow.workflow.service.FormService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
* @Classname SysProcdefController
* @Description
* @Date 2023/1/18 14:28
* @Author PoffyZhang
*/
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/sys/form")
@Api(value = "SysForm", tags = "系统管理-表单配置")
@RequiredArgsConstructor
public class SysFormController {

private final FormService formService;

@ApiOperation(value = "获取系统表单", notes = "获取系统表单")
@GetMapping("/{regionCode}")
public WflowFormVo list(@PathVariable String regionCode) {
return formService.getFormByRegionCode(regionCode);
}
}

+ 11
- 9
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java Прегледај датотеку

@@ -1,16 +1,14 @@
package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.basic.model.PageVo;
import com.wflow.bean.vo.OrgProcdefVo;
import com.wflow.bean.vo.WflowModelVo;
import com.wflow.service.ModelGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
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.*;

/**
* @Classname SysProcdefController
@@ -26,14 +24,18 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
public class SysProcdefController {

// private final
private final ModelGroupService modelGroupService;

@ApiOperation(value = "系统流程配置列表", notes = "系统流程配置列表")
@GetMapping("/list")
public PageVo<OrgProcdefVo> list(@RequestParam String regionCode, @RequestParam(defaultValue = "1") Integer pageNum,
public PageVo<WflowModelVo> list(@RequestParam String regionCode, @RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
// return orgProcdefService.getOrgProcessByOrgCode(orgCode,pageNum,pageSize);
return PageVo.empty();
return modelGroupService.getModelsPage(regionCode,pageNum,pageSize);
}

@ApiOperation(value = "系统流程配置详情", notes = "系统流程配置详情")
@GetMapping("/detail/{formId}")
public Object list(@PathVariable String formId) {
return modelGroupService.getModelById(formId);
}
}

Loading…
Откажи
Сачувај