Commit 3e986dc4 authored by tianbo's avatar tianbo

隐患流程调试

parent 8d8aae60
...@@ -35,51 +35,51 @@ public interface LatentDangerState { ...@@ -35,51 +35,51 @@ public interface LatentDangerState {
/** /**
* 提交隐患 * 提交隐患
*/ */
提交隐患("提交隐患", "dangerSubmit", null, null), 提交隐患("提交隐患", "dangerSubmit", null, null, "未审核"),
/** /**
* 现场确认 * 现场确认
*/ */
现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm"), 现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "审核中"),
/** /**
* 检查组长确认 * 检查组长确认
*/ */
检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm"), 检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "审核中"),
/** /**
* 隐患二次审核确认 * 隐患二次审核确认
*/ */
隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm"), 隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "审核中"),
/** /**
* 整改任务分配 * 整改任务分配
*/ */
整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit",""), 整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "整改中"),
/** /**
* 提交整改资料 * 提交整改资料
*/ */
提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm",""), 提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "整改中"),
/** /**
* 整改检查组长确认 * 整改检查组长确认
*/ */
整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit"), 整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "整改中"),
/** /**
* 整改检查负责人确认 * 整改检查负责人确认
*/ */
整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit"), 整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "整改中"),
/** /**
* 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同) * 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同)
*/ */
整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit"), 整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "整改中"),
/** /**
* 整改检查组长复查确认 * 整改检查组长复查确认
*/ */
整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit"), 整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "整改中"),
/** /**
* 整改二次审核确认 * 整改二次审核确认
*/ */
整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit"), 整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "整改中"),
/** /**
* 整改完毕 * 整改完毕
*/ */
整改完毕("整改完毕", "endOfGovernance", "",""); 整改完毕("整改完毕", "endOfGovernance", "","", "整改完毕");
/** /**
* 名称,描述 * 名称,描述
...@@ -101,11 +101,17 @@ public interface LatentDangerState { ...@@ -101,11 +101,17 @@ public interface LatentDangerState {
*/ */
private String rejectNext; private String rejectNext;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext) { /**
* 流程状态
*/
private String processState;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState) {
this.name = name; this.name = name;
this.code = code; this.code = code;
this.next = next; this.next = next;
this.rejectNext = rejectNext; this.rejectNext = rejectNext;
this.processState = processState;
} }
public String getName() { public String getName() {
...@@ -139,6 +145,14 @@ public interface LatentDangerState { ...@@ -139,6 +145,14 @@ public interface LatentDangerState {
this.rejectNext = rejectNext; this.rejectNext = rejectNext;
} }
public String getProcessState() {
return processState;
}
public void setProcessState(String processState) {
this.processState = processState;
}
public static SupervisionDangerStateEnum getEnumByCode(String code) { public static SupervisionDangerStateEnum getEnumByCode(String code) {
for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) { for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) {
if (code.equals(_enum.getCode())) { if (code.equals(_enum.getCode())) {
...@@ -169,6 +183,16 @@ public interface LatentDangerState { ...@@ -169,6 +183,16 @@ public interface LatentDangerState {
} }
return enumList; return enumList;
} }
public static List<SupervisionDangerStateEnum> getEnumListByProcessState(String processState) {
List<SupervisionDangerStateEnum> enumList = Lists.newArrayList();
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getProcessState().equals(processState)) {
enumList.add(type);
}
}
return enumList;
}
} }
enum PatrolDangerLevelEnum implements LatentDangerState { enum PatrolDangerLevelEnum implements LatentDangerState {
......
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 拥有者枚举
* @author WJK
*
*/
public enum OwerEnum {
/**
* 我的
*/
MY("我的","0"),
ALL("全部","1" );
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private OwerEnum(String name, String code){
this.name = name;
this.code = code;
}
public static OwerEnum getEnum(String code) {
OwerEnum jPushTypeEnum = null;
for(OwerEnum type: OwerEnum.values()) {
if (type.getCode().equals(code)) {
jPushTypeEnum = type;
break;
}
}
return jPushTypeEnum;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
...@@ -199,4 +199,10 @@ public class LatentDanger extends BasicEntity { ...@@ -199,4 +199,10 @@ public class LatentDanger extends BasicEntity {
} }
return false; return false;
} }
/**
* 提交信息
*/
@TableField(exist = false)
private JSONObject flowJson;
} }
...@@ -16,6 +16,16 @@ public class Constants { ...@@ -16,6 +16,16 @@ public class Constants {
public static final String DANGER_BIZ_TYPE_KEY= "danger_biz_type_key"; public static final String DANGER_BIZ_TYPE_KEY= "danger_biz_type_key";
/** /**
* 降序排列
*/
public static final String DESC = "desc";
/**
* 升序排列
*/
public static final String ASC = "asc";
/**
* 构造方法 * 构造方法
*/ */
private Constants() { private Constants() {
......
...@@ -7,10 +7,10 @@ import com.yeejoin.amos.boot.biz.common.bo.RoleBo; ...@@ -7,10 +7,10 @@ import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.latentdanger.business.dto.DangerExecuteSubmitDto; import com.yeejoin.amos.latentdanger.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.latentdanger.business.dto.ExecuteSubmitDto;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerDto; import com.yeejoin.amos.latentdanger.business.param.LatentDangerDto;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerExecuteParam; import com.yeejoin.amos.latentdanger.business.param.LatentDangerExecuteParam;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerListParam; import com.yeejoin.amos.latentdanger.business.param.LatentDangerListParam;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerNormalParam;
import com.yeejoin.amos.latentdanger.business.param.PageParam; import com.yeejoin.amos.latentdanger.business.param.PageParam;
import com.yeejoin.amos.latentdanger.business.service.intfc.ILatentDangerService; import com.yeejoin.amos.latentdanger.business.service.intfc.ILatentDangerService;
import com.yeejoin.amos.latentdanger.business.util.CommonResponse; import com.yeejoin.amos.latentdanger.business.util.CommonResponse;
...@@ -27,6 +27,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -27,6 +27,7 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -35,7 +36,6 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -35,7 +36,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -58,6 +58,9 @@ public class LatentDangerController extends BaseController { ...@@ -58,6 +58,9 @@ public class LatentDangerController extends BaseController {
@Autowired @Autowired
private ILatentDangerService iLatentDangerService; private ILatentDangerService iLatentDangerService;
@Value("${danger.biz.type}")
private static final String bizType = "patrol";
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患") @ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save") @PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -236,7 +239,7 @@ public class LatentDangerController extends BaseController { ...@@ -236,7 +239,7 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/page/list") @PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception { public ResponseModel listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception {
IPage<LatentDanger> result = iLatentDangerService.listDanger(pageParam); IPage<LatentDanger> result = iLatentDangerService.pageListDanger(pageParam);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
...@@ -317,8 +320,12 @@ public class LatentDangerController extends BaseController { ...@@ -317,8 +320,12 @@ public class LatentDangerController extends BaseController {
String departmentName = getDepartmentName(reginParams); String departmentName = getDepartmentName(reginParams);
String userRealName = user.getRealName(); String userRealName = user.getRealName();
String userId = user.getUserId(); String userId = user.getUserId();
return ResponseHelper.buildResponse(iLatentDangerService.dangerAudit(latentDangerDto, executeType, userId, ExecuteSubmitDto executeSubmitDto = iLatentDangerService.dangerAudit(latentDangerDto, executeType, userId,
userRealName, deptId, departmentName, reginParams)); userRealName, deptId, departmentName, reginParams);
if (!executeSubmitDto.getIsOk()) {
throw new Exception(executeSubmitDto.getMsg());
}
return ResponseHelper.buildResponse(executeSubmitDto);
} }
/** /**
......
...@@ -141,4 +141,8 @@ public class LatentDangerDto { ...@@ -141,4 +141,8 @@ public class LatentDangerDto {
*/ */
private Boolean unReviewed; private Boolean unReviewed;
/**
* 提交信息
*/
private JSONObject flowJson;
} }
...@@ -79,7 +79,7 @@ public class LatentDangerExecuteParam { ...@@ -79,7 +79,7 @@ public class LatentDangerExecuteParam {
/** /**
* 整改责任人 * 整改责任人
*/ */
private String reformUserId; private String reformLeaderId;
} }
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.latentdanger.business.dto.ExecuteSubmitDto;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerDto; import com.yeejoin.amos.latentdanger.business.param.LatentDangerDto;
import com.yeejoin.amos.latentdanger.business.param.LatentDangerExecuteParam; import com.yeejoin.amos.latentdanger.business.param.LatentDangerExecuteParam;
import com.yeejoin.amos.latentdanger.business.param.PageParam; import com.yeejoin.amos.latentdanger.business.param.PageParam;
...@@ -99,7 +100,7 @@ public interface ILatentDangerService { ...@@ -99,7 +100,7 @@ public interface ILatentDangerService {
*/ */
JSONObject getReviewInfo(Long dangerId); JSONObject getReviewInfo(Long dangerId);
IPage<LatentDanger> listDanger(PageParam pageParam) throws Exception; IPage<LatentDanger> pageListDanger(PageParam pageParam) throws Exception;
List<DangerListResponse> export(PageParam pageParam); List<DangerListResponse> export(PageParam pageParam);
...@@ -136,7 +137,7 @@ public interface ILatentDangerService { ...@@ -136,7 +137,7 @@ public interface ILatentDangerService {
* @param executeType 执行类型(通过0、驳回1) * @param executeType 执行类型(通过0、驳回1)
* @exception Exception * @exception Exception
*/ */
Object dangerAudit(LatentDangerDto latentDangerDto, Integer executeType, String userId, String userName, ExecuteSubmitDto dangerAudit(LatentDangerDto latentDangerDto, Integer executeType, String userId, String userName,
String deptId, String deptName, ReginParams reginParams) throws Exception; String deptId, String deptName, ReginParams reginParams) throws Exception;
/** /**
......
package com.yeejoin.amos.latentdanger.business.vo; package com.yeejoin.amos.latentdanger.business.vo;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.latentdanger.business.entity.mybatis.extend.LatentDangerFlowRecordBo; import com.yeejoin.amos.latentdanger.business.entity.mybatis.extend.LatentDangerFlowRecordBo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.checkerframework.checker.units.qual.A;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -13,44 +16,61 @@ import java.util.List; ...@@ -13,44 +16,61 @@ import java.util.List;
@Data @Data
public class LatentDangerDetailVo { public class LatentDangerDetailVo {
@ApiModelProperty(value = "隐患主键")
private Long id; private Long id;
@ApiModelProperty(value = "隐患编号")
private String businessKey;
@ApiModelProperty(value = "隐患名称")
private String dangerName; private String dangerName;
@ApiModelProperty(value = "业务id")
private Long bizId; private Long bizId;
@ApiModelProperty(value = "隐患等级")
private String dangerLevel; private String dangerLevel;
@ApiModelProperty(value = "隐患等级名称")
private String dangerLevelName; private String dangerLevelName;
@ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "隐患地点")
private String dangerPosition; private String dangerPosition;
@ApiModelProperty(value = "整改类型")
private String reformTypeName; private String reformTypeName;
@ApiModelProperty(value = "整改限制时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reformLimitDate; private Date reformLimitDate;
private String reformLimitDateStr; @ApiModelProperty(value = "整改对象")
private JSONObject reformJson; private JSONObject reformJson;
@ApiModelProperty(value = "当前流程节点记录id")
private Long currentFlowRecordId; private Long currentFlowRecordId;
@ApiModelProperty(value = "隐患状态名称")
private String dangerState; private String dangerState;
@ApiModelProperty(value = "隐患状态名称")
private String dangerStateName; private String dangerStateName;
private String dangerType; private String dangerType;
private String dangerTypeName; private String dangerTypeName;
@ApiModelProperty(value = "检查类型")
private String checkMode; private String checkMode;
public String getCheckMode() { public String getCheckMode() {
return this.dangerType; return this.dangerType;
} }
@ApiModelProperty(value = "检查类型名称")
private String checkModeName; private String checkModeName;
public String getCheckModeName() { public String getCheckModeName() {
...@@ -59,16 +79,21 @@ public class LatentDangerDetailVo { ...@@ -59,16 +79,21 @@ public class LatentDangerDetailVo {
private Boolean currentUserCanExecute; private Boolean currentUserCanExecute;
@ApiModelProperty(value = "隐患图片信息")
private List<String> photoUrl; private List<String> photoUrl;
private LatentDangerDetailRiskVo riskInfo; private LatentDangerDetailRiskVo riskInfo;
@ApiModelProperty(value = "复审信息")
private JSONObject reviewInfo; private JSONObject reviewInfo;
@ApiModelProperty(value = "整改信息")
private JSONObject reformInfo; private JSONObject reformInfo;
@ApiModelProperty(value = "复查信息")
private JSONObject recheckInfo; private JSONObject recheckInfo;
@ApiModelProperty(value = "流程信息")
private List<LatentDangerFlowRecordBo> records; private List<LatentDangerFlowRecordBo> records;
private Date delayLimitDate; private Date delayLimitDate;
...@@ -81,5 +106,19 @@ public class LatentDangerDetailVo { ...@@ -81,5 +106,19 @@ public class LatentDangerDetailVo {
private String taskId; private String taskId;
@ApiModelProperty(value = "业务信息")
private JSONObject bizInfo; private JSONObject bizInfo;
@ApiModelProperty(value = "提交时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createDate;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "审核信息")
private JSONObject flowJson;
} }
...@@ -11,6 +11,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -11,6 +11,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
...@@ -29,6 +30,9 @@ public class EnumFillAop { ...@@ -29,6 +30,9 @@ public class EnumFillAop {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Value("${danger.biz.type}")
private String bizType;
@Pointcut("execution(public * com.yeejoin.amos.latentdanger.business.controller..*(..))") @Pointcut("execution(public * com.yeejoin.amos.latentdanger.business.controller..*(..))")
public void fillEnum() { public void fillEnum() {
...@@ -37,19 +41,6 @@ public class EnumFillAop { ...@@ -37,19 +41,6 @@ public class EnumFillAop {
@Before("fillEnum()") @Before("fillEnum()")
public void doBefore(JoinPoint joinPoint) { public void doBefore(JoinPoint joinPoint) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
String bizType = request.getHeader("bizType");
if (bizType == null) {
bizType = request.getParameter("bizType");
}
if (!redisUtils.hasKey(Constants.DANGER_BIZ_TYPE_KEY)) {
redisUtils.set(Constants.DANGER_BIZ_TYPE_KEY, bizType);
}
if (bizType == null) {
bizType = redisUtils.get(Constants.DANGER_BIZ_TYPE_KEY).toString();
}
// 获取隐患等级枚举 // 获取隐患等级枚举
if (ValidationUtil.isEmpty(LatentDangerLevelEnum.enumMap)) { if (ValidationUtil.isEmpty(LatentDangerLevelEnum.enumMap)) {
List<DictionarieValueModel> dicResult = List<DictionarieValueModel> dicResult =
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
from from
cb_latent_danger_flow_record cb_latent_danger_flow_record
where where
deleted = 0 1 = 1
and and
danger_id = #{dangerId} danger_id = #{dangerId}
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment