9cf7ed8e 张雷

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

1 个父辈 3a1d6e9b
......@@ -106,7 +106,7 @@ public class AjhExerciseSituation {
/**应急预案*/
@Excel(name = "应急预案", width = 15)
@ApiModelProperty(value = "应急预案")
@Dict(dictTable = "emergency_plan_database", dicCode="id", dicText = "doc_name")
@Dict(dictTable = "emergency_plan_data", dicCode="id", dicText = "doc_name")
private String emergencyPlan;
/**应急评估*/
@Excel(name = "应急评估", width = 15)
......
package com.skua.modules.emergency.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 com.fasterxml.jackson.annotation.JsonFormat;
import com.skua.core.aspect.annotation.Dict;
import com.skua.modules.flow.core.entity.FlowEntity;
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;
/**
* 危险作业事件
*/
@Data
@TableName("dangerous_operation_manage")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="dangerous_operation_manage对象", description="危险作业事件")
public class DangerousOperation extends FlowEntity {
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
private String id;
/**作业类型*/
@Excel(name = "作业类型", width = 15)
@ApiModelProperty(value = "作业类型")
private String operationType;
/**作业名称*/
@Excel(name = "作业名称", width = 15)
@ApiModelProperty(value = "作业名称")
private String operationName;
/**作业描述*/
@Excel(name = "作业描述", width = 15)
@ApiModelProperty(value = "作业描述")
private String operationDesc;
/**作业地点(构筑物)*/
@Excel(name = "作业地点(构筑物)", width = 15)
@ApiModelProperty(value = "作业地点(构筑物)")
private String operationLocation;
/**申请时间*/
@Excel(name = "申请时间", width = 15)
@ApiModelProperty(value = "申请时间")
private String reportDate;
/**作业时间*/
@Excel(name = "作业时间", width = 15)
@ApiModelProperty(value = "作业时间")
private String operationDate;
/**风险评估*/
@Excel(name = "风险评估", width = 15)
@ApiModelProperty(value = "风险评估")
private String operationAssess;
/**作业方案附件*/
@Excel(name = "作业方案附件", width = 15)
@ApiModelProperty(value = "作业方案附件")
private String operationFile;
/**作业人员类型*/
@Excel(name = "作业人员类型", width = 15)
@ApiModelProperty(value = "作业人员类型")
private String operationUserType;
/**作业人员*/
@Excel(name = "作业人员", width = 15)
@ApiModelProperty(value = "作业人员")
@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
private String operationUser;
/**人员证书*/
@Excel(name = "人员证书", width = 15)
@ApiModelProperty(value = "人员证书")
private String operationUserFile;
/**安全交底单*/
@Excel(name = "安全交底单", width = 15)
@ApiModelProperty(value = "安全交底单")
private String operationSafeForm;
/**作业照片*/
@Excel(name = "作业照片", width = 15)
@ApiModelProperty(value = "作业照片")
private String operationImg;
/**作业情况*/
@Excel(name = "作业情况", width = 15)
@ApiModelProperty(value = "作业情况")
private String operationResult;
/**作业状态*/
@Excel(name = "作业状态", width = 15)
@ApiModelProperty(value = "作业状态")
private String operationStatus;
/**所属厂站*/
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
private String departId;
/**流程定义id*/
@Excel(name = "流程定义id", width = 15)
@ApiModelProperty(value = "流程定义id")
private String processDefinitionId;
/**流程实例id*/
@Excel(name = "流程实例id", width = 15)
@ApiModelProperty(value = "流程实例id")
private String processInstanceId;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id")
private String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.util.Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private String createDept;
/**所属公司*/
@Excel(name = "所属公司", width = 15)
@ApiModelProperty(value = "所属公司")
private String createCmpy;
/**删除标识,0:正常,1:删除*/
@Excel(name = "删除标识,0:正常,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:正常,1:删除")
private Integer delFlag;
@TableField(exist = false)
@ApiModelProperty(value = "开始时间")
private String startTime;
@TableField(exist = false)
@ApiModelProperty(value = "结束时间")
private String endTime;
}
package com.skua.modules.emergency.enums;
import lombok.Getter;
/**
*
* 字典:emergency_risk_event_handleresult
*/
@Getter
public enum DangerousOperationHandleResultEnums {
UN_HANDLE("1","未处理"),
HANDLED("3","已处理");
DangerousOperationHandleResultEnums(String itemValue, String itemText) {
this.itemValue = itemValue;
this.itemText = itemText;
}
private final String itemValue;
private final String itemText;
}
package com.skua.modules.emergency.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skua.modules.emergency.entity.DangerousOperation;
import com.skua.modules.emergency.entity.EmergencyRiskEvent;
/**
* 应急风险事件
*/
public interface DangerousOperationMapper extends BaseMapper<DangerousOperation> {
}
<?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.skua.modules.emergency.mapper.DangerousOperationMapper">
</mapper>
package com.skua.modules.emergency.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.emergency.entity.DangerousOperation;
import java.util.Map;
/**
* 应急风险事件
*/
public interface IDangerousOperationService extends IService<DangerousOperation> {
/**
* 开始流程
* @param dangerousOperation
*/
void startProcess(DangerousOperation dangerousOperation);
/**
* 应急风险事件-处理
* @param dangerousOperation
*/
void handle(DangerousOperation dangerousOperation);
}
package com.skua.modules.emergency.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.exception.JeecgBootException;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.emergency.entity.DangerousOperation;
import com.skua.modules.emergency.enums.DangerousOperationHandleResultEnums;
import com.skua.modules.emergency.mapper.DangerousOperationMapper;
import com.skua.modules.emergency.service.IDangerousOperationService;
import com.skua.modules.flow.business.service.FlowBusinessService;
import com.skua.modules.flow.business.service.IFlowService;
import com.skua.modules.flow.core.constant.ProcessConstant;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.utils.FlowUtil;
import com.skua.modules.flow.custombiz.handle.IFlowCustomHandle;
import com.skua.modules.flow.custombiz.vo.FlowProcessFormFieldInfoVO;
import com.skua.modules.flow.support.Kv;
import com.skua.modules.flow.utils.Func;
import com.skua.tool.util.UniqIdUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 应急风险事件
*/
@Service
public class DangerousOperationServiceImpl extends ServiceImpl<DangerousOperationMapper, DangerousOperation> implements IDangerousOperationService, IFlowCustomHandle {
@Autowired
private IFlowService flowService;
@Autowired
private FlowBusinessService flowBusinessService;
@Override
@Transactional(rollbackFor = Exception.class)
public void startProcess(DangerousOperation dangerousOperation) {
DangerousOperation saveParam = new DangerousOperation();
BeanUtils.copyProperties(dangerousOperation, saveParam);
saveParam.setId(UniqIdUtils.getInstance().getUniqID());
saveParam.setOperationStatus(DangerousOperationHandleResultEnums.UN_HANDLE.getItemValue());
this.save(saveParam);
String businessTable = "dangerous_operation_manage";
//设置当前人为上报人
// 启动流程
Kv variables = Kv.create().set(ProcessConstant.TASK_VARIABLE_CREATE_USER, "");
BladeFlow flow = flowService.startProcessInstanceById(saveParam.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(saveParam.getId())), variables);
if (Func.isNotEmpty(flow)) {
log.debug("流程已启动,流程ID:" + flow.getProcessInstanceId());
// 返回流程id写入leave
saveParam.setProcessInstanceId(flow.getProcessInstanceId());
updateById(saveParam);
} else {
throw new JeecgBootException("开启流程失败");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void handle(DangerousOperation dangerousOperation) {
DangerousOperation updateParam = this.getById(dangerousOperation.getId());
if (updateParam == null) {
throw new JeecgBootException("实体不存在!");
}
BeanUtils.copyProperties(dangerousOperation, updateParam);
updateParam.setOperationStatus(DangerousOperationHandleResultEnums.HANDLED.getItemValue());
this.updateById(updateParam);
//调用同意接口
boolean flag = flowBusinessService.completeTask(ProcessConstant.PASS_KEY, updateParam.getFlow());
if(!flag){
throw new JeecgBootException("流程办理失败!");
}
}
@Override
public List<FlowProcessFormFieldInfoVO> buildCustomData(String s, List<FlowProcessFormFieldInfoVO> list) {
for (FlowProcessFormFieldInfoVO entity : list) {
if ("operationUser".equals(entity.getFieldCode())) {
String fieldValue = (String) entity.getFieldValue();
if (StringUtils.isBlank(fieldValue)) {
entity.setFieldValue(BaseContextHandler.getUserId());
}
}
if ("reportDate".equals(entity.getFieldCode())) {
String fieldValue = ConvertUtils.getString(entity.getFieldValue());
if (StringUtils.isBlank(fieldValue)) {
entity.setFieldValue(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
}
}
}
return list;
}
}
......@@ -132,6 +132,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String startDate = weekMap.get("start");
String endDate = weekMap.get("end");
list = mapper.getWeekReportData(startDate, endDate);
map.put("start", startDate);//开始时间
map.put("end", endDate);//结束时间
map.put("zclsl", "776");//处理水量合计
map.put("rjclsl", "110.7");//日均处理水量
map.put("rjclsl_hb", "2");//较上周增减量
......
......@@ -218,6 +218,18 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
wdscnlMap.put("value","0");
wdscnlMap.put("valueTb","-");
wdscnlMap.put("valueHb","0");
map.put("rjdl",new HashMap<>());
Map<String, Object> rjdlMap = new HashMap<>();
rjdlMap.put("value","0");
rjdlMap.put("valueTb","-");
rjdlMap.put("valueHb","0");
map.put("yclsl", yclslMap);
map.put("rjclsl", rjclslMap);
map.put("yzdl", yzdlMap);
map.put("dsdh", dsdhMap);
map.put("yzcnl", yzcnlMap);
map.put("wdscnl", wdscnlMap);
map.put("rjdl", rjdlMap);
return map;
}
......
......@@ -197,9 +197,15 @@ public class EquipmentInfo {
@ApiModelProperty(value = "删除标识,0:正常,1:删除")
private Integer delFlag;
/**
* 赤水 补充字段
*/
//能耗等级
@Dict(dicCode = "energy_level")
@ApiModelProperty(value = "能耗等级")
private String energyLevel;
//能耗功率
@ApiModelProperty(value = "能耗功率")
private String energyPower;
//补充字段
@ApiModelProperty(value = "输送介质")
private String deliveryMedium;
......@@ -261,4 +267,20 @@ public class EquipmentInfo {
@ApiModelProperty(value = "报废日期")
private String scrapDate;
//检测机构
@ApiModelProperty(value = "检测机构")
private String testingDepart;
//附件
@ApiModelProperty(value = "特种设备附件")
private String specialFile;
//操作人
@ApiModelProperty(value = "操作人")
private String operatorId;
//安全负责人
@ApiModelProperty(value = "安全负责人")
private String securityManager;
//企业负责人
@ApiModelProperty(value = "企业负责人")
private String enterpriseManager;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!