Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -357,11 +357,6 @@ CREATE TABLE `process_fb_entry_change`
|
|||||||
`org_code` varchar(64) COMMENT '所属部门',
|
`org_code` varchar(64) COMMENT '所属部门',
|
||||||
`del_flag` int(1) DEFAULT 0 COMMENT '0表示未删除,1表示删除',
|
`del_flag` int(1) DEFAULT 0 COMMENT '0表示未删除,1表示删除',
|
||||||
|
|
||||||
`process_instance_id` varchar(50) COMMENT '流程示例id(流程信息)',
|
|
||||||
`processName` varchar(100) COMMENT '流程名称(流程信息)',
|
|
||||||
`process_due_date` datetime(0) COMMENT '截止日期(流程信息)',
|
|
||||||
`process_description` varchar(500) COMMENT '流程说明(流程信息)',
|
|
||||||
|
|
||||||
`source` varchar(5) COMMENT '来源(1国内、2海外)',
|
`source` varchar(5) COMMENT '来源(1国内、2海外)',
|
||||||
`operate_type` varchar(5) COMMENT '操作类型(1标准法规入库、2标准法规变更)',
|
`operate_type` varchar(5) COMMENT '操作类型(1标准法规入库、2标准法规变更)',
|
||||||
`standard_property` varchar(36) COMMENT '标准性质',
|
`standard_property` varchar(36) COMMENT '标准性质',
|
||||||
|
|||||||
+47
-7
@@ -26,6 +26,7 @@ import com.jero.common.constant.enums.LanguageEnum;
|
|||||||
import com.jero.common.util.MessageUtils;
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.modules.system.util.TreeUtils;
|
import com.jero.modules.system.util.TreeUtils;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@@ -70,7 +71,7 @@ public class SysDictItemController {
|
|||||||
@ApiOperation(value = "查询字典内容列表")
|
@ApiOperation(value = "查询字典内容列表")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public Result<IPage<SysDictItem>> queryPageList(SysDictItem sysDictItem, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
public Result<IPage<SysDictItem>> queryPageList(SysDictItem sysDictItem, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
||||||
Result<IPage<SysDictItem>> result = new Result<>();
|
Result<IPage<SysDictItem>> result = new Result<>();
|
||||||
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
|
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
|
||||||
queryWrapper.orderByAsc("sort_order");
|
queryWrapper.orderByAsc("sort_order");
|
||||||
@@ -89,12 +90,23 @@ public class SysDictItemController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询字典内容树形列表")
|
@ApiOperation(value = "查询字典内容树形列表")
|
||||||
@GetMapping("/treeList")
|
@GetMapping("/treeList")
|
||||||
public Result<JSONArray> queryTreeList(SysDictItem sysDictItem,
|
public Result<Page<Tree<String>>> queryTreeList(SysDictItem sysDictItem,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||||
|
Page<SysDictItem> page = new Page<>(pageNo, pageSize);
|
||||||
|
// 只查父节点
|
||||||
|
sysDictItem.setParentId("0");
|
||||||
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
|
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
|
||||||
List<SysDictItem> sysDictItems = sysDictItemService.list(queryWrapper);
|
//List<SysDictItem> sysDictItems = sysDictItemService.list(queryWrapper);
|
||||||
//当查询结果中有数据的父级不存在时,赋值父级id为"0"
|
Page<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
|
||||||
|
List<SysDictItem> sysDictItems = pageList.getRecords();
|
||||||
|
List<String> rootIds = sysDictItems.stream().map(SysDictItem::getId).collect(Collectors.toList());
|
||||||
|
// 递归查询子节点
|
||||||
|
queryChildrenNode(sysDictItems, rootIds);
|
||||||
|
// 重新获取ids
|
||||||
List<String> idList = sysDictItems.stream().map(SysDictItem::getId).collect(Collectors.toList());
|
List<String> idList = sysDictItems.stream().map(SysDictItem::getId).collect(Collectors.toList());
|
||||||
|
//当查询结果中有数据的父级不存在时,赋值父级id为"0"
|
||||||
idList.add("0");
|
idList.add("0");
|
||||||
//赋值pId
|
//赋值pId
|
||||||
sysDictItems.forEach(i ->{
|
sysDictItems.forEach(i ->{
|
||||||
@@ -127,9 +139,28 @@ public class SysDictItemController {
|
|||||||
tree.putExtra(s, map.get(s));
|
tree.putExtra(s, map.get(s));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Page<Tree<String>> treePage = new Page<>(pageNo, pageSize);
|
||||||
|
treePage.setRecords(treeNodes);
|
||||||
|
treePage.setTotal(pageList.getTotal());
|
||||||
|
return Result.OK(treePage);
|
||||||
|
}
|
||||||
|
|
||||||
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(treeNodes,SerializerFeature.WriteMapNullValue));
|
/**
|
||||||
return Result.OK(jsonArray != null ? jsonArray : new JSONArray());
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/2 14:04
|
||||||
|
* @Description: 递归查询子节点
|
||||||
|
**/
|
||||||
|
private void queryChildrenNode(List<SysDictItem> sysDictItems, List<String> idList) {
|
||||||
|
if (CollectionUtils.isNotEmpty(idList)) {
|
||||||
|
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(SysDictItem::getParentId, idList);
|
||||||
|
List<SysDictItem> dictItemChildren = sysDictItemService.list(queryWrapper);
|
||||||
|
if (CollectionUtils.isNotEmpty(dictItemChildren)) {
|
||||||
|
List<String> idChildren = dictItemChildren.stream().map(SysDictItem::getId).collect(Collectors.toList());
|
||||||
|
sysDictItems.addAll(dictItemChildren);
|
||||||
|
queryChildrenNode(sysDictItems, idChildren);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "选择框查询字典内容树形列表")
|
@ApiOperation(value = "选择框查询字典内容树形列表")
|
||||||
@@ -175,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-18
@@ -61,24 +61,7 @@ public class ProcessFbEntryChange implements Serializable {
|
|||||||
@Excel(name = "0表示未删除,1表示删除", width = 15)
|
@Excel(name = "0表示未删除,1表示删除", width = 15)
|
||||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||||
private java.lang.Integer delFlag;
|
private java.lang.Integer delFlag;
|
||||||
/**流程示例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;
|
|
||||||
/**来源(1国内、2海外)*/
|
/**来源(1国内、2海外)*/
|
||||||
@Excel(name = "来源(1国内、2海外)", width = 15)
|
@Excel(name = "来源(1国内、2海外)", width = 15)
|
||||||
@ApiModelProperty(value = "来源(1国内、2海外)")
|
@ApiModelProperty(value = "来源(1国内、2海外)")
|
||||||
|
|||||||
-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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
package com.jero.modules.activiti.process.fb.vo;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/1 17:16
|
|
||||||
* @Description: 标准法规入库_变更流程_人员信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="标准法规入库_变更流程_人员信息", description="标准法规入库_变更流程_人员信息")
|
|
||||||
public class FbEntryChangeUserVO {
|
|
||||||
|
|
||||||
/**法规工程师-发起*/
|
|
||||||
@ApiModelProperty(value = "法规工程师-发起")
|
|
||||||
private java.lang.String engineerId;
|
|
||||||
|
|
||||||
/**法规工程师主管级领导-审批*/
|
|
||||||
@ApiModelProperty(value = "法规工程师主管级领导-审批")
|
|
||||||
private java.lang.String leaderId;
|
|
||||||
|
|
||||||
}
|
|
||||||
-34
@@ -1,34 +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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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 common;
|
|
||||||
|
|
||||||
/**业务信息*/
|
|
||||||
@ApiModelProperty(value = "业务信息")
|
|
||||||
private ProcessFbEntryChange data;
|
|
||||||
|
|
||||||
/**人员信息*/
|
|
||||||
@ApiModelProperty(value = "人员信息")
|
|
||||||
private FbEntryChangeUserVO flowUser;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -31,7 +31,8 @@ public class FieldCommon {
|
|||||||
LawsFieldTypeEnum.OPTION_SINGLE.getValue(), // 下拉单选
|
LawsFieldTypeEnum.OPTION_SINGLE.getValue(), // 下拉单选
|
||||||
LawsFieldTypeEnum.TREE_BOX_SINGLE.getValue(), // 树型单选
|
LawsFieldTypeEnum.TREE_BOX_SINGLE.getValue(), // 树型单选
|
||||||
LawsFieldTypeEnum.TREE_BOX.getValue(), // 树型多选
|
LawsFieldTypeEnum.TREE_BOX.getValue(), // 树型多选
|
||||||
LawsFieldTypeEnum.OPTION_MANY.getValue() // 下拉多选
|
LawsFieldTypeEnum.OPTION_MANY.getValue(), // 下拉多选
|
||||||
|
LawsFieldTypeEnum.TREE_OPTION.getValue() // 树形弹框选择
|
||||||
);
|
);
|
||||||
|
|
||||||
// 字典翻译类型
|
// 字典翻译类型
|
||||||
@@ -39,7 +40,8 @@ public class FieldCommon {
|
|||||||
LawsFieldTypeEnum.OPTION_SINGLE.getValue(), // 下拉单选
|
LawsFieldTypeEnum.OPTION_SINGLE.getValue(), // 下拉单选
|
||||||
LawsFieldTypeEnum.OPTION_MANY.getValue(), // 下拉多选
|
LawsFieldTypeEnum.OPTION_MANY.getValue(), // 下拉多选
|
||||||
LawsFieldTypeEnum.TREE_BOX.getValue(), // 树型多选
|
LawsFieldTypeEnum.TREE_BOX.getValue(), // 树型多选
|
||||||
LawsFieldTypeEnum.TREE_BOX_SINGLE.getValue() // 树型单选
|
LawsFieldTypeEnum.TREE_BOX_SINGLE.getValue(), // 树型单选
|
||||||
|
LawsFieldTypeEnum.TREE_OPTION.getValue() // 树形弹框选择
|
||||||
);
|
);
|
||||||
|
|
||||||
// 特殊更新记录字段
|
// 特殊更新记录字段
|
||||||
|
|||||||
+3
-19
@@ -410,14 +410,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
resultMap.put(key + FieldCommon._DICT_TEXT, StringUtils.join(fileList.stream()
|
resultMap.put(key + FieldCommon._DICT_TEXT, StringUtils.join(fileList.stream()
|
||||||
.map(OSSFile::getFileName).collect(Collectors.toList()), ","));
|
.map(OSSFile::getFileName).collect(Collectors.toList()), ","));
|
||||||
}
|
}
|
||||||
} else if (FieldCommon.PART_NAME.equals(key)) {
|
|
||||||
// 如果是零部件名称(存的是id,数据源为其他系统,目前用字典做代替)
|
|
||||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(SysDictItem::getId, value);
|
|
||||||
SysDictItem dictItem = sysDictItemService.getOne(queryWrapper);
|
|
||||||
if (dictItem != null) {
|
|
||||||
resultMap.put(key + FieldCommon._DICT_TEXT, dictItem.getItemText());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,7 +758,9 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
lawsNodeRelationService.addRelation(standardSystem, standardNumber, id);
|
lawsNodeRelationService.addRelation(standardSystem, standardNumber, id);
|
||||||
|
|
||||||
// 企标授权部门处理
|
// 企标授权部门处理
|
||||||
esAuthUserService.resetAuthDept(id, parameterMap.get(FieldCommon.AUTH_DEPT).toString());
|
if (TableNameEnum.ENTERPRISE_STANDARDS.getValue().equals(module)) {
|
||||||
|
esAuthUserService.resetAuthDept(id, parameterMap.get(FieldCommon.AUTH_DEPT).toString());
|
||||||
|
}
|
||||||
|
|
||||||
return MessageUtils.getMessage(ResultCommon.OK);
|
return MessageUtils.getMessage(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
@@ -863,16 +857,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (FieldCommon.PART_NAME.equals(key)) {
|
|
||||||
// 零部件名称(单选)
|
|
||||||
oldValue = (String) oldDataMap.get(key + FieldCommon._DICT_TEXT);
|
|
||||||
if (StringUtils.isNotBlank(value)) {
|
|
||||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(SysDictItem::getDictId, lawsTag.getDictId());
|
|
||||||
queryWrapper.eq(SysDictItem::getItemValue, value);
|
|
||||||
SysDictItem dictItem = sysDictItemService.getOne(queryWrapper);
|
|
||||||
//value = dictItem.getItemText(); // 先注释掉,后面确定好显示后再放开
|
|
||||||
}
|
|
||||||
} else if (FieldCommon.TYPE_DICT.contains(lawsTag.getFieldShowType())) {
|
} else if (FieldCommon.TYPE_DICT.contains(lawsTag.getFieldShowType())) {
|
||||||
// 字典翻译
|
// 字典翻译
|
||||||
oldValue = (String) oldDataMap.get(key + FieldCommon._DICT_TEXT);
|
oldValue = (String) oldDataMap.get(key + FieldCommon._DICT_TEXT);
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ public class OldSystemImportDTO {
|
|||||||
@Excel(name = "TY", width = 15, orderNum = "15")
|
@Excel(name = "TY", width = 15, orderNum = "15")
|
||||||
private String ty;
|
private String ty;
|
||||||
|
|
||||||
@Excel(name = "BZZT", width = 15, orderNum = "16", dicCode = "enterprise_standard_state")
|
@Excel(name = "BZZT", width = 15, orderNum = "16")
|
||||||
private String bzzt;
|
private String bzzt;
|
||||||
|
|
||||||
@Excel(name = "BZXZ", width = 15, orderNum = "17")
|
@Excel(name = "BZXZ", width = 15, orderNum = "17")
|
||||||
|
|||||||
+2
-2
@@ -109,7 +109,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
// 查询授权部门-和临时授权部门
|
// 查询授权部门-和临时授权部门
|
||||||
LambdaQueryWrapper<EnterpriseStandardAuthDept> authDeptWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<EnterpriseStandardAuthDept> authDeptWrapper = new LambdaQueryWrapper<>();
|
||||||
authDeptWrapper.in(CollUtil.isNotEmpty(standardIds), EnterpriseStandardAuthDept::getStandardId, standardIds);
|
authDeptWrapper.in(CollUtil.isNotEmpty(standardIds), EnterpriseStandardAuthDept::getStandardId, standardIds);
|
||||||
authDeptWrapper.in(EnterpriseStandardAuthDept::getAuthDept, departIds);
|
authDeptWrapper.in(CollUtil.isNotEmpty(departIds), EnterpriseStandardAuthDept::getAuthDept, departIds);
|
||||||
List<EnterpriseStandardAuthDept> authDeptList = authDeptService.list(authDeptWrapper);
|
List<EnterpriseStandardAuthDept> authDeptList = authDeptService.list(authDeptWrapper);
|
||||||
authDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
|
authDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
|
||||||
authDeptList.addAll(authDeptService.list(authDeptWrapper));
|
authDeptList.addAll(authDeptService.list(authDeptWrapper));
|
||||||
@@ -227,7 +227,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
// 查询授权部门-和临时授权部门
|
// 查询授权部门-和临时授权部门
|
||||||
LambdaQueryWrapper<EnterpriseStandardAuthDept> authDeptWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<EnterpriseStandardAuthDept> authDeptWrapper = new LambdaQueryWrapper<>();
|
||||||
authDeptWrapper.eq(EnterpriseStandardAuthDept::getStandardId, standardId);
|
authDeptWrapper.eq(EnterpriseStandardAuthDept::getStandardId, standardId);
|
||||||
authDeptWrapper.in(EnterpriseStandardAuthDept::getAuthDept, departIds);
|
authDeptWrapper.in(CollUtil.isNotEmpty(departIds), EnterpriseStandardAuthDept::getAuthDept, departIds);
|
||||||
authDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
|
authDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
|
||||||
List<EnterpriseStandardAuthDept> authDeptList = authDeptService.list(authDeptWrapper);
|
List<EnterpriseStandardAuthDept> authDeptList = authDeptService.list(authDeptWrapper);
|
||||||
if (authDeptList.size() > 0) {
|
if (authDeptList.size() > 0) {
|
||||||
|
|||||||
+2
@@ -46,6 +46,8 @@ public class LawsUtilController {
|
|||||||
SysDictItem dictItem = new SysDictItem();
|
SysDictItem dictItem = new SysDictItem();
|
||||||
// 字典id
|
// 字典id
|
||||||
dictItem.setDictId("1696007957666533377");
|
dictItem.setDictId("1696007957666533377");
|
||||||
|
// 父节点
|
||||||
|
dictItem.setParentId("0");
|
||||||
// 是否标签管理显示(显示)
|
// 是否标签管理显示(显示)
|
||||||
dictItem.setIsTagDict(1);
|
dictItem.setIsTagDict(1);
|
||||||
// 状态(启用)
|
// 状态(启用)
|
||||||
|
|||||||
+4
-4
@@ -239,10 +239,10 @@ public class LawsEnterpriseController {
|
|||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AutoLog(value = "企业法规标准-老法规企标数据库Excel导入")
|
@AutoLog(value = "企业法规标准-老法规企标数据库Zip导入")
|
||||||
@ApiOperation(value="企业法规标准-老法规企标数据库Excel导入", notes="企业法规标准-老法规企标数据库Excel导入")
|
@ApiOperation(value="企业法规标准-老法规企标数据库Zip导入", notes="企业法规标准-老法规企标数据库Zip导入")
|
||||||
@PostMapping("/importExcelOldSystem")
|
@PostMapping("/importOldSystemESZip")
|
||||||
public Result<?> importExcelOldSystem(@RequestParam("file") MultipartFile file) {
|
public Result<?> importOldSystemESZip(@RequestParam("file") MultipartFile file) {
|
||||||
enterpriseStandardService.importExcelOldSystem(file);
|
enterpriseStandardService.importExcelOldSystem(file);
|
||||||
return Result.OK("导入成功");
|
return Result.OK("导入成功");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -196,7 +196,7 @@ public class LawsEnterpriseStandard implements Serializable {
|
|||||||
* 引用标准
|
* 引用标准
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "引用标准")
|
@ApiModelProperty(value = "引用标准")
|
||||||
private String quotedStandard;
|
private String referenceStandard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 被引用标准
|
* 被引用标准
|
||||||
|
|||||||
+250
-84
@@ -1,7 +1,6 @@
|
|||||||
package com.jero.modules.laws.standard.service.impl;
|
package com.jero.modules.laws.standard.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.api.CommonAPI;
|
import com.jero.common.api.CommonAPI;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
@@ -12,44 +11,59 @@ import com.jero.modules.laws.common.constant.FieldCommon;
|
|||||||
import com.jero.modules.laws.enterprise.entity.OldSystemImportDTO;
|
import com.jero.modules.laws.enterprise.entity.OldSystemImportDTO;
|
||||||
import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
||||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||||
|
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||||
|
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||||
import com.jero.modules.laws.standard.mapper.LawsEnterpriseStandardMapper;
|
import com.jero.modules.laws.standard.mapper.LawsEnterpriseStandardMapper;
|
||||||
|
import com.jero.modules.laws.standard.service.ILawsReplacedStandardService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.compress.utils.IOUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.springframework.mock.web.MockMultipartFile;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ThinkBook
|
* @author ThinkBook
|
||||||
* @description 针对表【laws_enterprise_standard(企业标准)】的数据库操作Service实现
|
* @description 针对表【laws_enterprise_standard(企业标准)】的数据库操作Service实现
|
||||||
* @createDate 2023-09-18 14:49:51
|
* @createDate 2023-09-18 14:49:51
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpriseStandardMapper, LawsEnterpriseStandard>
|
public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpriseStandardMapper, LawsEnterpriseStandard>
|
||||||
implements ILawsEnterpriseStandardService, ESSequenceNumberProvider {
|
implements ILawsEnterpriseStandardService, ESSequenceNumberProvider {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LawsEnterpriseStandardMapper esMapper;
|
private LawsEnterpriseStandardMapper esMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILawsDomesticStandardService domesticStandardService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExcelUtils excelUtils;
|
private ExcelUtils excelUtils;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private CommonAPI commonAPI;
|
private CommonAPI commonAPI;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILawsReplacedStandardService lawsReplacedStandardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LawsEnterpriseStandard queryByStandardNumber(String standardNumber) {
|
public LawsEnterpriseStandard queryByStandardNumber(String standardNumber) {
|
||||||
if (StringUtils.isBlank(standardNumber)){
|
if (StringUtils.isBlank(standardNumber)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<LawsEnterpriseStandard> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsEnterpriseStandard> wrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -60,83 +74,6 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void importExcelOldSystem(MultipartFile file) {
|
|
||||||
ImportParams params = new ImportParams();
|
|
||||||
params.setTitleRows(2);
|
|
||||||
params.setHeadRows(1);
|
|
||||||
params.setNeedSave(true);
|
|
||||||
// 获取数据
|
|
||||||
List<OldSystemImportDTO> list = null;
|
|
||||||
try {
|
|
||||||
// 获取当前时间戳(毫秒)
|
|
||||||
long startTime = System.currentTimeMillis();
|
|
||||||
list = ExcelImportUtil.importExcel(file.getInputStream(), OldSystemImportDTO.class, params);
|
|
||||||
// 删除空行
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
|
||||||
OldSystemImportDTO oldSystemImportDTO = list.get(i);
|
|
||||||
if (oldSystemImportDTO.isEmptyRow()) {
|
|
||||||
list.remove(i);
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.info("获取数据成功,数据条数:{}", list.size());
|
|
||||||
// 获取当前时间戳(毫秒)
|
|
||||||
long endTime = System.currentTimeMillis();
|
|
||||||
// 计算执行时间(毫秒)
|
|
||||||
long executionTime = endTime - startTime;
|
|
||||||
log.info("代码执行时间:" + executionTime + " 毫秒");
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("导入失败;{}", e.getMessage());
|
|
||||||
}
|
|
||||||
// 转换数据
|
|
||||||
List<LawsEnterpriseStandard> esList = new ArrayList<>();
|
|
||||||
// list判空
|
|
||||||
if (list == null || list.isEmpty()) {
|
|
||||||
throw new JeroBootException("导入数据为空");
|
|
||||||
}
|
|
||||||
for (OldSystemImportDTO dto : list) {
|
|
||||||
LawsEnterpriseStandard es = new LawsEnterpriseStandard();
|
|
||||||
es.setStandardNumber(dto.getBzh());
|
|
||||||
es.setStandardName(dto.getBzmc());
|
|
||||||
es.setEnglishName(dto.getBzywmc());
|
|
||||||
es.setReleaseDate(dto.getFbrq());
|
|
||||||
es.setImplementationDate(dto.getSsrq());
|
|
||||||
es.setStandardState(Integer.parseInt(dto.getBzzt()));
|
|
||||||
es.setSubstituteStandardNumber(dto.getTdbzh());
|
|
||||||
es.setReplacedByStandardNumber(dto.getBtdbzh());
|
|
||||||
|
|
||||||
// 等级分类默认值
|
|
||||||
es.setGradeClassification("1");
|
|
||||||
esList.add(es);
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
this.handleESData(esList);
|
|
||||||
// 保存数据
|
|
||||||
// 1. 首先获取所有现有的标准号
|
|
||||||
List<LawsEnterpriseStandard> existingEntities = esMapper.selectList(new QueryWrapper<>());
|
|
||||||
|
|
||||||
// 2. 创建一个Map,用于快速查找是否存在相同的标准号
|
|
||||||
Map<String, LawsEnterpriseStandard> standardNumberToEntityMap = new HashMap<>();
|
|
||||||
for (LawsEnterpriseStandard existingEntity : existingEntities) {
|
|
||||||
standardNumberToEntityMap.put(existingEntity.getStandardNumber(), existingEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 遍历待保存或更新的列表,设置ID
|
|
||||||
List<LawsEnterpriseStandard> toSaveOrUpdate = new ArrayList<>();
|
|
||||||
for (LawsEnterpriseStandard entity : esList) {
|
|
||||||
LawsEnterpriseStandard existingEntity = standardNumberToEntityMap.get(entity.getStandardNumber());
|
|
||||||
if (existingEntity != null) {
|
|
||||||
// 如果存在,则设置ID以进行更新
|
|
||||||
entity.setId(existingEntity.getId());
|
|
||||||
}
|
|
||||||
toSaveOrUpdate.add(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 最后,执行批量保存或更新
|
|
||||||
saveOrUpdateBatch(toSaveOrUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleESData(List<LawsEnterpriseStandard> esList) {
|
private void handleESData(List<LawsEnterpriseStandard> esList) {
|
||||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||||
// 编号拆分
|
// 编号拆分
|
||||||
@@ -167,6 +104,235 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void importExcelOldSystem(MultipartFile zipFile) {
|
||||||
|
// 验证文件是否为压缩格式
|
||||||
|
if (!Objects.requireNonNull(zipFile.getContentType()).contains("zip")) {
|
||||||
|
throw new JeroBootException("文件格式不正确,请上传zip格式的压缩包。");
|
||||||
|
}
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
params.setTitleRows(0);
|
||||||
|
params.setNeedSave(true);
|
||||||
|
// 获取数据
|
||||||
|
List<OldSystemImportDTO> allDatalist = null;
|
||||||
|
List<OldSystemImportDTO> esDatalist = new ArrayList<>();
|
||||||
|
List<OldSystemImportDTO> gbDatalist = new ArrayList<>();
|
||||||
|
List<OldSystemImportDTO> fbDatalist = new ArrayList<>();
|
||||||
|
// 解压缩文件,查找Excel文件
|
||||||
|
MultipartFile file = null;
|
||||||
|
try (ZipInputStream zis = new ZipInputStream(zipFile.getInputStream())) {
|
||||||
|
ZipEntry zipEntry;
|
||||||
|
while ((zipEntry = zis.getNextEntry()) != null) {
|
||||||
|
if (zipEntry.getName().endsWith(".xls") || zipEntry.getName().endsWith(".xlsx")) {
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
IOUtils.copy(zis, baos);
|
||||||
|
byte[] excelData = baos.toByteArray();
|
||||||
|
file = new MockMultipartFile(zipEntry.getName(), zipEntry.getName(), "application/vnd.ms-excel", excelData);
|
||||||
|
zis.closeEntry();
|
||||||
|
break; // 一旦找到Excel文件,就可以跳出循环
|
||||||
|
}
|
||||||
|
zis.closeEntry();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new JeroBootException("处理压缩文件时发生错误:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file == null) {
|
||||||
|
throw new JeroBootException("压缩包中未发现Excel文件。");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 获取当前时间戳(毫秒)
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
allDatalist = ExcelImportUtil.importExcel(file.getInputStream(), OldSystemImportDTO.class, params);
|
||||||
|
// 删除空行
|
||||||
|
for (int i = 0; i < allDatalist.size(); i++) {
|
||||||
|
OldSystemImportDTO oldSystemImportDTO = allDatalist.get(i);
|
||||||
|
if (oldSystemImportDTO.isEmptyRow()) {
|
||||||
|
allDatalist.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 区分数据
|
||||||
|
for (OldSystemImportDTO oldSystemImportDTO : allDatalist) {
|
||||||
|
if (oldSystemImportDTO.getBzfl().startsWith("企业标准")) {
|
||||||
|
esDatalist.add(oldSystemImportDTO);
|
||||||
|
} else if (oldSystemImportDTO.getBzfl().startsWith("国家标准")) {
|
||||||
|
gbDatalist.add(oldSystemImportDTO);
|
||||||
|
} else {
|
||||||
|
fbDatalist.add(oldSystemImportDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("获取数据成功,数据条数:{}", allDatalist.size());
|
||||||
|
log.info("获取数据成功,企标数据条数:{}", esDatalist.size());
|
||||||
|
log.info("获取数据成功,国标数据条数:{}", gbDatalist.size());
|
||||||
|
log.info("获取数据成功,其他数据条数:{}", fbDatalist.size());
|
||||||
|
// 获取当前时间戳(毫秒)
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
// 计算执行时间(毫秒)
|
||||||
|
long executionTime = endTime - startTime;
|
||||||
|
log.info("数据转换执行时间:" + executionTime + " 毫秒");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导入失败;{}", e.getMessage());
|
||||||
|
}
|
||||||
|
// 导入企标
|
||||||
|
// 判断是否需要跳过
|
||||||
|
if (esDatalist.isEmpty()) {
|
||||||
|
log.info("企标数据为空,跳过导入");
|
||||||
|
} else {
|
||||||
|
this.oldSysESImport(esDatalist);
|
||||||
|
}
|
||||||
|
// 导入国标
|
||||||
|
// 判断是否需要跳过
|
||||||
|
if (gbDatalist.isEmpty()) {
|
||||||
|
log.info("国标数据为空,跳过导入");
|
||||||
|
} else {
|
||||||
|
this.oldSysGBImport(gbDatalist);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void oldSysGBImport(List<OldSystemImportDTO> gbDatalist) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
// 转换数据
|
||||||
|
List<LawsDomesticStandard> gbList = new ArrayList<>();
|
||||||
|
for (OldSystemImportDTO dto : gbDatalist) {
|
||||||
|
LawsDomesticStandard gb = new LawsDomesticStandard();
|
||||||
|
gb.setStandardNumber(dto.getBzh());
|
||||||
|
|
||||||
|
String[] parts = dto.getBzh().split("[-\\s]"); // 使用空格或破折号作为分隔符
|
||||||
|
if (parts.length < 3) {
|
||||||
|
parts = dto.getBzh().split("[—\\s]"); // 使用空格或破折号作为分隔符
|
||||||
|
}
|
||||||
|
// 标准类别
|
||||||
|
gb.setStandardClass(parts[0]);
|
||||||
|
// 标准号
|
||||||
|
gb.setStandardNumberTemp(parts[1]);
|
||||||
|
// 年代号
|
||||||
|
gb.setYearNumber(parts[2]);
|
||||||
|
|
||||||
|
gb.setStandardName(dto.getBzmc());
|
||||||
|
gb.setStandardEnglishName(dto.getBzywmc());
|
||||||
|
gb.setReleaseDate(dto.getFbrq());
|
||||||
|
gb.setImplementationDate(dto.getSsrq());
|
||||||
|
String standardState = dto.getBzzt();
|
||||||
|
gb.setStandardState(standardState.equals("现行有效") ? "8" : "9");
|
||||||
|
// 代替被代替特殊逻辑
|
||||||
|
gb.setSubstituteStandardNumber(dto.getTdbzh());
|
||||||
|
gb.setReplacedByStandardNumber(dto.getBtdbzh());
|
||||||
|
gbList.add(gb);
|
||||||
|
}
|
||||||
|
// 保存数据
|
||||||
|
// 1. 首先获取所有现有的企标标准号
|
||||||
|
List<LawsDomesticStandard> existingEntities = domesticStandardService.list();
|
||||||
|
|
||||||
|
// 2. 创建一个Map,用于快速查找是否存在相同的标准号
|
||||||
|
Map<String, LawsDomesticStandard> standardNumberToEntityMap = new HashMap<>();
|
||||||
|
for (LawsDomesticStandard existingEntity : existingEntities) {
|
||||||
|
standardNumberToEntityMap.put(existingEntity.getStandardNumber(), existingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 遍历待保存或更新的列表,设置ID
|
||||||
|
for (LawsDomesticStandard entity : gbList) {
|
||||||
|
LawsDomesticStandard existingEntity = standardNumberToEntityMap.get(entity.getStandardNumber());
|
||||||
|
if (existingEntity != null) {
|
||||||
|
// 如果存在,则先删后增
|
||||||
|
this.removeById(existingEntity.getId());
|
||||||
|
// 删除替代
|
||||||
|
lawsReplacedStandardService.removeRelation(existingEntity.getStandardNumber(), 1);
|
||||||
|
}
|
||||||
|
String tdbzh = entity.getSubstituteStandardNumber();
|
||||||
|
String btdbzh = entity.getReplacedByStandardNumber();
|
||||||
|
// 代替标准号
|
||||||
|
if (StringUtils.isNotBlank(tdbzh)) {
|
||||||
|
lawsReplacedStandardService.addRelation(btdbzh, tdbzh, 1);
|
||||||
|
}
|
||||||
|
// 被代替标准号
|
||||||
|
if (StringUtils.isNotBlank(btdbzh)) {
|
||||||
|
List<String> replaceCodeList = Arrays.asList(btdbzh.split(";"));
|
||||||
|
replaceCodeList.forEach(replaceCode -> {
|
||||||
|
lawsReplacedStandardService.addRelation(replaceCode, btdbzh, 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
entity.setSubstituteStandardNumber(null);
|
||||||
|
entity.setReplacedByStandardNumber(null);
|
||||||
|
domesticStandardService.save(entity);
|
||||||
|
}
|
||||||
|
log.info("老法规国标覆盖导入完成");
|
||||||
|
// 获取当前时间戳(毫秒)
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
// 计算执行时间(毫秒)
|
||||||
|
long executionTime = endTime - startTime;
|
||||||
|
log.info("代码执行时间:" + executionTime + " 毫秒");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void oldSysESImport(List<OldSystemImportDTO> esDatalist) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
// 转换数据
|
||||||
|
List<LawsEnterpriseStandard> esList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 导入企标
|
||||||
|
for (OldSystemImportDTO dto : esDatalist) {
|
||||||
|
LawsEnterpriseStandard es = new LawsEnterpriseStandard();
|
||||||
|
es.setStandardNumber(dto.getBzh());
|
||||||
|
es.setStandardName(dto.getBzmc());
|
||||||
|
es.setEnglishName(dto.getBzywmc());
|
||||||
|
es.setReleaseDate(dto.getFbrq());
|
||||||
|
es.setImplementationDate(dto.getSsrq());
|
||||||
|
String standardState = dto.getBzzt();
|
||||||
|
es.setStandardState(standardState.equals("现行有效") ? 8 : 9);
|
||||||
|
// 代替被代替特殊逻辑
|
||||||
|
es.setSubstituteStandardNumber(dto.getTdbzh());
|
||||||
|
es.setReplacedByStandardNumber(dto.getBtdbzh());
|
||||||
|
// 等级分类默认值
|
||||||
|
es.setGradeClassification("1");
|
||||||
|
esList.add(es);
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
this.handleESData(esList);
|
||||||
|
// 保存数据
|
||||||
|
// 1. 首先获取所有现有的企标标准号
|
||||||
|
List<LawsEnterpriseStandard> existingEntities = this.list();
|
||||||
|
|
||||||
|
// 2. 创建一个Map,用于快速查找是否存在相同的标准号
|
||||||
|
Map<String, LawsEnterpriseStandard> standardNumberToEntityMap = new HashMap<>();
|
||||||
|
for (LawsEnterpriseStandard existingEntity : existingEntities) {
|
||||||
|
standardNumberToEntityMap.put(existingEntity.getStandardNumber(), existingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 遍历待保存或更新的列表,设置ID
|
||||||
|
for (LawsEnterpriseStandard entity : esList) {
|
||||||
|
String curStandardNumber = entity.getStandardNumber();
|
||||||
|
LawsEnterpriseStandard existingEntity = standardNumberToEntityMap.get(entity.getStandardNumber());
|
||||||
|
if (existingEntity != null) {
|
||||||
|
// 如果存在,则先删后增
|
||||||
|
this.removeById(existingEntity.getId());
|
||||||
|
// 代替
|
||||||
|
lawsReplacedStandardService.removeRelation(existingEntity.getStandardNumber(), 1);
|
||||||
|
}
|
||||||
|
String tdbzh = entity.getSubstituteStandardNumber();
|
||||||
|
String btdbzh = entity.getReplacedByStandardNumber();
|
||||||
|
// 代替标准号
|
||||||
|
if (StringUtils.isNotBlank(tdbzh)) {
|
||||||
|
lawsReplacedStandardService.addRelation(tdbzh, curStandardNumber, 1);
|
||||||
|
}
|
||||||
|
// 被代替标准号
|
||||||
|
if (StringUtils.isNotBlank(btdbzh)) {
|
||||||
|
List<String> replaceCodeList = Arrays.asList(btdbzh.split(";"));
|
||||||
|
replaceCodeList.forEach(replaceCode -> {
|
||||||
|
lawsReplacedStandardService.addRelation(curStandardNumber, replaceCode, 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
entity.setSubstituteStandardNumber(null);
|
||||||
|
entity.setReplacedByStandardNumber(null);
|
||||||
|
save(entity);
|
||||||
|
}
|
||||||
|
log.info("老法规企标覆盖导入完成");
|
||||||
|
// 获取当前时间戳(毫秒)
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
// 计算执行时间(毫秒)
|
||||||
|
long executionTime = endTime - startTime;
|
||||||
|
log.info("代码执行时间:" + executionTime + " 毫秒");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getSequenceNumbers(String esCodeDictValue, String esNameCodeDictValue, String categoryCodeDictValue) {
|
public List<String> getSequenceNumbers(String esCodeDictValue, String esNameCodeDictValue, String categoryCodeDictValue) {
|
||||||
// 已经存在的标准
|
// 已经存在的标准
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ public enum LawsFieldTypeEnum {
|
|||||||
OPTION_SINGLE("下拉单选","10"),
|
OPTION_SINGLE("下拉单选","10"),
|
||||||
OPTION_MANY("下拉多选","11"),
|
OPTION_MANY("下拉多选","11"),
|
||||||
TREE_BOX("树型结构(多选)","12"),
|
TREE_BOX("树型结构(多选)","12"),
|
||||||
OPTION_Link("输入框(链接)","13"),
|
OPTION_Link("输入框(链接)","13"), // 好像没用了
|
||||||
YEAR_OPTION("年份选择","14"),
|
YEAR_OPTION("年份选择","14"),
|
||||||
TREE_BOX_SINGLE("树型结构(单选)","15")
|
TREE_BOX_SINGLE("树型结构(单选)","15"),
|
||||||
|
TREE_OPTION("树形弹框选择","16"),
|
||||||
;
|
;
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|||||||
Reference in New Issue
Block a user