Merge remote-tracking branch 'origin/master'
This commit is contained in:
+14
-1
@@ -89,6 +89,19 @@ public class WorkCenterController {
|
||||
return Result.OK(sentList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询全部流程")
|
||||
@GetMapping("/getAllList")
|
||||
public Result<?> getAllList(ProcessAll processAll,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProcessAll> queryWrapper = getProcessAllQueryWrapper(processAll);
|
||||
|
||||
Page<ProcessAll> page = new Page<>(pageNo, pageSize);
|
||||
IPage<ProcessAll> sentList = processAllService.getAllList(page, queryWrapper);
|
||||
return Result.OK(sentList);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QueryWrapper<ProcessAll> getProcessAllQueryWrapper(ProcessAll processAll) {
|
||||
String prcName = processAll.getPrcName();
|
||||
@@ -105,7 +118,7 @@ public class WorkCenterController {
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "撤销流程")
|
||||
@ApiOperation(value = "强制撤销")
|
||||
@PostMapping("/delete")
|
||||
public Result<?> delete(@RequestBody Map<String, String> map) {
|
||||
String processInstanceId = map.get("processInstanceId");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.activiti.enums;
|
||||
|
||||
import com.jero.modules.activiti.process.esInitChange.service.impl.ProcessEsInitChangeServiceImpl;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -13,11 +14,13 @@ public enum ProcessTypeEnum {
|
||||
/**
|
||||
* A
|
||||
*/
|
||||
A("企标制修订流程", 1,"Process_17bj7d9");
|
||||
A("企标制修订流程", 1, "com.jero.modules.activiti.process.esInitChange.service.impl.ProcessEsInitChangeServiceImpl"),
|
||||
B("企标立项变更流程",2, "com.jero.modules.activiti.process.esInitChange.service.impl.ProcessEsInitChangeServiceImpl"),
|
||||
;
|
||||
|
||||
private String name;
|
||||
private Integer value;
|
||||
private String key;
|
||||
private String implClass;
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
for (ProcessTypeEnum enumObject : values()) {
|
||||
@@ -28,9 +31,18 @@ public enum ProcessTypeEnum {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer getValueByKey(String key) {
|
||||
public static String getClassByValue(Integer value) {
|
||||
for (ProcessTypeEnum enumObject : values()) {
|
||||
if (enumObject.getKey().equals(key)) {
|
||||
if (enumObject.getValue().equals(value)) {
|
||||
return enumObject.getImplClass();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer getValueByName(String name) {
|
||||
for (ProcessTypeEnum enumObject : values()) {
|
||||
if (enumObject.getName().equals(name)) {
|
||||
return enumObject.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
package com.jero.modules.activiti.listener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.enums.ProcessStatusEnum;
|
||||
import com.jero.modules.activiti.enums.ProcessTypeEnum;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.activiti.util.SpringContextUtil;
|
||||
import org.activiti.bpmn.model.ActivitiListener;
|
||||
import org.activiti.bpmn.model.FlowElement;
|
||||
|
||||
import org.activiti.engine.*;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.runtime.NativeProcessInstanceQuery;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
@@ -45,7 +37,7 @@ public class StartListener implements ExecutionListener {
|
||||
//新增流程总表信息(剩余的内容在启动流程时填充)
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProcessInstanceId(processInstanceId);
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByKey(key));
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByName(name));
|
||||
processAll.setPrcStatus(ProcessStatusEnum.INCOMPLETE.getValue());
|
||||
processAllService.save(processAll);
|
||||
}
|
||||
|
||||
@@ -19,4 +19,6 @@ public interface ProcessAllMapper extends BaseMapper<ProcessAll> {
|
||||
IPage<ProcessAll> getCompletedList(Page<ProcessAll> page, @Param(Constants.WRAPPER) QueryWrapper<ProcessAll> queryWrapper);
|
||||
|
||||
IPage<ProcessAll> getSentList(Page<ProcessAll> page, @Param(Constants.WRAPPER) QueryWrapper<ProcessAll> queryWrapper);
|
||||
|
||||
IPage<ProcessAll> getAllList(Page<ProcessAll> page, @Param(Constants.WRAPPER) QueryWrapper<ProcessAll> queryWrapper);
|
||||
}
|
||||
+15
-2
@@ -17,7 +17,7 @@
|
||||
${ew.customSqlSegment}
|
||||
) p
|
||||
left join process_approval_record par on p.process_instance_id = par.process_instance_id
|
||||
WHERE par.finish_flag = 0
|
||||
WHERE par.finish_flag = 0 or par.id is null
|
||||
group by p.process_instance_id
|
||||
</select>
|
||||
|
||||
@@ -30,7 +30,20 @@
|
||||
${ew.customSqlSegment}
|
||||
) p
|
||||
left join process_approval_record par on p.process_instance_id = par.process_instance_id
|
||||
WHERE par.finish_flag = 0
|
||||
WHERE par.finish_flag = 0 or par.id is null
|
||||
group by p.process_instance_id
|
||||
</select>
|
||||
|
||||
<select id="getAllList" resultType="com.jero.modules.activiti.entity.ProcessAll">
|
||||
select p.*, group_concat(par.user_id) as handleUserId
|
||||
from (
|
||||
select pa.*, max(par.create_time) as receivedTaskTime, max(par.end_time) as completedTaskTime
|
||||
from process_all pa
|
||||
left join process_approval_record par on pa.process_instance_id = par.process_instance_id
|
||||
${ew.customSqlSegment}
|
||||
) p
|
||||
left join process_approval_record par on p.process_instance_id = par.process_instance_id
|
||||
WHERE par.finish_flag = 0 or par.id is null
|
||||
group by p.process_instance_id
|
||||
</select>
|
||||
</mapper>
|
||||
+2
@@ -2,6 +2,7 @@ package com.jero.modules.activiti.process.common.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.modules.activiti.process.common.entity.CenterQueryVO;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.ProcessDraftService;
|
||||
@@ -97,6 +98,7 @@ public class ProcessCenterController {
|
||||
@AutoLog(value = "流程中心-办理")
|
||||
@ApiOperation(value="流程中心-办理", notes="流程中心-办理")
|
||||
@GetMapping("/handle")
|
||||
@Translation
|
||||
public Result<?> handle(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
return Result.OK(actFlowCommonService.handleTask(processInstanceId));
|
||||
}
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.service.ProcessEsAnnualInitService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jero.common.system.base.controller.JeroController.*;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/18 10:44
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "企标年度制修订标准化发起流程")
|
||||
@RequestMapping("/process/es/annualInit")
|
||||
public class ESAnnualInitController {
|
||||
|
||||
@Resource
|
||||
private ProcessEsAnnualInitService annualInitService;
|
||||
|
||||
/**
|
||||
* 导入模板下载
|
||||
*/
|
||||
@GetMapping("/templateDownload")
|
||||
@ApiOperation(value = "企标年度制修订标准化发起流程-模板下载", notes = "企标年度制修订标准化发起流程-模板下载",
|
||||
produces = "application/octet-stream")
|
||||
@AutoLog(value = "企标年度制修订标准化发起流程-模板下载")
|
||||
public ModelAndView templateDownload() {
|
||||
// AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
String title = "标准化发起导入模板";
|
||||
mv.addObject(FILE_NAME, title);
|
||||
mv.addObject(CLASS, ProcessEsAnnualInit.class);
|
||||
ExportParams exportParams = new ExportParams(title, title);
|
||||
// 导出xlsx
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
mv.addObject(PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, new ArrayList<T>());
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/importExcel")
|
||||
@ApiOperation(value = "企标年度制修订标准化发起流程-导入", notes = "企标年度制修订标准化发起流程-导入")
|
||||
@AutoLog(value = "企标年度制修订标准化发起流程-导入")
|
||||
@Translation
|
||||
public Result<?> importExcel(@ApiParam(value = "要上传的文件", required = true) @RequestParam("file") MultipartFile file) {
|
||||
Map<String, Object> resultMap = annualInitService.importData(file);
|
||||
Object flag = resultMap.get("flag");
|
||||
if (flag == YesOrNoEnum.YES.getValue()) {
|
||||
return Result.OK(resultMap.get("dataList"));
|
||||
} else {
|
||||
return Result.error("导入失败", resultMap.get("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
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.jeecgframework.poi.excel.annotation.ExcelVerify;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 企标-年度制修订计划-标准化发起
|
||||
* @TableName process_es_annual_init
|
||||
*/
|
||||
@TableName(value ="process_es_annual_init")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="process_es_annual_init", description="企标-年度制修订计划-标准化发起")
|
||||
public class ProcessEsAnnualInit implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 企标计划Id
|
||||
*/
|
||||
@ApiModelProperty(value = "企标计划Id")
|
||||
private String espId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
@ApiModelProperty(value = "流程实例Id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 申请类别
|
||||
*/
|
||||
@Dict(dicCode = "esp_application_category")
|
||||
@ApiModelProperty(value = "申请类别")
|
||||
private String applicationCategory;
|
||||
|
||||
/**
|
||||
* 制修订类型
|
||||
*/
|
||||
@Excel(name = "制修订类型", width = 15, orderNum = "1")
|
||||
@Dict(dicCode = "esp_revision_type")
|
||||
@ApiModelProperty(value = "制修订类型")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 原企标编号
|
||||
*/
|
||||
@Excel(name = "原企标编号", width = 15, orderNum = "2")
|
||||
@ApiModelProperty(value = "原企标编号")
|
||||
private String originEnStandardNo;
|
||||
|
||||
/**
|
||||
* 新企标编号
|
||||
*/
|
||||
@ApiModelProperty(value = "新企标编号")
|
||||
private String newEnStandardNo;
|
||||
|
||||
/**
|
||||
* 原企标名称
|
||||
*/
|
||||
@Excel(name = "原企标名称", width = 15, orderNum = "4")
|
||||
@ApiModelProperty(value = "原企标名称")
|
||||
private String originEnStandardName;
|
||||
|
||||
/**
|
||||
* 新企标名称
|
||||
*/
|
||||
@Excel(name = "新企标名称", width = 15, orderNum = "5")
|
||||
@ApiModelProperty(value = "新企标名称")
|
||||
private String newEnStandardName;
|
||||
|
||||
/**
|
||||
* 企标英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "企标英文名称")
|
||||
private String enStandardEnglishName;
|
||||
|
||||
/**
|
||||
* 企标体系
|
||||
*/
|
||||
@Dict(dictTable = "laws_tree_node", dicCode = "id", dicText = "node_name")
|
||||
@ApiModelProperty(value = "企标体系")
|
||||
private String enStandardSystem;
|
||||
|
||||
/**
|
||||
* 企业标准代号
|
||||
*/
|
||||
@Excel(name = "企业标准代号", width = 15, orderNum = "7")
|
||||
@ApiModelProperty(value = "企业标准代号")
|
||||
private String enStandardCode;
|
||||
|
||||
/**
|
||||
* 企业名称代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业名称代号")
|
||||
private String enNameCode;
|
||||
|
||||
/**
|
||||
* 标准类别代号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类别代号")
|
||||
private String standardCategoryCode;
|
||||
|
||||
/**
|
||||
* 年代号
|
||||
*/
|
||||
@ApiModelProperty(value = "年代号")
|
||||
private String decadeCode;
|
||||
|
||||
/**
|
||||
* 标准类型
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类型")
|
||||
private String standardType;
|
||||
|
||||
/**
|
||||
* 企标等级分类
|
||||
*/
|
||||
@ApiModelProperty(value = "企标等级分类")
|
||||
private String enStandardClassification;
|
||||
|
||||
/**
|
||||
* 草稿计划完成日期
|
||||
*/
|
||||
@Excel(name = "草稿计划完成日期", width = 20, orderNum = "13")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿计划完成日期")
|
||||
private Date draftPlannedCompleteDate;
|
||||
|
||||
/**
|
||||
* 征求意见稿计划完成日期
|
||||
*/
|
||||
@Excel(name = "征求意见稿计划完成日期", width = 24, orderNum = "14")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿计划完成日期")
|
||||
private Date solicitationDraftPlanCompleteDate;
|
||||
|
||||
/**
|
||||
* 计划报批日期
|
||||
*/
|
||||
@Excel(name = "计划报批日期", width = 15, orderNum = "15")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划报批日期")
|
||||
private Date planApprovalDate;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
@ApiModelProperty(value = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 编制说明
|
||||
*/
|
||||
@ApiModelProperty(value = "编制说明")
|
||||
private String compilationDescription;
|
||||
|
||||
/**
|
||||
* 零部件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件名称")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@Excel(name = "主起草人", width = 15, orderNum = "9")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@Excel(name = "主起草单位", width = 15, orderNum = "10")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
private String mainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 主起草单位责任人
|
||||
*/
|
||||
@Excel(name = "主起草单位责任人", width = 20, orderNum = "11")
|
||||
@Dict(dicCode = "id", dictTable = "sys_user", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草单位责任人")
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
|
||||
@Excel(name = "标准推进人", width = 15, orderNum = "12")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
private String standardPromoter;
|
||||
|
||||
/**
|
||||
* 征求意见稿完成日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿完成日期")
|
||||
private Date solicitationDraftCompletionDate;
|
||||
|
||||
/**
|
||||
* 变更状态
|
||||
*/
|
||||
@Dict(dicCode = "esp_change_status")
|
||||
@ApiModelProperty(value = "变更状态")
|
||||
private String changeStatus;
|
||||
|
||||
/**
|
||||
* 上传附件
|
||||
*/
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String uploadAttachment;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
@ApiModelProperty(value = "变更原因")
|
||||
private String changeReason;
|
||||
|
||||
/**
|
||||
* 授权部门
|
||||
*/
|
||||
@Excel(name = "授权部门", width = 15, orderNum = "6")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "授权部门")
|
||||
private String authDept;
|
||||
|
||||
/**
|
||||
* 配合单位
|
||||
*/
|
||||
@Excel(name = "配合单位", width = 15, orderNum = "8")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperationUnit;
|
||||
|
||||
/**
|
||||
* 联络人
|
||||
*/
|
||||
@Excel(name = "联络人", width = 15, orderNum = "17")
|
||||
@ApiModelProperty(value = "联络人")
|
||||
private String contactUser;
|
||||
|
||||
/**
|
||||
* 审批人
|
||||
*/
|
||||
@ApiModelProperty(value = "审批人")
|
||||
private String approvalUser;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sort;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.mapper;
|
||||
|
||||
import com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_init(企标立项变更流程)】的数据库操作Mapper
|
||||
* @createDate 2023-10-18 10:01:44
|
||||
* @Entity com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit
|
||||
*/
|
||||
public interface ProcessEsAnnualInitMapper extends BaseMapper<ProcessEsAnnualInit> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.activiti.process.esAnnualInit.mapper.ProcessEsAnnualInitMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="espId" column="esp_id" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
|
||||
<result property="processInstanceId" column="process_instance_id" jdbcType="VARCHAR"/>
|
||||
<result property="applicationCategory" column="application_category" jdbcType="VARCHAR"/>
|
||||
<result property="projectType" column="project_type" jdbcType="VARCHAR"/>
|
||||
<result property="originEnStandardNo" column="origin_en_standard_no" jdbcType="VARCHAR"/>
|
||||
<result property="newEnStandardNo" column="new_en_standard_no" jdbcType="VARCHAR"/>
|
||||
<result property="originEnStandardName" column="origin_en_standard_name" jdbcType="VARCHAR"/>
|
||||
<result property="newEnStandardName" column="new_en_standard_name" jdbcType="VARCHAR"/>
|
||||
<result property="enStandardEnglishName" column="en_standard_english_name" jdbcType="VARCHAR"/>
|
||||
<result property="enStandardSystem" column="en_standard_system" jdbcType="VARCHAR"/>
|
||||
<result property="enStandardCode" column="en_standard_code" jdbcType="VARCHAR"/>
|
||||
<result property="enNameCode" column="en_name_code" jdbcType="VARCHAR"/>
|
||||
<result property="standardCategoryCode" column="standard_category_code" jdbcType="VARCHAR"/>
|
||||
<result property="decadeCode" column="decade_code" jdbcType="VARCHAR"/>
|
||||
<result property="standardType" column="standard_type" jdbcType="VARCHAR"/>
|
||||
<result property="enStandardClassification" column="en_standard_classification" jdbcType="VARCHAR"/>
|
||||
<result property="draftPlannedCompleteDate" column="draft_planned_complete_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="solicitationDraftPlanCompleteDate" column="solicitation_draft_plan_complete_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="planApprovalDate" column="plan_approval_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="projectStatus" column="project_status" jdbcType="VARCHAR"/>
|
||||
<result property="compilationDescription" column="compilation_description" jdbcType="VARCHAR"/>
|
||||
<result property="componentName" column="component_name" jdbcType="VARCHAR"/>
|
||||
<result property="mainDraftingUser" column="main_drafting_user" jdbcType="VARCHAR"/>
|
||||
<result property="mainDraftingUnit" column="main_drafting_unit" jdbcType="VARCHAR"/>
|
||||
<result property="mainDraftingUnitResponsiblePerson" column="main_drafting_unit_responsible_person" jdbcType="VARCHAR"/>
|
||||
<result property="standardPromoter" column="standard_promoter" jdbcType="VARCHAR"/>
|
||||
<result property="solicitationDraftCompletionDate" column="solicitation_draft_completion_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="changeStatus" column="change_status" jdbcType="VARCHAR"/>
|
||||
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
||||
<result property="uploadAttachment" column="upload_attachment" jdbcType="VARCHAR"/>
|
||||
<result property="changeReason" column="change_reason" jdbcType="VARCHAR"/>
|
||||
<result property="authDept" column="auth_dept" jdbcType="VARCHAR"/>
|
||||
<result property="cooperationUnit" column="cooperation_unit" jdbcType="VARCHAR"/>
|
||||
<result property="contactUser" column="contact_user" jdbcType="VARCHAR"/>
|
||||
<result property="approvalUser" column="approval_user" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,esp_id,create_by,
|
||||
create_time,update_by,update_time,
|
||||
org_code,del_flag,process_instance_id,
|
||||
application_category,project_type,origin_en_standard_no,
|
||||
new_en_standard_no,origin_en_standard_name,new_en_standard_name,
|
||||
en_standard_english_name,en_standard_system,en_standard_code,
|
||||
en_name_code,standard_category_code,decade_code,
|
||||
standard_type,en_standard_classification,draft_planned_complete_date,
|
||||
solicitation_draft_plan_complete_date,plan_approval_date,project_status,
|
||||
compilation_description,component_name,main_drafting_user,
|
||||
main_drafting_unit,main_drafting_unit_responsible_person,standard_promoter,
|
||||
solicitation_draft_completion_date,change_status,remarks,
|
||||
upload_attachment,change_reason,auth_dept,
|
||||
cooperation_unit,contact_user,approval_user
|
||||
</sql>
|
||||
</mapper>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.service;
|
||||
|
||||
import com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_init(企标立项变更流程)】的数据库操作Service
|
||||
* @createDate 2023-10-18 10:01:44
|
||||
*/
|
||||
public interface ProcessEsAnnualInitService extends IService<ProcessEsAnnualInit> {
|
||||
|
||||
/**
|
||||
* 导入数据,返回数据列表
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> importData(MultipartFile file);
|
||||
}
|
||||
+297
@@ -0,0 +1,297 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.CommonAPI;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.system.vo.SysDictItemCore;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.service.ProcessEsAnnualInitService;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.mapper.ProcessEsAnnualInitMapper;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.activiti.util.ExcelUtils;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_init(企标立项变更流程)】的数据库操作Service实现
|
||||
* @createDate 2023-10-18 10:01:44
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ProcessEsAnnualInitServiceImpl extends ServiceImpl<ProcessEsAnnualInitMapper, ProcessEsAnnualInit>
|
||||
implements ProcessEsAnnualInitService {
|
||||
|
||||
@Resource
|
||||
private CommonAPI commonAPI;
|
||||
|
||||
@Resource
|
||||
private ExcelUtils excelUtils;
|
||||
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService enterpriseStandardService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> importData(MultipartFile file) {
|
||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<String> errorMsgs = new ArrayList<>();
|
||||
|
||||
// 获取Excel的header
|
||||
List<String> headers;
|
||||
try {
|
||||
headers = ExcelUtils.getHeaderFromExcel(file.getInputStream());
|
||||
} catch (Exception e) {
|
||||
errorMsgs.add("上传模板错误,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
log.error(e.getMessage(), e);
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
|
||||
// 使用静态方法验证header
|
||||
boolean isMatched = headers.equals(ExcelUtils.getSortedHeadersFromClass(ProcessEsAnnualInit.class));
|
||||
if (!isMatched) {
|
||||
errorMsgs.add("上传模板错误,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(1);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
|
||||
try {
|
||||
List<ProcessEsAnnualInit> list = ExcelImportUtil.importExcel(file.getInputStream(), ProcessEsAnnualInit.class, params);
|
||||
if (list.isEmpty()) {
|
||||
errorMsgs.add("文件暂无数据,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
// 批量检查数据是否有效
|
||||
errorMsgs = this.validationList(list, listDict);
|
||||
if (errorMsgs.size() > 0) {
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
} else {
|
||||
resultMap.put("flag", YesOrNoEnum.YES.getValue());
|
||||
// 转换为字典值
|
||||
this.transToDictValue(list, listDict);
|
||||
// 清洗
|
||||
this.cleanData(list);
|
||||
resultMap.put("dataList", list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errorMsgs.add("文件导入异常:" + e.getMessage());
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
log.error(e.getMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private void cleanData(List<ProcessEsAnnualInit> list) {
|
||||
list.forEach(item-> {
|
||||
// 如果是制定则去除掉所有的原企标名称 原企标编号
|
||||
if (ESPProjectType.ENACT.getValue().equals(item.getProjectType())) {
|
||||
item.setOriginEnStandardName(null);
|
||||
item.setOriginEnStandardNo(null);
|
||||
}
|
||||
// 设置变更状态 制定是新增 修订是变更
|
||||
if (item.getProjectType().equals("制定")) {
|
||||
item.setChangeStatus("新增");
|
||||
} else {
|
||||
item.setChangeStatus("变更");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void transToDictValue(List<ProcessEsAnnualInit> list, List<SysDictItemCore> listDict) {
|
||||
list.forEach(item -> {
|
||||
item.setProjectType(excelUtils.translateDictValue("esp_revision_type", item.getProjectType(), listDict));
|
||||
item.setAuthDept(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getAuthDept(), listDict));
|
||||
item.setEnStandardCode(excelUtils.translateDictValue("enterprise_standard_code", item.getEnStandardCode(), listDict));
|
||||
item.setCooperationUnit(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getCooperationUnit(), listDict));
|
||||
item.setMainDraftingUser(excelUtils.translateDictValue("username", "id", "sys_user", item.getMainDraftingUser(), listDict));
|
||||
item.setMainDraftingUnit(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getMainDraftingUnit(), listDict));
|
||||
item.setMainDraftingUnitResponsiblePerson(excelUtils.translateDictValue("username", "id", "sys_user", item.getMainDraftingUnitResponsiblePerson(), listDict));
|
||||
item.setStandardPromoter(excelUtils.translateDictValue("username", "id", "sys_user", item.getStandardPromoter(), listDict));
|
||||
item.setContactUser(excelUtils.translateDictValue("username", "id", "sys_user", item.getContactUser(), listDict));
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> validationList(List<ProcessEsAnnualInit> list, List<SysDictItemCore> listDict) {
|
||||
List<LawsEnterpriseStandard> esList = enterpriseStandardService.list();
|
||||
List<String> errorMsgs = new ArrayList<>();
|
||||
|
||||
int i = 3;
|
||||
Iterator<ProcessEsAnnualInit> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ProcessEsAnnualInit plan = iterator.next();
|
||||
if (ExcelUtils.isEmptyRow(plan)) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
plan.setSort(String.valueOf(i++));
|
||||
String enStandardCode = plan.getProjectType();
|
||||
String authDept = plan.getProjectType();
|
||||
String cooperationUnit = plan.getCooperationUnit();
|
||||
String mainDraftingUnit = plan.getMainDraftingUnit();
|
||||
String mainDraftingUser = plan.getProjectType();
|
||||
String mainDraftingUnitResponsiblePerson = plan.getMainDraftingUnitResponsiblePerson();
|
||||
String standardPromoter = plan.getStandardPromoter();
|
||||
String contactUser = plan.getContactUser();
|
||||
|
||||
StringBuilder errMsgHeader = new StringBuilder();
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
errMsgHeader.append("第").append(plan.getSort()).append("行");
|
||||
|
||||
// 检查制修订类型 编号 名称
|
||||
errMsg.append(validProjectType(plan, listDict, esList));
|
||||
// 检查所有数据字典校验的字段
|
||||
errMsg.append(validAuthDept(authDept, listDict));
|
||||
errMsg.append(validStandardCode(enStandardCode, listDict));
|
||||
errMsg.append(validCooperateUnit(cooperationUnit, listDict));
|
||||
errMsg.append(validMainDraftingUser(mainDraftingUser, listDict));
|
||||
errMsg.append(validMainDraftingUnit(mainDraftingUnit, listDict));
|
||||
errMsg.append(validMainDraftingUnitResponsiblePerson(mainDraftingUnitResponsiblePerson, listDict));
|
||||
errMsg.append(validStandardPromoter(standardPromoter, listDict));
|
||||
errMsg.append(validContactUser(contactUser, listDict));
|
||||
// 如果数据有问题,则将提示信息添加到 errorMsgs 中
|
||||
if (errMsg.length() > 0) {
|
||||
errorMsgs.add(errMsgHeader.append(errMsg).toString());
|
||||
}
|
||||
}
|
||||
return errorMsgs;
|
||||
}
|
||||
|
||||
private String validAuthDept(String value, List<SysDictItemCore> listDict) {
|
||||
// 非空检查
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'授权部门'不能为空。";
|
||||
}
|
||||
// 检查授权部门
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", false, listDict)) {
|
||||
return "'授权部门'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validStandardCode(String value, List<SysDictItemCore> listDict) {
|
||||
// 检查企业标准代号
|
||||
if (!excelUtils.validDict("enterprise_standard_code", value, null, null, true, listDict)) {
|
||||
return "'企业标准代号'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validCooperateUnit(String value, List<SysDictItemCore> listDict) { // 非空检查
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'配合单位'不能为空。";
|
||||
}
|
||||
// 检查配合单位
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", false, listDict)) {
|
||||
return "'配合单位'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUser(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草人'不能为空。";
|
||||
}
|
||||
// 检查主起草人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'主起草人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUnit(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草单位'不能为空。";
|
||||
}
|
||||
// 检查主起草单位
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", true, listDict)) {
|
||||
return "'主起草单位'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUnitResponsiblePerson(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草单位负责人'不能为空。";
|
||||
}
|
||||
// 检查主起草单位负责人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'主起草单位负责人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validStandardPromoter(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'标准推进人'不能为空。";
|
||||
}
|
||||
// 检查标准推进人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'标准推进人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validContactUser(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'联络人'不能为空。";
|
||||
}
|
||||
// 检查联络人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'联络人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private String validProjectType(ProcessEsAnnualInit plan, List<SysDictItemCore> listDict, List<LawsEnterpriseStandard> esList) {
|
||||
String projectType = plan.getProjectType();
|
||||
String originEnStandardNo = plan.getProjectType();
|
||||
String newEnStandardName = plan.getNewEnStandardName();
|
||||
if (StrUtil.isBlank(projectType)) {
|
||||
return "'制修订类型'不能为空。";
|
||||
}
|
||||
if (!excelUtils.validDict("esp_revision_type", projectType, null, null, true, listDict)) {
|
||||
return "'制修订类型'无效。";
|
||||
}
|
||||
// 修订
|
||||
if (projectType.equals(ESPProjectType.MODIFY.getValue())) {
|
||||
// 检查企标编号是否有效
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
return "'原企标编号'不能为空。";
|
||||
}
|
||||
if (!esList.stream().map(LawsEnterpriseStandard::getStandardNumber).collect(Collectors.toList()).contains(originEnStandardNo)) {
|
||||
return "'原企标编号'无效。";
|
||||
}
|
||||
}
|
||||
if (newEnStandardName.length() > 50) {
|
||||
return "'新企标名称'过长(最多50字)。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.service.ProcessEsAnnualReportService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jero.common.system.base.controller.JeroController.*;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/18 10:44
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "企标年度制修订主动上报流程")
|
||||
@RequestMapping("/process/es/annualReport")
|
||||
public class ESAnnualReportController {
|
||||
|
||||
@Resource
|
||||
private ProcessEsAnnualReportService annualReportService;
|
||||
|
||||
/**
|
||||
* 导入模板下载
|
||||
*/
|
||||
@GetMapping("/templateDownload")
|
||||
@ApiOperation(value = "企标年度制修订主动上报流程-导入模板下载", notes = "企标年度制修订主动上报流程-导入模板下载",
|
||||
produces = "application/octet-stream")
|
||||
@AutoLog(value = "企标年度制修订主动上报流程-导入模板下载")
|
||||
public ModelAndView templateDownload() {
|
||||
// AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
String title = "各部门主动上报导入模板";
|
||||
mv.addObject(FILE_NAME, title);
|
||||
mv.addObject(CLASS, ProcessEsAnnualReport.class);
|
||||
ExportParams exportParams = new ExportParams(title, title);
|
||||
// 导出xlsx
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
mv.addObject(PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, new ArrayList<T>());
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/importExcel")
|
||||
@ApiOperation(value = "企标年度制修订主动上报流程-导入", notes = "企标年度制修订主动上报流程-导入")
|
||||
@AutoLog(value = "企标年度制修订主动上报流程-导入")
|
||||
@Translation
|
||||
public Result<?> importExcel(@ApiParam(value = "要上传的文件", required = true) @RequestParam("file") MultipartFile file) {
|
||||
Map<String, Object> resultMap = annualReportService.importData(file);
|
||||
Object flag = resultMap.get("flag");
|
||||
if (flag == YesOrNoEnum.YES.getValue()) {
|
||||
return Result.OK(resultMap.get("dataList"));
|
||||
} else {
|
||||
return Result.error("导入失败", resultMap.get("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 企标-年度制修订计划-各部门主动上报
|
||||
* @TableName process_es_annual_report
|
||||
*/
|
||||
@Data
|
||||
@TableName(value ="process_es_annual_report")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="process_es_annual_report对象", description="企标-年度制修订计划-各部门主动上报")
|
||||
public class ProcessEsAnnualReport implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 企标计划Id
|
||||
*/
|
||||
@ApiModelProperty(value = "企标计划Id")
|
||||
private String espId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
@ApiModelProperty(value = "流程实例Id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 申请类别
|
||||
*/
|
||||
@Dict(dicCode = "esp_application_category")
|
||||
@ApiModelProperty(value = "申请类别")
|
||||
private String applicationCategory;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
@Excel(name = "制修订类型", width = 15, orderNum = "1")
|
||||
@Dict(dicCode = "esp_revision_type")
|
||||
@ApiModelProperty(value = "制修订类型")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 原企标编号
|
||||
*/
|
||||
@Excel(name = "原企标编号", width = 15, orderNum = "2")
|
||||
@ApiModelProperty(value = "原企标编号")
|
||||
private String originEnStandardNo;
|
||||
|
||||
/**
|
||||
* 新企标编号
|
||||
*/
|
||||
@ApiModelProperty(value = "新企标编号")
|
||||
private String newEnStandardNo;
|
||||
|
||||
/**
|
||||
* 原企标名称
|
||||
*/
|
||||
@Excel(name = "原企标名称", width = 15, orderNum = "4")
|
||||
@ApiModelProperty(value = "原企标名称")
|
||||
private String originEnStandardName;
|
||||
|
||||
/**
|
||||
* 新企标名称
|
||||
*/
|
||||
@Excel(name = "新企标名称", width = 15, orderNum = "5")
|
||||
@ApiModelProperty(value = "新企标名称")
|
||||
private String newEnStandardName;
|
||||
|
||||
/**
|
||||
* 企标英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "企标英文名称")
|
||||
private String enStandardEnglishName;
|
||||
|
||||
/**
|
||||
* 企标体系
|
||||
*/
|
||||
@ApiModelProperty(value = "企标体系")
|
||||
private String enStandardSystem;
|
||||
|
||||
/**
|
||||
* 企业标准代号
|
||||
*/
|
||||
@Excel(name = "企业标准代号", width = 15, orderNum = "7")
|
||||
@Dict(dicCode = "enterprise_standard_code")
|
||||
@ApiModelProperty(value = "企业标准代号")
|
||||
private String enStandardCode;
|
||||
|
||||
/**
|
||||
* 企业名称代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业名称代号")
|
||||
private String enNameCode;
|
||||
|
||||
/**
|
||||
* 标准类别代号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类别代号")
|
||||
private String standardCategoryCode;
|
||||
|
||||
/**
|
||||
* 年代号
|
||||
*/
|
||||
@ApiModelProperty(value = "年代号")
|
||||
private String decadeCode;
|
||||
|
||||
/**
|
||||
* 标准类型
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类型")
|
||||
private String standardType;
|
||||
|
||||
/**
|
||||
* 企标等级分类
|
||||
*/
|
||||
@ApiModelProperty(value = "企标等级分类")
|
||||
private String enStandardClassification;
|
||||
|
||||
/**
|
||||
* 草稿计划完成日期
|
||||
*/
|
||||
@Excel(name = "草稿计划完成日期", width = 20, orderNum = "13")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿计划完成日期")
|
||||
private Date draftPlannedCompleteDate;
|
||||
|
||||
/**
|
||||
* 征求意见稿计划完成日期
|
||||
*/
|
||||
@Excel(name = "征求意见稿计划完成日期", width = 24, orderNum = "14")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿计划完成日期")
|
||||
private Date solicitationDraftPlanCompleteDate;
|
||||
|
||||
/**
|
||||
* 计划报批日期
|
||||
*/
|
||||
@Excel(name = "计划报批日期", width = 15, orderNum = "15")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划报批日期")
|
||||
private Date planApprovalDate;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
@ApiModelProperty(value = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 编制说明
|
||||
*/
|
||||
@ApiModelProperty(value = "编制说明")
|
||||
private String compilationDescription;
|
||||
|
||||
/**
|
||||
* 零部件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件名称")
|
||||
private String componentName;
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@Excel(name = "主起草单位", width = 15, orderNum = "9")
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
private String mainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 主起草单位责任人
|
||||
*/
|
||||
@Excel(name = "主起草单位责任人", width = 20, orderNum = "10")
|
||||
@Dict(dicCode = "id", dictTable = "sys_user", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草单位责任人")
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
|
||||
/**
|
||||
* 标准推进人
|
||||
*/
|
||||
@Excel(name = "标准推进人", width = 15, orderNum = "12")
|
||||
@Dict(dicCode = "id", dictTable = "sys_user", dicText = "username")
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
private String standardPromoter;
|
||||
|
||||
/**
|
||||
* 草稿完成日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿完成日期")
|
||||
private Date draftCompletionDate;
|
||||
|
||||
/**
|
||||
* 提交草稿日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "提交草稿日期")
|
||||
private Date draftSubmissionDate;
|
||||
|
||||
/**
|
||||
* 是否征求意见
|
||||
*/
|
||||
@ApiModelProperty(value = "是否征求意见")
|
||||
private String solicitationOpinionEnabled;
|
||||
|
||||
/**
|
||||
* 征求意见稿完成日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿完成日期")
|
||||
private Date solicitationDraftCompletionDate;
|
||||
|
||||
/**
|
||||
* 变更状态
|
||||
*/
|
||||
@Dict(dicCode = "esp_change_status")
|
||||
@ApiModelProperty(value = "变更状态")
|
||||
private String changeStatus;
|
||||
|
||||
/**
|
||||
* 上传附件
|
||||
*/
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String uploadAttachment;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
@ApiModelProperty(value = "变更原因")
|
||||
private String changeReason;
|
||||
|
||||
/**
|
||||
* 授权部门
|
||||
*/
|
||||
@Excel(name = "授权部门", width = 15, orderNum = "6")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "授权部门")
|
||||
private String authDept;
|
||||
|
||||
/**
|
||||
* 配合单位
|
||||
*/
|
||||
@Excel(name = "配合单位", width = 15, orderNum = "8")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperationUnit;
|
||||
|
||||
/**
|
||||
* 隶属工作组
|
||||
*/
|
||||
@Excel(name = "隶属工作组", width = 15, orderNum = "11")
|
||||
@Dict(dictTable = "laws_working_group", dicCode = "id", dicText = "name")
|
||||
@ApiModelProperty(value = "隶属工作组")
|
||||
private String workGroup;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sort;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_report(企标-年度制修订计划-各部门主动上报)】的数据库操作Mapper
|
||||
* @createDate 2023-10-18 09:52:41
|
||||
* @Entity com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualReport
|
||||
*/
|
||||
public interface ProcessEsAnnualReportMapper extends BaseMapper<ProcessEsAnnualReport> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_report(企标-年度制修订计划-各部门主动上报)】的数据库操作Service
|
||||
* @createDate 2023-10-18 09:52:41
|
||||
*/
|
||||
public interface ProcessEsAnnualReportService extends IService<ProcessEsAnnualReport> {
|
||||
|
||||
Map<String, Object> importData(MultipartFile file);
|
||||
}
|
||||
+294
@@ -0,0 +1,294 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.CommonAPI;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.SysDictItemCore;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.mapper.ProcessEsAnnualReportMapper;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.service.ProcessEsAnnualReportService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.activiti.util.ExcelUtils;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_annual_report(企标-年度制修订计划-各部门主动上报)】的数据库操作Service实现
|
||||
* @createDate 2023-10-18 09:52:41
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnualReportMapper, ProcessEsAnnualReport>
|
||||
implements ProcessEsAnnualReportService {
|
||||
|
||||
@Resource
|
||||
private CommonAPI commonAPI;
|
||||
|
||||
@Resource
|
||||
private ExcelUtils excelUtils;
|
||||
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService enterpriseStandardService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> importData(MultipartFile file) {
|
||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<String> errorMsgs = new ArrayList<>();
|
||||
|
||||
// 获取Excel的header
|
||||
List<String> headers;
|
||||
try {
|
||||
headers = ExcelUtils.getHeaderFromExcel(file.getInputStream());
|
||||
} catch (Exception e) {
|
||||
errorMsgs.add("上传模板错误,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
log.error(e.getMessage(), e);
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
|
||||
// 使用静态方法验证header
|
||||
boolean isMatched = headers.equals(ExcelUtils.getSortedHeadersFromClass(ProcessEsAnnualReport.class));
|
||||
if (!isMatched) {
|
||||
errorMsgs.add("上传模板错误,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(1);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
|
||||
try {
|
||||
List<ProcessEsAnnualReport> list = ExcelImportUtil.importExcel(file.getInputStream(), ProcessEsAnnualReport.class, params);
|
||||
if (list.isEmpty()) {
|
||||
errorMsgs.add("文件暂无数据,请检查后重试。");
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
return resultMap; // 返回错误信息
|
||||
}
|
||||
// 批量检查数据是否有效
|
||||
errorMsgs = this.validationList(list, listDict);
|
||||
if (errorMsgs.size() > 0) {
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
} else {
|
||||
resultMap.put("flag", YesOrNoEnum.YES.getValue());
|
||||
// 转换为字典值
|
||||
this.transToDictValue(list, listDict);
|
||||
// 清洗
|
||||
this.cleanData(list);
|
||||
resultMap.put("dataList", list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errorMsgs.add("文件导入异常:" + e.getMessage());
|
||||
resultMap.put("msg", errorMsgs);
|
||||
resultMap.put("flag", YesOrNoEnum.NO.getValue());
|
||||
log.error(e.getMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private void cleanData(List<ProcessEsAnnualReport> list) {
|
||||
list.forEach(item-> {
|
||||
// 如果是制定则去除掉所有的原企标名称 原企标编号
|
||||
if (ESPProjectType.ENACT.getValue().equals(item.getProjectType())) {
|
||||
item.setOriginEnStandardName(null);
|
||||
item.setOriginEnStandardNo(null);
|
||||
}
|
||||
// 设置变更状态 制定是新增 修订是变更
|
||||
if (item.getProjectType().equals("制定")) {
|
||||
item.setChangeStatus("新增");
|
||||
} else {
|
||||
item.setChangeStatus("变更");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void transToDictValue(List<ProcessEsAnnualReport> list, List<SysDictItemCore> listDict) {
|
||||
list.forEach(item -> {
|
||||
item.setProjectType(excelUtils.translateDictValue("esp_revision_type", item.getProjectType(), listDict));
|
||||
item.setAuthDept(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getAuthDept(), listDict));
|
||||
item.setEnStandardCode(excelUtils.translateDictValue("enterprise_standard_code", item.getEnStandardCode(), listDict));
|
||||
item.setCooperationUnit(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getCooperationUnit(), listDict));
|
||||
item.setMainDraftingUser(excelUtils.translateDictValue("username", "id", "sys_user", item.getMainDraftingUser(), listDict));
|
||||
item.setMainDraftingUnit(excelUtils.translateDictValue("depart_name", "id", "sys_depart", item.getMainDraftingUnit(), listDict));
|
||||
item.setMainDraftingUnitResponsiblePerson(excelUtils.translateDictValue("username", "id", "sys_user", item.getMainDraftingUnitResponsiblePerson(), listDict));
|
||||
item.setStandardPromoter(excelUtils.translateDictValue("username", "id", "sys_user", item.getStandardPromoter(), listDict));
|
||||
item.setWorkGroup(excelUtils.translateDictValue("name", "id", "laws_working_group", item.getWorkGroup(), listDict));
|
||||
});
|
||||
}
|
||||
|
||||
private List<String> validationList(List<ProcessEsAnnualReport> list, List<SysDictItemCore> listDict) {
|
||||
List<LawsEnterpriseStandard> esList = enterpriseStandardService.list();
|
||||
List<String> errorMsgs = new ArrayList<>();
|
||||
|
||||
int i = 3;
|
||||
Iterator<ProcessEsAnnualReport> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ProcessEsAnnualReport plan = iterator.next();
|
||||
if (ExcelUtils.isEmptyRow(plan)) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
plan.setSort(String.valueOf(i++));
|
||||
String enStandardCode = plan.getProjectType();
|
||||
String authDept = plan.getProjectType();
|
||||
String cooperationUnit = plan.getCooperationUnit();
|
||||
String mainDraftingUnit = plan.getMainDraftingUnit();
|
||||
String mainDraftingUser = plan.getProjectType();
|
||||
String mainDraftingUnitResponsiblePerson = plan.getMainDraftingUnitResponsiblePerson();
|
||||
String standardPromoter = plan.getStandardPromoter();
|
||||
String workGroup = plan.getWorkGroup();
|
||||
|
||||
StringBuilder errMsgHeader = new StringBuilder();
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
errMsgHeader.append("第").append(plan.getSort()).append("行");
|
||||
|
||||
// 检查制修订类型 编号 名称
|
||||
errMsg.append(validProjectType(plan, listDict, esList));
|
||||
// 检查所有数据字典校验的字段
|
||||
errMsg.append(validAuthDept(authDept, listDict));
|
||||
errMsg.append(validStandardCode(enStandardCode, listDict));
|
||||
errMsg.append(validCooperateUnit(cooperationUnit, listDict));
|
||||
errMsg.append(validMainDraftingUser(mainDraftingUser, listDict));
|
||||
errMsg.append(validMainDraftingUnit(mainDraftingUnit, listDict));
|
||||
errMsg.append(validMainDraftingUnitResponsiblePerson(mainDraftingUnitResponsiblePerson, listDict));
|
||||
errMsg.append(validStandardPromoter(standardPromoter, listDict));
|
||||
errMsg.append(validWorkGroup(workGroup, listDict));
|
||||
// 如果数据有问题,则将提示信息添加到 errorMsgs 中
|
||||
if (errMsg.length() > 0) {
|
||||
errorMsgs.add(errMsgHeader.append(errMsg).toString());
|
||||
}
|
||||
}
|
||||
return errorMsgs;
|
||||
}
|
||||
|
||||
private String validAuthDept(String value, List<SysDictItemCore> listDict) {
|
||||
// 非空检查
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'授权部门'不能为空。";
|
||||
}
|
||||
// 检查授权部门
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", false, listDict)) {
|
||||
return "'授权部门'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validStandardCode(String value, List<SysDictItemCore> listDict) {
|
||||
// 检查企业标准代号
|
||||
if (!excelUtils.validDict("enterprise_standard_code", value, null, null, true, listDict)) {
|
||||
return "'企业标准代号'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validCooperateUnit(String value, List<SysDictItemCore> listDict) { // 非空检查
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'配合单位'不能为空。";
|
||||
}
|
||||
// 检查配合单位
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", false, listDict)) {
|
||||
return "'配合单位'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUser(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草人'不能为空。";
|
||||
}
|
||||
// 检查主起草人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'主起草人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUnit(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草单位'不能为空。";
|
||||
}
|
||||
// 检查主起草单位
|
||||
if (!excelUtils.validDict("depart_name", value, "sys_depart", "id", true, listDict)) {
|
||||
return "'主起草单位'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validMainDraftingUnitResponsiblePerson(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'主起草单位负责人'不能为空。";
|
||||
}
|
||||
// 检查主起草单位负责人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'主起草单位负责人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validStandardPromoter(String value, List<SysDictItemCore> listDict) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "'标准推进人'不能为空。";
|
||||
}
|
||||
// 检查标准推进人
|
||||
if (!excelUtils.validDict("username", value, "sys_user", "id", true, listDict)) {
|
||||
return "'标准推进人'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private String validWorkGroup(String value, List<SysDictItemCore> listDict) {
|
||||
// 检查工作组
|
||||
if (!excelUtils.validDict("name", value, "laws_working_group", "id", true, listDict)) {
|
||||
return "'工作组'无效。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private String validProjectType(ProcessEsAnnualReport plan, List<SysDictItemCore> listDict, List<LawsEnterpriseStandard> esList) {
|
||||
String projectType = plan.getProjectType();
|
||||
String originEnStandardNo = plan.getProjectType();
|
||||
String newEnStandardName = plan.getNewEnStandardName();
|
||||
if (StrUtil.isBlank(projectType)) {
|
||||
return "'制修订类型'不能为空。";
|
||||
}
|
||||
if (!excelUtils.validDict("esp_revision_type", projectType, null, null, true, listDict)) {
|
||||
return "'制修订类型'无效。";
|
||||
}
|
||||
// 修订
|
||||
if (projectType.equals(ESPProjectType.MODIFY.getValue())) {
|
||||
// 检查企标编号是否有效
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
return "'原企标编号'不能为空。";
|
||||
}
|
||||
if (!esList.stream().map(LawsEnterpriseStandard::getStandardNumber).collect(Collectors.toList()).contains(originEnStandardNo)) {
|
||||
return "'原企标编号'无效。";
|
||||
}
|
||||
}
|
||||
if (newEnStandardName.length() > 50) {
|
||||
return "'新企标名称'过长(最多50字)。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+112
-68
@@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 企标计划
|
||||
* 企标立项变更计划
|
||||
* @TableName process_es_init_change
|
||||
*/
|
||||
@Data
|
||||
@@ -33,86 +33,109 @@ public class ProcessEsInitChange implements Serializable {
|
||||
private String id;
|
||||
|
||||
/** 企标计划ID */
|
||||
@ApiModelProperty(value = "企标计划ID")
|
||||
private String espId;
|
||||
|
||||
/**
|
||||
* 标准计划Id1(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准计划Id1(合并流程字段)")
|
||||
private String standardIdOne;
|
||||
|
||||
/**
|
||||
* 标准编号1(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准编号1(合并流程字段)")
|
||||
private String standardNoOne;
|
||||
|
||||
/**
|
||||
* 标准名称1(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准名称1(合并流程字段)")
|
||||
private String standardNameOne;
|
||||
|
||||
/**
|
||||
* 制修订类型1(合并流程字段)
|
||||
*/
|
||||
@Dict(dicCode = "esp_project_type")
|
||||
@ApiModelProperty(value = "制修订类型1(合并流程字段)")
|
||||
private String projectTypeOne;
|
||||
|
||||
/**
|
||||
* 制修订类型2(合并流程字段)
|
||||
*/
|
||||
@Dict(dicCode = "esp_project_type")
|
||||
@ApiModelProperty(value = "制修订类型2(合并流程字段)")
|
||||
private String projectTypeTwo;
|
||||
|
||||
/**
|
||||
* 标准计划Id2(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准计划Id2(合并流程字段)")
|
||||
private String standardIdTwo;
|
||||
|
||||
/**
|
||||
* 标准编号2(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准编号2(合并流程字段)")
|
||||
private String standardNoTwo;
|
||||
|
||||
/**
|
||||
* 标准名称2(合并流程字段)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准名称2(合并流程字段)")
|
||||
private String standardNameTwo;
|
||||
|
||||
/**
|
||||
* 制修订类型2(合并流程字段)
|
||||
*/
|
||||
private String projectTypeTwo;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
@ApiModelProperty(value = "流程实例Id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
@@ -120,81 +143,99 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "截止日期")
|
||||
private Date deadlineDate;
|
||||
|
||||
/**
|
||||
* 流程说明
|
||||
*/
|
||||
@ApiModelProperty(value = "流程说明")
|
||||
private String processDescription;
|
||||
|
||||
/**
|
||||
* 申请类别
|
||||
*/
|
||||
@Dict(dicCode = "esp_application_category")
|
||||
@ApiModelProperty(value = "申请类别")
|
||||
private String applicationCategory;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
@Dict(dicCode = "esp_project_type")
|
||||
@ApiModelProperty(value = "项目类型")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 原企标编号
|
||||
*/
|
||||
@ApiModelProperty(value = "原企标编号")
|
||||
private String originEnStandardNo;
|
||||
|
||||
/**
|
||||
* 新企标编号
|
||||
*/
|
||||
@ApiModelProperty(value = "新企标编号")
|
||||
private String newEnStandardNo;
|
||||
|
||||
/**
|
||||
* 原企标名称
|
||||
*/
|
||||
@ApiModelProperty(value = "原企标名称")
|
||||
private String originEnStandardName;
|
||||
|
||||
/**
|
||||
* 新企标名称
|
||||
*/
|
||||
@ApiModelProperty(value = "新企标名称")
|
||||
private String newEnStandardName;
|
||||
|
||||
/**
|
||||
* 企标英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "企标英文名称")
|
||||
private String enStandardEnglishName;
|
||||
|
||||
/**
|
||||
* 企标体系
|
||||
*/
|
||||
@ApiModelProperty(value = "企标体系")
|
||||
private String enStandardSystem;
|
||||
|
||||
/**
|
||||
* 企业标准代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业标准代号")
|
||||
private String enStandardCode;
|
||||
|
||||
/**
|
||||
* 企业名称代号
|
||||
*/
|
||||
@ApiModelProperty(value = "企业名称代号")
|
||||
private String enNameCode;
|
||||
|
||||
/**
|
||||
* 标准类别代号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类别代号")
|
||||
private String standardCategoryCode;
|
||||
|
||||
/**
|
||||
* 年代号
|
||||
*/
|
||||
@ApiModelProperty(value = "年代号")
|
||||
private String decadeCode;
|
||||
|
||||
/**
|
||||
* 标准类型
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类型")
|
||||
private String standardType;
|
||||
|
||||
/**
|
||||
* 企标等级分类
|
||||
*/
|
||||
@ApiModelProperty(value = "企标等级分类")
|
||||
private String enStandardClassification;
|
||||
|
||||
/**
|
||||
@@ -202,6 +243,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "原草稿计划完成日期")
|
||||
private Date originDraftPlannedCompleteDate;
|
||||
|
||||
/**
|
||||
@@ -209,6 +251,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "原征求意见稿计划完成日期")
|
||||
private Date originSolicitationDraftPlanCompleteDate;
|
||||
|
||||
/**
|
||||
@@ -216,14 +259,15 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "原计划报批日期")
|
||||
private Date originPlanApprovalDate;
|
||||
|
||||
|
||||
/**
|
||||
* 草稿计划完成日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿计划完成日期")
|
||||
private Date draftPlannedCompleteDate;
|
||||
|
||||
/**
|
||||
@@ -231,6 +275,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿计划完成日期")
|
||||
private Date solicitationDraftPlanCompleteDate;
|
||||
|
||||
/**
|
||||
@@ -238,82 +283,56 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划报批日期")
|
||||
private Date planApprovalDate;
|
||||
|
||||
/**
|
||||
* 项目状态
|
||||
*/
|
||||
@ApiModelProperty(value = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
/**
|
||||
* 编制说明
|
||||
*/
|
||||
@ApiModelProperty(value = "编制说明")
|
||||
private String compilationDescription;
|
||||
|
||||
/**
|
||||
* 零部件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件名称")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUser_dictText")
|
||||
private String mainDraftingUserDictText;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
private String mainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUnit_dictText")
|
||||
private String mainDraftingUnitDictText;
|
||||
|
||||
/**
|
||||
* 主起草单位责任人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草单位责任人")
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
|
||||
/**
|
||||
* 主起草单位责任人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUnitResponsiblePerson_dictText")
|
||||
private String mainDraftingUnitResponsiblePersonDictText;
|
||||
|
||||
|
||||
/**
|
||||
* 新主起草单位负责人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "新主起草单位负责人")
|
||||
private String newMainDraftingUnitResponsiblePerson;
|
||||
|
||||
/**
|
||||
* 标准推进人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
private String standardPromoter;
|
||||
|
||||
/**
|
||||
* 标准推进人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("standardPromoter_dictText")
|
||||
private String standardPromoterDictText;
|
||||
|
||||
/**
|
||||
* 草稿完成日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿完成日期")
|
||||
private Date draftCompletionDate;
|
||||
|
||||
/**
|
||||
@@ -321,11 +340,13 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "提交草稿日期")
|
||||
private Date draftSubmissionDate;
|
||||
|
||||
/**
|
||||
* 是否征求意见
|
||||
*/
|
||||
@ApiModelProperty(value = "是否征求意见")
|
||||
private String solicitationOpinionEnabled;
|
||||
|
||||
/**
|
||||
@@ -333,6 +354,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿完成日期")
|
||||
private Date solicitationDraftCompletionDate;
|
||||
|
||||
/**
|
||||
@@ -340,6 +362,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "评审日期")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
@@ -347,6 +370,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "报批日期")
|
||||
private Date approvalDate;
|
||||
|
||||
/**
|
||||
@@ -354,140 +378,160 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private Date releaseDate;
|
||||
|
||||
/**
|
||||
* 变更状态
|
||||
*/
|
||||
@ApiModelProperty(value = "变更状态")
|
||||
private String changeStatus;
|
||||
|
||||
/**
|
||||
* 立项背景、立项依据
|
||||
*/
|
||||
@ApiModelProperty(value = "立项背景、立项依据")
|
||||
private String projectBackground;
|
||||
|
||||
/**
|
||||
* 国际、国家及行业同类标准分析
|
||||
*/
|
||||
@ApiModelProperty(value = "国家及行业同类标准分析")
|
||||
private String similarNaStandardsAnalysis;
|
||||
|
||||
/**
|
||||
* 企业同类标准对比分析
|
||||
*/
|
||||
@ApiModelProperty(value = "企业同类标准对比分析")
|
||||
private String similarEnStandardsAnalysis;
|
||||
|
||||
/**
|
||||
* 立项标准的领先性与必要性
|
||||
*/
|
||||
@ApiModelProperty(value = "立项标准的领先性与必要性")
|
||||
private String standardLeadingNecessity;
|
||||
|
||||
/**
|
||||
* 立项目的及预期效果等
|
||||
*/
|
||||
@ApiModelProperty(value = "立项目的及预期效果等")
|
||||
private String projectExpectedEffects;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 上传附件
|
||||
*/
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String uploadAttachment;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
@ApiModelProperty(value = "附件")
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 是否为优质标准
|
||||
*/
|
||||
private String qualityFlag;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
@ApiModelProperty(value = "变更原因")
|
||||
private String changeReason;
|
||||
|
||||
/**
|
||||
* 新主起草人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "新主起草人")
|
||||
private String newMainDraftingUser;
|
||||
|
||||
/**
|
||||
* 新主起草单位
|
||||
*/
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "新主起草单位")
|
||||
private String newMainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 部所联络人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "部所联络人")
|
||||
private String contactUser;
|
||||
|
||||
/**
|
||||
* 标准专家
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准专家")
|
||||
private String standardExpert;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人主管级领导")
|
||||
private String mainDraftUserLeader;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUserLeader_dictText")
|
||||
private String mainDraftUserLeaderDictText;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导上级领导
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人主管级领导上级领导")
|
||||
private String mainDraftUserLeaderLeader;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导上级领导
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUserLeaderLeader_dictText")
|
||||
private String mainDraftUserLeaderLeaderDictText;
|
||||
|
||||
/**
|
||||
* 标准化审批人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准化审批人")
|
||||
private String standardizationApprovalUser;
|
||||
|
||||
/**
|
||||
* 新主起草部门领导的领导
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "新主起草部门领导的领导")
|
||||
private String newMainDraftUserLeaderLeader;
|
||||
|
||||
/**
|
||||
* 新主起草部门领导
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "新主起草部门领导")
|
||||
private String newMainDraftUserLeader;
|
||||
|
||||
/**
|
||||
* 相关人员
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "相关人员")
|
||||
private String relatedUser;
|
||||
|
||||
/**
|
||||
* 抄送人
|
||||
*/
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "抄送人")
|
||||
private String copyUser;
|
||||
|
||||
/**
|
||||
* 授权部门
|
||||
*/
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "授权部门")
|
||||
private String authDept;
|
||||
|
||||
/**
|
||||
* 配合单位
|
||||
*/
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperationUnit;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
||||
+1
-61
@@ -97,67 +97,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
return translateData(list(lambdaQueryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动翻译数据
|
||||
* @return
|
||||
*/
|
||||
private List<ProcessEsInitChange> translateData(List<ProcessEsInitChange> initChangeList) {
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
List<String> departIdList = new ArrayList<>();
|
||||
|
||||
// 制作需要的Id集合
|
||||
for (ProcessEsInitChange initChange : initChangeList) {
|
||||
userIdList.add(initChange.getMainDraftingUser());
|
||||
userIdList.add(initChange.getMainDraftingUnitResponsiblePerson());
|
||||
userIdList.add(initChange.getStandardPromoter());
|
||||
userIdList.add(initChange.getMainDraftUserLeader());
|
||||
userIdList.add(initChange.getMainDraftUserLeaderLeader());
|
||||
departIdList.add(initChange.getMainDraftingUnit());
|
||||
}
|
||||
// 根据Id集合获取所需数据
|
||||
LambdaQueryWrapper<SysUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userLambdaQueryWrapper.in(SysUser::getId, userIdList);
|
||||
List<SysUser> userList = sysUserService.list(userLambdaQueryWrapper);
|
||||
// 转成Map
|
||||
Map<String, SysUser> userMap = userList.stream().collect(Collectors.toMap(SysUser::getId, sysUser -> sysUser));
|
||||
|
||||
LambdaQueryWrapper<SysDepart> deptLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
deptLambdaQueryWrapper.in(SysDepart::getId, departIdList);
|
||||
List<SysDepart> departList = sysDepartService.list(deptLambdaQueryWrapper);
|
||||
// 转成Map
|
||||
Map<String, SysDepart> departMap = departList.stream().collect(Collectors.toMap(SysDepart::getId, sysDepart -> sysDepart));
|
||||
|
||||
// 翻译数据
|
||||
for (ProcessEsInitChange initChange : initChangeList) {
|
||||
// 主起草人
|
||||
if (userMap.get(initChange.getMainDraftingUser()) != null) {
|
||||
initChange.setMainDraftingUserDictText(userMap.get(initChange.getMainDraftingUser()).getUsername());
|
||||
}
|
||||
// 起草单位负责人
|
||||
if (userMap.get(initChange.getMainDraftingUnitResponsiblePerson()) != null) {
|
||||
initChange.setMainDraftingUnitResponsiblePersonDictText(userMap.get(initChange.getMainDraftingUnitResponsiblePerson()).getUsername());
|
||||
}
|
||||
// 标准推进人
|
||||
if (userMap.get(initChange.getStandardPromoter()) != null) {
|
||||
initChange.setStandardPromoterDictText(userMap.get(initChange.getStandardPromoter()).getUsername());
|
||||
}
|
||||
// 主起草人上级领导
|
||||
if (userMap.get(initChange.getMainDraftUserLeader()) != null) {
|
||||
initChange.setMainDraftUserLeaderDictText(userMap.get(initChange.getMainDraftUserLeader()).getUsername());
|
||||
}
|
||||
// 主起草用户领导的领导
|
||||
if (userMap.get(initChange.getMainDraftUserLeaderLeader()) != null) {
|
||||
initChange.setMainDraftUserLeaderLeaderDictText(userMap.get(initChange.getMainDraftUserLeaderLeader()).getUsername());
|
||||
}
|
||||
// 主起草单位
|
||||
if (departMap.get(initChange.getMainDraftingUnit()) != null) {
|
||||
initChange.setMainDraftingUnitDictText(departMap.get(initChange.getMainDraftingUnit()).getDepartName());
|
||||
}
|
||||
}
|
||||
return initChangeList;
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+22
-5
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.enums.ProcessTypeEnum;
|
||||
import com.jero.modules.activiti.mapper.ProcessApprovalRecordMapper;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,13 +47,29 @@ public class ProcessAllService extends ServiceImpl<ProcessAllMapper, ProcessAll>
|
||||
}
|
||||
|
||||
public void delete(String processInstanceId) {
|
||||
runtimeService.deleteProcessInstance(processInstanceId,"撤销");
|
||||
LambdaQueryWrapper<ProcessAll> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProcessAll::getProcessInstanceId,processInstanceId);
|
||||
this.remove(wrapper);
|
||||
|
||||
//activiti撤销
|
||||
runtimeService.deleteProcessInstance(processInstanceId,"强制撤销");
|
||||
//获得流程总表
|
||||
ProcessAll processAll = getByProcessInstanceId(processInstanceId);
|
||||
//删除流程总表
|
||||
this.removeById(processAll.getId());
|
||||
//删除审批表
|
||||
LambdaQueryWrapper<ProcessApprovalRecord> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(ProcessApprovalRecord::getProcessInstanceId,processInstanceId);
|
||||
processApprovalRecordMapper.delete(wrapper1);
|
||||
//业务表修改为草稿
|
||||
Integer prcType = processAll.getPrcType();
|
||||
WorkCenterService classByValue = null;
|
||||
try {
|
||||
classByValue = (WorkCenterService) Class.forName(ProcessTypeEnum.getClassByValue(prcType)).newInstance();
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
classByValue.changeToDraft(processAll.getProjectId());
|
||||
//todo 同步删除操作到统一待办
|
||||
}
|
||||
|
||||
public IPage<ProcessAll> getAllList(Page<ProcessAll> page, QueryWrapper<ProcessAll> queryWrapper) {
|
||||
return processAllMapper.getAllList(page,queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.jero.modules.activiti.service;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2023-10-19 15:22
|
||||
*/
|
||||
public interface WorkCenterService {
|
||||
/**
|
||||
* 更改业务表为草稿
|
||||
* @param id
|
||||
*/
|
||||
void changeToDraft(String id);
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.jero.modules.activiti.util;
|
||||
|
||||
import com.jero.common.api.CommonAPI;
|
||||
import com.jero.common.system.vo.SysDictItemCore;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/8/18 15:50
|
||||
*/
|
||||
@Component
|
||||
public class ExcelUtils {
|
||||
|
||||
@Resource
|
||||
private CommonAPI commonAPI;
|
||||
|
||||
public static Date excelSerialDateToJavaDate(double serialDate) {
|
||||
// 首先,我们定义数据库支持的最早和最晚的日期。
|
||||
Calendar minDate = Calendar.getInstance();
|
||||
minDate.set(1000, Calendar.JANUARY, 1); // 这是MySQL的最小日期,可以根据需要修改
|
||||
|
||||
Calendar maxDate = Calendar.getInstance();
|
||||
maxDate.set(9999, Calendar.DECEMBER, 31); // 这是MySQL的最大日期,可以根据需要修改
|
||||
|
||||
Calendar baseDate = Calendar.getInstance();
|
||||
baseDate.set(1900, Calendar.JANUARY, 1); // Excel起始日期是1900-01-01
|
||||
baseDate.add(Calendar.DATE, (int) serialDate - 2); // 减2是因为Excel中1900年被错误地视为闰年
|
||||
|
||||
// 现在我们比较日期是否在有效范围内
|
||||
if (baseDate.before(minDate) || baseDate.after(maxDate)) {
|
||||
throw new IllegalArgumentException("日期超出了有效范围: " + baseDate.getTime());
|
||||
}
|
||||
return baseDate.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取HeadRow的文本内容
|
||||
*
|
||||
* @param is 文件输入流
|
||||
* @return HeadRow的List
|
||||
* @throws Exception
|
||||
*/
|
||||
public static List<String> getHeaderFromExcel(InputStream is) throws Exception {
|
||||
List<String> headers = new ArrayList<>();
|
||||
|
||||
Workbook workbook = new XSSFWorkbook(is);
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// HeadRow在index 1
|
||||
for (int rowIndex = 1; rowIndex <= 1; rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
for (Cell cell : row) {
|
||||
headers.add(cell.getStringCellValue());
|
||||
}
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个类的所有带@Excel注解的字段的name属性值,并按照orderNum正序排序。
|
||||
*
|
||||
* @param clazz 要检查的类
|
||||
* @return 包含所有带@Excel注解字段的name属性值的列表
|
||||
*/
|
||||
public static List<String> getSortedHeadersFromClass(Class<?> clazz) {
|
||||
List<Field> annotatedFields = new ArrayList<>();
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
|
||||
for (Field field : fields) {
|
||||
if (field.isAnnotationPresent(Excel.class)) {
|
||||
annotatedFields.add(field);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据orderNum正序排序
|
||||
annotatedFields.sort(new Comparator<Field>() {
|
||||
@Override
|
||||
public int compare(Field o1, Field o2) {
|
||||
Excel excel1 = o1.getAnnotation(Excel.class);
|
||||
Excel excel2 = o2.getAnnotation(Excel.class);
|
||||
return Integer.compare(Integer.parseInt(excel1.orderNum()), Integer.parseInt(excel2.orderNum()));
|
||||
}
|
||||
});
|
||||
|
||||
// 提取排序后字段的name属性值
|
||||
List<String> sortedHeaders = new ArrayList<>();
|
||||
for (Field field : annotatedFields) {
|
||||
Excel excel = field.getAnnotation(Excel.class);
|
||||
sortedHeaders.add(excel.name());
|
||||
}
|
||||
return sortedHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查一个对象的所有带@Excel注解的字段是否为空。
|
||||
*
|
||||
* @param obj 要检查的对象
|
||||
* @return 如果所有带@Excel注解的字段都为空,则返回true,否则返回false。
|
||||
*/
|
||||
public static boolean isEmptyRow(Object obj) {
|
||||
boolean isEmpty = true; // 假设行是空的
|
||||
Field[] fields = obj.getClass().getDeclaredFields(); // 获取类的所有字段
|
||||
|
||||
for (Field field : fields) {
|
||||
if (field.isAnnotationPresent(Excel.class)) { // 检查字段是否有@Excel注解
|
||||
field.setAccessible(true); // 允许访问私有字段
|
||||
try {
|
||||
Object value = field.get(obj); // 获取字段的值
|
||||
if (value != null) { // 如果字段不为空
|
||||
isEmpty = false; // 行不是空的
|
||||
break;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return isEmpty;
|
||||
}
|
||||
|
||||
// 校验数据字典
|
||||
public boolean validDict(String dictCode, String dictValue, String dicTable, String dicText, boolean isSingle, List<SysDictItemCore> listDict) {
|
||||
if (isSingle && dictValue.contains(",")) {
|
||||
return false;
|
||||
}
|
||||
int count = dictValue.split(",").length;
|
||||
String value = this.translateDictValue(dictCode, dicText, dicTable, dictValue, listDict);
|
||||
return value != null && value.split(",").length == count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 翻译字典文本
|
||||
*
|
||||
* @param code 编码
|
||||
* @param text 值
|
||||
* @param listDict 字典集合
|
||||
*/
|
||||
public String translateDictValue(String code, String text, List<SysDictItemCore> listDict) {
|
||||
StringBuilder textValue = new StringBuilder();
|
||||
String tmpValue = null;
|
||||
List<SysDictItemCore> listNew = listDict.stream().filter(o -> Objects.equals(o.getDictCode(), code) && Objects.equals(o.getItemText(), text.trim())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(listNew)) {
|
||||
tmpValue = listNew.get(0).getItemValue();
|
||||
}
|
||||
if (tmpValue != null) {
|
||||
if (!"".contentEquals(textValue)) {
|
||||
textValue.append(",");
|
||||
}
|
||||
textValue.append(tmpValue);
|
||||
}
|
||||
return textValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 翻译字典文本
|
||||
*
|
||||
* @param code 编码
|
||||
* @param text 值
|
||||
* @param table 表名
|
||||
* @param key 键
|
||||
* @param listDict 字典集合
|
||||
*/
|
||||
public String translateDictValue(String code, String text, String table, String key, List<SysDictItemCore> listDict) {
|
||||
if (oConvertUtils.isEmpty(key)) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder textValue = new StringBuilder();
|
||||
String[] keys = key.split(",");
|
||||
for (String k : keys) {
|
||||
String tmpValue = null;
|
||||
if (k.trim().length() == 0) {
|
||||
continue; //跳过循环
|
||||
}
|
||||
if (!StringUtils.isEmpty(table)) {
|
||||
tmpValue = commonAPI.queryTableDictTextByKey(table, text, code, k.trim());
|
||||
} else {
|
||||
List<SysDictItemCore> listNew = listDict.stream().filter(o -> Objects.equals(o.getDictCode(), code) && Objects.equals(o.getItemValue(), k.trim())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(listNew)) {
|
||||
tmpValue = listNew.get(0).getItemText();
|
||||
}
|
||||
}
|
||||
|
||||
if (tmpValue != null) {
|
||||
if (!"".contentEquals(textValue)) {
|
||||
textValue.append(",");
|
||||
}
|
||||
textValue.append(tmpValue);
|
||||
}
|
||||
}
|
||||
return textValue.toString();
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -125,8 +125,8 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
|
||||
|
||||
for (SarFileCompareInfo info : pageList.getRecords()) {
|
||||
info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut));
|
||||
info.setFileTypeLeft(getFileTypeText(info.getFileTypeLeft(), cut));
|
||||
info.setFileTypeRight(getFileTypeText(info.getFileTypeRight(), cut));
|
||||
// info.setFileTypeLeft(getFileTypeText(info.getFileTypeLeft(), cut));
|
||||
// info.setFileTypeRight(getFileTypeText(info.getFileTypeRight(), cut));
|
||||
// 根据编号赋值标准ID、标准来源、补充创建人
|
||||
setProperty(info, lawsDomesticStandards, lawsOverseasStandards, lawsEnterpriseStandards);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class SarFileCompareInfo implements Serializable {
|
||||
/**文本状态1*/
|
||||
@Excel(name = "文本状态1", width = 15)
|
||||
@ApiModelProperty(value = "文本状态1")
|
||||
@Dict(dicCode = "process_manuscript")
|
||||
private String fileTypeLeft;
|
||||
|
||||
/**文件名称1*/
|
||||
@@ -113,6 +114,7 @@ public class SarFileCompareInfo implements Serializable {
|
||||
/**文本状态2*/
|
||||
@Excel(name = "文本状态2", width = 15)
|
||||
@ApiModelProperty(value = "文本状态2")
|
||||
@Dict(dicCode = "process_manuscript")
|
||||
private String fileTypeRight;
|
||||
|
||||
/**文件名称2*/
|
||||
|
||||
+14
-14
@@ -1,15 +1,14 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.compare.entity.*;
|
||||
import com.jero.modules.compare.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareInfoMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareMenuService;
|
||||
import com.jero.modules.compare.utils.CompHanLPUtils;
|
||||
import com.jero.modules.compare.utils.CompareConst;
|
||||
import com.jero.modules.compare.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
@@ -207,10 +206,10 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
for (SarFileSplitItemsEO itemsEO : list) {
|
||||
SarFileCompareItem item = new SarFileCompareItem();
|
||||
item.setInfoId(infoId);
|
||||
item.setItemsName(itemsEO.getItemsName());
|
||||
item.setItemsName(itemsEO.getItemTitle());
|
||||
item.setMenuId(itemsEO.getMenuId());
|
||||
item.setItemsNum(itemsEO.getItemsNum());
|
||||
item.setItemsText(itemsEO.getItermsConditions());
|
||||
item.setItemsNum(itemsEO.getItemNum());
|
||||
item.setItemsText(itemsEO.getItemContent());
|
||||
SarFileCompareMenu menu = menuMap.get(itemsEO.getMenuId());
|
||||
if (menu != null) {
|
||||
item.setItemsDisplayNum(menu.getDisplaySeq());
|
||||
@@ -241,10 +240,11 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
sarFileCompareInfo.setId(id);
|
||||
sarFileCompareInfo.setFileIdLeft(leftInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(leftInfo.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
sarFileCompareInfo.setFileKeyLeft(bussDocumentLibraryEOList.get(0).get("id").toString());
|
||||
}
|
||||
// List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(leftInfo.getSerialNumber());
|
||||
// if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
// sarFileCompareInfo.setFileKeyLeft(bussDocumentLibraryEOList.get(0).get("id").toString());
|
||||
// }
|
||||
sarFileCompareInfo.setFileKeyLeft(leftInfo.getStandardId());
|
||||
sarFileCompareInfo.setFileNameLeft(leftInfo.getFileName());
|
||||
sarFileCompareInfo.setTitleLeft(leftInfo.getTitle());
|
||||
sarFileCompareInfo.setFileTypeLeft(leftInfo.getFileType());
|
||||
@@ -252,11 +252,11 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
|
||||
sarFileCompareInfo.setFileIdRight(rightInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList1 = bussDocumentLibraryEOService.getListBySerialNumber(rightInfo.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList1)) {
|
||||
sarFileCompareInfo.setFileKeyRight(bussDocumentLibraryEOList1.get(0).get("id").toString());
|
||||
}
|
||||
sarFileCompareInfo.setFileKeyRight(rightInfo.getConnectId());
|
||||
// List<Map<String, Object>> bussDocumentLibraryEOList1 = bussDocumentLibraryEOService.getListBySerialNumber(rightInfo.getSerialNumber());
|
||||
// if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList1)) {
|
||||
// sarFileCompareInfo.setFileKeyRight(bussDocumentLibraryEOList1.get(0).get("id").toString());
|
||||
// }
|
||||
sarFileCompareInfo.setFileKeyRight(rightInfo.getStandardId());
|
||||
sarFileCompareInfo.setFileNameRight(rightInfo.getFileName());
|
||||
sarFileCompareInfo.setFileTypeRight(rightInfo.getFileType());
|
||||
sarFileCompareInfo.setTitleRight(rightInfo.getTitle());
|
||||
|
||||
@@ -115,4 +115,17 @@ public class FieldCommon {
|
||||
// 稽查内容
|
||||
public static final String CHECK_LIST = "checkList";
|
||||
|
||||
// 发布稿(原文)
|
||||
public static final String FILE_PUBLISH_OF_ORIGINAL = "publish_of_original";
|
||||
// 修改单
|
||||
public static final String FILE_MODIFICATION_LIST = "modification_list";
|
||||
// 报批稿
|
||||
public static final String FILE_DRAFT_FOR_REVIEW = "draft_for_review";
|
||||
// 送审稿
|
||||
public static final String FILE_DRAFT_FOR_APPROVAL = "draft_for_approval";
|
||||
// 征求意见稿
|
||||
public static final String FILE_DRAFT_FOR_COMMENT = "draft_for_comment";
|
||||
// 草案
|
||||
public static final String FILE_DRAFT = "draft";
|
||||
|
||||
}
|
||||
|
||||
+41
@@ -34,6 +34,8 @@ import com.jero.modules.personal.entity.LawsBrowsingHistory;
|
||||
import com.jero.modules.personal.entity.LawsStandardCollection;
|
||||
import com.jero.modules.personal.service.ILawsBrowsingHistoryService;
|
||||
import com.jero.modules.personal.service.ILawsStandardCollectionService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
@@ -123,6 +125,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
private EnterpriseStandardAuthUserService esAuthUserService;
|
||||
@Resource
|
||||
private WaterMarkUtil waterMarkUtil;
|
||||
@Autowired
|
||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
@@ -170,6 +174,41 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
* @Date: 2023/10/19 15:36
|
||||
* @Description: 标准拆分标识
|
||||
**/
|
||||
private void splitFlag(Map<String, Object> map) {
|
||||
String id = (String) map.get("id");
|
||||
// 查询标准拆分表
|
||||
LambdaQueryWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 标准id
|
||||
queryWrapper.eq(SarFileSplitInfoEO::getStandardId, id);
|
||||
// 拆分表发布标识
|
||||
queryWrapper.isNotNull(SarFileSplitInfoEO::getPublishBeforeId);
|
||||
// 文件字段标识
|
||||
queryWrapper.isNotNull(SarFileSplitInfoEO::getFileType);
|
||||
List<SarFileSplitInfoEO> sarFileSplitInfoEOList = sarFileSplitInfoService.list(queryWrapper);
|
||||
|
||||
Map<String, String> flagMap = new HashMap<>();
|
||||
sarFileSplitInfoEOList.forEach(e -> flagMap.put(e.getFileType(), e.getId() + "," + e.getPublishBeforeId()));
|
||||
|
||||
// 拆分的标识
|
||||
map.put(FieldCommon.FILE_PUBLISH_OF_ORIGINAL + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_PUBLISH_OF_ORIGINAL));
|
||||
map.put(FieldCommon.FILE_MODIFICATION_LIST + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_MODIFICATION_LIST));
|
||||
map.put(FieldCommon.FILE_DRAFT_FOR_REVIEW + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_DRAFT_FOR_REVIEW));
|
||||
map.put(FieldCommon.FILE_DRAFT_FOR_APPROVAL + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_DRAFT_FOR_APPROVAL));
|
||||
map.put(FieldCommon.FILE_DRAFT_FOR_COMMENT + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_DRAFT_FOR_COMMENT));
|
||||
map.put(FieldCommon.FILE_DRAFT + FieldCommon._STANDARD_SPLIT,
|
||||
flagMap.get(FieldCommon.FILE_DRAFT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<Map<String, Object>> getExportData(Map<String, Object> parameterMap, List<LawsTag> fieldList) {
|
||||
// 获取操作模块
|
||||
@@ -994,6 +1033,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
stringObjectMap.put("checkList", list);
|
||||
}
|
||||
|
||||
// 标准拆分标识
|
||||
splitFlag(stringObjectMap);
|
||||
// 对返回的字段做处理
|
||||
return stringObjectMap;
|
||||
}
|
||||
|
||||
+11
-3
@@ -25,13 +25,21 @@ public class DocumentSplitCommon {
|
||||
*/
|
||||
public static final String DATE_FORMAT_END = " , '%Y-%m-%d') ";
|
||||
/**
|
||||
* 模糊匹配
|
||||
* between
|
||||
*/
|
||||
public static final String CONCAT_LIKE_BEGIN = " concat('%', ' ";
|
||||
public static final String BETWEEN = "between ";
|
||||
/**
|
||||
* 模糊匹配
|
||||
*/
|
||||
public static final String CONCAT_LIKE_END = " ', '%') ";
|
||||
public static final String CONCAT_LIKE_BEGIN = " concat('%', '";
|
||||
/**
|
||||
* 模糊匹配
|
||||
*/
|
||||
public static final String CONCAT_LIKE_END = "', '%') ";
|
||||
/**
|
||||
* 包含
|
||||
*/
|
||||
public static final String INSTR_BEGIN = " instr(";
|
||||
/**
|
||||
* and
|
||||
*/
|
||||
|
||||
+13
-1
@@ -224,7 +224,7 @@ public class DocumentSplitController {
|
||||
@PostMapping("/editBatchDocumentSplitDetail")
|
||||
public Result<T> editBatchDocumentSplitDetail(@RequestBody Map<String, Object> parameter) {
|
||||
documentSplitService.editBatchDocumentSplitDetail(parameter);
|
||||
return Result.OK(DocumentSplitCommon.MEG_DEL_BATCH);
|
||||
return Result.OK("批量编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,4 +303,16 @@ public class DocumentSplitController {
|
||||
public void downloadImportTemplate(HttpServletRequest request, HttpServletResponse response) {
|
||||
documentSplitService.downloadImportTemplate(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档拆分详情-导出
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@AutoLog(value = "文档拆分详情-导出")
|
||||
@ApiOperation(value = "文档拆分详情-导出")
|
||||
@GetMapping("/exportDocumentSplitDetail")
|
||||
public void exportDocumentSplitDetail(@RequestBody Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response) {
|
||||
documentSplitService.exportDocumentSplitDetail(parameter, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
+35
-15
@@ -17,31 +17,51 @@ import javax.annotation.PostConstruct;
|
||||
@Component
|
||||
public class DateManyConditionImpl extends AbstractConditionBase {
|
||||
|
||||
/**
|
||||
* 实现逻辑,多日期字符串字段(存储时前端从小到大排好序(必须))
|
||||
* 逗号拆分获取首位和末尾日期,来分别匹配是否符合查询参数的两个日期区间
|
||||
* 实现sql参考:(代码拼接中加入了date_format来格式化日期)
|
||||
* select
|
||||
* epr.*
|
||||
* from
|
||||
* event_plan_record epr
|
||||
* where
|
||||
* substring_index('epr.realStartTime', ',', 1) BETWEEN #{startDate} AND #{endDate}
|
||||
* or substring_index('epr.realStartTime', ',', -1) BETWEEN #{startDate} AND #{endDate}
|
||||
* or #{startDate} BETWEEN substring_index('epr.realStartTime', ',', 1) AND substring_index('epr.realStartTime', ',', -1)
|
||||
* or #{endDate} BETWEEN substring_index('epr.realStartTime', ',', 1) AND substring_index('epr.realStartTime', ',', -1)
|
||||
* @param fieldName
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String buildCondition(String fieldName, String value){
|
||||
// 多日期查询
|
||||
String substringBegin = "SUBSTRING_INDEX(";
|
||||
String substringEnd = ", ',', 1)";
|
||||
String substringEndFirst = ", ',', 1)";
|
||||
String substringEndLast = ", ',', -1)";
|
||||
String dateMany = DocumentSplitCommon.AND;
|
||||
if (value.contains(",")) {
|
||||
// 范围查询
|
||||
String[] split = value.split(",");
|
||||
dateMany += "((";
|
||||
dateMany += "(";
|
||||
String startDate = DocumentSplitCommon.DATE_FORMAT_BEGIN + "'" + split[0] + "'" + DocumentSplitCommon.DATE_FORMAT_END;
|
||||
String endDate = DocumentSplitCommon.DATE_FORMAT_BEGIN + "'" + split[1] + "'" + DocumentSplitCommon.DATE_FORMAT_END;
|
||||
dateMany +=
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEnd + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.GT + startDate +
|
||||
DocumentSplitCommon.AND +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEnd + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.LT + endDate + ")" +
|
||||
DocumentSplitCommon.OR + "(" +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEnd + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.GT + startDate +
|
||||
DocumentSplitCommon.AND +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEnd + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.LT + endDate + ")" +
|
||||
DocumentSplitCommon.OR + "(" +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + ", ',', -1)" + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.GT + startDate +
|
||||
DocumentSplitCommon.AND +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + ", ',', -1)" + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.LT + endDate + "))";
|
||||
|
||||
dateMany += "(" +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndFirst + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.BETWEEN + startDate + DocumentSplitCommon.AND + endDate +
|
||||
")" +
|
||||
DocumentSplitCommon.OR +
|
||||
"(" +
|
||||
DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndLast + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.BETWEEN + startDate + DocumentSplitCommon.AND + endDate +
|
||||
")" +
|
||||
DocumentSplitCommon.OR +
|
||||
"(" +
|
||||
startDate + DocumentSplitCommon.BETWEEN + DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndFirst + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.AND + DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndLast + DocumentSplitCommon.DATE_FORMAT_END +
|
||||
")" +
|
||||
DocumentSplitCommon.OR +
|
||||
"(" +
|
||||
endDate + DocumentSplitCommon.BETWEEN + DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndFirst + DocumentSplitCommon.DATE_FORMAT_END + DocumentSplitCommon.AND + DocumentSplitCommon.DATE_FORMAT_BEGIN + substringBegin + fieldName + substringEndLast + DocumentSplitCommon.DATE_FORMAT_END +
|
||||
")" + ")";
|
||||
} else {
|
||||
dateMany += fieldName + DocumentSplitCommon.LIKE + DocumentSplitCommon.CONCAT_LIKE_BEGIN + value + DocumentSplitCommon.CONCAT_LIKE_END;
|
||||
}
|
||||
|
||||
+11
-8
@@ -7,11 +7,13 @@ import com.jero.modules.laws.documenttool.handler.AbstractConditionBase;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: yjz
|
||||
* @Date: 2023/10/13/17:05
|
||||
* @Description: in查询
|
||||
* @Description: 下拉框查询
|
||||
*/
|
||||
|
||||
@Component
|
||||
@@ -19,16 +21,17 @@ public class InConditionImpl extends AbstractConditionBase {
|
||||
|
||||
@Override
|
||||
public String buildCondition(String fieldName, String value){
|
||||
// in查询
|
||||
// 下拉框查询
|
||||
StringBuilder in = new StringBuilder();
|
||||
in.append(DocumentSplitCommon.AND).append(fieldName).append(DocumentSplitCommon.IN).append("(");
|
||||
for (String s : value.split(",")) {
|
||||
in.append("'").append(s).append("'");
|
||||
if (value.indexOf(s) != value.length() -1){
|
||||
in.append(",");
|
||||
in.append(DocumentSplitCommon.AND).append("((");
|
||||
List<String> list = Arrays.asList(value.split(","));
|
||||
for (String s : list) {
|
||||
in.append(DocumentSplitCommon.INSTR_BEGIN).append(fieldName).append(",").append("'").append(s).append("'").append(")");
|
||||
if (list.indexOf(s) != list.size() -1){
|
||||
in.append(DocumentSplitCommon.OR);
|
||||
}
|
||||
}
|
||||
in.append(")");
|
||||
in.append("))");
|
||||
return in.toString();
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -112,6 +112,12 @@ public interface DocumentSplitMapper {
|
||||
*/
|
||||
Map<String, Object> queryLawsDocumentSplitById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 文档拆分详情通过id范围查询
|
||||
* @param id
|
||||
*/
|
||||
Map<String, Object> queryLawsDocumentSplitInId(@Param("idList") String id);
|
||||
|
||||
/**
|
||||
* 文档拆分详情-新增
|
||||
* @param insertField
|
||||
|
||||
+12
-3
@@ -24,8 +24,8 @@
|
||||
</insert>
|
||||
|
||||
<insert id="insertDocumentSplitInfo">
|
||||
insert into sar_file_split_info(id, create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag)
|
||||
values (#{id}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag})
|
||||
insert into sar_file_split_info(id, create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag, publish_before_id)
|
||||
values (#{id}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag}, #{publishBeforeId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatchSarFileSplitMenuByInfoId">
|
||||
@@ -81,7 +81,7 @@
|
||||
<delete id="deleteItemsValByItemIds">
|
||||
delete from sar_file_split_items_val
|
||||
where item_id in
|
||||
<foreach collection="itemIds.split(',')" item="item" separator="or" open="(" close=")">
|
||||
<foreach collection="itemIds.split(',')" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
@@ -189,6 +189,15 @@
|
||||
where valid_flag = 0 and item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id="queryLawsDocumentSplitInId" resultType="java.util.Map">
|
||||
select *
|
||||
from laws_document_split
|
||||
where id in
|
||||
<foreach collection="idList.split(',')" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="editDocumentSplitDetail">
|
||||
UPDATE laws_document_split
|
||||
SET ${updateSet}
|
||||
|
||||
+7
@@ -149,4 +149,11 @@ public interface IDocumentSplitService {
|
||||
* @param parameter
|
||||
*/
|
||||
void revocation(Map<String, Object> parameter);
|
||||
|
||||
/**
|
||||
* 文档拆分详情-导出
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
void exportDocumentSplitDetail(Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response);
|
||||
}
|
||||
|
||||
+137
-20
@@ -10,8 +10,10 @@ import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.FileUtils;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.util.UUIDUtils;
|
||||
import com.jero.common.util.ZipUtil;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
|
||||
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
||||
@@ -53,19 +55,20 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.net.URLEncoder.encode;
|
||||
|
||||
/**
|
||||
* @Author: yjz
|
||||
* @Date: 2023/10/12/23:03
|
||||
@@ -113,6 +116,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
this.sysDictItemService = sysDictItemService;
|
||||
}
|
||||
|
||||
@Value("${jero.path.exportExcelTempPath}")
|
||||
private String exportExcelTempPath;
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSplitInfo> queryByPage(DocumentSplitInfo documentSplitInfo, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
@@ -410,7 +416,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
// 条文解读更新
|
||||
// 删除旧数据
|
||||
documentSplitMapper.deleteItemsValByItemIds((String) parameter.get(ID), DocumentSplitCommon.INTERPRETATION);
|
||||
documentSplitMapper.deleteItemsValByItemIds((String) parameter.get("ids"), DocumentSplitCommon.INTERPRETATION);
|
||||
if (!Objects.isNull(articlesList) && !articlesList.isEmpty()){
|
||||
// 添加新数据
|
||||
documentSplitMapper.addBatchItemsVal(articlesList);
|
||||
@@ -560,6 +566,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
@Override
|
||||
public void downloadImportTemplate(HttpServletRequest request, HttpServletResponse response) {
|
||||
try (Workbook workbook = new XSSFWorkbook()){
|
||||
String fileName = "拆分导入模版下载.xlsx";
|
||||
// sheet页
|
||||
XSSFSheet sheet = (XSSFSheet) workbook.createSheet("拆分导入模版");
|
||||
// 列宽
|
||||
@@ -574,7 +581,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 水平、垂直居中
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
// 问本格式
|
||||
// 文本格式
|
||||
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("@"));
|
||||
|
||||
for (int i = 0; i < titleArr.length; i++) {
|
||||
@@ -602,20 +609,69 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
CellRangeAddress region = new CellRangeAddress(1, 1, 0, 2);
|
||||
sheet.addMergedRegion(region);
|
||||
|
||||
// 返回流
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" +
|
||||
encode("拆分导入模版下载.xlsx", "UTF-8"));
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
// excel临时保存到本地并在同级创建文件夹
|
||||
generateExcel(workbook, fileName);
|
||||
|
||||
// 生成zip文件返回文件流
|
||||
ZipUtil.toZip(exportExcelTempPath, response.getOutputStream(), response, true);
|
||||
|
||||
//删除指定文件夹
|
||||
FileUtils.deleteFolders(exportExcelTempPath);
|
||||
}catch (Exception e){
|
||||
throw new JeroBootException("下载文件失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* private static void returnOutPutStream(HttpServletResponse response, String fileName, String zipPath) throws IOException {
|
||||
* ServletOutputStream outputStream = null;
|
||||
* try (InputStream in = Files.newInputStream(Paths.get(zipPath));){
|
||||
* response.reset();
|
||||
* response.setContentType("application/ostet-stream");
|
||||
* response.setHeader("content-type", "application/octet-stream");
|
||||
* response.setContentType("application/octet-stream");
|
||||
* response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + new String((fileName + ".zip").getBytes("GB2312"), StandardCharsets.ISO_8859_1));
|
||||
* response.setCharacterEncoding("UTF-8");
|
||||
* outputStream = response.getOutputStream();
|
||||
* //创建存放文件内容的数组
|
||||
* byte[] buff = new byte[1024];
|
||||
* //所读取的内容使用n来接收
|
||||
* int n;
|
||||
* //当没有读取完时,继续读取,循环
|
||||
* while ((n = in.read(buff)) != -1) {
|
||||
* //将字节数组的数据全部写入到输出流中
|
||||
* outputStream.write(buff, 0, n);
|
||||
* }
|
||||
* //强制将缓存区的数据进行输出
|
||||
* outputStream.println();
|
||||
* }
|
||||
* outputStream.close();
|
||||
* }
|
||||
*
|
||||
*/
|
||||
|
||||
private void generateExcel(Workbook workbook, String fileName) throws IOException {
|
||||
File saveFile = new File(exportExcelTempPath);
|
||||
// 导出路径 没有则创建
|
||||
if (!saveFile.exists()) {
|
||||
saveFile.mkdirs();
|
||||
}
|
||||
// 生成excel文件路径
|
||||
String excelPath = exportExcelTempPath + File.separator + fileName;
|
||||
// 写出excel文件
|
||||
try (FileOutputStream fos = new FileOutputStream(excelPath)){
|
||||
workbook.write(fos);
|
||||
|
||||
// 同级创建文件夹
|
||||
File savePaperFile = new File(exportExcelTempPath+ File.separator + "外部资源");
|
||||
if (!savePaperFile.exists()) {
|
||||
savePaperFile.mkdirs();
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarFileSplitItemsValEO> queryInterpretationArticlesList(String itemId) {
|
||||
return documentSplitMapper.queryItemsValByItemId(itemId, DocumentSplitCommon.INTERPRETATION);
|
||||
@@ -640,7 +696,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
splitMenuEOPage.setOrderBy("display_seq");
|
||||
splitMenuEOPage.setInfoId(id);
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryByList(splitMenuEOPage);
|
||||
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS);
|
||||
// 不需要总目录层级
|
||||
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS.get(0).getChildren());
|
||||
|
||||
// 文档拆分详情
|
||||
parameter.remove(ID);
|
||||
@@ -655,6 +712,15 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
String id = (String) parameter.get(ID);
|
||||
// 文档拆分信息(旧)
|
||||
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
||||
// 判断是否发布过
|
||||
SarFileSplitInfoEO sarFileSplitInfoEO = sarFileSplitInfoService.getOne(
|
||||
new QueryWrapper<SarFileSplitInfoEO>().lambda()
|
||||
.eq(SarFileSplitInfoEO::getPublishBeforeId, id));
|
||||
if (!Objects.isNull(sarFileSplitInfoEO)){
|
||||
// 删除旧发布数据
|
||||
sarFileSplitInfoService.deleteById(sarFileSplitInfoEO.getId());
|
||||
}
|
||||
|
||||
// 修改发布状态
|
||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(SarFileSplitInfoEO::getId, oldInfo.getId());
|
||||
@@ -678,8 +744,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
oldMenuIdList.add(sarFileSplitMenu.getId());
|
||||
String newId = UUID.randomUUID().toString().replace("-", "");
|
||||
newMenuIdList.add(newId);
|
||||
sarFileSplitMenu.setId(newId);
|
||||
sarFileSplitMenu.setInfoId(newInfo.getId());
|
||||
|
||||
// 父子级关系处理
|
||||
oldMenuList.stream()
|
||||
@@ -689,6 +753,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
return v;
|
||||
})
|
||||
.forEach(v -> log.info(v.getParentId()));
|
||||
|
||||
sarFileSplitMenu.setId(newId);
|
||||
sarFileSplitMenu.setInfoId(newInfo.getId());
|
||||
}
|
||||
// 新增数据
|
||||
documentSplitMapper.insertBatchSarFileSplitMenuByInfoId(oldMenuList);
|
||||
@@ -741,7 +808,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
@Override
|
||||
public void revocation(Map<String, Object> parameter) {
|
||||
String id = (String) parameter.get(ID);
|
||||
// 文档拆分信息(旧)
|
||||
// 文档拆分信息
|
||||
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
||||
// 修改发布状态
|
||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -750,6 +817,56 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
sarFileSplitInfoService.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportDocumentSplitDetail(Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response) {
|
||||
try (Workbook workbook = new XSSFWorkbook()){
|
||||
// 文档拆分详情数据
|
||||
List<Map<String, Object>> mapList = queryDocumentSplitDetailByList(parameter);
|
||||
// 创建工作簿
|
||||
|
||||
// 创建sheet页
|
||||
Sheet sheet = workbook.createSheet("条款内容");
|
||||
// 字段名
|
||||
List<String> keyList = new ArrayList<>();
|
||||
if(!Objects.isNull(mapList) && !mapList.isEmpty()){
|
||||
Map<String, Object> map = mapList.get(0);
|
||||
keyList = map.entrySet().stream().map(Map.Entry::getKey).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 样式1
|
||||
CellStyle cellStyleOne = workbook.createCellStyle();
|
||||
cellStyleOne.setWrapText(true);
|
||||
cellStyleOne.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
// 样式2
|
||||
CellStyle cellStyleTwo = workbook.createCellStyle();
|
||||
cellStyleTwo.setWrapText(true);
|
||||
cellStyleTwo.setAlignment(HorizontalAlignment.CENTER);
|
||||
// 样式3
|
||||
CellStyle cellStyleThree = workbook.createCellStyle();
|
||||
Font font = workbook.createFont();
|
||||
font.setColor(IndexedColors.LIGHT_BLUE.getIndex());
|
||||
cellStyleThree.setWrapText(true);
|
||||
cellStyleThree.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
// 设置表头
|
||||
Row row = sheet.createRow(0);
|
||||
for (int i = 0; i < keyList.size(); i++) {
|
||||
// 创建列,应用样式
|
||||
Cell cell = row.createCell(i);
|
||||
cell.setCellValue(new XSSFRichTextString(keyList.get(i)));
|
||||
cell.setCellStyle(cellStyleOne);
|
||||
|
||||
if("条文内容".equals(keyList.get(i))) {
|
||||
sheet.setColumnWidth(i, 80 * 256);
|
||||
} else {
|
||||
sheet.setColumnWidth(i, 20 * 256);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new JeroBootException("导出失败!");
|
||||
}
|
||||
}
|
||||
|
||||
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, StringBuilder valuesBuilder) {
|
||||
// 所有key(字段名)
|
||||
resultMap.forEach((k, v) -> {
|
||||
@@ -843,7 +960,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
Optional<LawsTag> lawsTag = fieldListCondition.stream().filter(o -> k.equals(o.getDbFieldName())).findFirst();
|
||||
lawsTag.ifPresent(l -> {
|
||||
// 构建查询条件 (工厂 + 策略 设计模式)
|
||||
String sqlCondition = ConditionMapFactory.getInvokeStrategy(l.getDbFieldName()).buildCondition(l.getDbFieldName(), (String) v);
|
||||
String sqlCondition = ConditionMapFactory.getInvokeStrategy(l.getFieldShowType()).buildCondition(l.getDbFieldName(), (String) v);
|
||||
selectCondition.append(sqlCondition);
|
||||
});
|
||||
});
|
||||
@@ -918,7 +1035,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 拆分状态
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getSplitStatus()), "split_status", documentSplitInfo.getSplitStatus());
|
||||
// 编辑人
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getAuthor()), "username", documentSplitInfo.getAuthor());
|
||||
queryWrapper.like(StringUtils.isNotBlank(documentSplitInfo.getAuthor()), "username", documentSplitInfo.getAuthor());
|
||||
// 发布前id
|
||||
if (StringUtils.isNotBlank(documentSplitInfo.getPublishBeforeId())){
|
||||
queryWrapper.eq("publish_before_id", documentSplitInfo.getPublishBeforeId());
|
||||
|
||||
+11
-29
@@ -1,12 +1,9 @@
|
||||
package com.jero.modules.laws.enterprise.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -93,6 +90,7 @@ public class EnterpriseStandardPlan implements Serializable {
|
||||
@ApiModelProperty(value = "企标英文名称")
|
||||
private String enStandardEnglishName;
|
||||
|
||||
@Dict(dictTable = "laws_tree_node", dicCode = "id", dicText = "node_name")
|
||||
@ApiModelProperty(value = "企标体系")
|
||||
private String enStandardSystem;
|
||||
|
||||
@@ -134,46 +132,32 @@ public class EnterpriseStandardPlan implements Serializable {
|
||||
@ApiModelProperty(value = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
@ApiModelProperty(value = "编制说明")
|
||||
private String compilationDescription;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "附件文件名")
|
||||
private String compilationFileName;
|
||||
|
||||
@ApiModelProperty(value = "零部件名称")
|
||||
private String componentName;
|
||||
|
||||
@ApiModelProperty(value = "授权部门")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
private String authDept;
|
||||
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "主起草人用户名")
|
||||
@JsonProperty("mainDraftingUser_dictText")
|
||||
private String mainDraftingUserDictText;
|
||||
|
||||
@ApiModelProperty(value = "主起草单位Id")
|
||||
private String mainDraftingUnit;
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUnit_dictText")
|
||||
private String mainDraftingUnitDictText;
|
||||
private String mainDraftingUnit;
|
||||
|
||||
@ApiModelProperty(value = "主起草单位责任人Id")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草单位责任人")
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "主起草单位责任人用户名")
|
||||
@JsonProperty("mainDraftingUnitResponsiblePerson_dictText")
|
||||
private String mainDraftingUnitResponsiblePersonDictText;
|
||||
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
private String standardPromoter;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
@JsonProperty("standardPromoter_dictText")
|
||||
private String standardPromoterDictText;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@@ -231,17 +215,15 @@ public class EnterpriseStandardPlan implements Serializable {
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String uploadAttachment;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "附件文件名")
|
||||
private String attachmentFileName;
|
||||
|
||||
@Dict(dicCode = "yn")
|
||||
@ApiModelProperty(value = "是否为优质标准")
|
||||
private String qualityFlag;
|
||||
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperationUnit;
|
||||
|
||||
|
||||
+18
-5
@@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -93,15 +94,27 @@ public class ESPlanQueryDTO {
|
||||
@ApiModelProperty(value = "项目状态列表,流程中用")
|
||||
private List<String> projectStatusList;
|
||||
|
||||
public void transIdsToList() {
|
||||
if (StrUtil.isBlank(this.selections)) {
|
||||
return;
|
||||
@ApiModelProperty(value = "排除Id列表,流程中用")
|
||||
private String excludeIds;
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@ApiModelProperty(value = "排除Id列表,流程中用")
|
||||
private List<String> excludeIdList;
|
||||
|
||||
public List<String> transIdsToList(String values) {
|
||||
if (StrUtil.isBlank(values)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
this.idList = StrUtil.split(this.selections, StrUtil.COMMA);
|
||||
return StrUtil.split(values, StrUtil.COMMA);
|
||||
}
|
||||
|
||||
public void setSelections(String selections) {
|
||||
this.selections = selections;
|
||||
this.transIdsToList();
|
||||
this.idList = transIdsToList(selections);
|
||||
}
|
||||
|
||||
public void setExcludeIds(String excludeIds) {
|
||||
this.excludeIds = excludeIds;
|
||||
this.excludeIdList = transIdsToList(excludeIds);
|
||||
}
|
||||
}
|
||||
|
||||
+37
-47
@@ -46,77 +46,67 @@ public class EnterpriseStandardPlanVo {
|
||||
@ApiModelProperty(value = "新企标名称")
|
||||
private String newEnStandardName;
|
||||
|
||||
@Excel(name = "授权部门", width = 15, orderNum = "1")
|
||||
@Excel(name = "授权部门", width = 15, orderNum = "1", dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "授权部门")
|
||||
private String authDeparts;
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
private String authDept;
|
||||
|
||||
@Excel(name = "配合单位", width = 15, orderNum = "1", dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperationUnit;
|
||||
|
||||
@Excel(name = "企业标准代号", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "企业标准代号")
|
||||
private String enStandardCode;
|
||||
|
||||
@Excel(name = "配合单位", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "配合单位")
|
||||
private String cooperateDeparts;
|
||||
|
||||
@ApiModelProperty(value = "主起草人Id")
|
||||
@Excel(name = "主起草人", width = 15, orderNum = "1", dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草人")
|
||||
private String mainDraftingUser;
|
||||
|
||||
@Excel(name = "主起草人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "主起草人用户名")
|
||||
@JsonProperty("mainDraftingUser_dictText")
|
||||
private String mainDraftingUserDictText;
|
||||
|
||||
@ApiModelProperty(value = "主起草单位Id")
|
||||
@Excel(name = "主起草单位", width = 15, orderNum = "1")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "主起草单位")
|
||||
private String mainDraftingUnit;
|
||||
|
||||
@Excel(name = "主起草单位", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "主起草单位名")
|
||||
@JsonProperty("mainDraftingUnit_dictText")
|
||||
private String mainDraftingUnitDictText;
|
||||
|
||||
@Excel(name = "主起草单位责任人", width = 15, orderNum = "1", dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "主起草单位责任人")
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
|
||||
@Excel(name = "主起草单位责任人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "主起草单位责任人用户名")
|
||||
@JsonProperty("mainDraftingUnitResponsiblePerson_dictText")
|
||||
private String mainDraftingUnitResponsiblePersonDictText;
|
||||
|
||||
@ApiModelProperty(value = "标准推进人Id")
|
||||
@Excel(name = "标准推进人", width = 15, orderNum = "1", dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "username")
|
||||
@ApiModelProperty(value = "标准推进人")
|
||||
private String standardPromoter;
|
||||
|
||||
@Excel(name = "标准推进人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "标准推进人用户名")
|
||||
@JsonProperty("standardPromoter_dictText")
|
||||
private String standardPromoterDictText;
|
||||
|
||||
@Excel(name = "草稿计划完成日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿计划完成日期")
|
||||
private Date draftPlannedCompleteDate;
|
||||
|
||||
@Excel(name = "征求意见稿计划完成日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿计划完成日期")
|
||||
private Date solicitationDraftPlanCompleteDate;
|
||||
|
||||
@Excel(name = "计划报批日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划报批日期")
|
||||
private Date planApprovalDate;
|
||||
|
||||
@Excel(name = "草稿完成日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "草稿完成日期")
|
||||
private Date draftCompletionDate;
|
||||
|
||||
@Excel(name = "提交草稿日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "提交草稿日期")
|
||||
private Date draftSubmissionDate;
|
||||
|
||||
@@ -126,26 +116,26 @@ public class EnterpriseStandardPlanVo {
|
||||
private String solicitationOpinionEnabled;
|
||||
|
||||
@Excel(name = "征求意见稿完成日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "征求意见稿完成日期")
|
||||
private Date solicitationDraftCompletionDate;
|
||||
|
||||
@Excel(name = "评审日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "评审日期")
|
||||
private Date reviewDate;
|
||||
|
||||
@Excel(name = "报批日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "报批日期")
|
||||
private Date approvalDate;
|
||||
|
||||
@Excel(name = "发布日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private Date releaseDate;
|
||||
|
||||
|
||||
+16
-54
@@ -87,17 +87,13 @@
|
||||
p.origin_en_standard_name,
|
||||
p.new_en_standard_no,
|
||||
p.new_en_standard_name,
|
||||
ad.authDeparts,
|
||||
p.auth_dept,
|
||||
p.en_standard_code,
|
||||
cu.cooperateDeparts,
|
||||
u1.id AS mainDraftingUser,
|
||||
u1.username AS mainDraftingUserDictText,
|
||||
d.id AS mainDraftingUnit,
|
||||
d.depart_name AS mainDraftingUnitDictText,
|
||||
u2.id AS mainDraftingUnitResponsiblePerson,
|
||||
u2.username AS mainDraftingUnitResponsiblePersonDictText,
|
||||
u3.id AS standardPromoter,
|
||||
u3.username AS standardPromoterDictText,
|
||||
p.cooperation_unit,
|
||||
p.main_drafting_user,
|
||||
p.main_drafting_unit,
|
||||
p.main_drafting_unit_responsible_person,
|
||||
p.standard_promoter,
|
||||
p.draft_planned_complete_date,
|
||||
p.solicitation_draft_plan_complete_date,
|
||||
p.plan_approval_date,
|
||||
@@ -116,20 +112,6 @@
|
||||
LEFT JOIN sys_user AS u2 ON u2.id = p.main_drafting_unit_responsible_person
|
||||
LEFT JOIN sys_user AS u3 ON u3.id = p.standard_promoter
|
||||
LEFT JOIN sys_depart AS d ON d.id = p.main_drafting_unit
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
ad.plan_id as id,
|
||||
GROUP_CONCAT((d.depart_name) SEPARATOR ',') AS authDeparts
|
||||
FROM
|
||||
laws_enterprise_standard_plan_auth_dept AS ad
|
||||
LEFT JOIN sys_depart AS d ON d.id = ad.dept_id) AS ad ON ad.id = p.id
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
cu.plan_id as id,
|
||||
GROUP_CONCAT((d.depart_name) SEPARATOR ',') AS cooperateDeparts
|
||||
FROM
|
||||
laws_enterprise_standard_plan_cooperate_unit AS cu
|
||||
LEFT JOIN sys_depart AS d ON d.id = cu.dept_id) AS cu ON cu.id = p.id
|
||||
WHERE p.del_flag = 0
|
||||
<!--原企标编号判断-->
|
||||
<if test="param.originEnStandardNo != null and param.originEnStandardNo != ''">
|
||||
@@ -203,6 +185,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.excludeIdList != null and param.excludeIdList.size() > 0">
|
||||
AND p.id NOT IN
|
||||
<foreach item="item" index="index" collection="param.excludeIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetailById" resultType="com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan">
|
||||
@@ -230,16 +218,11 @@
|
||||
p.plan_approval_date,
|
||||
p.project_status,
|
||||
p.compilation_description,
|
||||
o1.file_name AS compilationFileName,
|
||||
p.component_name,
|
||||
u1.id as mainDraftingUser,
|
||||
u1.username as mainDraftingUserDictText,
|
||||
d.id as mainDraftingUnit,
|
||||
d.depart_name as mainDraftingUnitDictText,
|
||||
u2.id as mainDraftingUnitResponsiblePerson,
|
||||
u2.username as mainDraftingUnitResponsiblePersonDictText,
|
||||
u3.id as promoter,
|
||||
u3.username as standardPromoterDictText,
|
||||
p.main_drafting_user,
|
||||
p.main_drafting_unit,
|
||||
p.main_drafting_unit_responsible_person,
|
||||
p.standard_promoter,
|
||||
p.draft_completion_date,
|
||||
p.draft_submission_date,
|
||||
p.solicitation_opinion_enabled,
|
||||
@@ -255,30 +238,9 @@
|
||||
p.project_expected_effects,
|
||||
p.remarks,
|
||||
p.upload_attachment,
|
||||
o2.file_name AS attachmentFileName,
|
||||
p.quality_flag
|
||||
FROM
|
||||
`laws_enterprise_standard_plan` AS p
|
||||
LEFT JOIN sys_user AS u1 ON u1.id = p.main_drafting_user
|
||||
LEFT JOIN sys_user AS u2 ON u2.id = p.main_drafting_unit_responsible_person
|
||||
LEFT JOIN sys_user AS u3 ON u3.id = p.standard_promoter
|
||||
LEFT JOIN sys_depart AS d ON d.id = p.main_drafting_unit
|
||||
LEFt JOIN oss_file AS o1 ON o1.id = p.compilation_description
|
||||
LEFt JOIN oss_file AS o2 ON o2.id = p.upload_attachment
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
ad.plan_id as id,
|
||||
GROUP_CONCAT((d.depart_name) SEPARATOR ',') AS authDeparts
|
||||
FROM
|
||||
laws_enterprise_standard_plan_auth_dept AS ad
|
||||
LEFT JOIN sys_depart AS d ON d.id = ad.dept_id) AS ad ON ad.id = p.id
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
cu.plan_id as id,
|
||||
GROUP_CONCAT((d.depart_name) SEPARATOR ',') AS cooperateDeparts
|
||||
FROM
|
||||
laws_enterprise_standard_plan_cooperate_unit AS cu
|
||||
LEFT JOIN sys_depart AS d ON d.id = cu.dept_id) AS cu ON cu.id = p.id
|
||||
WHERE p.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -24,13 +24,13 @@ public class SarFileSplitItemsEO implements Serializable {
|
||||
private String infoId;
|
||||
|
||||
@ApiModelProperty(value = "条款号")
|
||||
private String itemsNum;
|
||||
private String itemNum;
|
||||
|
||||
@ApiModelProperty(value = "条款名称")
|
||||
private String itemsName;
|
||||
private String itemTitle;
|
||||
|
||||
@ApiModelProperty(value = "条款内容")
|
||||
private String itermsConditions;
|
||||
private String itemContent;
|
||||
|
||||
@ApiModelProperty(value = "拆分目录id")
|
||||
private String menuId;
|
||||
|
||||
+10
-10
@@ -238,7 +238,7 @@ public class FileSpiltService {
|
||||
String numberParent = p.getNumLevelText().substring(0, p.getNumLevelText().lastIndexOf("."));
|
||||
if (numberMap.containsKey(numberParent)) {
|
||||
Integer numbernow = (Integer) numberMap.get(numberParent) + 1;
|
||||
if (messageList != null && !messageList.isEmpty() && messageList.get(messageList.size() - 1).getItemsNum().equals(numberParent + "." + String.valueOf(numbernow))) {
|
||||
if (messageList != null && !messageList.isEmpty() && messageList.get(messageList.size() - 1).getItemNum().equals(numberParent + "." + String.valueOf(numbernow))) {
|
||||
numberMap.put(numberParent, numbernow + 1);
|
||||
paragraphString = numberParent + "." + String.valueOf(numbernow + 1) + paragraphString;
|
||||
} else {
|
||||
@@ -265,7 +265,7 @@ public class FileSpiltService {
|
||||
documentTreeEO1.setPId(generalCatalogueId);
|
||||
documentTreeEO1.setInfoId(sarFileSplitInfoEO.getId());
|
||||
documentTreeEO1.setDisplaySeq(treeListDisplay++);
|
||||
documentTreeEO1.setName(message.getItemsNum());
|
||||
documentTreeEO1.setName(message.getItemNum());
|
||||
documentTreeEO1.setValidFlag(0);
|
||||
// treeList.add(documentTreeEO1);
|
||||
|
||||
@@ -346,8 +346,8 @@ public class FileSpiltService {
|
||||
ptest = Pattern.compile("^附录\\s{0,3}[A-Z]{1}");
|
||||
matcher = ptest.matcher(paragraphString);
|
||||
// 获取当前最后一项num
|
||||
String appendixNum = messageList.get(messageList.size() - 1).getItemsNum().split("\\.")[0];
|
||||
if (matcher.find()&& !messageList.get(messageList.size() - 1).getItemsNum().equals("附录")) {
|
||||
String appendixNum = messageList.get(messageList.size() - 1).getItemNum().split("\\.")[0];
|
||||
if (matcher.find()&& !messageList.get(messageList.size() - 1).getItemNum().equals("附录")) {
|
||||
if (Integer.valueOf(appendixNum) + 1 <= sarFileSplitInfoEO.getStopNumber()) {
|
||||
String itemName = "附录";
|
||||
List<String> clauseContent = new ArrayList<>();
|
||||
@@ -789,10 +789,10 @@ public class FileSpiltService {
|
||||
public static SarFileSplitItemsEO getSarFileSplitItemsEO(String infoId, String itemsNum, String itemsName, List<String> itemsCondi) {
|
||||
SarFileSplitItemsEO sarFileSplitItemsEO = new SarFileSplitItemsEO();
|
||||
sarFileSplitItemsEO.setInfoId(infoId);
|
||||
sarFileSplitItemsEO.setItemsNum(itemsNum);
|
||||
sarFileSplitItemsEO.setItemsName(itemsName);
|
||||
sarFileSplitItemsEO.setItemNum(itemsNum);
|
||||
sarFileSplitItemsEO.setItemTitle(itemsName);
|
||||
sarFileSplitItemsEO.setItemsCondi(itemsCondi);
|
||||
sarFileSplitItemsEO.setItermsConditions("");
|
||||
sarFileSplitItemsEO.setItemContent("");
|
||||
sarFileSplitItemsEO.setId(UUIDUtils.randomUUID20());
|
||||
sarFileSplitItemsEO.setValidFlag(0);
|
||||
sarFileSplitItemsEO.setCreationTime(new Date());
|
||||
@@ -872,7 +872,7 @@ public class FileSpiltService {
|
||||
// 像每个条款中依次插入每一段的内容
|
||||
public static void addItermsConditionsText(SarFileSplitItemsEO message, List<SarFileSplitItemsValEO> itemsValList, String p) {
|
||||
message.getItemsCondi().add(p);
|
||||
message.setItermsConditions(message.getItermsConditions() + "<p>" + p + "</p>");
|
||||
message.setItemTitle(message.getItemContent() + "<p>" + p + "</p>");
|
||||
itemsValList.add(getSplitItemsValObject(message.getId(), SplitFilePragraTypeEnum.TEXT.getValue(), p, message.getItemsCondi().size(), null));
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ public class FileSpiltService {
|
||||
rowNum++;
|
||||
}*/
|
||||
message.getItemsCondi().add(table.getText());
|
||||
message.setItermsConditions(message.getItermsConditions() + tabaleStringNew);
|
||||
message.setItemContent(message.getItemContent() + tabaleStringNew);
|
||||
itemsValList.add(getSplitItemsValObject(message.getId(), SplitFilePragraTypeEnum.TABLE.getValue(), tabaleStringNew.toString(), message.getItemsCondi().size(), null));
|
||||
|
||||
}
|
||||
@@ -929,7 +929,7 @@ public class FileSpiltService {
|
||||
String imgCon = path;
|
||||
String imgConVal = "<img class=\"wordImg\" style=\"width:100%;height:100%\" src=\"" + path + "\">";
|
||||
message.getItemsCondi().add(imgConVal);
|
||||
message.setItermsConditions(message.getItermsConditions() + imgConVal);
|
||||
message.setItemContent(message.getItemContent() + imgConVal);
|
||||
itemsValList.add(getSplitItemsValObject(message.getId(), SplitFilePragraTypeEnum.IMG.getValue(), imgCon, message.getItemsCondi().size(), null));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user