Commit 55d23f0e authored by xinglei's avatar xinglei

*)增加计划审核完成方法

parent 8409ca89
...@@ -8,7 +8,8 @@ package com.yeejoin.amos.boot.biz.common.enums; ...@@ -8,7 +8,8 @@ package com.yeejoin.amos.boot.biz.common.enums;
public enum RuleTypeEnum { public enum RuleTypeEnum {
// 防火监督 // 防火监督
计划提交("计划提交", "addPlan","auditPage"), 计划提交("计划提交", "addPlan","auditPage"),
计划审核("计划审核", "planAudit", ""), 计划审核("计划审核", "planAudit", "auditPage"),
计划审核完成("计划审核完成", "planAuditAll", "formulatePage"),
计划生成("计划生成", "addPlanTask", null), 计划生成("计划生成", "addPlanTask", null),
计划完成("计划完成", "planCompleted", null), 计划完成("计划完成", "planCompleted", null),
......
package com.yeejoin.amos.boot.biz.common.utils; package com.yeejoin.amos.boot.biz.common.utils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Map; import java.util.Map;
...@@ -14,7 +15,7 @@ public class RuleUtils { ...@@ -14,7 +15,7 @@ public class RuleUtils {
public static String instedParams(String content, Object msgObj) { public static String instedParams(String content, Object msgObj) {
Map<String, Object> strengthMap = JSON.parseObject(JSON.toJSONString(msgObj), Map.class); Map<String, Object> strengthMap = JSON.parseObject(JSON.toJSONString(msgObj), Map.class);
for (String key : strengthMap.keySet()) for (String key : strengthMap.keySet())
content = content.replaceAll("\\$\\{" + key + "}", String.valueOf(strengthMap.get(key))); content = content.replaceAll("\\$\\{" + key + "}", String.valueOf(ValidationUtil.isEmpty(strengthMap.get(key)) ? "" : strengthMap.get(key)));
return content; return content;
} }
} }
...@@ -35,51 +35,51 @@ public interface LatentDangerState { ...@@ -35,51 +35,51 @@ public interface LatentDangerState {
/** /**
* 提交隐患 * 提交隐患
*/ */
提交隐患("提交隐患", "dangerSubmit", null, null, "0"), 提交隐患("提交隐患", "dangerSubmit", null, null, "0", ""),
/** /**
* 现场确认 * 现场确认
*/ */
现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "1"), 现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "1", ""),
/** /**
* 检查组长确认 * 检查组长确认
*/ */
检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "1"), 检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "1", ""),
/** /**
* 隐患二次审核确认 * 隐患二次审核确认
*/ */
隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "1"), 隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "1", ""),
/** /**
* 整改任务分配 * 整改任务分配
*/ */
整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "2"), 整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "2", "allotRecordPage"),
/** /**
* 提交整改资料 * 提交整改资料
*/ */
提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "3"), 提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "3", "rectifyRecordPage"),
/** /**
* 整改检查组长确认 * 整改检查组长确认
*/ */
整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "4"), 整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查负责人确认 * 整改检查负责人确认
*/ */
整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "4"), 整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同) * 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同)
*/ */
整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "4"), 整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查组长复查确认 * 整改检查组长复查确认
*/ */
整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "4"), 整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改二次审核确认 * 整改二次审核确认
*/ */
整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "4"), 整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改完毕 * 整改完毕
*/ */
整改完毕("整改完毕", "endOfGovernance", "","", "5"); 整改完毕("整改完毕", "endOfGovernance", "","", "5", "auditRecordPage");
/** /**
* 名称,描述 * 名称,描述
...@@ -106,12 +106,18 @@ public interface LatentDangerState { ...@@ -106,12 +106,18 @@ public interface LatentDangerState {
*/ */
private String processState; private String processState;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState) { /**
* 跳转页面
*/
private String url;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState, String url) {
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; this.processState = processState;
this.url = url;
} }
public String getName() { public String getName() {
...@@ -153,6 +159,14 @@ public interface LatentDangerState { ...@@ -153,6 +159,14 @@ public interface LatentDangerState {
this.processState = processState; this.processState = processState;
} }
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
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())) {
...@@ -173,6 +187,17 @@ public interface LatentDangerState { ...@@ -173,6 +187,17 @@ public interface LatentDangerState {
return enumName; return enumName;
} }
public static String getEnumUrlByCode(String code) {
String enumUrl = "";
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getCode().equals(code)) {
enumUrl = type.getUrl();
break;
}
}
return enumUrl;
}
public static List<Map<String, String>> getEnumList() { public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> enumList = Lists.newArrayList(); List<Map<String, String>> enumList = Lists.newArrayList();
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) { for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
......
...@@ -31,6 +31,9 @@ public class LatentDangerRo implements Serializable { ...@@ -31,6 +31,9 @@ public class LatentDangerRo implements Serializable {
@Label(value = "整改类型名称") @Label(value = "整改类型名称")
private String reformTypeName; private String reformTypeName;
@Label(value = "隐患状态")
private String dangerState;
@Label(value = "隐患状态名称") @Label(value = "隐患状态名称")
private String dangerStateName; private String dangerStateName;
......
...@@ -39,6 +39,7 @@ public class RuleDangerService { ...@@ -39,6 +39,7 @@ public class RuleDangerService {
public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception { public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType); LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
latentDangerRo.setTerminal(APP);
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult(); List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) { if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult(); List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult();
...@@ -52,10 +53,15 @@ public class RuleDangerService { ...@@ -52,10 +53,15 @@ public class RuleDangerService {
public Boolean addDangerSubmitRule(LatentDanger latentDanger, List<String> userIds, String ruleType, String excuteStateName) throws Exception { public Boolean addDangerSubmitRule(LatentDanger latentDanger, List<String> userIds, String ruleType, String excuteStateName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType); LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
Map<String, String> extras = !ValidationUtil.isEmpty(latentDangerRo.getExtras()) ? latentDangerRo.getExtras() : new HashMap<>();
// 跳转url
String url = LatentDangerState.SupervisionDangerStateEnum.getEnumUrlByCode(latentDanger.getDangerState());
extras.put("url", url);
latentDangerRo.setExtras(extras);
latentDangerRo.setExcuteStateName(excuteStateName); latentDangerRo.setExcuteStateName(excuteStateName);
latentDangerRo.setIsSendWeb(true); latentDangerRo.setIsSendWeb(true);
latentDangerRo.setRecivers(userIds); latentDangerRo.setRecivers(userIds);
latentDangerRo.setTerminal(APP_WEB);
//触发规则 //触发规则
ruleTrigger.publish(latentDangerRo, packageId, new String[0]); ruleTrigger.publish(latentDangerRo, packageId, new String[0]);
return true; return true;
...@@ -75,7 +81,7 @@ public class RuleDangerService { ...@@ -75,7 +81,7 @@ public class RuleDangerService {
LatentDangerState.SupervisionDangerStateEnum stateEnum = LatentDangerState.SupervisionDangerStateEnum stateEnum =
LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(latentDanger.getDangerState()); LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(latentDanger.getDangerState());
if (!ValidationUtil.isEmpty(stateEnum)) { if (!ValidationUtil.isEmpty(stateEnum)) {
if (stateEnum.getProcessState().equals("1")) { if (stateEnum.getProcessState().equals("0") || stateEnum.getProcessState().equals("1")) {
type = "1"; type = "1";
} else if (stateEnum.getProcessState().equals("4")) { } else if (stateEnum.getProcessState().equals("4")) {
type = "2"; type = "2";
......
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -1619,6 +1620,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1619,6 +1620,7 @@ public class CheckServiceImpl implements ICheckService {
} }
}); });
// 1.feign调用保存隐患 // 1.feign调用保存隐患
log.info(String.format("隐患参数:%s", JSON.toJSONString(allDanger)));
FeignClientResult<List<DangerDto>> listFeignClientResult = DangerFeignClient.saveOrUpdateBatch(allDanger); FeignClientResult<List<DangerDto>> listFeignClientResult = DangerFeignClient.saveOrUpdateBatch(allDanger);
if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) { if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(listFeignClientResult.getDevMessage()); throw new RuntimeException(listFeignClientResult.getDevMessage());
......
...@@ -230,7 +230,11 @@ public class PlanServiceImpl implements IPlanService { ...@@ -230,7 +230,11 @@ public class PlanServiceImpl implements IPlanService {
if (ValidationUtil.isEmpty(status)){ if (ValidationUtil.isEmpty(status)){
rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交); // 计划提交 rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交); // 计划提交
} else { } else {
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核 if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核
} else {
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核完成, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核完成
}
} }
} catch (Exception e) { } catch (Exception e) {
log.info("规则调用失败"); log.info("规则调用失败");
......
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