415ad99b 张雷

feat(ajh): 添加经营方案审批功能

- 新增 AjhPlanScheduleInfo 实体类,用于经营方案审批
- 实现经营方案审批的 CRUD 接口和控制器
- 添加经营方案审批的流程启动功能
- 在 FlowBussinessDescManageServiceImpl 中增加经营方案审批流程的处理逻辑
- 更新 DataAssessmentInfo 实体类,添加考核对象和考核时间类型等字段
- 在 DangerInspectionRecordController 中添加巡检类型查询条件
- 更新 DangerInspectionRecordVO 实体类,添加巡检类型字段
1 个父辈 63002f31
1 package com.skua.modules.ajh.entity;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField;
9 import com.skua.core.aspect.annotation.Dict;
10 import com.skua.modules.flow.core.entity.FlowEntity;
11 import io.swagger.annotations.ApiModel;
12 import io.swagger.annotations.ApiModelProperty;
13 import lombok.Data;
14 import lombok.EqualsAndHashCode;
15 import lombok.experimental.Accessors;
16 import com.fasterxml.jackson.annotation.JsonFormat;
17 import org.springframework.format.annotation.DateTimeFormat;
18 import org.jeecgframework.poi.excel.annotation.Excel;
19
20 /**
21 * 经营方案审批父类
22 */
23 @Data
24 @TableName("ajh_plan_schedule_info")
25 @EqualsAndHashCode(callSuper = false)
26 @Accessors(chain = true)
27 @ApiModel(value="ajh_plan_schedule_info对象", description="经营方案审批父类")
28 public class AjhPlanScheduleInfo extends FlowEntity {
29
30 /**id*/
31 @TableId(type = IdType.ID_WORKER_STR)
32 @ApiModelProperty(value = "id")
33 private String id;
34 /**所属厂站编号*/
35 @Excel(name = "所属厂站编号", width = 15)
36 @ApiModelProperty(value = "所属厂站编号")
37 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
38 private String departId;
39 /**时间yyyy-MM*/
40 @Excel(name = "时间yyyy-MM", width = 15)
41 @ApiModelProperty(value = "时间yyyy-MM")
42 private String dateTime;
43 /**流程定义id*/
44 @Excel(name = "流程定义id", width = 15)
45 @ApiModelProperty(value = "流程定义id")
46 private String processDefinitionId;
47 /**流程实例id*/
48 @Excel(name = "流程实例id", width = 15)
49 @ApiModelProperty(value = "流程实例id")
50 private String processInstanceId;
51 /**创建人Id*/
52 @Excel(name = "创建人Id", width = 15)
53 @ApiModelProperty(value = "创建人Id")
54 private String createBy;
55 /**创建时间*/
56 @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
57 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
58 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
59 @ApiModelProperty(value = "创建时间")
60 private Date createTime;
61 /**修改人Id*/
62 @Excel(name = "修改人Id", width = 15)
63 @ApiModelProperty(value = "修改人Id")
64 private String updateBy;
65 /**修改时间*/
66 @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
67 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
68 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
69 @ApiModelProperty(value = "修改时间")
70 private Date updateTime;
71 }
1 package com.skua.modules.ajh.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.ajh.entity.AjhPlanScheduleInfo;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 经营方案审批父类
11 */
12 public interface AjhPlanScheduleInfoMapper extends BaseMapper<AjhPlanScheduleInfo> {
13
14 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.ajh.mapper.AjhPlanScheduleInfoMapper">
4
5 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.skua.modules.ajh.service;
2
3 import com.skua.modules.ajh.entity.AjhPlanScheduleInfo;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 /**
7 * 经营方案审批父类
8 */
9 public interface IAjhPlanScheduleInfoService extends IService<AjhPlanScheduleInfo> {
10
11 AjhPlanScheduleInfo startProcess(AjhPlanScheduleInfo ajhPlanScheduleInfo);
12 }
1 package com.skua.modules.ajh.service.impl;
2
3 import com.skua.core.exception.JeecgBootException;
4 import com.skua.modules.ajh.entity.AjhPlanScheduleInfo;
5 import com.skua.modules.ajh.mapper.AjhPlanScheduleInfoMapper;
6 import com.skua.modules.ajh.service.IAjhPlanScheduleInfoService;
7 import com.skua.modules.flow.business.service.IFlowService;
8 import com.skua.modules.flow.core.constant.ProcessConstant;
9 import com.skua.modules.flow.core.entity.BladeFlow;
10 import com.skua.modules.flow.core.utils.FlowUtil;
11 import com.skua.modules.flow.support.Kv;
12 import com.skua.modules.flow.utils.Func;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service;
15
16 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
17 import org.springframework.transaction.annotation.Transactional;
18
19 import java.text.SimpleDateFormat;
20 import java.util.Date;
21
22 /**
23 * 经营方案审批父类
24 */
25 @Service
26 public class AjhPlanScheduleInfoServiceImpl extends ServiceImpl<AjhPlanScheduleInfoMapper, AjhPlanScheduleInfo> implements IAjhPlanScheduleInfoService {
27
28 @Autowired
29 private IFlowService flowService;
30
31 @Override
32 @Transactional(rollbackFor = Exception.class)
33 public AjhPlanScheduleInfo startProcess(AjhPlanScheduleInfo ajhPlanScheduleInfo) {
34 String businessTable = "ajh_plan_schedule_info";
35 this.saveOrUpdate(ajhPlanScheduleInfo);
36 // 启动流程
37 Kv variables = Kv.create().set(ProcessConstant.TASK_VARIABLE_CREATE_USER, "");
38 BladeFlow flow = flowService.startProcessInstanceById(ajhPlanScheduleInfo.getProcessDefinitionId(),
39 FlowUtil.getBusinessKey(businessTable, String.valueOf(ajhPlanScheduleInfo.getId())), variables);
40
41 if (Func.isNotEmpty(flow)){
42 log.debug("流程已启动,流程ID:" + flow.getProcessInstanceId());
43 // 返回流程id写入leave
44 ajhPlanScheduleInfo.setProcessInstanceId(flow.getProcessInstanceId());
45 updateById(ajhPlanScheduleInfo);
46 } else {
47 throw new JeecgBootException("开启流程失败");
48 }
49 return ajhPlanScheduleInfo;
50 }
51 }
...@@ -56,6 +56,22 @@ public class DataAssessmentInfo { ...@@ -56,6 +56,22 @@ public class DataAssessmentInfo {
56 @Excel(name = "考核厂站", width = 15) 56 @Excel(name = "考核厂站", width = 15)
57 @ApiModelProperty(value = "考核厂站") 57 @ApiModelProperty(value = "考核厂站")
58 private String asseDepartId; 58 private String asseDepartId;
59
60 @Excel(name = "考核对象", width = 15)
61 @ApiModelProperty(value = "考核对象")
62 private String asseObject;
63
64 @Excel(name = "考核时间类型", width = 15)
65 @ApiModelProperty(value = "考核时间类型")
66 private String asseTimeType;
67
68 @Excel(name = "初试分数", width = 15)
69 @ApiModelProperty(value = "初试分数")
70 private String initScore;
71
72 @Excel(name = "是否展示总分", width = 15)
73 @ApiModelProperty(value = "是否展示总分")
74 private String isShowScore;
59 /** 75 /**
60 * 标识 76 * 标识
61 */ 77 */
......
...@@ -176,6 +176,20 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ ...@@ -176,6 +176,20 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
176 for (Map<String, Object> dataMap : dataList) { 176 for (Map<String, Object> dataMap : dataList) {
177 resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("title"))); 177 resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("title")));
178 } 178 }
179 }else if(tableName.equals("ajh_plan_schedule_info")) {
180 //经营方案审批流程
181 String ids = tableMap.get(tableName).substring(1);
182 List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
183 String inSqlPart = avgIndexCodeArray.stream().map(s -> "'"+s.trim()+"'").collect(Collectors.joining(","));
184 String sql = "select s.id,CONCAT(d.depart_name,'[',s.date_time,']','-经营方案填报审批') as title " +
185 " from ajh_plan_schedule_info s " +
186 " left join sys_depart d on s.depart_id = d.id " +
187 " WHERE " +
188 " s.id in ("+inSqlPart+")";
189 List<Map<String, Object>> dataList = masterDB.queryForList(sql);
190 for(Map<String, Object> dataMap : dataList) {
191 resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("title")));
192 }
179 } 193 }
180 } 194 }
181 } 195 }
......
...@@ -71,6 +71,9 @@ public class APPDangerInspectionRecordController { ...@@ -71,6 +71,9 @@ public class APPDangerInspectionRecordController {
71 if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){ 71 if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
72 queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ; 72 queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
73 } 73 }
74 if(StringUtils.isNotBlank(dangerInspectionRecord.getInspectionType())){
75 queryWrapper.eq("inspection_type", dangerInspectionRecord.getInspectionType() ) ;
76 }
74 if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){ 77 if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){
75 queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ; 78 queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ;
76 } 79 }
......
...@@ -41,7 +41,6 @@ public class DangerInspectionRecordVO { ...@@ -41,7 +41,6 @@ public class DangerInspectionRecordVO {
41 @ApiModelProperty(value = "巡检记录编号") 41 @ApiModelProperty(value = "巡检记录编号")
42 private String inspectionRecord; 42 private String inspectionRecord;
43 43
44
45 @Excel(name = "风险等级名称", width = 15) 44 @Excel(name = "风险等级名称", width = 15)
46 @ApiModelProperty(value = "风险等级名称") 45 @ApiModelProperty(value = "风险等级名称")
47 private String dangerName; 46 private String dangerName;
...@@ -52,6 +51,9 @@ public class DangerInspectionRecordVO { ...@@ -52,6 +51,9 @@ public class DangerInspectionRecordVO {
52 @ApiModelProperty(value = "风险区域名称") 51 @ApiModelProperty(value = "风险区域名称")
53 private String dangerPlace; 52 private String dangerPlace;
54 53
54 @ApiModelProperty(value = "巡检类型")
55 private String inspectionType;
56
55 @ApiModelProperty(value = "巡检状态(1:开始,2:结束)") 57 @ApiModelProperty(value = "巡检状态(1:开始,2:结束)")
56 private String status; 58 private String status;
57 59
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!