9cf7ed8e 张雷

危险作业接口及工作流开发

1 个父辈 3a1d6e9b
...@@ -106,7 +106,7 @@ public class AjhExerciseSituation { ...@@ -106,7 +106,7 @@ public class AjhExerciseSituation {
106 /**应急预案*/ 106 /**应急预案*/
107 @Excel(name = "应急预案", width = 15) 107 @Excel(name = "应急预案", width = 15)
108 @ApiModelProperty(value = "应急预案") 108 @ApiModelProperty(value = "应急预案")
109 @Dict(dictTable = "emergency_plan_database", dicCode="id", dicText = "doc_name") 109 @Dict(dictTable = "emergency_plan_data", dicCode="id", dicText = "doc_name")
110 private String emergencyPlan; 110 private String emergencyPlan;
111 /**应急评估*/ 111 /**应急评估*/
112 @Excel(name = "应急评估", width = 15) 112 @Excel(name = "应急评估", width = 15)
......
1 package com.skua.modules.emergency.entity;
2
3 import com.baomidou.mybatisplus.annotation.IdType;
4 import com.baomidou.mybatisplus.annotation.TableField;
5 import com.baomidou.mybatisplus.annotation.TableId;
6 import com.baomidou.mybatisplus.annotation.TableName;
7 import com.fasterxml.jackson.annotation.JsonFormat;
8 import com.skua.core.aspect.annotation.Dict;
9 import com.skua.modules.flow.core.entity.FlowEntity;
10 import io.swagger.annotations.ApiModel;
11 import io.swagger.annotations.ApiModelProperty;
12 import lombok.Data;
13 import lombok.EqualsAndHashCode;
14 import lombok.experimental.Accessors;
15 import org.jeecgframework.poi.excel.annotation.Excel;
16 import org.springframework.format.annotation.DateTimeFormat;
17
18 /**
19 * 危险作业事件
20 */
21 @Data
22 @TableName("dangerous_operation_manage")
23 @EqualsAndHashCode(callSuper = false)
24 @Accessors(chain = true)
25 @ApiModel(value="dangerous_operation_manage对象", description="危险作业事件")
26 public class DangerousOperation extends FlowEntity {
27
28 /**id*/
29 @TableId(type = IdType.ID_WORKER_STR)
30 @ApiModelProperty(value = "id")
31 private String id;
32 /**作业类型*/
33 @Excel(name = "作业类型", width = 15)
34 @ApiModelProperty(value = "作业类型")
35 private String operationType;
36 /**作业名称*/
37 @Excel(name = "作业名称", width = 15)
38 @ApiModelProperty(value = "作业名称")
39 private String operationName;
40 /**作业描述*/
41 @Excel(name = "作业描述", width = 15)
42 @ApiModelProperty(value = "作业描述")
43 private String operationDesc;
44 /**作业地点(构筑物)*/
45 @Excel(name = "作业地点(构筑物)", width = 15)
46 @ApiModelProperty(value = "作业地点(构筑物)")
47 private String operationLocation;
48 /**申请时间*/
49 @Excel(name = "申请时间", width = 15)
50 @ApiModelProperty(value = "申请时间")
51 private String reportDate;
52 /**作业时间*/
53 @Excel(name = "作业时间", width = 15)
54 @ApiModelProperty(value = "作业时间")
55 private String operationDate;
56 /**风险评估*/
57 @Excel(name = "风险评估", width = 15)
58 @ApiModelProperty(value = "风险评估")
59 private String operationAssess;
60 /**作业方案附件*/
61 @Excel(name = "作业方案附件", width = 15)
62 @ApiModelProperty(value = "作业方案附件")
63 private String operationFile;
64 /**作业人员类型*/
65 @Excel(name = "作业人员类型", width = 15)
66 @ApiModelProperty(value = "作业人员类型")
67 private String operationUserType;
68 /**作业人员*/
69 @Excel(name = "作业人员", width = 15)
70 @ApiModelProperty(value = "作业人员")
71 @Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
72 private String operationUser;
73 /**人员证书*/
74 @Excel(name = "人员证书", width = 15)
75 @ApiModelProperty(value = "人员证书")
76 private String operationUserFile;
77 /**安全交底单*/
78 @Excel(name = "安全交底单", width = 15)
79 @ApiModelProperty(value = "安全交底单")
80 private String operationSafeForm;
81 /**作业照片*/
82 @Excel(name = "作业照片", width = 15)
83 @ApiModelProperty(value = "作业照片")
84 private String operationImg;
85 /**作业情况*/
86 @Excel(name = "作业情况", width = 15)
87 @ApiModelProperty(value = "作业情况")
88 private String operationResult;
89 /**作业状态*/
90 @Excel(name = "作业状态", width = 15)
91 @ApiModelProperty(value = "作业状态")
92 private String operationStatus;
93 /**所属厂站*/
94 @Excel(name = "所属厂站", width = 15)
95 @ApiModelProperty(value = "所属厂站")
96 @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
97 private String departId;
98 /**流程定义id*/
99 @Excel(name = "流程定义id", width = 15)
100 @ApiModelProperty(value = "流程定义id")
101 private String processDefinitionId;
102 /**流程实例id*/
103 @Excel(name = "流程实例id", width = 15)
104 @ApiModelProperty(value = "流程实例id")
105 private String processInstanceId;
106 /**创建人id*/
107 @Excel(name = "创建人id", width = 15)
108 @ApiModelProperty(value = "创建人id")
109 private String createBy;
110 /**创建时间*/
111 @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
112 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
113 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
114 @ApiModelProperty(value = "创建时间")
115 private java.util.Date createTime;
116 /**修改人id*/
117 @Excel(name = "修改人id", width = 15)
118 @ApiModelProperty(value = "修改人id")
119 private String updateBy;
120 /**修改时间*/
121 @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
122 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
123 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
124 @ApiModelProperty(value = "修改时间")
125 private java.util.Date updateTime;
126 /**所属部门*/
127 @Excel(name = "所属部门", width = 15)
128 @ApiModelProperty(value = "所属部门")
129 private String createDept;
130 /**所属公司*/
131 @Excel(name = "所属公司", width = 15)
132 @ApiModelProperty(value = "所属公司")
133 private String createCmpy;
134 /**删除标识,0:正常,1:删除*/
135 @Excel(name = "删除标识,0:正常,1:删除", width = 15)
136 @ApiModelProperty(value = "删除标识,0:正常,1:删除")
137 private Integer delFlag;
138 @TableField(exist = false)
139 @ApiModelProperty(value = "开始时间")
140 private String startTime;
141 @TableField(exist = false)
142 @ApiModelProperty(value = "结束时间")
143 private String endTime;
144 }
1 package com.skua.modules.emergency.enums;
2
3 import lombok.Getter;
4
5 /**
6 *
7 * 字典:emergency_risk_event_handleresult
8 */
9 @Getter
10 public enum DangerousOperationHandleResultEnums {
11 UN_HANDLE("1","未处理"),
12 HANDLED("3","已处理");
13
14 DangerousOperationHandleResultEnums(String itemValue, String itemText) {
15 this.itemValue = itemValue;
16 this.itemText = itemText;
17 }
18
19 private final String itemValue;
20 private final String itemText;
21
22
23 }
1 package com.skua.modules.emergency.mapper;
2
3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 import com.skua.modules.emergency.entity.DangerousOperation;
5 import com.skua.modules.emergency.entity.EmergencyRiskEvent;
6
7 /**
8 * 应急风险事件
9 */
10 public interface DangerousOperationMapper extends BaseMapper<DangerousOperation> {
11
12 }
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.emergency.mapper.DangerousOperationMapper">
4
5 </mapper>
1 package com.skua.modules.emergency.service;
2
3 import com.baomidou.mybatisplus.extension.service.IService;
4 import com.skua.modules.emergency.entity.DangerousOperation;
5
6 import java.util.Map;
7
8 /**
9 * 应急风险事件
10 */
11 public interface IDangerousOperationService extends IService<DangerousOperation> {
12
13 /**
14 * 开始流程
15 * @param dangerousOperation
16 */
17 void startProcess(DangerousOperation dangerousOperation);
18
19 /**
20 * 应急风险事件-处理
21 * @param dangerousOperation
22 */
23 void handle(DangerousOperation dangerousOperation);
24
25 }
1 package com.skua.modules.emergency.service.impl;
2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 import com.skua.core.context.BaseContextHandler;
6 import com.skua.core.exception.JeecgBootException;
7 import com.skua.core.util.ConvertUtils;
8 import com.skua.core.util.DateUtils;
9 import com.skua.modules.emergency.entity.DangerousOperation;
10 import com.skua.modules.emergency.enums.DangerousOperationHandleResultEnums;
11 import com.skua.modules.emergency.mapper.DangerousOperationMapper;
12 import com.skua.modules.emergency.service.IDangerousOperationService;
13 import com.skua.modules.flow.business.service.FlowBusinessService;
14 import com.skua.modules.flow.business.service.IFlowService;
15 import com.skua.modules.flow.core.constant.ProcessConstant;
16 import com.skua.modules.flow.core.entity.BladeFlow;
17 import com.skua.modules.flow.core.utils.FlowUtil;
18 import com.skua.modules.flow.custombiz.handle.IFlowCustomHandle;
19 import com.skua.modules.flow.custombiz.vo.FlowProcessFormFieldInfoVO;
20 import com.skua.modules.flow.support.Kv;
21 import com.skua.modules.flow.utils.Func;
22 import com.skua.tool.util.UniqIdUtils;
23 import org.apache.commons.lang3.StringUtils;
24 import org.springframework.beans.BeanUtils;
25 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.stereotype.Service;
27 import org.springframework.transaction.annotation.Transactional;
28
29 import java.util.List;
30 import java.util.Map;
31
32 /**
33 * 应急风险事件
34 */
35 @Service
36 public class DangerousOperationServiceImpl extends ServiceImpl<DangerousOperationMapper, DangerousOperation> implements IDangerousOperationService, IFlowCustomHandle {
37 @Autowired
38 private IFlowService flowService;
39 @Autowired
40 private FlowBusinessService flowBusinessService;
41
42 @Override
43 @Transactional(rollbackFor = Exception.class)
44 public void startProcess(DangerousOperation dangerousOperation) {
45 DangerousOperation saveParam = new DangerousOperation();
46 BeanUtils.copyProperties(dangerousOperation, saveParam);
47 saveParam.setId(UniqIdUtils.getInstance().getUniqID());
48 saveParam.setOperationStatus(DangerousOperationHandleResultEnums.UN_HANDLE.getItemValue());
49 this.save(saveParam);
50
51 String businessTable = "dangerous_operation_manage";
52 //设置当前人为上报人
53
54 // 启动流程
55 Kv variables = Kv.create().set(ProcessConstant.TASK_VARIABLE_CREATE_USER, "");
56
57 BladeFlow flow = flowService.startProcessInstanceById(saveParam.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(saveParam.getId())), variables);
58
59 if (Func.isNotEmpty(flow)) {
60 log.debug("流程已启动,流程ID:" + flow.getProcessInstanceId());
61 // 返回流程id写入leave
62 saveParam.setProcessInstanceId(flow.getProcessInstanceId());
63 updateById(saveParam);
64 } else {
65 throw new JeecgBootException("开启流程失败");
66 }
67
68 }
69
70 @Override
71 @Transactional(rollbackFor = Exception.class)
72 public void handle(DangerousOperation dangerousOperation) {
73 DangerousOperation updateParam = this.getById(dangerousOperation.getId());
74 if (updateParam == null) {
75 throw new JeecgBootException("实体不存在!");
76 }
77 BeanUtils.copyProperties(dangerousOperation, updateParam);
78 updateParam.setOperationStatus(DangerousOperationHandleResultEnums.HANDLED.getItemValue());
79 this.updateById(updateParam);
80
81 //调用同意接口
82 boolean flag = flowBusinessService.completeTask(ProcessConstant.PASS_KEY, updateParam.getFlow());
83 if(!flag){
84 throw new JeecgBootException("流程办理失败!");
85 }
86 }
87
88 @Override
89 public List<FlowProcessFormFieldInfoVO> buildCustomData(String s, List<FlowProcessFormFieldInfoVO> list) {
90 for (FlowProcessFormFieldInfoVO entity : list) {
91 if ("operationUser".equals(entity.getFieldCode())) {
92 String fieldValue = (String) entity.getFieldValue();
93 if (StringUtils.isBlank(fieldValue)) {
94 entity.setFieldValue(BaseContextHandler.getUserId());
95 }
96 }
97 if ("reportDate".equals(entity.getFieldCode())) {
98 String fieldValue = ConvertUtils.getString(entity.getFieldValue());
99 if (StringUtils.isBlank(fieldValue)) {
100 entity.setFieldValue(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
101 }
102 }
103 }
104 return list;
105 }
106
107 }
...@@ -132,6 +132,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -132,6 +132,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
132 String startDate = weekMap.get("start"); 132 String startDate = weekMap.get("start");
133 String endDate = weekMap.get("end"); 133 String endDate = weekMap.get("end");
134 list = mapper.getWeekReportData(startDate, endDate); 134 list = mapper.getWeekReportData(startDate, endDate);
135 map.put("start", startDate);//开始时间
136 map.put("end", endDate);//结束时间
135 map.put("zclsl", "776");//处理水量合计 137 map.put("zclsl", "776");//处理水量合计
136 map.put("rjclsl", "110.7");//日均处理水量 138 map.put("rjclsl", "110.7");//日均处理水量
137 map.put("rjclsl_hb", "2");//较上周增减量 139 map.put("rjclsl_hb", "2");//较上周增减量
......
...@@ -218,6 +218,18 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { ...@@ -218,6 +218,18 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
218 wdscnlMap.put("value","0"); 218 wdscnlMap.put("value","0");
219 wdscnlMap.put("valueTb","-"); 219 wdscnlMap.put("valueTb","-");
220 wdscnlMap.put("valueHb","0"); 220 wdscnlMap.put("valueHb","0");
221 map.put("rjdl",new HashMap<>());
222 Map<String, Object> rjdlMap = new HashMap<>();
223 rjdlMap.put("value","0");
224 rjdlMap.put("valueTb","-");
225 rjdlMap.put("valueHb","0");
226 map.put("yclsl", yclslMap);
227 map.put("rjclsl", rjclslMap);
228 map.put("yzdl", yzdlMap);
229 map.put("dsdh", dsdhMap);
230 map.put("yzcnl", yzcnlMap);
231 map.put("wdscnl", wdscnlMap);
232 map.put("rjdl", rjdlMap);
221 return map; 233 return map;
222 } 234 }
223 235
......
...@@ -197,9 +197,15 @@ public class EquipmentInfo { ...@@ -197,9 +197,15 @@ public class EquipmentInfo {
197 @ApiModelProperty(value = "删除标识,0:正常,1:删除") 197 @ApiModelProperty(value = "删除标识,0:正常,1:删除")
198 private Integer delFlag; 198 private Integer delFlag;
199 199
200 /** 200 //能耗等级
201 * 赤水 补充字段 201 @Dict(dicCode = "energy_level")
202 */ 202 @ApiModelProperty(value = "能耗等级")
203 private String energyLevel;
204 //能耗功率
205 @ApiModelProperty(value = "能耗功率")
206 private String energyPower;
207
208 //补充字段
203 @ApiModelProperty(value = "输送介质") 209 @ApiModelProperty(value = "输送介质")
204 private String deliveryMedium; 210 private String deliveryMedium;
205 211
...@@ -261,4 +267,20 @@ public class EquipmentInfo { ...@@ -261,4 +267,20 @@ public class EquipmentInfo {
261 @ApiModelProperty(value = "报废日期") 267 @ApiModelProperty(value = "报废日期")
262 private String scrapDate; 268 private String scrapDate;
263 269
270 //检测机构
271 @ApiModelProperty(value = "检测机构")
272 private String testingDepart;
273 //附件
274 @ApiModelProperty(value = "特种设备附件")
275 private String specialFile;
276 //操作人
277 @ApiModelProperty(value = "操作人")
278 private String operatorId;
279 //安全负责人
280 @ApiModelProperty(value = "安全负责人")
281 private String securityManager;
282 //企业负责人
283 @ApiModelProperty(value = "企业负责人")
284 private String enterpriseManager;
285
264 } 286 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!