Commit 8214b40c authored by tianbo's avatar tianbo

隐患流程修改

parent 68f6ef4e
package com.yeejoin.amos.latentdanger.common.enums; package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public enum ExecuteStateEnum { public enum ExecuteStateEnum {
未执行("未执行", 1, ""), /**
通过("通过", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"), * 未执行
驳回("驳回", 3, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"), */
已确认("已确认", 4, ""), 未执行("未执行", 0, ""),
停止执行("停止执行", 5, ""), 通过("通过", 1, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
作业开始执行("作业开始执行", 6, ""), 驳回("驳回", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
作业完成("作业完成", 7, ""); 已确认("已确认", 3, ""),
停止执行("停止执行", 4, ""),
作业开始执行("作业开始执行", 5, ""),
作业完成("作业完成", 6, "");
/** /**
* 名称,描述 * 名称,描述
......
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public interface LatentDangerState {
/**
* 根据code获取枚举
*
* @param code
* @return
*/
LatentDangerState getEnumByCode(String code);
/**
* 根据code获取枚举名称
*
* @param code
* @return
*/
String getEnumNameByCode(String code);
enum SupervisionDangerStateEnum implements LatentDangerState {
/**
* 提交隐患
*/
提交隐患("提交隐患", "dangerSubmit", null, null),
/**
* 现场确认
*/
现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm"),
/**
* 检查组长确认
*/
检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm"),
/**
* 隐患二次审核确认
*/
隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm"),
/**
* 整改任务分配
*/
整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit",""),
/**
* 提交整改资料
*/
提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm",""),
/**
* 整改检查组长确认
*/
整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit"),
/**
* 整改检查负责人确认
*/
整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit"),
/**
* 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同)
*/
整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit"),
/**
* 整改检查组长复查确认
*/
整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit"),
/**
* 整改二次审核确认
*/
整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit"),
/**
* 整改完毕
*/
整改完毕("整改完毕", "endOfGovernance", "","");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 通过下一步骤
*/
private String next;
/**
* 拒绝下一步骤
*/
private String rejectNext;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext) {
this.name = name;
this.code = code;
this.next = next;
this.rejectNext = rejectNext;
}
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;
}
public String getNext() {
return next;
}
public void setNext(String next) {
this.next = next;
}
public String getRejectNext() {
return rejectNext;
}
public void setRejectNext(String rejectNext) {
this.rejectNext = rejectNext;
}
public LatentDangerState getNextEnum() {
return getEnumByCode(next);
}
public LatentDangerState getRejectNextEnum() {
return getEnumByCode(rejectNext);
}
@Override
public LatentDangerState getEnumByCode(String code) {
for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) {
if (code.equals(_enum.getCode())) {
return _enum;
}
}
return null;
}
@Override
public String getEnumNameByCode(String code) {
String enumName = "";
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getCode().equals(code)) {
enumName = type.getName();
break;
}
}
return enumName;
}
}
enum PatrolDangerLevelEnum implements LatentDangerState {
/**
* 待评审
*/
待评审("待评审", "1"),
待治理("待治理", "2"),
安措计划中("安措计划中", "3"),
待验证("待验证", "4"),
治理完毕("治理完毕", "5"),
已撤销("已撤销", "6"),
延期治理申请("延期治理中", "7"),
延期治理申请待车间部门审核("延期治理待车间部门审核", "8"),
延期治理申请待公司审核("延期治理待公司审核", "9");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
PatrolDangerLevelEnum(String name, String code) {
this.name = name;
this.code = code;
}
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;
}
@Override
public LatentDangerState getEnumByCode(String code) {
for (PatrolDangerLevelEnum _enum : PatrolDangerLevelEnum.values()) {
if (code.equals(_enum.getCode())) {
return _enum;
}
}
return null;
}
@Override
public String getEnumNameByCode(String code) {
String enumName = "";
for(PatrolDangerLevelEnum type: PatrolDangerLevelEnum.values()) {
if (type.getCode().equals(code)) {
enumName = type.getName();
break;
}
}
return enumName;
}
}
}
package com.yeejoin.amos.latentdanger.dao.entity; package com.yeejoin.amos.latentdanger.dao.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
...@@ -209,4 +210,10 @@ public class LatentDanger extends BasicEntity { ...@@ -209,4 +210,10 @@ public class LatentDanger extends BasicEntity {
* 纬度 * 纬度
*/ */
private String latitude; private String latitude;
/**
* 业务信息
*/
@Column(name = "biz_info")
private JSONObject bizInfo;
} }
...@@ -17,6 +17,7 @@ import com.yeejoin.amos.latentdanger.business.util.CommonResponse; ...@@ -17,6 +17,7 @@ import com.yeejoin.amos.latentdanger.business.util.CommonResponse;
import com.yeejoin.amos.latentdanger.business.util.CommonResponseUtil; import com.yeejoin.amos.latentdanger.business.util.CommonResponseUtil;
import com.yeejoin.amos.latentdanger.business.util.FileHelper; import com.yeejoin.amos.latentdanger.business.util.FileHelper;
import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo; import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse; import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger; import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -26,8 +27,8 @@ import org.apache.commons.lang.StringUtils; ...@@ -26,8 +27,8 @@ 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.data.domain.Page;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -36,6 +37,8 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -36,6 +37,8 @@ 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.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.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Date; import java.util.Date;
...@@ -81,24 +84,16 @@ public class LatentDangerController extends BaseController { ...@@ -81,24 +84,16 @@ public class LatentDangerController extends BaseController {
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患") @ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save") @PostMapping(value = "/patrol/save")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody List<LatentDangerDto> latentDangerDtoList) { public ResponseModel<List<LatentDanger>> savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody List<LatentDangerDto> latentDangerDtoList) throws Exception {
try { AgencyUserModel user = getUserInfo();
AgencyUserModel user = getUserInfo(); ReginParams reginParams = getSelectedOrgInfo();
if (ObjectUtils.isEmpty(user)) { String loginOrgCode = getOrgCode(reginParams);
return CommonResponseUtil.failure("登录过期,请重新登录"); String deptId = getDepartmentId(reginParams);
} String companyId = getCompanyId(reginParams);
ReginParams reginParams = getSelectedOrgInfo(); String departmentName = getDepartmentName(reginParams);
String loginOrgCode = getOrgCode(reginParams); RoleBo role = reginParams.getRole();
String deptId = getDepartmentId(reginParams); return ResponseHelper.buildResponse(iLatentDangerService.savePatrol(latentDangerDtoList, user.getUserId(),
String companyId = getCompanyId(reginParams); user.getRealName(), deptId, departmentName, companyId, loginOrgCode, role));
String departmentName = getDepartmentName(reginParams);
RoleBo role = reginParams.getRole();
return iLatentDangerService.savePatrol(latentDangerDtoList, user.getUserId(),
user.getRealName(), deptId, departmentName, companyId, loginOrgCode, role);
} catch (Exception e) {
logger.error("创建巡检隐患异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
} }
@ApiOperation(value = "隐患列表", notes = "隐患列表") @ApiOperation(value = "隐患列表", notes = "隐患列表")
...@@ -127,45 +122,26 @@ public class LatentDangerController extends BaseController { ...@@ -127,45 +122,26 @@ public class LatentDangerController extends BaseController {
@ApiOperation(value = "隐患详情", notes = "隐患详情") @ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id, public ResponseModel<LatentDangerDetailVo> detail(@ApiParam(value = "隐患Id", required = true) @RequestParam Long dangerId,
@ApiParam(value = "是否完成") @RequestParam(required = false) boolean isFinish) { @ApiParam(value = "是否完成") @RequestParam(required = false) boolean isFinish) throws Exception {
try { AgencyUserModel user = getUserInfo();
AgencyUserModel user = getUserInfo(); throw new Exception("aaaa");
if (ObjectUtils.isEmpty(user)) { // return iLatentDangerService.detail(dangerId, user.getUserId(), isFinish);
return CommonResponseUtil.failure("登录过期,请重新登录");
}
return iLatentDangerService.detail(id, user.getUserId(), isFinish);
} catch (Exception e) {
logger.error("隐患详情异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
} }
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录") @ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord") @GetMapping(value = "/listFlowRecord")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listFlowRecord(@ApiParam(value = "隐患id", required = true) @RequestParam Long id) { public ResponseModel listFlowRecord(@ApiParam(value = "隐患id", required = true) @RequestParam Long id) throws Exception {
try { return ResponseHelper.buildResponse(iLatentDangerService.listFlowRecord(getToken(), getProduct(),
AgencyUserModel user = getUserInfo(); getAppKey(), id));
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("登录过期,请重新登录");
}
return iLatentDangerService.listFlowRecord(getToken(), getProduct(), getAppKey(), id);
} catch (Exception e) {
logger.error("隐患执行记录异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
} }
@ApiOperation(value = "流程执行", notes = "流程执行") @ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute") @PostMapping(value = "/excute")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse execute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExecuteParam latentDangerExecuteParam) { public ResponseModel execute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExecuteParam latentDangerExecuteParam) throws Exception {
try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("登录过期,请重新登录");
}
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String deptId = getDepartmentId(reginParams); String deptId = getDepartmentId(reginParams);
String departmentName = getDepartmentName(reginParams); String departmentName = getDepartmentName(reginParams);
...@@ -184,11 +160,7 @@ public class LatentDangerController extends BaseController { ...@@ -184,11 +160,7 @@ public class LatentDangerController extends BaseController {
// } else { // } else {
// return CommonResponseUtil.failure(executeSubmitDto.getMsg()); // return CommonResponseUtil.failure(executeSubmitDto.getMsg());
// } // }
return CommonResponseUtil.success(); return ResponseHelper.buildResponse("success");
} catch (Exception e) {
logger.error("流程执行异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
} }
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息") @ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
...@@ -241,15 +213,15 @@ public class LatentDangerController extends BaseController { ...@@ -241,15 +213,15 @@ public class LatentDangerController extends BaseController {
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级") @ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel") @GetMapping(value = "/dangerLevel")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerLevel() { public ResponseModel getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel()); return ResponseHelper.buildResponse((iLatentDangerService.getDangerLevel()));
} }
@ApiOperation(value = "获取隐患整改方式", notes = "获取隐患整改方式") @ApiOperation(value = "获取隐患整改方式", notes = "获取隐患整改方式")
@GetMapping(value = "/dangerGovernance") @GetMapping(value = "/dangerGovernance")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerGovernance() { public ResponseModel getDangerGovernance() {
return CommonResponseUtil.success(iLatentDangerService.getDangerGovernance()); return ResponseHelper.buildResponse((iLatentDangerService.getDangerGovernance()));
} }
@ApiOperation(value = "获取隐患评审信息", notes = "获取隐患评审信息") @ApiOperation(value = "获取隐患评审信息", notes = "获取隐患评审信息")
...@@ -261,16 +233,12 @@ public class LatentDangerController extends BaseController { ...@@ -261,16 +233,12 @@ public class LatentDangerController extends BaseController {
/** /**
* 隐患清单 * 隐患清单
*/ */
@ApiOperation(value = "隐患清单", notes = "隐患清单") @ApiOperation(value = "隐患分页列表", notes = "隐患分页列表")
@PostMapping(value = "/page/list") @PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) { public ResponseModel listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("登录过期,请重新登录");
}
IPage<LatentDanger> result = iLatentDangerService.listDanger(pageParam); IPage<LatentDanger> result = iLatentDangerService.listDanger(pageParam);
return CommonResponseUtil.success(result); return ResponseHelper.buildResponse(result);
} }
/** /**
...@@ -285,7 +253,7 @@ public class LatentDangerController extends BaseController { ...@@ -285,7 +253,7 @@ public class LatentDangerController extends BaseController {
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
throw new RuntimeException("登录过期,请重新登录"); throw new RuntimeException("登录过期,请重新登录");
} }
pageParam.setPageSize(Integer.MAX_VALUE); pageParam.setSize(Integer.MAX_VALUE);
List<DangerListResponse> list = iLatentDangerService.export(pageParam); List<DangerListResponse> list = iLatentDangerService.export(pageParam);
String fileName = "隐患清单" + System.currentTimeMillis(); String fileName = "隐患清单" + System.currentTimeMillis();
FileHelper.exportExcel(list, "隐患清单", "隐患清单", DangerListResponse.class, fileName + ".xls", response); FileHelper.exportExcel(list, "隐患清单", "隐患清单", DangerListResponse.class, fileName + ".xls", response);
...@@ -318,4 +286,18 @@ public class LatentDangerController extends BaseController { ...@@ -318,4 +286,18 @@ public class LatentDangerController extends BaseController {
return CommonResponseUtil.failure(e.getMessage()); return CommonResponseUtil.failure(e.getMessage());
} }
} }
@ApiOperation(value = "隐患列表", notes = "查询隐患列表")
@PostMapping(value = "/list/all")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<List<LatentDanger>> listAllDanger(@RequestBody LatentDangerListParam searchParam) {
return ResponseHelper.buildResponse(iLatentDangerService.listAllDanger(searchParam));
}
@ApiOperation(value = "隐患删除", notes = "隐患删除")
@DeleteMapping(value = "/delete")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<Boolean> delete(@RequestParam String ids) throws Exception {
return ResponseHelper.buildResponse(iLatentDangerService.delete(ids));
}
} }
package com.yeejoin.amos.latentdanger.business.param; package com.yeejoin.amos.latentdanger.business.param;
import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -51,12 +53,12 @@ public class LatentDangerDto { ...@@ -51,12 +53,12 @@ public class LatentDangerDto {
/** /**
* 隐患名称 * 隐患名称
*/ */
private String name; private String dangerName;
/** /**
* 整改日期 * 整改日期
*/ */
private String reformLimitDate; private Date reformLimitDate;
/** /**
* 经度 * 经度
...@@ -127,4 +129,9 @@ public class LatentDangerDto { ...@@ -127,4 +129,9 @@ public class LatentDangerDto {
* 检查类型(1无码检查、2计划检查、3无计划检查、4随手拍) * 检查类型(1无码检查、2计划检查、3无计划检查、4随手拍)
*/ */
private String checkMode; private String checkMode;
/**
* 业务信息
*/
private JSONObject bizInfo;
} }
...@@ -20,9 +20,9 @@ public class LatentDangerListParam extends CommonPageable { ...@@ -20,9 +20,9 @@ public class LatentDangerListParam extends CommonPageable {
private Integer belongType; private Integer belongType;
/** /**
* 0:全部;1:待评审;2:待治理;3:安措计划中;4:待验证;5:治理完毕;6:已撤销;7:延期治理中;8:延期治理待车间部门审核;9:延期治理待公司审核 * 隐患流程状态枚举key
*/ */
private Integer dangerState; private String dangerState;
/** /**
* 是否已处理(1:是;2:否) * 是否已处理(1:是;2:否)
...@@ -30,11 +30,13 @@ public class LatentDangerListParam extends CommonPageable { ...@@ -30,11 +30,13 @@ public class LatentDangerListParam extends CommonPageable {
private Boolean isHandle; private Boolean isHandle;
/** /**
* -1:全部;1:一般隐患;2:重大隐患;0:安全问题 * null:全部;隐患等级
*/ */
private Integer dangerLevel; private String dangerLevel;
private String dangerName; private String dangerName;
private String userId; private String userId;
private String dangerIds;
} }
package com.yeejoin.amos.latentdanger.business.param; package com.yeejoin.amos.latentdanger.business.param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
/**
* @author DELL
*/
public class PageParam<K, V> extends HashMap<K, V> implements Pageable { public class PageParam<K, V> extends HashMap<K, V> implements Pageable {
/** /**
* 页号(大于等于0) * 页号(大于等于0)
*/ */
protected int pageNumber = 0; protected int current = 1;
/** /**
* 每页大小(大于等于0) * 每页大小(大于等于0)
*/ */
protected int pageSize = 10; protected int size = 10;
/** /**
* 起始索引 * 起始索引
...@@ -28,70 +34,65 @@ public class PageParam<K, V> extends HashMap<K, V> implements Pageable { ...@@ -28,70 +34,65 @@ public class PageParam<K, V> extends HashMap<K, V> implements Pageable {
protected Sort sort = null; protected Sort sort = null;
public PageParam() { public PageParam() {
this.pageNumber = 0; this.current = 1;
this.pageSize = 10; this.size = 10;
this.offset = pageSize * pageNumber; this.offset = size * current;
} }
public PageParam(int pageNumber, int pageSize) { public PageParam(int pageNumber, int size) {
this.pageNumber = pageNumber; this.current = pageNumber;
this.pageSize = pageSize; this.size = size;
this.offset = pageSize * pageNumber; this.offset = size * pageNumber;
} }
public PageParam(int pageNumber, int pageSize, Sort sort) { public PageParam(int pageNumber, int size, Sort sort) {
this.pageNumber = pageNumber; this.current = pageNumber;
this.pageSize = pageSize; this.size = size;
this.sort = sort; this.sort = sort;
this.offset = pageSize * pageNumber; this.offset = size * pageNumber;
} }
public void setSize(int size) {
this.size = size;
}
@Override
public int getPageNumber() { public int getPageNumber() {
return this.pageNumber; return 0;
} }
@Override
public int getPageSize() { public int getPageSize() {
return pageSize; return 0;
} }
@Override
public long getOffset() { public long getOffset() {
offset = pageSize * pageNumber; return 0;
return offset;
} }
@Override
public Sort getSort() { public Sort getSort() {
return sort; return null;
} }
@Override
public Pageable next() { public Pageable next() {
return null; return null;
} }
@Override
public Pageable previousOrFirst() { public Pageable previousOrFirst() {
return null; return null;
} }
@Override
public Pageable first() { public Pageable first() {
return null; return null;
} }
@Override
public boolean hasPrevious() { public boolean hasPrevious() {
return false; return false;
} }
public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public void setOffset(int offset) {
this.offset = offset;
}
} }
...@@ -12,6 +12,7 @@ import com.google.common.collect.Maps; ...@@ -12,6 +12,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
...@@ -55,6 +56,7 @@ import com.yeejoin.amos.latentdanger.common.enums.LatentDangerExecuteTypeEnum; ...@@ -55,6 +56,7 @@ import com.yeejoin.amos.latentdanger.common.enums.LatentDangerExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerOvertimeStateEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerOvertimeStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerTypeEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerTypeEnum;
import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService; import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService;
...@@ -66,7 +68,6 @@ import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse; ...@@ -66,7 +68,6 @@ import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse;
import com.yeejoin.amos.latentdanger.core.util.StringUtil; import com.yeejoin.amos.latentdanger.core.util.StringUtil;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger; import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDangerFlowRecord; import com.yeejoin.amos.latentdanger.dao.entity.LatentDangerFlowRecord;
import com.yeejoin.amos.latentdanger.exception.YeeException;
import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService; import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService;
import com.yeejoin.amos.latentdanger.mqtt.WebMqttComponent; import com.yeejoin.amos.latentdanger.mqtt.WebMqttComponent;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -85,6 +86,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -85,6 +86,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -92,7 +94,6 @@ import java.util.Arrays; ...@@ -92,7 +94,6 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -166,6 +167,9 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -166,6 +167,9 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
private WorkflowExcuteServiceImpl workflowExecuteService;
@Autowired
private WorkflowFeignService workflowFeignService; private WorkflowFeignService workflowFeignService;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -218,17 +222,19 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -218,17 +222,19 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public CommonResponse savePatrol(List<LatentDangerDto> latentDangerDtoList, String userId, String userRealName, public List<LatentDanger> savePatrol(List<LatentDangerDto> latentDangerDtoList, String userId,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) throws IllegalAccessException, InstantiationException { String userRealName,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) throws Exception {
if (ValidationUtil.isEmpty(latentDangerDtoList)) { if (ValidationUtil.isEmpty(latentDangerDtoList)) {
return CommonResponseUtil.success(); throw new Exception("参数有误");
} }
// 获取业务类型枚举 // 获取业务类型枚举
String bizType = redisUtils.get(Constants.DANGER_BIZ_TYPE_KEY).toString();
LatentDangerBizTypeEnum bizTypeEnum = LatentDangerBizTypeEnum bizTypeEnum =
LatentDangerBizTypeEnum.getByCode(latentDangerDtoList.get(0).getBizType()); LatentDangerBizTypeEnum.getByCode(bizType);
if (ValidationUtil.isEmpty(bizTypeEnum)) { if (ValidationUtil.isEmpty(bizTypeEnum)) {
return CommonResponseUtil.failure("业务类型有误"); throw new Exception("业务类型有误");
} }
List<LatentDanger> dangerList = Lists.newArrayList(); List<LatentDanger> dangerList = Lists.newArrayList();
...@@ -236,13 +242,13 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -236,13 +242,13 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
String businessKey = RandomUtil.buildOrderNo(); String businessKey = RandomUtil.buildOrderNo();
LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(param.getDangerLevel()); LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(param.getDangerLevel());
if (levelEnum == null) { if (levelEnum == null) {
return CommonResponseUtil.failure("隐患等级参数有误"); throw new Exception("隐患等级参数有误");
} }
LatentDangerTypeEnum dangerTypeEnum = LatentDangerTypeEnum dangerTypeEnum =
LatentDangerTypeEnum.getByCode(latentDangerDtoList.get(0).getCheckMode()); LatentDangerTypeEnum.getByCode(latentDangerDtoList.get(0).getCheckMode());
if (ValidationUtil.isEmpty(dangerTypeEnum)) { if (ValidationUtil.isEmpty(dangerTypeEnum)) {
return CommonResponseUtil.failure("检查类型参数有误"); throw new Exception("检查类型参数有误");
} }
// 保存隐患 // 保存隐患
...@@ -262,16 +268,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -262,16 +268,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
logger.info("-------------------------提交隐患时间" + (endDate.getTime() - startDate.getTime())); logger.info("-------------------------提交隐患时间" + (endDate.getTime() - startDate.getTime()));
if (jsonObject == null) { if (jsonObject == null) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return CommonResponseUtil.failure("启动流程失败"); throw new Exception("启动流程失败");
} }
instance = jsonObject.getJSONObject("data"); instance = jsonObject.getJSONObject("data");
if (instance == null) { if (instance == null) {
return CommonResponseUtil.failure("无提交隐患权限"); throw new Exception("无提交隐患权限");
} }
} }
JSONObject flowJson = new JSONObject(); JSONObject flowJson = new JSONObject();
flowJson.put("photoUrls", Joiner.on(",").join(param.getPhotoUrl())); if (!ValidationUtil.isEmpty(param.getPhotoUrl())) {
flowJson.put("photoUrls", Joiner.on(",").join(param.getPhotoUrl()));
}
if (ValidationUtil.isEmpty(param.getId())) { if (ValidationUtil.isEmpty(param.getId())) {
// 第一次保存隐患提交记录 // 第一次保存隐患提交记录
LatentDangerFlowRecord inputRecord = saveFlowRecord(instance.getString("id"), "提交隐患", userId, departmentId, LatentDangerFlowRecord inputRecord = saveFlowRecord(instance.getString("id"), "提交隐患", userId, departmentId,
...@@ -294,7 +302,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -294,7 +302,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
dangerList.add(latentDanger); dangerList.add(latentDanger);
} }
return CommonResponseUtil.success(dangerList); return dangerList;
} }
// TODO 使用远程调用替换 // TODO 使用远程调用替换
...@@ -357,17 +365,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -357,17 +365,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
LatentDangerTypeEnum dangerTypeEnum) { LatentDangerTypeEnum dangerTypeEnum) {
LatentDanger latentDanger = new LatentDanger(); LatentDanger latentDanger = new LatentDanger();
Bean.copyExistPropertis(param, latentDanger); Bean.copyExistPropertis(param, latentDanger);
latentDanger.setDangerName(param.getName());
if (ValidationUtil.isEmpty(param.getId())) { if (ValidationUtil.isEmpty(param.getId())) {
// 新增 // 新增
latentDanger.setBusinessKey(businessKey); latentDanger.setBusinessKey(businessKey);
latentDanger.setDiscovererDepartmentId(departmentId); latentDanger.setDiscovererDepartmentId(departmentId);
latentDanger.setDiscovererUserId(userId); latentDanger.setDiscovererUserId(userId);
latentDanger.setOrgCode(orgCode); latentDanger.setOrgCode(orgCode);
latentDanger.setDangerType(dangerTypeEnum.getCode().toString()); latentDanger.setDangerType(dangerTypeEnum.getCode());
if (!ValidationUtil.isEmpty(param.getName())) { if (ValidationUtil.isEmpty(param.getDangerName())) {
latentDanger.setDangerName(param.getName());
} else {
latentDanger.setDangerName(param.getInputItemName()); latentDanger.setDangerName(param.getInputItemName());
} }
} }
...@@ -494,10 +499,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -494,10 +499,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (0 == latentDangerListParam.getBelongType()) { if (0 == latentDangerListParam.getBelongType()) {
latentDangerListParam.setUserId(null); latentDangerListParam.setUserId(null);
} }
if (-1 == latentDangerListParam.getDangerLevel()) { if (null == latentDangerListParam.getDangerLevel()) {
latentDangerListParam.setDangerLevel(null); latentDangerListParam.setDangerLevel(null);
} }
if (0 == latentDangerListParam.getDangerState()) { if ("0" == latentDangerListParam.getDangerState()) {
latentDangerListParam.setDangerState(null); latentDangerListParam.setDangerState(null);
} }
Date startDate1 = new Date(); Date startDate1 = new Date();
...@@ -611,7 +616,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -611,7 +616,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public DangerExecuteSubmitDto execute(LatentDangerExecuteParam latentDangerExecuteParam, String userId, String userRealName, String departmentId, String departmentName, RoleBo role) { public DangerExecuteSubmitDto execute(LatentDangerExecuteParam latentDangerExecuteParam, String userId, String userRealName, String departmentId, String departmentName, RoleBo role) throws Exception {
DangerExecuteSubmitDto executeSubmitDto = new DangerExecuteSubmitDto(); DangerExecuteSubmitDto executeSubmitDto = new DangerExecuteSubmitDto();
LatentDanger latentDanger = latentDangerMapper.selectById(latentDangerExecuteParam.getDangerId()); LatentDanger latentDanger = latentDangerMapper.selectById(latentDangerExecuteParam.getDangerId());
if (ValidationUtil.isEmpty(latentDanger)) { if (ValidationUtil.isEmpty(latentDanger)) {
...@@ -624,6 +629,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -624,6 +629,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
try { try {
if (dangerExecuteSubmitDto.getIsOk()) { if (dangerExecuteSubmitDto.getIsOk()) {
webMqttComponent.publish(dangerTopic, ""); webMqttComponent.publish(dangerTopic, "");
} else {
throw new Exception(executeSubmitDto.getMsg());
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("隐患执行结果推送失败-----------" + e.getMessage()); logger.error("隐患执行结果推送失败-----------" + e.getMessage());
...@@ -632,84 +639,64 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -632,84 +639,64 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return dangerExecuteSubmitDto; return dangerExecuteSubmitDto;
} }
@Override @Override
public CommonResponse detail(String id, String userId, boolean isFinish) { public ResponseModel<LatentDangerDetailVo> detail(Long dangerId, String userId, boolean isFinish){
LatentDanger danger = this.baseMapper.selectById(id); LatentDanger latentDanger = this.baseMapper.selectById(dangerId);
// danger.getDangerState() // JSONObject jsonObject;
JSONObject jsonObject; // if (isFinish) {
if (isFinish) { // jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id);
jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id); // } else {
} else { // jsonObject = remoteWorkFlowService.queryTaskDetail(id);
jsonObject = remoteWorkFlowService.queryTaskDetail(id); // }
} //
// JSONObject task = jsonObject.getJSONObject("data");
JSONObject task = jsonObject.getJSONObject("data"); // LatentDangerBo latentDangerBo = latentDangerMapper.getByBusinessKey(task.getString("businessKey"));
LatentDangerBo latentDangerBo = latentDangerMapper.getByBusinessKey(task.getString("businessKey"));
// LatentDangerBo latentDangerBo = latentDangerMapper.getByBusinessKey("20210923163838164"); // LatentDangerBo latentDangerBo = latentDangerMapper.getByBusinessKey("20210923163838164");
LatentDangerDetailVo detailVo = new LatentDangerDetailVo(); LatentDangerDetailVo detailVo = new LatentDangerDetailVo();
if (latentDangerBo != null) { if (latentDanger != null) {
detailVo.setId(latentDangerBo.getId()); Bean.copyExistPropertis(latentDanger, detailVo);
detailVo.setBizId(latentDangerBo.getBizId()); LatentDangerTypeEnum dangerTypeEnum = LatentDangerTypeEnum.getByCode(latentDanger.getDangerType());
detailVo.setDangerType(latentDangerBo.getDangerType());
LatentDangerTypeEnum dangerTypeEnum = LatentDangerTypeEnum.getByCode(latentDangerBo.getDangerType());
if (dangerTypeEnum != null) { if (dangerTypeEnum != null) {
detailVo.setDangerTypeName(dangerTypeEnum.getName()); detailVo.setDangerTypeName(dangerTypeEnum.getName());
} }
if (StringUtils.isEmpty(latentDangerBo.getDangerPosition())) { if (StringUtils.isEmpty(latentDanger.getDangerPosition())) {
detailVo.setDangerPosition(latentDangerBo.getStructureName()); detailVo.setDangerPosition(latentDanger.getStructureName());
} else { } else {
detailVo.setDangerPosition(latentDangerBo.getStructureName() + "·" + latentDangerBo.getDangerPosition()); detailVo.setDangerPosition(latentDanger.getStructureName() + "·" + latentDanger.getDangerPosition());
} }
detailVo.setDangerState(latentDangerBo.getDangerState()); LatentDangerStateEnum dangerStateEnum = LatentDangerStateEnum.getByCode(latentDanger.getDangerState());
detailVo.setProblemDescription(latentDangerBo.getProblemDescription());
detailVo.setReasonAnalysis(latentDangerBo.getReasonAnalysis());
detailVo.setInferOtherThings(latentDangerBo.getInferOtherThings());
detailVo.setProblemDescription(latentDangerBo.getProblemDescription());
LatentDangerStateEnum dangerStateEnum = LatentDangerStateEnum.getByCode(latentDangerBo.getDangerState());
if (dangerStateEnum != null) { if (dangerStateEnum != null) {
detailVo.setDangerStateName(dangerStateEnum.getName()); detailVo.setDangerStateName(dangerStateEnum.getName());
} }
detailVo.setName(latentDangerBo.getDangerName()); detailVo.setDangerName(latentDanger.getDangerName());
detailVo.setDangerLevel(latentDangerBo.getDangerLevel()); LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(latentDanger.getDangerLevel());
LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(latentDangerBo.getDangerLevel());
if (levelEnum != null) { if (levelEnum != null) {
detailVo.setDangerLevelName(levelEnum.getName()); detailVo.setDangerLevelName(levelEnum.getName());
} }
detailVo.setRemark(latentDangerBo.getRemark()); if (latentDanger.getReformType() != null) {
if (latentDangerBo.getReformType() != null) { LatentDangerReformTypeEnum typeEnum = LatentDangerReformTypeEnum.getEnumByCode(latentDanger.getReformType());
LatentDangerReformTypeEnum typeEnum = LatentDangerReformTypeEnum.getEnumByCode(latentDangerBo.getReformType());
if (typeEnum != null) { if (typeEnum != null) {
detailVo.setReformTypeName(typeEnum.getName()); detailVo.setReformTypeName(typeEnum.getName());
} }
} }
if (latentDangerBo.getReformLimitDate() != null) { if (!StringUtils.isEmpty(latentDanger.getReformJson())) {
detailVo.setReformLimitDate(DateUtil.date2Str(latentDangerBo.getReformLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT)); detailVo.setReformJson(JSONObject.parseObject(latentDanger.getReformJson()));
}
if (latentDangerBo.getDelayLimitDate() != null) {
detailVo.setDelayLimitDate(DateUtil.date2Str(latentDangerBo.getDelayLimitDate(),
DateUtil.DATETIME_DEFAULT_FORMAT));
} }
detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId()); if (!StringUtils.isEmpty(latentDanger.getPhotoUrls())) {
if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) { List<String> photoUrls = Lists.newArrayList(latentDanger.getPhotoUrls().split(","));
detailVo.setReformJson(JSONObject.parseObject(latentDangerBo.getReformJson())); detailVo.setPhotoUrl(photoUrls);
}
if (!StringUtils.isEmpty(latentDangerBo.getPhotoUrls())) {
List<String> photoUrls = Lists.newArrayList(latentDangerBo.getPhotoUrls().split(","));
detailVo.setPhotoUrls(photoUrls);
} }
if (dangerBizType.equals(LatentDangerBizTypeEnum.巡检.getCode())) { if (dangerBizType.equals(LatentDangerBizTypeEnum.巡检.getCode())) {
buildOfDifferentDangerType(latentDangerBo, detailVo); // buildOfDifferentDangerType(latentDangerBo, detailVo);
} }
detailVo.setTaskId(task.getString("id")); // detailVo.setTaskId(task.getString("id"));
} }
return CommonResponseUtil.success(detailVo); return ResponseHelper.buildResponse(detailVo);
} }
/** /**
...@@ -1030,13 +1017,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1030,13 +1017,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
@Override @Override
public CommonResponse listFlowRecord(String token, String product, String appKey, Long id) { public LatentDangerDetailVo listFlowRecord(String token, String product, String appKey, Long id) throws Exception {
LatentDangerBo latentDangerBo = latentDangerMapper.getById(id); LatentDangerBo latentDangerBo = latentDangerMapper.getById(id);
if (latentDangerBo == null) { if (latentDangerBo == null) {
return CommonResponseUtil.failure("隐患不存在"); throw new Exception("隐患不存在");
} }
LatentDangerDetailVo detailVo = new LatentDangerDetailVo(); LatentDangerDetailVo detailVo = new LatentDangerDetailVo();
detailVo.setName(latentDangerBo.getDangerName());
detailVo.setDangerName(latentDangerBo.getDangerName());
detailVo.setDangerLevel(latentDangerBo.getDangerLevel()); detailVo.setDangerLevel(latentDangerBo.getDangerLevel());
detailVo.setDangerPosition(latentDangerBo.getStructureName()); detailVo.setDangerPosition(latentDangerBo.getStructureName());
LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(latentDangerBo.getDangerLevel()); LatentDangerLevelEnum levelEnum = LatentDangerLevelEnum.getEnumByCode(latentDangerBo.getDangerLevel());
...@@ -1072,7 +1060,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1072,7 +1060,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
detailVo.setRecords(records); detailVo.setRecords(records);
} }
return CommonResponseUtil.success(detailVo); return detailVo;
} }
/** /**
...@@ -1095,7 +1083,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1095,7 +1083,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
String departmentId, String departmentId,
String departmentName, String departmentName,
DangerExecuteSubmitDto executeSubmitDto, DangerExecuteSubmitDto executeSubmitDto,
RoleBo role) { RoleBo role) throws Exception {
// 根据业务类型不同执行不同逻辑 // 根据业务类型不同执行不同逻辑
if (LatentDangerBizTypeEnum.防火监督.getCode().equals(redisUtils.get(Constants.DANGER_BIZ_TYPE_KEY))) { if (LatentDangerBizTypeEnum.防火监督.getCode().equals(redisUtils.get(Constants.DANGER_BIZ_TYPE_KEY))) {
// 防火监督业务 // 防火监督业务
...@@ -1110,13 +1098,67 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1110,13 +1098,67 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return executeSubmitDto; return executeSubmitDto;
} }
private DangerExecuteSubmitDto executeSupervisionBiz(LatentDangerExecuteParam param, LatentDanger latentDanger, String userId, String userRealName, String departmentId, String departmentName, DangerExecuteSubmitDto executeSubmitDto, RoleBo role) { private DangerExecuteSubmitDto executeSupervisionBiz(LatentDangerExecuteParam param, LatentDanger latentDanger, String userId, String userRealName, String departmentId, String departmentName, DangerExecuteSubmitDto executeSubmitDto, RoleBo role) throws Exception {
// 1、开启工作流 // TODO 查询隐患的巡查信息
JSONObject result = workflowFeignService.startByVariable(latentDanger.getId()); String planType = "special";
String taskUserId = "256";
String processInstanceId = latentDanger.getInstanceId();
String dangerState = latentDanger.getDangerState();
String executeResultMsg = "";
String condition = "";
// 第一次处于待现场确认时,启动工作流
if (ValidationUtil.isEmpty(processInstanceId)) {
// 1、开启工作流
JSONObject result = workflowFeignService.startByVariable(workflowProcessDefinitionKey);
if (result == null) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("启动工作流失败");
return executeSubmitDto;
}
latentDanger.setInstanceId((String) result.get("instanceId"));
latentDanger.setUpdateDate(new Date());
latentDanger.setDangerState(LatentDangerState.SupervisionDangerStateEnum.现场确认.getCode());
latentDanger.setDangerStateName(LatentDangerState.SupervisionDangerStateEnum.现场确认.getName());
this.updateById(latentDanger);
executeSubmitDto.setIsOk(true);
executeSubmitDto.setMsg(latentDanger.getDangerStateName());
return executeSubmitDto;
}
if (LatentDangerState.SupervisionDangerStateEnum.现场确认.getCode().equals(latentDanger.getDangerState())) {
condition = planType;
} else {
condition = param.getExecuteType().toString();
}
// 执行任务(带权限校验)
workflowExecuteService.CompleteTask(processInstanceId, condition);
// 当隐患状态是现场确认时,在执行完节点后需要将检查组长id设置为下个节点执行人
if (LatentDangerState.SupervisionDangerStateEnum.现场确认.getCode().equals(dangerState)) {
Object result = workflowExecuteService.setTaskAssign(processInstanceId, taskUserId);
if (!(Boolean) result) {
executeSubmitDto.setIsOk(false);
executeResultMsg = "设置节点执行人失败";
}
}
if (LatentDangerState.SupervisionDangerStateEnum.整改检查分管领导确认.getCode().equals(dangerState)
|| LatentDangerState.SupervisionDangerStateEnum.整改二次审核确认.getCode().equals(dangerState)) {
latentDanger.setDangerState(LatentDangerState.SupervisionDangerStateEnum.整改完毕.getCode());
latentDanger.setDangerStateName(LatentDangerState.SupervisionDangerStateEnum.整改完毕.getName());
executeResultMsg = latentDanger.getDangerStateName();
}
this.updateById(latentDanger);
executeSubmitDto.setIsOk(true);
executeSubmitDto.setMsg(executeResultMsg);
return executeSubmitDto; return executeSubmitDto;
} }
public DangerExecuteSubmitDto executePatrolBiz(LatentDangerExecuteParam param, LatentDanger latentDanger, String userId, String userRealName, String departmentId, String departmentName, DangerExecuteSubmitDto executeSubmitDto, RoleBo role) { private DangerExecuteSubmitDto executePatrolBiz(LatentDangerExecuteParam param, LatentDanger latentDanger, String userId, String userRealName, String departmentId, String departmentName, DangerExecuteSubmitDto executeSubmitDto, RoleBo role) {
if (StringUtil.isNotEmpty(param.getReformLimitDate())) { if (StringUtil.isNotEmpty(param.getReformLimitDate())) {
param.setReformLimitDate(param.getReformLimitDate() + " 23:59:59"); param.setReformLimitDate(param.getReformLimitDate() + " 23:59:59");
} }
...@@ -1159,26 +1201,26 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1159,26 +1201,26 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
JSONObject data = executeJson.getJSONObject("data"); JSONObject data = executeJson.getJSONObject("data");
if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.已撤销)) { if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.已撤销)) {
latentDanger.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDanger.setDangerState(executeTypeEnum.getNextState().getCode());
saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark()); param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark());
} else if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.治理完毕)) { } else if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.治理完毕)) {
latentDanger.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDanger.setDangerState(executeTypeEnum.getNextState().getCode());
saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark()); param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark());
} else { } else {
LatentDangerFlowRecord flowRecord = saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, LatentDangerFlowRecord flowRecord = saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark()); param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(), param.getRemark());
latentDanger.setCurrentFlowRecordId(flowRecord.getId()); latentDanger.setCurrentFlowRecordId(flowRecord.getId());
latentDanger.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDanger.setDangerState(executeTypeEnum.getNextState().getCode());
if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患常规治理)) { if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患常规治理)) {
latentDanger.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString()); latentDanger.setReformType(LatentDangerReformTypeEnum.常规整改.getCode());
latentDanger.setReformJson(param.getFlowJson().toJSONString()); latentDanger.setReformJson(param.getFlowJson().toJSONString());
latentDanger.setInferOtherThings(param.getInferOtherThings()); latentDanger.setInferOtherThings(param.getInferOtherThings());
latentDanger.setProblemDescription(param.getReasonAnalysis()); latentDanger.setProblemDescription(param.getReasonAnalysis());
latentDanger.setReasonAnalysis(param.getRemark()); latentDanger.setReasonAnalysis(param.getRemark());
} else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理)) { } else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理)) {
latentDanger.setReformType(LatentDangerReformTypeEnum.延期治理.getCode().toString()); latentDanger.setReformType(LatentDangerReformTypeEnum.延期治理.getCode());
latentDanger.setReformJson(param.getFlowJson().toJSONString()); latentDanger.setReformJson(param.getFlowJson().toJSONString());
latentDanger.setInferOtherThings(param.getInferOtherThings()); latentDanger.setInferOtherThings(param.getInferOtherThings());
latentDanger.setProblemDescription(param.getReasonAnalysis()); latentDanger.setProblemDescription(param.getReasonAnalysis());
...@@ -1193,10 +1235,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1193,10 +1235,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理车间部门审核通过)) { if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理车间部门审核通过)) {
// 延期治理评审通过且 不需要 公司审核 // 延期治理评审通过且 不需要 公司审核
if (param.getNeedCompanyVerify() == 0) { if (param.getNeedCompanyVerify() == 0) {
latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString()); latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请.getCode());
latentDanger.setReformLimitDate(latentDanger.getDelayLimitDate()); latentDanger.setReformLimitDate(latentDanger.getDelayLimitDate());
} else {// 延期治理评审通过且 需要 公司审核 } else {// 延期治理评审通过且 需要 公司审核
latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请待公司审核.getCode().toString()); latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请待公司审核.getCode());
LatentDangerFlowRecordBo recordBo = LatentDangerFlowRecordBo recordBo =
latentDangerFlowRecordMapper.getByDangerIdAndCreate(latentDanger.getId()); latentDangerFlowRecordMapper.getByDangerIdAndCreate(latentDanger.getId());
String flowJsonStr = recordBo.getFlowJson(); String flowJsonStr = recordBo.getFlowJson();
...@@ -1206,12 +1248,12 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1206,12 +1248,12 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
latentDangerFlowRecordMapper.update(recordBo); latentDangerFlowRecordMapper.update(recordBo);
} }
} else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理车间部门审核拒绝)) { } else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理车间部门审核拒绝)) {
latentDanger.setDangerState(LatentDangerStateEnum.待治理.getCode().toString()); latentDanger.setDangerState(LatentDangerStateEnum.待治理.getCode());
} else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理公司审核通过)) { } else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理公司审核通过)) {
latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString()); latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请.getCode());
latentDanger.setReformLimitDate(latentDanger.getDelayLimitDate()); latentDanger.setReformLimitDate(latentDanger.getDelayLimitDate());
} else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理公司审核拒绝)) { } else if (executeTypeEnum.equals(LatentDangerExecuteTypeEnum.隐患延期治理公司审核拒绝)) {
latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请待车间部门审核.getCode().toString()); latentDanger.setDangerState(LatentDangerStateEnum.延期治理申请待车间部门审核.getCode());
} }
latentDangerMapper.updateById(latentDanger); latentDangerMapper.updateById(latentDanger);
if (patrolBo != null) { if (patrolBo != null) {
...@@ -1504,13 +1546,13 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1504,13 +1546,13 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
List<String> dangerIdList = Lists.newArrayList(idsStr.split(",")); List<String> dangerIdList = Lists.newArrayList(idsStr.split(","));
pageParam.put("dangerIds", dangerIdList); pageParam.put("dangerIds", dangerIdList);
} }
if (StringUtil.isNotEmpty(pageParam.get("pageNumber")) && StringUtil.isNotEmpty(pageParam.get("pageSize"))) { // if (StringUtil.isNotEmpty(pageParam.get("current")) && StringUtil.isNotEmpty(pageParam.get("size"))) {
int offSet = (int) pageParam.get("pageNumber") * (int) pageParam.get("pageSize"); // int offSet = (int) pageParam.get("current") * (int) pageParam.get("size");
pageParam.put("offset", offSet); // pageParam.put("offset", offSet);
} // }
// 获取隐患地点的子节点 // 获取隐患地点的子节点
Object structureId = pageParam.get("structureId"); Object structureId = pageParam.get("structureId");
List<Long> structureIdList = null; List<Long> structureIdList = Lists.newArrayList();
if (structureId != null && structureId.toString().trim().length() > 0) { if (structureId != null && structureId.toString().trim().length() > 0) {
ResponseModel<Object> response = equipFeign.getBuildingTree(); ResponseModel<Object> response = equipFeign.getBuildingTree();
List<Map<String, Object>> buildingTree = (List<Map<String, Object>>) response.getResult(); List<Map<String, Object>> buildingTree = (List<Map<String, Object>>) response.getResult();
...@@ -1519,19 +1561,19 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1519,19 +1561,19 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
structureIdList = findBuildChildrenIds(node); structureIdList = findBuildChildrenIds(node);
} }
} }
pageParam.put("structureId", structureIdList);
IPage<LatentDanger> page = new Page<>((Integer) pageParam.get("pageNumber"), IPage<LatentDanger> page = new Page<>(Integer.parseInt((String) pageParam.get("current")),
(Integer) pageParam.get("pageSize")); Integer.parseInt((String) pageParam.get("size")));
page = latentDangerMapper.selectPage(page, LambdaQueryWrapper<LatentDanger> queryWrapper = new LambdaQueryWrapper();
new LambdaQueryWrapper<LatentDanger>().like(ValidationUtil.isEmpty(pageParam.get("name")), queryWrapper.like(!ValidationUtil.isEmpty(pageParam.get("name")),
LatentDanger::getDangerName, LatentDanger::getDangerName, pageParam.get("name"))
pageParam.get("name")).eq(ValidationUtil.isEmpty(pageParam.get("dangerLevel")), .eq(!ValidationUtil.isEmpty(pageParam.get("dangerLevel")), LatentDanger::getDangerLevel,
LatentDanger::getDangerLevel, pageParam.get("dangerLevel")).
pageParam.get("dangerLevel")).eq(ValidationUtil.isEmpty(pageParam.get("dangerState")), eq(!ValidationUtil.isEmpty(pageParam.get("dangerState")), LatentDanger::getDangerState,
LatentDanger pageParam.get("dangerState"))
::getDangerState, pageParam.get("dangerState"))); .eq(LatentDanger::getDeleted, false)
return page; .in(!ValidationUtil.isEmpty(structureIdList), LatentDanger::getStructureId, structureIdList);
return latentDangerMapper.selectPage(page, queryWrapper);
// List<DangerListResponse> dangerListResponseList = latentDangerMapper.dangerListByMap(pageParam); // List<DangerListResponse> dangerListResponseList = latentDangerMapper.dangerListByMap(pageParam);
// Map<Long, String> buildingAbsolutePositionMap = new HashMap<>(); // Map<Long, String> buildingAbsolutePositionMap = new HashMap<>();
...@@ -1645,4 +1687,35 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1645,4 +1687,35 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
return informerList; return informerList;
} }
@Override
public List<LatentDanger> listAllDanger(LatentDangerListParam searchParam) {
String bizType = redisUtils.get(Constants.DANGER_BIZ_TYPE_KEY).toString();
LambdaQueryWrapper<LatentDanger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(LatentDanger::getBizType, bizType);
lambdaQueryWrapper.eq(LatentDanger::getDeleted, false);
lambdaQueryWrapper.eq(!ValidationUtil.isEmpty(searchParam.getDangerState()), LatentDanger::getDangerState,
searchParam.getDangerState());
lambdaQueryWrapper.like(!ValidationUtil.isEmpty(searchParam.getDangerName()), LatentDanger::getDangerName,
searchParam.getDangerName());
lambdaQueryWrapper.eq(!ValidationUtil.isEmpty(searchParam.getDangerLevel()), LatentDanger::getDangerLevel,
searchParam.getDangerLevel());
if (!ValidationUtil.isEmpty(searchParam.getDangerIds())) {
lambdaQueryWrapper.in(LatentDanger::getId, Lists.newArrayList(searchParam.getDangerIds().split(",")));
}
return this.baseMapper.selectList(lambdaQueryWrapper);
}
@Override
public Boolean delete(String ids) throws Exception {
List<Long> dangerIdList =
Arrays.stream(ids.split(",")).mapToLong(Long::parseLong).boxed().collect(Collectors.toList());
LambdaQueryWrapper<LatentDanger> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(LatentDanger::getId, dangerIdList).isNull(LatentDanger::getInstanceId);
List<LatentDanger> dangerList = this.baseMapper.selectList(queryWrapper);
if (dangerIdList.size() != dangerList.size()) {
throw new Exception("执行中隐患不能删除");
}
return this.deleteBatchSeq(dangerIdList);
}
} }
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
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;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger; import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -22,6 +23,7 @@ import com.yeejoin.amos.latentdanger.business.param.LatentDangerPatrolParam; ...@@ -22,6 +23,7 @@ import com.yeejoin.amos.latentdanger.business.param.LatentDangerPatrolParam;
import com.yeejoin.amos.latentdanger.business.util.CommonResponse; import com.yeejoin.amos.latentdanger.business.util.CommonResponse;
import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo; import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse; import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/** /**
* @author keyong * @author keyong
...@@ -36,8 +38,8 @@ public interface ILatentDangerService { ...@@ -36,8 +38,8 @@ public interface ILatentDangerService {
CommonResponse saveNormal(LatentDangerNormalParam latentDangerParam, String userId, String userRealName, CommonResponse saveNormal(LatentDangerNormalParam latentDangerParam, String userId, String userRealName,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role); String departmentId, String departmentName, String companyId, String orgCode, RoleBo role);
CommonResponse savePatrol(List<LatentDangerDto> latentDangerDtoList, String userId, String userRealName, List<LatentDanger> savePatrol(List<LatentDangerDto> latentDangerDtoList, String userId, String userRealName,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) throws IllegalAccessException, InstantiationException; String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) throws Exception;
CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId); CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId);
...@@ -53,9 +55,9 @@ public interface ILatentDangerService { ...@@ -53,9 +55,9 @@ public interface ILatentDangerService {
* @return * @return
*/ */
DangerExecuteSubmitDto execute(LatentDangerExecuteParam latentDangerExecuteParam, String userId, DangerExecuteSubmitDto execute(LatentDangerExecuteParam latentDangerExecuteParam, String userId,
String userRealName, String departmentId, String departmentName, RoleBo role); String userRealName, String departmentId, String departmentName, RoleBo role) throws Exception;
CommonResponse detail(String id, String userId,boolean isFinish); ResponseModel<LatentDangerDetailVo> detail(Long dangerId, String userId, boolean isFinish) throws Exception;
CommonResponse getByInstanceId(String instanceId); CommonResponse getByInstanceId(String instanceId);
...@@ -64,7 +66,7 @@ public interface ILatentDangerService { ...@@ -64,7 +66,7 @@ public interface ILatentDangerService {
void updateDangerStateOfOvertime(); void updateDangerStateOfOvertime();
CommonResponse listFlowRecord(String token, String product, String appKey, Long id); LatentDangerDetailVo listFlowRecord(String token, String product, String appKey, Long id) throws Exception;
void sendLatentDangerExecuteResult(DangerExecuteSubmitDto executeSubmitDto); void sendLatentDangerExecuteResult(DangerExecuteSubmitDto executeSubmitDto);
...@@ -106,4 +108,19 @@ public interface ILatentDangerService { ...@@ -106,4 +108,19 @@ public interface ILatentDangerService {
List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime); List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime);
/**
* 查询所有隐患列表
*
* @param searchParam
* @return
*/
List<LatentDanger> listAllDanger(LatentDangerListParam searchParam);
/**
* 根据ids(逗号分割)删除隐患
*
* @param ids
* @return
*/
Boolean delete(String ids) throws Exception;
} }
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.latentdanger.business.entity.mybatis.extend.LatentDangerFlowRecordBo; import com.yeejoin.amos.latentdanger.business.entity.mybatis.extend.LatentDangerFlowRecordBo;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -14,7 +15,7 @@ public class LatentDangerDetailVo { ...@@ -14,7 +15,7 @@ public class LatentDangerDetailVo {
private Long id; private Long id;
private String name; private String dangerName;
private Long bizId; private Long bizId;
...@@ -28,7 +29,7 @@ public class LatentDangerDetailVo { ...@@ -28,7 +29,7 @@ public class LatentDangerDetailVo {
private String reformTypeName; private String reformTypeName;
private String reformLimitDate; private Date reformLimitDate;
private JSONObject reformJson; private JSONObject reformJson;
...@@ -42,9 +43,21 @@ public class LatentDangerDetailVo { ...@@ -42,9 +43,21 @@ public class LatentDangerDetailVo {
private String dangerTypeName; private String dangerTypeName;
private Boolean currentUserCanExcute; private String checkMode;
private List<String> photoUrls; public String getCheckMode() {
return this.dangerType;
}
private String checkModeName;
public String getCheckModeName() {
return this.dangerTypeName;
}
private Boolean currentUserCanExecute;
private List<String> photoUrl;
private LatentDangerDetailRiskVo riskInfo; private LatentDangerDetailRiskVo riskInfo;
...@@ -56,7 +69,7 @@ public class LatentDangerDetailVo { ...@@ -56,7 +69,7 @@ public class LatentDangerDetailVo {
private List<LatentDangerFlowRecordBo> records; private List<LatentDangerFlowRecordBo> records;
private String delayLimitDate; private Date delayLimitDate;
private String problemDescription; private String problemDescription;
......
...@@ -6,7 +6,6 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; ...@@ -6,7 +6,6 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.latentdanger.business.constants.Constants; import com.yeejoin.amos.latentdanger.business.constants.Constants;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
...@@ -65,10 +64,10 @@ public class EnumFillAop { ...@@ -65,10 +64,10 @@ public class EnumFillAop {
dicResult.forEach(dic -> LatentDangerReformTypeEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey())); dicResult.forEach(dic -> LatentDangerReformTypeEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey()));
} }
// 获取治理状态枚举 // 获取治理状态枚举
if (ValidationUtil.isEmpty(LatentDangerStateEnum.enumMap)) { // if (ValidationUtil.isEmpty(LatentDangerStateEnum.enumMap)) {
List<DictionarieValueModel> dicResult = // List<DictionarieValueModel> dicResult =
Systemctl.dictionarieClient.dictValues(bizType + LatentDangerStateEnum.dictCode).getResult(); // Systemctl.dictionarieClient.dictValues(bizType + LatentDangerStateEnum.dictCode).getResult();
dicResult.forEach(dic -> LatentDangerStateEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey())); // dicResult.forEach(dic -> LatentDangerStateEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey()));
} // }
} }
} }
...@@ -19,7 +19,7 @@ public class LatentDangerScheduled { ...@@ -19,7 +19,7 @@ public class LatentDangerScheduled {
/** /**
* 每1分钟执行一次:查询逾期的隐患,修改状态 * 每1分钟执行一次:查询逾期的隐患,修改状态
*/ */
@Scheduled(cron = "0 0/1 * * * ?") // @Scheduled(cron = "0 0/1 * * * ?")
public void updateDangerStateOfOvertime() { public void updateDangerStateOfOvertime() {
iLatentDangerService.updateDangerStateOfOvertime(); iLatentDangerService.updateDangerStateOfOvertime();
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="DEBUG"> <root level="DEBUG">
<!--<appender-ref ref="FILE" /> --> <appender-ref ref="FILE" />
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
</configuration> </configuration>
\ No newline at end of file
...@@ -3,7 +3,7 @@ spring.datasource.url = jdbc:mysql://172.16.11.20:3306/amos-supervision_v1.0?use ...@@ -3,7 +3,7 @@ spring.datasource.url = jdbc:mysql://172.16.11.20:3306/amos-supervision_v1.0?use
spring.datasource.username= root spring.datasource.username= root
spring.datasource.password= root_123 spring.datasource.password= root_123
## eureka properties: ## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
security.password=a1234560 security.password=a1234560
security.loginId=jc_wjk006 security.loginId=jc_wjk006
...@@ -12,10 +12,10 @@ security.productApp=STUDIO_APP_MOBILE ...@@ -12,10 +12,10 @@ security.productApp=STUDIO_APP_MOBILE
security.appKey=studio_normalapp_3168830 security.appKey=studio_normalapp_3168830
#redis 配置 #redis 配置
spring.redis.database=1 spring.redis.database=0
spring.redis.host=172.16.11.20 spring.redis.host=172.16.10.85
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=1234560 spring.redis.password=amos2019Redis
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
......
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