Parcourir la source

提交项目 优化

tags/24080901
PoffyZhang il y a 1 an
Parent
révision
407a88f927
8 fichiers modifiés avec 37 ajouts et 16 suppressions
  1. +10
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  2. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java
  3. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java
  4. +1
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java
  5. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  6. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java
  7. +5
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
  8. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java

+ 10
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java Voir le fichier

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.common.handler;

import cn.hutool.json.JSONUtil;
import com.ningdatech.basic.model.ApiResponse;
import com.ningdatech.pmapi.common.utils.BizUtils;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
@@ -16,7 +17,15 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
* @Date 2021/7/21 11:26
* @Version 1.0
**/
@RestControllerAdvice(basePackages = {"com.ningdatech.pmapi.fiscal.controller"})
@RestControllerAdvice(basePackages = {
"com.ningdatech.pmapi.fiscal.controller",
"com.ningdatech.pmapi.organization.controller",
"com.ningdatech.pmapi.projectdeclared.controller",
"com.ningdatech.pmapi.projectlib.controller",
"com.ningdatech.pmapi.sys.controller",
"com.ningdatech.pmapi.todocenter.controller",
"com.ningdatech.pmapi.user.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {

private static final String SWAGGER_CLASS_PREFIX = "springfox.documentation";


+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java Voir le fichier

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.common.utils;

import cn.hutool.core.util.StrUtil;
import com.ningdatech.basic.util.StrPool;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.NumberUtils;

import java.util.Arrays;
@@ -50,4 +51,16 @@ public class BizUtils {
}
}

public static boolean getJSONType(String str) {
boolean result = false;
if (StringUtils.isNotBlank(str)) {
str = str.trim();
if (str.startsWith("{") && str.endsWith("}")) {
result = true;
} else if (str.startsWith("[") && str.endsWith("]")) {
result = true;
}
}
return result;
}
}

+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java Voir le fichier

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.projectdeclared.controller;

import com.ningdatech.basic.model.ApiResponse;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto;
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto;


+ 1
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java Voir le fichier

@@ -32,14 +32,11 @@ public class DeclaredProjectDto implements Serializable {

private Map<String,Object> formData;

@NotBlank
private String regionCode;

@NotNull
private ProcessInstanceUserDto user;

public Map<String,Object> getFormData(){
if(CollUtil.isNotEmpty(this.formData)){
if(CollUtil.isEmpty(this.formData)){
this.formData = Maps.newHashMap();
return this.formData;
}


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Voir le fichier

@@ -132,7 +132,8 @@ public class DeclaredProjectManage {
* @return
*/
public String startTheProcess(DeclaredProjectDto dto) {
String regionCode = dto.getRegionCode();
ProjectDto projectInfo = dto.getProjectInfo();
String regionCode = projectInfo.getAreaCode();

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java Voir le fichier

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.projectlib.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -163,6 +164,7 @@ public class ProjectDto implements Serializable {
@ApiModelProperty("立项批复资金(万元)")
private BigDecimal approvalAmount;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime annualPlanAddTime;

@ApiModelProperty("核心业务-核心业务模块")


+ 5
- 8
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java Voir le fichier

@@ -1,21 +1,17 @@
package com.ningdatech.pmapi.scheduler.task;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.pmapi.scheduler.contants.TaskContant;
import com.ningdatech.pmapi.sys.contant.RegionConst;
import com.ningdatech.pmapi.sys.entity.Region;
import com.ningdatech.pmapi.sys.service.IRegionService;
import com.wflow.bean.entity.WflowModelHistorys;
import com.wflow.bean.dto.WflowModelHistorysDto;
import com.wflow.bean.entity.WflowModels;
import com.wflow.mapper.WflowModelHistorysMapper;
import com.wflow.mapper.WflowModelsMapper;
import com.wflow.workflow.bean.process.ProcessNode;
import com.wflow.workflow.service.ProcessModelService;
import com.wflow.workflow.service.WflowFormsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -102,7 +98,7 @@ public class InitProcessTask {

String[] processList = TaskContant.Wflow.DEFAULT_PROCESS_LIST;
for(String processName : processList){
WflowModelHistorys models = new WflowModelHistorys();
WflowModelHistorysDto models = new WflowModelHistorysDto();
models.setCreated(GregorianCalendar.getInstance().getTime());
// models.setFormId("wf" + IdUtil.objectId());
models.setVersion(1);
@@ -110,7 +106,8 @@ public class InitProcessTask {
// models.setProcessDefId("pd" + IdUtil.objectId());
models.setFormName(processName);
models.setRegionCode(region.getRegionCode());
models.setProcess("{\"id\":\"root\",\"desc\":\"任何人\",\"name\":\"发起人\",\"type\":\"ROOT\",\"props\":{},\"children\":{},\"parentId\":null}");
ProcessNode processNode = new ProcessNode();
models.setProcess(processNode);
models.setSettings("{\"sign\":false,\"admin\":[],\"notify\":{},\"commiter\":[]}");
models.setFormItems("[]");



+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java Voir le fichier

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.basic.model.PageVo;
import com.wflow.bean.dto.WflowModelHistorysDto;
import com.wflow.bean.entity.WflowModelHistorys;
import com.wflow.bean.vo.WflowModelVo;
import com.wflow.service.ModelGroupService;
@@ -46,8 +47,8 @@ public class SysProcdefController {

@ApiOperation(value = "系统流程配置保存", notes = "系统流程配置保存")
@PostMapping("/save")
public String save(@Validated @RequestBody WflowModelHistorys modelHistory) {
return processModelService.saveProcess(modelHistory);
public String save(@Validated @RequestBody WflowModelHistorysDto dto) {
return processModelService.saveProcess(dto);
}

@ApiOperation(value = "系统流程配置启用(停用)", notes = "系统流程配置启用(停用)")


Chargement…
Annuler
Enregistrer