add 根据codes查询字典列表信息
This commit is contained in:
+9
@@ -206,6 +206,15 @@ public class SysDictItemController {
|
|||||||
return Result.OK(jsonArray != null ? jsonArray : new JSONArray());
|
return Result.OK(jsonArray != null ? jsonArray : new JSONArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据codes查询列表信息")
|
||||||
|
@GetMapping("/listByCodes")
|
||||||
|
public Result<List<SysDictItem>> listByCodes(@RequestParam(name = "codes") String codes) {
|
||||||
|
List<String> codeList = Arrays.asList(codes.split(","));
|
||||||
|
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(SysDictItem::getItemValue, codeList);
|
||||||
|
return Result.OK(sysDictItemService.list(queryWrapper));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @功能:新增
|
* @功能:新增
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
+19
-8
@@ -2,15 +2,18 @@ package com.jero.modules.activiti.process.fb.controller;
|
|||||||
|
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.modules.activiti.process.esChange.entity.vo.ESChangeDataVO;
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
||||||
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
|
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
|
||||||
import com.jero.modules.activiti.process.fb.vo.FbEntryChangeVO;
|
|
||||||
import com.jero.modules.laws.common.constant.ResultCommon;
|
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||||
|
import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
||||||
@@ -29,12 +32,20 @@ public class ProcessFbEntryChangeController extends JeroController<ProcessFbEntr
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IProcessFbEntryChangeService processFbEntryChangeService;
|
private IProcessFbEntryChangeService processFbEntryChangeService;
|
||||||
|
|
||||||
@AutoLog(value = "标准法规入库_变更流程-发起流程")
|
@AutoLog(value = "标准法规入库_变更流程-添加业务信息")
|
||||||
@ApiOperation(value="标准法规入库_变更流程-发起流程", notes="标准法规入库_变更流程-发起流程")
|
@ApiOperation(value = "标准法规入库_变更流程-添加业务信息", notes = "标准法规入库_变更流程-添加业务信息")
|
||||||
@PostMapping("/start")
|
@PostMapping(value = "/addBusinessInfo")
|
||||||
public Result<String> startProcess(@RequestBody FbEntryChangeVO fbEntryChangeVO) {
|
public Result<T> addBusinessInfo(@Validated @RequestBody ProcessFbEntryChange processFbEntryChange) {
|
||||||
processFbEntryChangeService.startProcess(fbEntryChangeVO);
|
processFbEntryChangeService.addBusinessInfo(processFbEntryChange);
|
||||||
return Result.OK(ResultCommon.OK);
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "标准法规入库_变更流程-编辑业务信息")
|
||||||
|
@ApiOperation(value = "标准法规入库_变更流程-编辑业务信息", notes = "标准法规入库_变更流程-编辑业务信息")
|
||||||
|
@PostMapping(value = "/editBusinessInfo")
|
||||||
|
public Result<T> edit(@Validated @RequestBody ProcessFbEntryChange processFbEntryChange) {
|
||||||
|
processFbEntryChangeService.editBusinessInfo(processFbEntryChange);
|
||||||
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -9,10 +9,6 @@
|
|||||||
<result column="update_time" property="updateTime" />
|
<result column="update_time" property="updateTime" />
|
||||||
<result column="org_code" property="orgCode" />
|
<result column="org_code" property="orgCode" />
|
||||||
<result column="del_flag" property="delFlag" />
|
<result column="del_flag" property="delFlag" />
|
||||||
<result column="process_instance_id" property="processInstanceId" />
|
|
||||||
<result column="processname" property="processname" />
|
|
||||||
<result column="process_due_date" property="processDueDate" />
|
|
||||||
<result column="process_description" property="processDescription" />
|
|
||||||
<result column="source" property="source" />
|
<result column="source" property="source" />
|
||||||
<result column="operate_type" property="operateType" />
|
<result column="operate_type" property="operateType" />
|
||||||
<result column="standard_property" property="standardProperty" />
|
<result column="standard_property" property="standardProperty" />
|
||||||
|
|||||||
+10
-4
@@ -2,7 +2,7 @@ package com.jero.modules.activiti.process.fb.service;
|
|||||||
|
|
||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.activiti.process.fb.vo.FbEntryChangeVO;
|
import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 标准法规入库/变更流程
|
* @Description: 标准法规入库/变更流程
|
||||||
@@ -11,11 +11,17 @@ import com.jero.modules.activiti.process.fb.vo.FbEntryChangeVO;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IProcessFbEntryChangeService extends IService<ProcessFbEntryChange> {
|
public interface IProcessFbEntryChangeService extends IService<ProcessFbEntryChange> {
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/2 15:43
|
||||||
|
* @Description: 添加业务信息
|
||||||
|
**/
|
||||||
|
void addBusinessInfo(ProcessFbEntryChange processFbEntryChange);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
* @Date: 2023/11/1 17:23
|
* @Date: 2023/11/2 15:48
|
||||||
* @Description: 发起流程
|
* @Description: 编辑业务信息
|
||||||
**/
|
**/
|
||||||
void startProcess(FbEntryChangeVO fbEntryChangeVO);
|
void editBusinessInfo(ProcessFbEntryChange processFbEntryChange);
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-5
@@ -3,7 +3,7 @@ package com.jero.modules.activiti.process.fb.service.impl;
|
|||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
||||||
import com.jero.modules.activiti.process.fb.mapper.ProcessFbEntryChangeMapper;
|
import com.jero.modules.activiti.process.fb.mapper.ProcessFbEntryChangeMapper;
|
||||||
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
|
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
|
||||||
import com.jero.modules.activiti.process.fb.vo.FbEntryChangeVO;
|
import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -22,14 +22,24 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryChangeMapper, ProcessFbEntryChange> implements IProcessFbEntryChangeService {
|
public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryChangeMapper, ProcessFbEntryChange> implements IProcessFbEntryChangeService {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
* @Date: 2023/11/1 17:23
|
* @Date: 2023/11/2 15:43
|
||||||
* @Description: 发起流程
|
* @Description: 添加业务信息
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void startProcess(FbEntryChangeVO fbEntryChangeVO) {
|
public void addBusinessInfo(ProcessFbEntryChange processFbEntryChange) {
|
||||||
|
save(processFbEntryChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/2 15:48
|
||||||
|
* @Description: 编辑业务信息
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void editBusinessInfo(ProcessFbEntryChange processFbEntryChange) {
|
||||||
|
updateById(processFbEntryChange);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+97
@@ -0,0 +1,97 @@
|
|||||||
|
package com.jero.modules.activiti.process.fb.util;
|
||||||
|
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/2 15:26
|
||||||
|
* @Description: 实体类转Map集合
|
||||||
|
*/
|
||||||
|
public class ObjectToMapUtil {
|
||||||
|
private static final String COMPILE = "[A-Z]";
|
||||||
|
private ObjectToMapUtil(){}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bean -> Map
|
||||||
|
* 驼峰规范属性转下划线
|
||||||
|
* 支持递归转换,如属性为JavaBean时
|
||||||
|
*/
|
||||||
|
public static<T> Map transform(T object){
|
||||||
|
if(object == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
// 获取实体类所有属性,返回Field数组
|
||||||
|
Field[] fields = object.getClass().getDeclaredFields();
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (int i = 0 ; i < fields.length; i++){
|
||||||
|
// 属性名称
|
||||||
|
String fieldName = fields[i].getName();
|
||||||
|
|
||||||
|
if ("serialVersionUID".equalsIgnoreCase(fieldName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换驼峰形式属性名称成下划线风格,获取map的key 例:fieldName 》 field_name
|
||||||
|
String transformFieldName = ObjectToMapUtil.getTransformFieldName(fieldName);
|
||||||
|
// map 的 value ,属性的值
|
||||||
|
Object fieldValue;
|
||||||
|
|
||||||
|
// 将属性的首字符大写,方便构造get,set方法
|
||||||
|
String name = fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
|
||||||
|
|
||||||
|
// 获取属性的类型
|
||||||
|
String type = fields[i].getGenericType().toString();
|
||||||
|
Method m = object.getClass().getMethod("get" + name);
|
||||||
|
|
||||||
|
switch (type){
|
||||||
|
// 如果有需要,可以仿照下面继续进行扩充,再增加对其它类型的判断
|
||||||
|
case "class java.lang.String":
|
||||||
|
case "class java.lang.Boolean":
|
||||||
|
case "class java.util.Date":
|
||||||
|
case "class java.lang.Integer":
|
||||||
|
case "class java.lang.Long":
|
||||||
|
// 调用getter方法获取属性值
|
||||||
|
fieldValue = m.invoke(object);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 属性类型为bean,则递归
|
||||||
|
Object obj = m.invoke(object);
|
||||||
|
fieldValue = ObjectToMapUtil.transform(obj);
|
||||||
|
}
|
||||||
|
map.put(transformFieldName,fieldValue);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
// 系统异常
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new JeroBootException("系统异常");
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转换风格 驼峰转下划线
|
||||||
|
* @param fieldName 属性名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static String getTransformFieldName(String fieldName) {
|
||||||
|
Pattern humpPattern = Pattern.compile(COMPILE);
|
||||||
|
Matcher matcher = humpPattern.matcher(fieldName);
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
while(matcher.find()){
|
||||||
|
matcher.appendReplacement(sb, "_"+matcher.group(0).toLowerCase());
|
||||||
|
}
|
||||||
|
matcher.appendTail(sb);
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
-42
@@ -1,42 +0,0 @@
|
|||||||
package com.jero.modules.activiti.process.fb.vo;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/2 14:35
|
|
||||||
* @Description: 流程信息通用类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="流程信息通用类", description="流程信息通用类")
|
|
||||||
public class CommonProcessInfo {
|
|
||||||
|
|
||||||
/**流程实例id*/
|
|
||||||
@Excel(name = "流程实例id", width = 15)
|
|
||||||
@ApiModelProperty(value = "流程实例id")
|
|
||||||
private java.lang.String processInstanceId;
|
|
||||||
/**流程名称*/
|
|
||||||
@Excel(name = "流程名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "流程名称")
|
|
||||||
private java.lang.String processName;
|
|
||||||
/**截止日期*/
|
|
||||||
@Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
|
||||||
@ApiModelProperty(value = "截止日期")
|
|
||||||
private java.util.Date processDueDate;
|
|
||||||
/**流程说明*/
|
|
||||||
@Excel(name = "流程说明", width = 15)
|
|
||||||
@ApiModelProperty(value = "流程说明")
|
|
||||||
private java.lang.String processDescription;
|
|
||||||
|
|
||||||
}
|
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
package com.jero.modules.activiti.process.fb.vo;
|
|
||||||
|
|
||||||
import com.jero.modules.activiti.process.common.entity.CommonVO;
|
|
||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/1 17:11
|
|
||||||
* @Description: 标准法规入库_变更流程VO类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="标准法规入库_变更流程VO类", description="标准法规入库_变更流程VO类")
|
|
||||||
public class FbEntryChangeVO {
|
|
||||||
|
|
||||||
/**流程通用信息*/
|
|
||||||
@ApiModelProperty(value = "流程通用信息")
|
|
||||||
private CommonVO commonInfo;
|
|
||||||
|
|
||||||
/**业务信息*/
|
|
||||||
@ApiModelProperty(value = "业务信息")
|
|
||||||
private ProcessFbEntryChange businessInfo;
|
|
||||||
|
|
||||||
/**人员信息*/
|
|
||||||
@ApiModelProperty(value = "人员信息")
|
|
||||||
private Map<String, String> userInfoMap;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.jero.modules.activiti.process.fb.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/2 14:35
|
||||||
|
* @Description: 流程信息通用类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="流程信息通用类", description="流程信息通用类")
|
||||||
|
public class ProcessInfoVO {
|
||||||
|
|
||||||
|
/**流程定义id*/
|
||||||
|
@ApiModelProperty(value = "流程定义id")
|
||||||
|
private java.lang.String processDefinitionId;
|
||||||
|
/**流程实例id*/
|
||||||
|
@ApiModelProperty(value = "流程实例id")
|
||||||
|
private java.lang.String processInstanceId;
|
||||||
|
|
||||||
|
/**流程信息-流程名称*/
|
||||||
|
@ApiModelProperty(value = "流程信息-流程名称")
|
||||||
|
private java.lang.String processName;
|
||||||
|
/**流程信息-截止日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "流程信息-截止日期")
|
||||||
|
private java.util.Date processDueDate;
|
||||||
|
/**流程信息-流程说明*/
|
||||||
|
@ApiModelProperty(value = "流程信息-流程说明")
|
||||||
|
private java.lang.String processDescription;
|
||||||
|
|
||||||
|
/**流程审批信息-备注*/
|
||||||
|
@ApiModelProperty(value = "流程审批信息-备注")
|
||||||
|
private java.lang.String handleText;
|
||||||
|
/**流程审批信息-附件*/
|
||||||
|
@ApiModelProperty(value = "流程审批信息-附件")
|
||||||
|
private java.lang.String handleFile;
|
||||||
|
/**流程审批信息-操作类型*/
|
||||||
|
@ApiModelProperty(value = "流程审批信息-操作类型")
|
||||||
|
private java.lang.String handleType;
|
||||||
|
|
||||||
|
/**业务id*/
|
||||||
|
@ApiModelProperty(value = "业务id")
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**人员信息*/
|
||||||
|
@ApiModelProperty(value = "人员信息")
|
||||||
|
private Map<String, String> userInfoMap;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user