Commit 2f554c53 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 2d57e853 450b2e29
package com.yeejoin.amos.boot.biz.common.constants;
/**
* @Description: 业务通用常量类
* @Author: DELL
* @Date: 2021/5/26
*/
public interface BizConstant {
/**
* 经度
*/
public final static String LONGITUDE = "longitude";
/**
* 纬度
*/
public final static String LATITUDE = "latitude";
/**
* 地址
*/
public final static String ADDRESS = "address";
}
......@@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
*
*
* @param params
* @return
*/
......@@ -24,7 +24,7 @@ public interface WorkflowFeignService {
/**
* 完成任务
*
*
* @param taskID
* @param variable
* @return
......@@ -36,7 +36,7 @@ public interface WorkflowFeignService {
/**
* 查询当前流程下所有的可执行任务
*
*
* @param processInstanceId
* @return
*/
......@@ -45,13 +45,13 @@ public interface WorkflowFeignService {
/**
* 查询当前任务的执行用户组
*
*
* @param processInstanceId
* @return
*/
@RequestMapping(value = "/task/getTaskGroupName/{taskId}", method = RequestMethod.GET)
JSONObject getTaskGroupName(@PathVariable("taskId") String taskId);
/**
* 我的待办
* @param processDefinitionKey
......@@ -74,7 +74,7 @@ public interface WorkflowFeignService {
* @param processInstanceId
* @return
*/
@RequestMapping(value = "/activitiHistory/tasks/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryTasksByProcessInstanceId(@PathVariable("processInstanceId") String processInstanceId);
@RequestMapping(value = "/activitiHistory/historyTask/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryHistoryTasksByProcessInstanceId(@PathVariable("processInstanceId") String processInstanceId);
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerExcuteTypeEnum {
填写隐患完成("填写隐患完成", 1, ExecuteStateEnum.通过, LatentDangerStateEnum.待评审,
"{\"action\": \"complete\"}"),
隐患评审通过("隐患评审通过", 2, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"reviewResult\": \"通过\"}"),
隐患评审拒绝("隐患评审拒绝", 3, ExecuteStateEnum.驳回, LatentDangerStateEnum.已撤销,
"{\"reviewResult\": \"不通过\"}"),
隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证,
"{\"rectifyResult\": \"常规整改\"}"),
隐患安措计划("隐患安措计划", 5, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"),
隐患延期治理("隐患延期治理", 15, ExecuteStateEnum.通过, LatentDangerStateEnum.延期治理申请待车间部门审核,
"{\"rectifyResult\": \"延期\"}"),
隐患延期治理车间部门审核通过("隐患延期治理车间部门审核通过", 16, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"approveResult\": \"通过\"}"),
隐患延期治理车间部门审核拒绝("隐患延期治理车间部门审核拒绝", 17, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"approveResult\": \"不通过\"}"),
隐患延期治理公司审核通过("隐患延期治理公司审核通过", 18, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"approveResult\": true}"),
隐患延期治理公司审核拒绝("隐患延期治理公司审核拒绝", 19, ExecuteStateEnum.驳回, LatentDangerStateEnum.延期治理申请待车间部门审核,
"{\"approveResult\": false}"),
填写安措计划完成("填写安措计划完成", 6, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\"}"),
车间部门审核通过("车间部门审核通过", 7, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
车间部门审核拒绝("车间部门审核拒绝", 8, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
总工程师审核通过("总工程师审核通过", 9, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
总工程师审核拒绝("总工程师审核拒绝", 10, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
公司负责人审核通过("公司负责人审核通过", 11, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
公司负责人审核拒绝("公司负责人审核拒绝", 12, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
隐患验证通过("隐患验证通过", 13, ExecuteStateEnum.通过, LatentDangerStateEnum.治理完毕,
"{\"validationResult\": \"通过\"}"),
隐患验证拒绝("隐患验证拒绝", 14, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"validationResult\": \"不通过\"}");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
/**
* 执行状态
*/
private ExecuteStateEnum excuteState;
private String requestBody;
private LatentDangerStateEnum nextState;
LatentDangerExcuteTypeEnum(String name, Integer code, ExecuteStateEnum excuteState, LatentDangerStateEnum nextState, String requestBody) {
this.name = name;
this.code = code;
this.excuteState = excuteState;
this.requestBody = requestBody;
this.nextState = nextState;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ExecuteStateEnum getExcuteState() {
return excuteState;
}
public void setExcuteState(ExecuteStateEnum excuteState) {
this.excuteState = excuteState;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public LatentDangerStateEnum getNextState() {
return nextState;
}
public void setNextState(LatentDangerStateEnum nextState) {
this.nextState = nextState;
}
public static LatentDangerExcuteTypeEnum getByCode(Integer code) {
for (LatentDangerExcuteTypeEnum e : LatentDangerExcuteTypeEnum.values()) {
if (code.equals(e.getCode())) {
return e;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerLevelEnum {
安全问题("安全问题", 0, "0"),
一般隐患("一般隐患", 1, "1"),
重大隐患("重大隐患", 2, "2");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
private String riskSourceDangerLevelCode;
LatentDangerLevelEnum(String name, Integer code, String riskSourceDangerLevelCode) {
this.name = name;
this.code = code;
this.riskSourceDangerLevelCode = riskSourceDangerLevelCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getRiskSourceDangerLevelCode() {
return riskSourceDangerLevelCode;
}
public void setRiskSourceDangerLevelCode(String riskSourceDangerLevelCode) {
this.riskSourceDangerLevelCode = riskSourceDangerLevelCode;
}
public static LatentDangerLevelEnum getByRiskSourceDangerLevelCode(String riskSourceDangerLevelCode) {
for (LatentDangerLevelEnum l : LatentDangerLevelEnum.values()) {
if (riskSourceDangerLevelCode.equals(l.getRiskSourceDangerLevelCode())) {
return l;
}
}
return null;
}
public static LatentDangerLevelEnum getByCode(Integer code) {
for (LatentDangerLevelEnum l : LatentDangerLevelEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerOvertimeStateEnum {
未超时("未超时", 0),
已超时("已超时", 1);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
LatentDangerOvertimeStateEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static LatentDangerOvertimeStateEnum getByCode(Integer code) {
for (LatentDangerOvertimeStateEnum l : LatentDangerOvertimeStateEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerReformTypeEnum {
常规整改("常规整改", 1),
安措计划("安措计划", 2),
延期治理("延期治理", 3);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
LatentDangerReformTypeEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static LatentDangerReformTypeEnum getByCode(Integer code) {
for (LatentDangerReformTypeEnum l : LatentDangerReformTypeEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerStateEnum {
待评审("待评审", 1),
待治理("待治理", 2),
安措计划中("安措计划中", 3),
待验证("待验证", 4),
治理完毕("治理完毕", 5),
已撤销("已撤销", 6),
延期治理申请("延期治理中", 7),
延期治理申请待车间部门审核("延期治理待车间部门审核", 8),
延期治理申请待公司审核("延期治理待公司审核", 9);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
LatentDangerStateEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static String getEnumName(Integer code) {
String name = "";
for(LatentDangerStateEnum type: LatentDangerStateEnum.values()) {
if (type.getCode()==code) {
name = type.getName();
break;
}
}
return name;
}
public static LatentDangerStateEnum getByCode(Integer code) {
for (LatentDangerStateEnum l : LatentDangerStateEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum LatentDangerTypeEnum {
无码检查("无码检查", 1),
计划检查("计划检查", 2),
无计划检查("无计划检查", 3),
随手拍("随手拍", 4);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
LatentDangerTypeEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static String getEnumName(Integer code) {
String name = "";
for(LatentDangerTypeEnum type: LatentDangerTypeEnum.values()) {
if (type.getCode()==code) {
name = type.getName();
break;
}
}
return name;
}
public static LatentDangerTypeEnum getByCode(Integer code) {
for (LatentDangerTypeEnum l : LatentDangerTypeEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
......@@ -17,7 +17,9 @@ public enum OrderByEnum {
PLAN_TASK_NUM_ASC("计划维保设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc");
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
DATE_DESC("维保记录时间倒序", "7", "checkDate desc"),
DATE_ASC("维保记录时间正序", "8", "checkDate asc");
/**
* 名字
......
package com.yeejoin.amos.maintenance.common.enums;
public enum RiskFactorWorkFlowActionTypeEnum {
通过("通过", 1),
拒绝("拒绝", 2),
终止流程("终止流程", 3),
唤起流程("唤起流程", 4),
重启流程("重启流程", 5);
private String desc;
private Integer actionType;
RiskFactorWorkFlowActionTypeEnum(String desc, Integer actionType) {
this.desc = desc;
this.actionType = actionType;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getActionType() {
return actionType;
}
public void setActionType(Integer actionType) {
this.actionType = actionType;
}
public static RiskFactorWorkFlowActionTypeEnum getByActionType(Integer actionType) {
for (RiskFactorWorkFlowActionTypeEnum e : RiskFactorWorkFlowActionTypeEnum.values()) {
if (actionType.equals(e.actionType)) {
return e;
}
}
return null;
}
}
\ No newline at end of file
package com.yeejoin.amos.maintenance.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 风险管控内容状态
* @author maoying
*
*/
public enum RiskFactorsCmStatusEnum {
Control("受控","1"),
outOfControl("失控","2"),
generalDanger("一般","3"),
majorDanger("重要","4");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private RiskFactorsCmStatusEnum(String name, String code){
this.name = name;
this.code = code;
}
public static RiskFactorsCmStatusEnum getEnum(String code) {
RiskFactorsCmStatusEnum instance = null;
for(RiskFactorsCmStatusEnum type: RiskFactorsCmStatusEnum.values()) {
if (type.getCode().equals(code)) {
instance = type;
break;
}
}
return instance;
}
public static String getEnumName(String code) {
String name = "";
for(RiskFactorsCmStatusEnum type: RiskFactorsCmStatusEnum.values()) {
if (type.getCode().equals(code)) {
name = type.getName();
break;
}
}
return name;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> list = new ArrayList<>();
for(RiskFactorsCmStatusEnum e : RiskFactorsCmStatusEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("code", e.getCode());
map.put("name", e.getName());
list.add(map);
}
return list;
}
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;
}
}
package com.yeejoin.amos.maintenance.common.enums;
/**
* 作业活动类型
*
* @author Administrator
*/
public enum RiskJudgeTaskworkTypeEnum {
重大工艺操作(TaskworkTypeEnum.重大工艺操作,"danger_work_control_a"),
检维修作业(TaskworkTypeEnum.检维修作业, "danger_work_control_b"),
特殊动火作业(TaskworkTypeEnum.特殊动火作业, "danger_work_control_c"),
一级动火作业(TaskworkTypeEnum.一级动火作业, "danger_work_control_d"),
二级动火作业(TaskworkTypeEnum.二级动火作业, "danger_work_control_e"),
进入受限空间作业(TaskworkTypeEnum.进入受限空间作业, "danger_work_control_f");
/**
* 名称,描述
*/
private TaskworkTypeEnum eum;
/**
* 编码
*/
private String intemFlag;
private RiskJudgeTaskworkTypeEnum(TaskworkTypeEnum eum, String intemFlag) {
this.setEum(eum);
this.setIntemFlag(intemFlag);
}
public TaskworkTypeEnum getEum() {
return eum;
}
public void setEum(TaskworkTypeEnum eum) {
this.eum = eum;
}
public String getIntemFlag() {
return intemFlag;
}
public void setIntemFlag(String intemFlag) {
this.intemFlag = intemFlag;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum RiskJudgmentSelectStatusEnum {
可控("可控", "1"),
不可控("不可控", "2");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
RiskJudgmentSelectStatusEnum(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;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum RiskJudgmentStatusEnum {
未开始("未开始", 0),
进行中("进行中", 1),
已超时("已超时", 2),
已提交("已提交", 3);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
RiskJudgmentStatusEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum RiskJudgmentTaskStatusEnum {
未开始("未开始", 0),
进行中("进行中", 1),
已超时("已超时", 2),
已提交("已提交", 3),
已审核("已审核", 4),
已合并("已汇总", 5);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
RiskJudgmentTaskStatusEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static RiskJudgmentTaskStatusEnum getByCode(Integer code) {
for (RiskJudgmentTaskStatusEnum l : RiskJudgmentTaskStatusEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum WorkFlowDefinitionKeyEnum {
设备设施风险评级("设备设施风险评级", "1", "A"),
隐患治理流程("隐患治理流程", "2", "B"),
作业活动风险评级("作业活动风险评级", "3", "C"),
风险研判评审("风险研判评审", "4", "G");
private String desc;
private String key;
private String processDefinitionKey;
WorkFlowDefinitionKeyEnum(String desc, String key, String processDefinitionKey) {
this.desc = desc;
this.key = key;
this.processDefinitionKey = processDefinitionKey;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getProcessDefinitionKey() {
return processDefinitionKey;
}
public void setProcessDefinitionKey(String processDefinitionKey) {
this.processDefinitionKey = processDefinitionKey;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public static WorkFlowDefinitionKeyEnum getByKey(String key) {
for (WorkFlowDefinitionKeyEnum w : WorkFlowDefinitionKeyEnum.values()) {
if (key.equals(w.key)) {
return w;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum WorkFlowRiskFactorUriEnum {
唤起流程("唤起流程", "/api/spcRiskFactor/flowCallBack", ""),
检查结果推送("检查结果推送", "/api/protal/data", ""),
隐患治理结果推送("隐患治理结果推送", "/api/protal/hiddentrouble", ""),
等级查询("等级查询", "/api/spcRiskLevel/listselect", "");
private String desc;
private String uri;
private String params;
WorkFlowRiskFactorUriEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.maintenance.common.enums;
public enum WorkFlowUriEnum {
启动流程("启动流程", "/workflow/task/startTask", ""),
流程详情("流程详情", "/workflow/task/{taskId}", "taskId"),
合并启动流程("合并启动流程", "/workflow/task/startProcess", ""),
所有已执行任务详情("所有已执行任务详情","/workflow/activitiHistory/task/detail/{taskId}","taskId"),
流程任务("流程任务", "/workflow/task?processInstanceId={processInstanceId}", "processInstanceId"),
我的代办("我的代办", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
我的代办有ID("我的代办有ID", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
已执行任务("已执行任务", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
已执行任务有ID("已执行任务有ID", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
启动免登录流程("启动免登录流程", "/processes/{appKey}", "appKey"),
当前节点("当前节点", "/wf/taskstodo?processInstanceId={processInstanceId}", "processInstanceId"),
执行流程("执行流程", "/workflow/task/pickupAndCompleteTask/{taskId}", "taskId"),
终止流程("终止流程", "/wf/processes/{processInstanceId}?deleteReason={deleteReason}", "processInstanceId,deleteReason"),
当前子节点("当前子节点", "/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}", "processInstanceId,taskDefinitionKey"),
工作流流水("工作流流水","/wf/processes/{processInstanceId}/tasks", "processInstanceId"),
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId");
private String desc;
private String uri;
private String params;
WorkFlowUriEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.maintenance.dao.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keyong
* @title: LatentDanger
* <pre>
* @description: 隐患表
* </pre>
* @date 2021/1/26 14:03
*/
@Entity
@Table(name = "p_latent_danger")
@NamedQuery(name = "LatentDanger.findAll", query = "SELECT c FROM LatentDanger c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
public class LatentDanger extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 业务唯一标识
*/
@Column(name = "business_key")
private String businessKey;
/**
* 公司组织机构
*/
@Column(name = "org_code")
private String orgCode;
/**
* 隐患名称
*/
@Column(name = "danger_name")
private String dangerName;
@Column(name = "instance_id")
private String instanceId;
@Column(name = "current_flow_record_id")
private Long currentFlowRecordId;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
@Column(name = "danger_level")
private Integer dangerLevel;
/**
* 隐患地点
*/
@Column(name = "danger_position")
private String dangerPosition;
/**
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
@Column(name = "danger_type")
private Integer dangerType;
/**
* 备注
*/
@Column(name = "remark")
private String remark;
/**
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
@Column(name = "reform_type")
private Integer reformType;
/**
* 限制时间
*/
@Column(name = "reform_limit_date")
private Date reformLimitDate;
@Column(name = "overtime_state")
private Integer overtimeState;
@Column(name = "reform_json")
private String reformJson;
/**
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
@Column(name = "danger_state")
private Integer dangerState;
/**
* 发现人
*/
@Column(name = "discoverer_user_id")
private String discovererUserId;
@Column(name = "discoverer_department_id")
private String discovererDepartmentId;
@Column(name = "photo_urls")
private String photoUrls;
/**
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
/**
* 记录修改时间
*/
@Column(name = "update_date")
private Date updateDate;
/**
* 延期治理时间
*/
@Column(name = "delay_limit_date")
private Date delayLimitDate;
/**
* 问题描述
*/
@Column(name = "problem_description")
private String problemDescription;
/**
* 原因分析
*/
@Column(name = "reason_analysis")
private String reasonAnalysis;
/**
* 举一反三
*/
@Column(name = "infer_other_things")
private String inferOtherThings;
/**
* 检查记录创建的隐患检查项对应id
*/
@Column(name = "check_input_id")
private Long checkInputId;
}
package com.yeejoin.amos.maintenance.dao.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerFlowRecord
* <pre>
* @description: 隐患工作流记录表
* </pre>
* @date 2021/1/26 14:18
*/
@Entity
@Table(name = "p_latent_danger_flow_record")
@NamedQuery(name = "LatentDangerFlowRecord.findAll", query = "SELECT c FROM LatentDangerFlowRecord c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
public class LatentDangerFlowRecord extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "danger_id")
private Long dangerId;
@Column(name = "action_flag")
private String actionFlag;
@Column(name = "flow_task_name")
private String flowTaskName;
@Column(name = "flow_task_user_ids")
private String flowTaskUserIds;
@Column(name = "flow_task_id")
private String flowTaskId;
@Column(name = "excute_state")
private Integer excuteState;
@Column(name = "excute_user_id")
private String excuteUserId;
@Column(name = "excute_result")
private String excuteResult;
@Column(name = "remark")
private String remark;
@Column(name = "flow_json")
private String flowJson;
/**
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
/**
* 记录修改时间
*/
@Column(name = "update_date")
private Date updateDate;
@Column(name = "excute_department_id")
private String excuteDepartmentId;
}
package com.yeejoin.amos.maintenance.dao.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.Transient;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerPatrol
* <pre>
* @description: 隐患巡检关系表
* </pre>
* @date 2021/1/26 14:51
*/
@Entity
@Table(name = "p_latent_danger_patrol")
@NamedQuery(name = "LatentDangerPatrol.findAll", query = "SELECT c FROM LatentDangerPatrol c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
public class LatentDangerPatrol extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "latent_danger_id")
private Long latentDangerId;
@Column(name = "point_classify_id")
private Long pointClassifyId;
@Column(name = "check_id")
private Long checkId;
@Column(name = "item_id")
private Long itemId;
@Column(name = "point_id")
private Long pointId;
@Column(name = "route_id")
private Long routeId;
@Column(name = "risk_factor_flow_id")
private String riskFactorFlowId;
@Column(name = "route_point_item_id")
private Long routePointItemId;
/**
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
/**
* 检查类型-交大字段,只是前段显示用
*/
@Transient private String checkType;
/**
* 记录修改时间
*/
@Column(name = "update_date")
private Date updateDate;
}
package com.yeejoin.amos.maintenance.dao.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* @author keyong
* @title: LatentDangerPhoto
* <pre>
* @description: 隐患图片
* </pre>
* @date 2021/1/26 14:50
*/
@Entity
@Table(name = "p_latent_danger_photo")
@NamedQuery(name = "LatentDangerPhoto.findAll", query = "SELECT c FROM LatentDangerPhoto c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
public class LatentDangerPhoto extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "biz_code")
private String bizCode;
@Column(name = "url")
private String url;
@Column(name = "biz_id")
private Long bizId;
@Column(name = "deleted")
private String deleted;
@Column(name = "update_date")
private String updateDate;
}
......@@ -72,6 +72,9 @@ public class DispatchSaveFeedbackDto extends BaseDto {
@ApiModelProperty(value = "回访时间")
private Date feedbackTime;
@ApiModelProperty(value = "维修备注")
private String fixRemark;
public DispatchSaveFeedbackDto() {
......
package com.yeejoin.amos.boot.module.tzs.api.enums;
/**
* @author kongfm
* @date 2021/8/16.
*/
public class TzsCommonParam {
public static final String SAVE_FEEDBACK_TIME = "save_feedback_time";
public static final String SAVE_FEEDBACK_USER = "save_feedback_user";
public static final String SAVE_FEEDBACK_UID = "save_feedback_uid";
public static final String SAVE_FEEDBACK_RESULT = "save_feedback_result";
public static final String FIX_RESULT = "fix_result";
public static final String ERROR_RESULT = "error_result";
public static final String FIX_REMARK = "fix_remark";
public static final String FIX_FEEDBACK_TIME = "fix_feedback_time";
public static final String FEEDBACK_RESULT = "feedback_result";
public static final String FIX_FEEDBACK_TYPE = "fix_feedback_type";
public static final String FIX_FEEDBACK_UNAME = "fix_feedback_uname";
public static final String FIX_FEEDBACK_UID = "fix_feedback_uid";
public static final String CONSULT_FEEDBACK_TIME = "consult_feedback_time";
public static final String ACTION_RESULT = "action_result";
public static final String CONSULT_FEEDBACK_TYPE = "consult_feedback_type";
public static final String CONSULT_FEEDBACK_UNAME = "consult_feedback_uname";
public static final String CONSULT_FEEDBACK_UID = "consult_feedback_uid";
public static final String MAIN_FEEDBACK_RESULT = "main_feedback_result";
public static final String PQ = "PQ";
public static final String JYHF = "JYHF";
public static final String WXJG = "WXJG";
public static final String GZYY = "GZYY";
public static final String WXFK = "WXFK";
public static final String BXFK = "BXFK";
public static final String FKFS = "FKFS";
public static final String TSRFK = "TSRFK";
public static final String CZJG = "CZJG";
public static final String FKJG = "FKJG";
public static final String WXFK_TS = "WXFK_TS";
public static final String DD = "DD";
public static final String JC = "JC";
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto;
......@@ -91,19 +92,11 @@ public class WaterResourceController extends BaseController {
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
if(model.getAddress()!=null){
String[] data= model.getAddress().split("@address@");
model.setAddress(data[0]);
if(data[1]!=null&&!"".equals(data[1])){
JSONObject jSONObject = JSON.parseObject(data[1]);
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
if (!StringUtils.isEmpty(resourceType)) {
......@@ -174,21 +167,13 @@ public class WaterResourceController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
if(model.getAddress()!=null){
String[] data= model.getAddress().split("@address@");
model.setAddress(data[0]);
if(data[1]!=null&&!"".equals(data[1])){
JSONObject jSONObject = JSON.parseObject(data[1]);
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
}
if (StringUtils.isNotEmpty(model.getAddress())) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
// 更新基本信息
model.setSequenceNbr(sequenceNbr);
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.constats.Constants;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -30,11 +32,13 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.boot.module.common.biz.constats.Constants;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
/**
......@@ -524,14 +528,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
if(Boolean.parseBoolean(map.get("checkFlag").toString())) {
String buttonValueString = map.get("name").toString();
if(buttonValueString.contains(PROCESS_NAME[1])) { //提交维修单
if(buttonValueString.endsWith(PROCESS_NAME[1])) { //提交维修单
flag=1;
}else if(buttonValueString.contains(PROCESS_NAME[2])) { //审核
}else if(buttonValueString.endsWith(PROCESS_NAME[2])) { //审核
if(buttonValueString.startsWith(PROCESS_NAME[3])) {
flag=3;
}
flag=2;
}else if(buttonValueString.contains(PROCESS_NAME[3])) {//维修
flag=3;
}else if(buttonValueString.contains(PROCESS_NAME[4])) {//验收
}else if(buttonValueString.endsWith(PROCESS_NAME[3])) {//维修
flag=4;
}else if(buttonValueString.endsWith(PROCESS_NAME[4])) {//验收
flag=5;
}
}
FailureDetails details = this.baseMapper.selectById(sequenceNbr);
......@@ -540,7 +547,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
for (Object historyDetail : array) {
JSONObject historyDetailJson= JSONObject.parseObject(JSONObject.toJSONString(historyDetail));
if("rejected".equals(historyDetailJson.getString("activityId"))) {
flag=5;
flag=6;
}
}
return flag;
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
......@@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -124,17 +126,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public LinkageUnitDto saveModel(LinkageUnitDto linkageUnitDto) {
if (linkageUnitDto.getAddress() != null) {
String[] data = linkageUnitDto.getAddress().split("@address@");
linkageUnitDto.setAddress(data[0]);
if (data[1] != null && !"".equals(data[1])) {
JSONObject jSONObject = JSON.parseObject(data[1]);
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress());
linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS));
linkageUnitDto.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
linkageUnitDto.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
// 1.保存行数据
String groupCode = this.getGroupCode();
......@@ -178,8 +173,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
LinkageUnitDto linkageUnitDto = linkageUnitMapper.selectOne(false, fieldCodes, groupCode, sequenceNbr);
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(linkageUnitDto.getSequenceNbr());
linkageUnitDto.setImage(sourceFiles);
if (!ValidationUtil.isEmpty(linkageUnitDto)) {
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(linkageUnitDto.getSequenceNbr());
linkageUnitDto.setImage(sourceFiles);
}
return linkageUnitDto;
}
......@@ -204,17 +201,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public LinkageUnitDto updateById(LinkageUnitDto linkageUnitDto) {
if (linkageUnitDto.getAddress() != null) {
String[] data = linkageUnitDto.getAddress().split("@address@");
linkageUnitDto.setAddress(data[0]);
if (data[1] != null && !"".equals(data[1])) {
JSONObject jSONObject = JSON.parseObject(data[1]);
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress());
linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS));
linkageUnitDto.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
linkageUnitDto.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
// 修改基本信息
updateWithModel(linkageUnitDto);
......
......@@ -6,7 +6,10 @@ import java.util.Optional;
import javax.annotation.Resource;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
......@@ -235,4 +238,31 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete);
}
public static JSONObject getLongLatFromAddress(String address) {
JSONObject result = new JSONObject();
result.put(BizConstant.ADDRESS, "");
result.put(BizConstant.LONGITUDE, "0");
result.put(BizConstant.LATITUDE, "0");
if (StringUtils.isNotEmpty(address)) {
String[] addressData = address.split("@address@");
if (addressData.length > 1) {
result.put(BizConstant.ADDRESS, addressData[0]);
JSONObject langLatObj = JSON.parseObject(addressData[1]);
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LONGITUDE))) {
result.put(BizConstant.LONGITUDE, langLatObj.getString(BizConstant.LONGITUDE));
} else {
result.put(BizConstant.LONGITUDE, "0");
}
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LATITUDE))) {
result.put(BizConstant.LATITUDE, langLatObj.getString(BizConstant.LATITUDE));
} else {
result.put(BizConstant.LATITUDE, "0");
}
} else {
result.put(BizConstant.ADDRESS, addressData[0]);
}
}
return result;
}
}
......@@ -10,11 +10,13 @@ import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.common.enums.OrderByEnum;
import com.yeejoin.amos.maintenance.core.async.AsyncTask;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -29,6 +31,7 @@ import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
......@@ -194,9 +197,12 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "保存巡检记录-mobile", notes = "保存巡检记录-mobile")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse saveCheckRecord(
@ApiParam(value = "检查信息") @RequestBody() CheckRecordParam requestParam) {
@ApiParam(value = "检查信息") @RequestBody CheckRecordParam requestParam) {
try {
CheckDto checkDto = checkService.saveCheckRecord(requestParam, getSelectedOrgInfo());
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
requestParam.setOrgCode(orgCode);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, reginParams);
return CommonResponseUtil.success(checkDto);
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -477,4 +483,46 @@ public class CheckController extends AbstractBaseController {
@ApiParam(value = "源ids,逗号分隔", required = true) @PathVariable String... relationId) {
return CommonResponseUtil.success(checkService.obtainLastCheckRecord(relationId));
}
@PersonIdentify(isNeedIdentity = true)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录分页查询", notes = "维保记录分页查询")
@GetMapping(value = "/page")
public CommonResponse getCheckRecord(
@ApiParam(value = "查询范围") @RequestParam(value = "userId", required = false) String userId,
@ApiParam(value = "时间范围") @RequestParam(value = "timeType", required = false) String timeType,
@ApiParam(value = "维保结果") @RequestParam(value = "result", required = false) String result,
@ApiParam(value = "排序规则") @RequestParam(value = "orderRule", required = false) String orderRule,
@ApiParam(value = "开始时间") @RequestParam(value = "beginTime", required = false) String beginTime,
@ApiParam(value = "结束时间") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "维保人员") @RequestParam(value = "personId", required = false) String person,
@ApiParam(value = "业主单位") @RequestParam(value = "teamId", required = false) String teamId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception{
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap);
params.put("userId", userId);
params.put("timeType", timeType);
params.put("result", result);
params.put("orderRule", OrderByEnum.getEumByCode(orderRule).getOderBy());
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("person", person);
params.put("teamId", teamId);
params.put("orgCode", loginOrgCode);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(checkService.getCheckPage(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录详情", notes = "维保记录详情")
@GetMapping(value = "/detail/{id}")
public CommonResponse getCheckDetail(
@ApiParam(value = "记录Id") @PathVariable(value = "id") String id) throws Exception{
return CommonResponseUtil.success(checkService.getCheckDetail(id));
}
}
......@@ -36,7 +36,7 @@ public interface CheckMapper extends BaseMapper {
List<PointCheckDetailBo> findCheckPointInputItem(@Param(value="checkId") long checkId);
int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "checkId") Long pointId);
int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "pointId") Long pointId);
List<Map<String, Object>> queryCheckPointImgs(@Param(value="planTaskId") int planTaskId, @Param(value="pointId") int pointId);
......@@ -277,4 +277,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
long getCheckCount(HashMap<String, Object> params);
List<HashMap<String, Object>> getChecks(HashMap<String, Object> params);
Map<String, Object> getCheckDetail(@Param(value = "id") String id);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo;
import com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface LatentDangerFlowRecordMapper extends BaseMapper {
Integer save(LatentDangerFlowRecordBo latentDangerFlowRecordBo);
LatentDangerFlowRecordBo getByDangerIdAndActionFlag(@Param("dangerId") Long dangerId, @Param("actionFlag") String actionFlag);
LatentDangerFlowRecordBo getByDangerIdAndCreate(@Param("dangerId") Long dangerId);
LatentDangerFlowRecordBo getById(Long id);
List<LatentDangerFlowRecordBo> listPassByDangerId(Long dangerId);
Integer update(LatentDangerFlowRecordBo latentDangerFlowRecordBo);
LatentDangerFlowRecordBo getNewestRecordByDangerId(Long dangerId);
List<LatentDangerFlowRecordBo> listNewestRecordByDangerIds(List<Long> dangerIds);
List<LatentDangerFlowRecordBo> listByDangerId(Long dangerId);
void deleteByLatentDangerIds(List<Long> dangerIds);
List<DangerTimeAxisVo> listExecuteLog(Map<String, Object> map);
LatentDangerFlowRecordBo getByIdOderByDate(Long dangerId);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerNoticeBo;
import com.yeejoin.amos.maintenance.business.param.LatentDangerListParam;
import com.yeejoin.amos.maintenance.business.param.PageParam;
import com.yeejoin.amos.maintenance.core.common.response.DangerListResponse;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface LatentDangerMapper extends BaseMapper {
Integer save(LatentDangerBo latentDangerBo);
List<LatentDangerBo> listByMap(Map<String, Object> map);
Long countByMap(Map<String, Object> map);
LatentDangerBo getById(Long id);
Integer update(LatentDangerBo latentDangerBo);
LatentDangerBo getByInstanceId(String instanceId);
List<LatentDangerBo> listOfOvertime();
Integer countNotFinishByFlowId(String flowId);
List<LatentDangerBo> listNotFinishByPointId(HashMap<String, Object> params);
Long countByFlowUserIds(String userId);
Long countNotFinishByTypeAndDeptId(@Param("type") Integer type, @Param("departmentId") String departmentId);
String getNotFinishIdsByTypeAndDeptId(@Param("type") Integer type, @Param("departmentId") String departmentId);
void deleteByIds(List<Long> dangerIds);
/**
* 查询治理期限即将到期的隐患
*
* @return
*/
List<LatentDangerNoticeBo> listNeedNoticeDanger();
/**
* 根据隐患id获取评审信息
*
* @param dangerId
* @return
*/
List<HashMap<String, Object>> getReViewInfo(Long dangerId);
List<DangerListResponse> dangerListByMap(PageParam pageParam);
Long countDangerListByMap(PageParam pageParam);
List<LatentDangerBo> getByBathBusinessKeys(@Param("businessKeys") List<String> businessKeys, @Param("latentDangerListParam") LatentDangerListParam latentDangerListParam);
int countByBathBusinessKeys(@Param("businessKeys") List<String> businessKeys, @Param("latentDangerListParam") LatentDangerListParam latentDangerListParam);
int countByStatus(@Param("businessKeys") List<String> businessKeys);
void updateCheckInputDangerState(@Param("id") Long id, @Param("code") int code);
LatentDangerBo getbyBusinessKey(@Param("businessKey") String businessKey);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo;
import java.util.List;
import java.util.Map;
public interface LatentDangerPatrolMapper extends BaseMapper {
Integer save(LatentDangerPatrolBo latentDangerPatrolBo);
LatentDangerPatrolBo getByDangerId(Long dangerId);
List<LatentDangerPatrolBo> listByMap(Map<String, Object> map);
List<LatentDangerPatrolBo> listByPointId(Long pointId);
List<LatentDangerPatrolBo> queryByPointClassifyIds(List<String> pointClassifyIds);
void deleteByLatentDangerIds(List<Long> latentDangerIds);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 风险研判填写记录表
*/
public interface RiskJudgmentFillRecordMapper {
Integer save(RiskJudgmentFillRecordBo riskJudgmentFillRecordBo);
Integer update(RiskJudgmentFillRecordBo riskJudgmentFillRecordBo);
Integer saveBatch(List<RiskJudgmentFillRecordBo> recordList);
void saveBatchWithStatus (List<RiskJudgmentFillRecordBo> recordList);
Integer updateBatch(List<RiskJudgmentFillRecordBo> recordList);
List<RiskJudgmentFillRecordBo> listFillRecordData(@Param("taskId") Long taskId, @Param("type") Integer itemType, @Param("level") Integer itemLevel, @Param("itemParentId") Long itemId);
Long countNotFinishRecordByTaskId(Long taskId);
void updateInputResultAndselectResult(Map<String, Object> map);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo;
import java.util.List;
/**
* 风险研判项表
*/
public interface RiskJudgmentItemMapper {
Integer save(RiskJudgmentItemBo riskJudgmentItemBo);
Integer update(RiskJudgmentItemBo riskJudgmentItemBo);
List<RiskJudgmentItemBo> listAllItemByDepartmentCode(String departmentCode);
RiskJudgmentItemBo findByItemId(Long itemId);
}
package com.yeejoin.amos.maintenance.business.dao.mapper;
import com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 风险研判任务表
*/
public interface RiskJudgmentTaskMapper {
Integer save(RiskJudgmentTaskBo riskJudgmentTaskBo);
Integer update(RiskJudgmentTaskBo riskJudgmentTaskBo);
Integer updateBatch(List<RiskJudgmentTaskBo> list);
List<RiskJudgmentTaskBo> listByDateAndStatus(@Param("date") String date, @Param("status") Integer status);
List<RiskJudgmentTaskBo> listByMap(Map<String, Object> map);
Long countByMap(Map<String, Object> map);
RiskJudgmentTaskBo getById(Long id);
Long countByFlowUserIds(String userId);
RiskJudgmentTaskBo getByInstanceIdAndTaskDefinitionKey(@Param("instanceId") String instanceId, @Param("taskDefinitionKey") String taskDefinitionKey);
void updatetTaskStatusByInstanceId(HashMap<String, Object> map);
}
package com.yeejoin.amos.maintenance.business.dto;
import com.yeejoin.amos.maintenance.common.enums.LatentDangerExcuteTypeEnum;
import lombok.Data;
@Data
public class DangerExecuteSubmitDto extends ExecuteSubmitDto{
private String pointOriginalId;
private Long pointId;
private String dangerName;
private Long dangerId;
private LatentDangerExcuteTypeEnum executeTypeEnum;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis;
import lombok.Data;
@Data
public class LatentDangerFlowRecordBoExtend {
private String executeDepartmentName = "";
private String executeUserName;
private String executeTime;
private Integer dangerOvertimeState;
private Integer dangerState;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis;
import lombok.Data;
@Data
public class LatentDangerPatrolBoExtend {
private String itemName;
private String itemBasis;
private String pointName;
private String pointLevel;
private String pointNo;
private String planName;
private String planType;
private String routeName;
private String itemRemark;
private String checkTime;
private String checkUserId;
private String classifyName;
private String pointDepartMentId;
private String classifyOriginalId;
private String pointOriginalId;
private String itemOriginalId;
private Integer executeRate;
private String checkDepartmentId;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.RiskJudgmentFillRecordExtend;
import lombok.Data;
import java.util.Date;
/**
* 风险研判填写记录表
*/
@Data
public class RiskJudgmentFillRecordBo extends RiskJudgmentFillRecordExtend {
/**
* 主键自增
*/
private Long id;
/**
* 风险研判任务编号
*/
private Long taskId;
/**
* 风险研判项编号
*/
private Long itemId;
/**
* 选择结果
*/
private String selectResult;
/**
* 填写结果
*/
private String inputResult;
/**
* 备注结果
*/
private String remarkResult;
/**
* 拍照结果
*/
private String photoResult;
private Integer itemFinish;
private String orgCode;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
/**
* 排序-0开始
*/
private Integer orderNum;
/**
* 危险作业/其他隐患风险id(逗号分隔)(一般风险、低风险不保存)
*/
private String extraIds;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis;
import lombok.Data;
import java.util.Date;
/**
* 风险研判项表
*/
@Data
public class RiskJudgmentItemBo {
/**
* 主键自增
*/
private Long id;
/**
* 唯一标识
*/
private String itemFlag;
/**
* 风险研判项级别
*/
private Integer itemLevel;
/**
* 风险研判项类型(1:风险研判表;2:风险研判采集表)
*/
private Integer itemType;
/**
* 节点名称
*/
private String itemName;
/**
* 父节点编号
*/
private Long itemParentId;
private Integer itemCanCopy;
/**
* 选项名称
*/
private String selectName;
/**
* 选项是否需要(0:否;1:是)
*/
private Integer selectIsNeed;
/**
* 选项是否必选(0:否;1:是)
*/
private Integer selectIsRequired;
/**
* 选项json[{"id":1,"name":"否"}]
*/
private String selectJson;
/**
* 输入项名称
*/
private String inputName;
private Integer inputType;
private Integer inputCanEdit;
/**
* 输入是否需要(0:否;1:是)
*/
private Integer inputIsNeed;
/**
* 输入项是否必填(0:否;1:是)
*/
private Integer inputIsRequired;
/**
* 备注是否需要(0:否;1:是)
*/
private Integer remarkIsNeed;
/**
* 备注是否必填(0:否;1:是)
*/
private Integer remarkIsRequired;
/**
* 拍照是否需要(0:否;1:是)
*/
private Integer photoIsNeed;
/**
* 拍照是否必填(0:否;1:是)
*/
private Integer photoIsRequired;
private String orgCode;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
/**
* 排序-0开始
*/
private Integer orderNum;
/**
* 部门code
*/
private String deptCode;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis;
import lombok.Data;
import java.util.Date;
/**
* 风险研判任务表
*/
@Data
public class RiskJudgmentTaskBo {
/**
* 主键自增
*/
private Long id;
/**
* 风险研判名称
*/
private String taskName;
/**
* 部门编号
*/
private String departmentId;
/**
* 状态(0:未开始;1:进行中;2:已超时;3:已提交)
*/
private Integer taskStatus;
/**
* 风险研判日期(今天8:00-明天8:00)
*/
private Date taskDate;
/**
* 提交时间
*/
private Date taskCommitDate;
private String currentFlowTaskId;
private String taskDefinitionKey;
/**
* 可执行用户(多个逗号隔开)
*/
private String flowUserIds;
/**
* 业务唯一标识
*/
private String businessKey;
/**
* 工作流实例编号
*/
private String flowInstanceId;
private String orgCode;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import lombok.Data;
import java.util.Date;
/**
* 隐患表
*/
@Data
public class LatentDangerBo {
/**
* 主键自增
*/
private Long id;
/**
* 业务唯一标识
*/
private String businessKey;
/**
* 公司组织机构
*/
private String orgCode;
/**
* 隐患名称
*/
private String dangerName;
private String instanceId;
private Long currentFlowRecordId;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
private Integer dangerLevel;
/**
* 隐患地点
*/
private String dangerPosition;
/**
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
private Integer dangerType;
/**
* 备注
*/
private String remark;
/**
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
private Integer reformType;
/**
* 限制时间
*/
private Date reformLimitDate;
private Integer overtimeState;
private String reformJson;
/**
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
private Integer dangerState;
/**
* 发现人
*/
private String discovererUserId;
private String discovererDepartmentId;
private String photoUrls;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
/**
* 延期治理时间
*/
private Date delayLimitDate;
/**
* 问题描述
*/
private String problemDescription;
/**
* 原因分析
*/
private String reasonAnalysis;
/**
* 举一反三
*/
private String inferOtherThings;
/**
* 检查记录创建的隐患检查项对应id
*/
private Long checkInputId;
/**
* 建筑id
*/
private Long structureId;
/**
* 建筑名称
*/
private String structureName;
private String instanceKey;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import com.yeejoin.amos.maintenance.business.entity.mybatis.LatentDangerFlowRecordBoExtend;
import lombok.Data;
import java.util.Date;
@Data
public class LatentDangerFlowRecordBo extends LatentDangerFlowRecordBoExtend {
private Long id;
private Long dangerId;
private String actionFlag;
private String flowTaskName;
private String flowTaskUserIds;
private String flowTaskId;
private Integer excuteState;
private String excuteUserId;
private String excuteResult;
private String remark;
private String flowJson;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
private String excuteDepartmentId;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import java.util.Date;
public class LatentDangerNoticeBo {
/**
* 隐患id
*/
private Long dangerId;
private String orgCode;
/**
* 隐患状态
*/
private Integer dangerState;
/**
* 隐患名称
*/
private String dangerName;
/**
* 治理期限
*/
private Date reformLimitDate;
/**
* 消息接收人(隐患治理人)
*/
private String receiverIds;
private String instanceId;
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public Long getDangerId() {
return dangerId;
}
public void setDangerId(Long dangerId) {
this.dangerId = dangerId;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public Integer getDangerState() {
return dangerState;
}
public void setDangerState(Integer dangerState) {
this.dangerState = dangerState;
}
public String getDangerName() {
return dangerName;
}
public void setDangerName(String dangerName) {
this.dangerName = dangerName;
}
public Date getReformLimitDate() {
return reformLimitDate;
}
public void setReformLimitDate(Date reformLimitDate) {
this.reformLimitDate = reformLimitDate;
}
public String getReceiverIds() {
return receiverIds;
}
public void setReceiverIds(String receiverIds) {
this.receiverIds = receiverIds;
}
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import com.yeejoin.amos.maintenance.business.entity.mybatis.LatentDangerPatrolBoExtend;
import lombok.Data;
import java.util.Date;
/**
* 隐患巡检关系表
*/
@Data
public class LatentDangerPatrolBo extends LatentDangerPatrolBoExtend {
private Long id;
private Long latentDangerId;
private Long pointClassifyId;
private Long checkId;
private Long itemId;
private Long pointId;
private Long routeId;
private String riskFactorFlowId;
private Long routePointItemId;
/**
* 是否删除(0:否;1:是)
*/
private Integer deleted;
/**
* 检查类型-交大字段,只是前段显示用
*/
private String checkType;
/**
* 记录创建时间
*/
private Date createDate;
/**
* 记录修改时间
*/
private Date updateDate;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import lombok.Data;
@Data
public class RiskJudgmentFillRecordExtend {
/**
* 唯一标识
*/
private String itemFlag;
/**
* 风险研判项级别
*/
private Integer itemLevel;
/**
* 风险研判项类型(1:风险研判表;2:风险研判采集表)
*/
private Integer itemType;
/**
* 节点名称
*/
private String itemName;
/**
* 父节点编号
*/
private Long itemParentId;
private Integer itemCanCopy;
/**
* 选项名称
*/
private String selectName;
/**
* 选项是否需要(0:否;1:是)
*/
private Integer selectIsNeed;
/**
* 选项是否必选(0:否;1:是)
*/
private Integer selectIsRequired;
/**
* 选项json[{"id":1,"name":"否"}]
*/
private String selectJson;
/**
* 输入项名称
*/
private String inputName;
private Integer inputType;
private Integer inputCanEdit;
/**
* 输入是否需要(0:否;1:是)
*/
private Integer inputIsNeed;
/**
* 输入项是否必填(0:否;1:是)
*/
private Integer inputIsRequired;
/**
* 备注是否需要(0:否;1:是)
*/
private Integer remarkIsNeed;
/**
* 备注是否必填(0:否;1:是)
*/
private Integer remarkIsRequired;
/**
* 拍照是否需要(0:否;1:是)
*/
private Integer photoIsNeed;
/**
* 拍照是否必填(0:否;1:是)
*/
private Integer photoIsRequired;
}
package com.yeejoin.amos.maintenance.business.param;
import com.yeejoin.amos.maintenance.business.dto.CheckShotDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -9,6 +11,8 @@ import java.util.List;
* @author DELL
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CheckInputParam {
private long inputItemId;
private String inputValue;
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -10,6 +11,7 @@ import java.util.List;
* @author DELL
*/
@Data
@NoArgsConstructor
@ApiModel(value = "任务提交")
public class CheckRecordParam {
......@@ -19,22 +21,12 @@ public class CheckRecordParam {
@ApiModelProperty(value = "点id",required = true)
private Long pointId;
@ApiModelProperty(value = "点名称")
private String pointName;
@ApiModelProperty(value = "检查记录id")
private Long checkId;
@ApiModelProperty(value = "执行人id")
private String userId;
@ApiModelProperty(value = "任务id")
private String orgCode;
@ApiModelProperty(value = "组织机构",required = false)
private String orgCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "路线id")
private Long routeId;
......
package com.yeejoin.amos.maintenance.business.param;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
@Data
public class LatentDangerExcuteParam {
private Long flowRecordId;
private String taskId;
private Integer excuteType;
private String remark;
private String nextCanActionUser;
private String reformLimitDate;
private JSONObject flowJson;
private String delayLimitDate;
/**
* 隐患id
*/
private Long dangerId;
/**
* 延期治理是否需要公司审核
*/
private Integer needCompanyVerify;
/**
* 原因分析
*/
private String reasonAnalysis;
/**
* 举一反三
*/
private String inferOtherThings;
/**
*问题描述
*/
private String problemDescription;
private Integer dangerLevel;
}
package com.yeejoin.amos.maintenance.business.param;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import lombok.Data;
/**
* @author keyong
* @title: LatentDangerListParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:49
*/
@Data
public class LatentDangerListParam extends CommonPageable {
/**
* 0:全部;1:我的
*/
private Integer belongType;
/**
* 0:全部;1:待评审;2:待治理;3:安措计划中;4:待验证;5:治理完毕;6:已撤销;7:延期治理中;8:延期治理待车间部门审核;9:延期治理待公司审核
*/
private Integer dangerState;
/**
* 是否已处理(1:是;2:否)
*/
private Boolean isHandle;
/**
* -1:全部;1:一般隐患;2:重大隐患;0:安全问题
*/
private Integer dangerLevel;
private String dangerName;
private String userId;
}
package com.yeejoin.amos.maintenance.business.param;
import lombok.Data;
/**
* @author keyong
* @title: LatentDangerNormalParam
* <pre>
* @description: 隐患
* </pre>
* @date 2021/1/26 14:46
*/
@Data
public class LatentDangerNormalParam {
/**
* 隐患名称
*/
private String dangerName;
/**
* 隐患等级(1:一般隐患;2:重大隐患;3:安全问题)
*/
private Integer dangerLevel;
/**
* 隐患地点
*/
private String dangerPosition;
/**
* 备注
*/
private String remark;
/**
* 拍照路径集合(多个逗号分开)
*/
private String photoUrls;
/**
* 建筑id
*/
private Long structureId;
/**
* 建筑名称
*/
private String structureName;
}
package com.yeejoin.amos.maintenance.business.param;
import lombok.Data;
/**
* @author keyong
* @title: LatentDangerPatrolItemParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:48
*/
@Data
public class LatentDangerPatrolItemParam {
private Long itemId;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
private Integer dangerLevel;
private Long routePointItemId;
/**
* 问题描述
*/
private String remark;
/**
* p_check_input 主键id
*/
private Long checkInputId;
/**
* 建筑id
*/
private Long structureId;
/**
* 建筑名称
*/
private String structureName;
private String instanceKey;
/*
* 隐患名称
* */
private String name;
private String limitDate;
}
package com.yeejoin.amos.maintenance.business.param;
import lombok.Data;
import java.util.List;
/**
* @author keyong
* @title: LatentDangerPatrolParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:47
*/
@Data
public class LatentDangerPatrolParam {
private List<LatentDangerPatrolItemParam> itemList;
private Long checkId;
}
package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.AppVersionDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao;
import com.yeejoin.amos.maintenance.business.param.UserMsgInitParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IAppService;
import com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService;
import com.yeejoin.amos.maintenance.common.remote.RemoteWorkFlowService;
import com.yeejoin.amos.maintenance.common.enums.YesOrNoEnum;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yeejoin.amos.maintenance.business.param.UserMsgInitParam;
import com.yeejoin.amos.maintenance.common.enums.MsgSubscribeTypeEnum;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
import com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
......@@ -27,121 +20,65 @@ import java.util.List;
@Service("iAppService")
public class AppServiceImpl implements IAppService {
@Autowired
private IMsgSubscribeDao msgSubscribeDao;
@Autowired
private AppVersionDao appVersionDao;
private IMsgSubscribeDao msgSubscribeDao;
@Autowired
private RemoteWorkFlowService remoteWorkFlowService;
@Autowired private IMsgSubscribeService msgSubscribeService;
private AppVersionDao appVersionDao;
@Autowired
private LatentDangerMapper latentDangerMapper;
private IMsgSubscribeService msgSubscribeService;
@Autowired
private PlanTaskMapper planTaskMapper;
@Autowired
private RiskJudgmentTaskMapper riskJudgmentTaskMapper;
@Override
public AppVersion queryAppLastVersion() {
// TODO Auto-generated method stub
return appVersionDao.findLastVersion();
}
@Override
public AppVersion queryAppLastVersion() {
// TODO Auto-generated method stub
return appVersionDao.findLastVersion();
}
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public List<MsgSubscribe> saveUserMsgInit(UserMsgInitParam userInitParam) {
Long count = msgSubscribeDao.countByUserId(userInitParam.getUserId());
if (count > 0) { // 已存在用户订阅,直接返回
return msgSubscribeService.queryMsgSubscribes(userInitParam.getUserId());
}
List<MsgSubscribe> msgConfigs = new ArrayList<MsgSubscribe>();
for (MsgSubscribeTypeEnum type : MsgSubscribeTypeEnum.values()) {
MsgSubscribe msgSub = new MsgSubscribe();
msgSub.setOrgCode(userInitParam.getOrgCode());
msgSub.setUserId(userInitParam.getUserId());
if (type.equals(MsgSubscribeTypeEnum.PLANBEGIN)
|| type.equals(MsgSubscribeTypeEnum.PLANWARN)
|| type.equals(MsgSubscribeTypeEnum.PLANEND)) {
msgSub.setAttribute1("False");
msgSub.setAttribute2(10 + "");
} else if (type.equals(MsgSubscribeTypeEnum.CHECKTYPE)
|| type.equals(MsgSubscribeTypeEnum.CHECKEMAIL)) {
msgSub.setAttribute1("error");
}
/**else if (type.equals(MsgSubscribeTypeEnum.ROUTE) && !userInitParam.getInit()) {
// TODO 查询该用户下的路线
String roleTypeName = userInitParam.getRoleTypeName();
String orgCode = userInitParam.getOrgCode();
Specification<Route> spec = new Specification<Route>() {// 构建查询条件
@Override
public Predicate toPredicate(Root<Route> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
List<Predicate> predicate = new ArrayList<>();
if (!ObjectUtils.isEmpty(roleTypeName)) {
if (XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName)
|| XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName)) {
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode + "%"));
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)) {
String orgCode_ = orgCode;
if (orgCode.indexOf("-") != -1) {
orgCode_ = orgCode.substring(0, orgCode.indexOf("-"));
}
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode_ + "%"));
} else {
predicate.add(cb.equal(root.get("orgCode").as(String.class), orgCode));
}
}
Predicate[] pre = new Predicate[predicate.size()];
return query.where(predicate.toArray(pre)).getRestriction();
}
};
List<Route> routeList = iRouteDao.findAll(spec);
List<Long> routeIdList = new ArrayList<>();
for (Route route : routeList) {
routeIdList.add(route.getId());
}
String routeIds = StringUtils.join(routeIdList.toArray(), ",");
msgSub.setAttribute1(routeIds);
}*/
msgSub.setMsgType(type.getName());
msgSubscribeDao.saveAndFlush(msgSub);
msgConfigs.add(msgSub);
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public List<MsgSubscribe> saveUserMsgInit(UserMsgInitParam userInitParam) {
Long count = msgSubscribeDao.countByUserId(userInitParam.getUserId());
if (count > 0) { // 已存在用户订阅,直接返回
return msgSubscribeService.queryMsgSubscribes(userInitParam.getUserId());
}
List<MsgSubscribe> msgConfigs = new ArrayList<MsgSubscribe>();
for (MsgSubscribeTypeEnum type : MsgSubscribeTypeEnum.values()) {
MsgSubscribe msgSub = new MsgSubscribe();
msgSub.setOrgCode(userInitParam.getOrgCode());
msgSub.setUserId(userInitParam.getUserId());
if (type.equals(MsgSubscribeTypeEnum.PLANBEGIN)
|| type.equals(MsgSubscribeTypeEnum.PLANWARN)
|| type.equals(MsgSubscribeTypeEnum.PLANEND)) {
msgSub.setAttribute1("False");
msgSub.setAttribute2(10 + "");
} else if (type.equals(MsgSubscribeTypeEnum.CHECKTYPE)
|| type.equals(MsgSubscribeTypeEnum.CHECKEMAIL)) {
msgSub.setAttribute1("error");
}
msgSub.setMsgType(type.getName());
msgSubscribeDao.saveAndFlush(msgSub);
msgConfigs.add(msgSub);
}
return msgConfigs;
}
}
return msgConfigs;
}
@Override
public List<String> getHaveToDoList(String userId) {
int taskCount = planTaskMapper.getCurrentPlanTaskCount(userId);
@Override
public List<String> getHaveToDoList(String userId) {
int taskCount = planTaskMapper.getCurrentPlanTaskCount(userId);
List<String> havetoDoList = Lists.newArrayList();
if (taskCount > 0) {
havetoDoList.add("planPatrol");
}
JSONObject respBody = remoteWorkFlowService.pageTask(userId,Integer.parseInt(YesOrNoEnum.YES.getCode()));
JSONArray taskJsonList = respBody.getJSONArray("data");
List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class);
List<String> bussinessKeys = new ArrayList<>();
for (JSONObject json : taskList) {
bussinessKeys.add(json.getString("businessKey"));
}
Integer dangerCount = latentDangerMapper.countByStatus(bussinessKeys);
if(dangerCount > 0){
havetoDoList.add("waitHandle");
}
return havetoDoList;
}
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yeejoin.amos.maintenance.common.enums.CheckStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PointLevelEnum;
import com.yeejoin.amos.maintenance.common.enums.PointStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.*;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
......@@ -138,11 +139,10 @@ public class CheckServiceImpl implements ICheckService {
check.setPlanTaskId(recordParam.getPlanTaskId());
check.setPlanId(planTask.getPlanId());
check.setPlanName(detail.get("planName").toString());
check.setPointName(detail.get("pointName").toString());
recordParam.setPointName(detail.get("pointName").toString());
check.setPointId(recordParam.getPointId());
check.setPointName(point.getName());
check.setPointId(point.getId());
check.setRemark(recordParam.getRemark());
check.setCheckTime(DateUtil.getLongDate(recordParam.getCheckTime()));
check.setCheckTime(new Date());
check.setUploadTime(new Date());
check.setOrgCode(recordParam.getOrgCode());
check.setUserId(mtUserSeq);
......@@ -158,7 +158,7 @@ public class CheckServiceImpl implements ICheckService {
CheckInput checkInput = new CheckInput();
checkInput.setCreateDate(new Date());
checkInput.setOrgCode(recordParam.getOrgCode());
checkInput.setInputId(Long.valueOf(item.getInputItemId() + ""));
checkInput.setInputId(inputItem.getId());
checkInput.setInputName(inputItem.getName());
checkInput.setOrderNo(inputItem.getOrderNo());
checkInput.setRemark(item.getRemark());
......@@ -176,7 +176,7 @@ public class CheckServiceImpl implements ICheckService {
Map<String, Object> unCheckMap = Maps.newHashMap();
unCheckMap.put("itemId", item.getInputItemId());
unCheckMap.put("routeId", check.getRouteId());
unCheckMap.put("pointId", recordParam.getPointId());
unCheckMap.put("pointId", point.getId());
unCheckMap.put("name", inputItem.getName());
unCheckMap.put("inputValue", item.getInputValue());
unqualifiedCheckItemList.add(unCheckMap);
......@@ -225,6 +225,7 @@ public class CheckServiceImpl implements ICheckService {
checkItemList.forEach(c -> {
c.getCheckShotList().forEach(s -> {
s.setCheckId(c.getCheckId());
s.setOrgCode(recordParam.getOrgCode());
s.setCheckInputId(c.getId());
});
allShot.addAll(c.getCheckShotList());
......@@ -1030,6 +1031,38 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> params, CommonPageable page) {
List<HashMap<String, Object>> content = Lists.newArrayList();
long total = checkMapper.getCheckCount(params);
if (total == 0) {
return new PageImpl<>(content, page, total);
}
params.put("offset", page.getOffset());
params.put("pageSize", page.getPageSize());
content = checkMapper.getChecks(params);
if (0 < content.size()) {
for(HashMap<String, Object> map : content) {
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
}
}
return new PageImpl<>(content, page, total);
}
@Override
public Map<String, Object> getCheckDetail(String id) {
Map<String, Object> map = checkMapper.getCheckDetail(id);
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
if (map.containsKey("picture")) {
map.put("picture", fileUrl + map.get("picture"));
}
return map;
}
@Override
public List<HashMap<String, Object>> getEquipInputByCheckId(CheckDetailInputPageParam param) {
// 如果不传巡检ID,则获取最新一条巡检点对应的巡检记录ID
if (param.getCheckID() == -1) {
......
......@@ -1022,6 +1022,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
facility.put("pointNo", point.getPointNo());
facility.put("position", point.getBuildingName() + point.getAddress());
facility.put("userName", planTask.getUserName());
facility.put("planTaskId", planTask.getId());
facility.put("riskAndManage", point.getRemark());
return facility;
}
......
package com.yeejoin.amos.maintenance.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckDetailBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInfoBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInputBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckTraListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PlanRoutePointBo;
import com.yeejoin.amos.maintenance.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
import com.yeejoin.amos.maintenance.business.entity.mybatis.*;
import com.yeejoin.amos.maintenance.business.param.*;
import com.yeejoin.amos.maintenance.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.CommonPage;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.common.response.QueryCriteriaRespone;
import com.yeejoin.amos.maintenance.dao.entity.CheckShot;
import com.yeejoin.amos.maintenance.exception.YeeException;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface ICheckService {
/**
......@@ -269,6 +256,9 @@ public interface ICheckService {
*/
Map<String,CheckRecordDto> obtainLastCheckRecord(String[] relationId);
Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> map, CommonPageable pageable);
Map<String, Object> getCheckDetail(String id);
/**
* 校验是否已经填写过
* @param planTaskId
......
package com.yeejoin.amos.maintenance.business.service.intfc;
import java.util.List;
import org.springframework.data.domain.Page;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.maintenance.business.param.LatentDangerExcuteParam;
import com.yeejoin.amos.maintenance.business.param.LatentDangerListParam;
import com.yeejoin.amos.maintenance.business.param.LatentDangerNormalParam;
import com.yeejoin.amos.maintenance.business.param.LatentDangerPatrolParam;
import com.yeejoin.amos.maintenance.business.param.PageParam;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.maintenance.core.common.response.DangerListResponse;
/**
* @author keyong
* @title: ILatentDangerService
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:44
*/
public interface ILatentDangerService {
CommonResponse saveNormal(LatentDangerNormalParam latentDangerParam, String userId, String userRealName,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role);
CommonResponse savePatrol(LatentDangerPatrolParam latentDangerPatrolParam, String userId, String userRealName,
String departmentId, String departmentName, String companyId, String orgCode, RoleBo role);
CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId);
DangerExecuteSubmitDto execute(LatentDangerExcuteParam latentDangerExcuteParam, String userId,
String userRealName, String departmentId, String departmentName, RoleBo role);
CommonResponse detail(String id, String userId,boolean isFinish);
CommonResponse getByInstanceId(String instanceId);
DangerExecuteSubmitDto excuteCallBack(String instanceId, Integer actionType, String remark, String token, String userId,
String userRealName, String departmentId, String departmentName);
void updateDangerStateOfOvertime();
CommonResponse listFlowRecord(String token, String product, String appKey, Long id);
void sendLatentDangerExcuteResult(DangerExecuteSubmitDto executeSubmitDto);
void freshRiskJudgmentLangerCount(LatentDangerExcuteParam latentDangerExcuteParam);
/**
* 获取隐患等级字典值
*
* @return
*/
Object getDangerLevel(String token, String product, String appKey, String dictCode);
/**
* 根据等级字符串获取等级字典对象
*
* @param dangerLevelStr 等级("1","2","0")
* @return
*/
JSONObject getDangerLevelJsonObject(String dangerLevelStr, String token, String product, String appKey, String dictCode);
/**
* 根据隐患id获取评审信息
*
* @param dangerId
* @return
*/
JSONObject getReviewInfo(Long dangerId);
Page<DangerListResponse> listDanger(PageParam pageParam);
List<DangerListResponse> export(PageParam pageParam);
List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime);
}
......@@ -17,8 +17,6 @@ public class CheckParamUtil {
if("checkTime".equals(name)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString());
}else if("userId".equals(name)){
param.setUserId(daoCriterias.get(i).getValue().toString());
}else if("routeId".equals(name)){
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){
......
package com.yeejoin.amos.maintenance.business.vo;
import lombok.Data;
import java.util.List;
@Data
public class LatentDangerDetailRiskVo {
private String pointName;
private String pointNo;
private String belongDepartmentName;
private String pointLevel;
private List<String> basis;
/**
* 计划名称
*/
private String planName;
/**
* 检查时间
*/
private String checkTime;
/**
* 检查人
*/
private String checkUser;
}
package com.yeejoin.amos.maintenance.business.vo;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo;
import lombok.Data;
import java.util.List;
@Data
public class LatentDangerDetailVo {
private Long dangerId;
private String dangerName;
private Integer level;
private String levelDesc;
private String remark;
private String position;
private String reformTypeDesc;
private String reformLimitDate;
private JSONObject reformJson;
private Long currentFlowRecordId;
private Integer dangerState;
private Integer dangerType;
private String dangerStateDesc;
private Boolean currentUserCanExcute;
private List<String> photoUrls;
private LatentDangerDetailRiskVo riskInfo;
private JSONObject reviewInfo;
private JSONObject reformInfo;
private JSONObject recheckInfo;
private List<LatentDangerFlowRecordBo> records;
private String delayLimitDate;
private String problemDescription;
private String reasonAnalysis;
private String inferOtherThings;
private String taskId;
}
package com.yeejoin.amos.maintenance.business.vo;
import lombok.Data;
@Data
public class LatentDangerListVo {
private Long dangerId;
private String dangerName;
private String discovererUserName;
private Integer level;
private String levelDesc;
private String limitDesc;
private Integer state;
private String stateDesc;
private Integer overtimeState;
private String taskId;
}
//package com.yeejoin.amos.maintenance.common.remote;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.google.common.collect.Maps;
//import com.yeejoin.amos.maintenance.business.constants.XJConstant;
//import com.yeejoin.amos.maintenance.business.util.HttpUtil;
//import com.yeejoin.amos.maintenance.common.enums.WorkFlowRiskFactorUriEnum;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.springframework.util.StringUtils;
//
//import java.util.Map;
//
//@Service("remoteSpcService")
//public class RemoteRiskFactorFlowService {
//
// private final Logger logger = LoggerFactory.getLogger(RemoteRiskFactorFlowService.class);
//
// /* @Value("${params.spc.address}")
// private String address;*/
//
// private static final String success = "SUCCESS";
//
// private String buildUrl(String address, WorkFlowRiskFactorUriEnum workFlowRiskFactorUriEnum, Map<String, String> map) {
// String uri = workFlowRiskFactorUriEnum.getUri();
// String params = workFlowRiskFactorUriEnum.getParams();
// if (!StringUtils.isEmpty(params) && map != null) {
// String[] paramsArr = params.split(",");
// for (String param : paramsArr) {
// uri = uri.replace("{" + param + "}", map.get(param));
// }
// }
// return address + uri;
// }
//
// private JSONObject handleResult(String resultStr) {
// if (resultStr == null) {
// return null;
// }
// JSONObject json = JSON.parseObject(resultStr);
// if (success.equals(json.getString("result"))) {
// return json;
// }
// return null;
// }
//
// /* public JSONObject wakeUpRiskFactorFlow(String pointClassifyOriginalId, String token) {
// String url = buildUrl(address, WorkFlowRiskFactorUriEnum.唤起流程, null);
// JSONObject body = new JSONObject();
// body.put("riskFactorId", pointClassifyOriginalId);
// Map<String, String> headerMap = Maps.newHashMap();
// headerMap.put(XJConstant.TOKEN_KEY, token);
// String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
// return handleResult(resultStr);
// }
//*/
//
//}
package com.yeejoin.amos.maintenance.common.remote;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.yeejoin.amos.maintenance.business.util.HttpUtil;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.common.enums.RiskFactorWorkFlowActionTypeEnum;
import com.yeejoin.amos.maintenance.common.enums.WorkFlowRiskFactorUriEnum;
import com.yeejoin.amos.maintenance.core.common.request.CheckResultPushSpcRequest;
import com.yeejoin.amos.maintenance.core.common.request.LatentDangerResultPushSpcRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Map;
@Service("remoteSpcService")
public class RemoteSpcService {
private final Logger logger = LoggerFactory.getLogger(RemoteSpcService.class);
@Value("${params.spc.address}")
private String address;
private static final String success = "SUCCESS";
private String buildUrl(String address, WorkFlowRiskFactorUriEnum workFlowRiskFactorUriEnum, Map<String, String> map) {
String uri = workFlowRiskFactorUriEnum.getUri();
String params = workFlowRiskFactorUriEnum.getParams();
if (!StringUtils.isEmpty(params) && map != null) {
String[] paramsArr = params.split(",");
for (String param : paramsArr) {
uri = uri.replace("{" + param + "}", map.get(param));
}
}
return address + uri;
}
private JSONObject handleResult(String resultStr) {
if (resultStr == null) {
return null;
}
JSONObject json = JSON.parseObject(resultStr);
if (success.equals(json.getString("result"))) {
return json;
}
return null;
}
public JSONObject wakeUpOrRestartRiskFactorFlow(String instanceId, WorkFlowRiskFactorUriEnum factorUriEnum, String token, RiskFactorWorkFlowActionTypeEnum actionType) {
String url = buildUrl(address, factorUriEnum, null);
JSONObject body = new JSONObject();
body.put("instanceId", instanceId);
body.put("actionType", actionType.getActionType());
Map<String, String> headerMap = Maps.newHashMap();
headerMap.put(XJConstant.TOKEN_KEY, token);
String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
return handleResult(resultStr);
}
public JSONObject pushSpcCheckResult(CheckResultPushSpcRequest checkResultPushSpcRequest) {
String url = buildUrl(address, WorkFlowRiskFactorUriEnum.检查结果推送, null);
String stringJson = JSONObject.toJSONString(checkResultPushSpcRequest);
String resultStr = HttpUtil.sendHttpPostJson(url, stringJson);
return handleResult(resultStr);
}
public JSONObject pushLatentDangerExcuteResult(LatentDangerResultPushSpcRequest latentDangerResultPushSpcRequest) {
String url = buildUrl(address, WorkFlowRiskFactorUriEnum.隐患治理结果推送, null);
String stringJson = JSONObject.toJSONString(latentDangerResultPushSpcRequest);
String resultStr = HttpUtil.sendHttpPostJson(url, stringJson);
logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + stringJson + "\r\n返回参数=======================>" + resultStr);
return handleResult(resultStr);
}
public JSONObject queryPagetree() {
String url = buildUrl(address, WorkFlowRiskFactorUriEnum.等级查询, null);
String resultStr = HttpUtil.sendHttpPostJson(url, null);
return handleResult(resultStr);
}
}
package com.yeejoin.amos.maintenance.schedule;
import com.yeejoin.amos.maintenance.business.service.intfc.ILatentDangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
/**
* 隐患定时任务
*/
@Configuration("latentDanerScheduled")
@EnableScheduling
public class LatentDanerScheduled {
@Autowired
private ILatentDangerService iLatentDangerService;
/**
* 每1分钟执行一次:查询逾期的隐患,修改状态
*/
// @Scheduled(cron = "0 0/1 * * * ?")
public void updateDangerStateOfOvertime() {
iLatentDangerService.updateDangerStateOfOvertime();
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -13,41 +23,15 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* 警情接警填报记录服务实现类
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
......@@ -105,8 +106,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String content = template.getContent();
// 替换模板内容
// 通用替换字段 报修时间 地址 电梯识别码 使用单位分类
SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
String createTime = sdf.format(alertCalledDto.getCallTime());
String createTime = DateUtils.date2LongStr(alertCalledDto.getCallTime());
String rescueCode = alertCalledDto.getDeviceId();
String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall();
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.RepairConsultMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IRepairConsultService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -83,7 +84,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto();
// 获取模板 拼接json
QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>();
templateQueryWrapper.eq("type_code","RECORD-" + type);
if(TzsCommonParam.WXFK_TS.equals(type)) {
templateQueryWrapper.eq("type_code","RECORD-WXFK");
} else {
templateQueryWrapper.eq("type_code","RECORD-" + type);
}
Template template = templateServiceImpl.getOne(templateQueryWrapper);
String content = template.getContent();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -103,7 +108,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType);
} else if("PQ".equals(type)) {
} else if(TzsCommonParam.PQ.equals(type)) {
String createUser = user.getUserName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName();
......@@ -125,25 +130,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
}
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$unit",unit);
content = content.replace("$person",person).replace("$phone",phone).replace("$taskType",taskType);
} else if("DD".equals(type)) {
} else if(TzsCommonParam.DD.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS);
} else if("JC".equals(type)) {
} else if(TzsCommonParam.JC.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS);
} else if("JYHF".equals(type)) {
} else if(TzsCommonParam.JYHF.equals(type)) {
String createUser = user.getUserName();
String create = alertCalledVo.getEmergencyPerson();
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create);
} else if("WXFK".equals(type)) { //从派遣单获取数据
} else if(TzsCommonParam.WXFK.equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
......@@ -152,12 +157,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("fix_result".equals(alertFormValue.getFieldCode())) {
if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
} else if("WXFK-TS".equals(type)) { //从派遣单获取数据
} else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
......@@ -166,13 +171,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("action_result".equals(alertFormValue.getFieldCode())) {
if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
type = "WXFK";
} else if("BXFK".equals(type)) {
type = TzsCommonParam.WXFK;
} else if(TzsCommonParam.BXFK.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
......@@ -180,14 +185,14 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("fix_feedback_type".equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue());
} else if("fix_result".equals(alertFormValue.getFieldCode())) {
if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} else if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("fixResult"));
} else if("TSRFK".equals(type)) {
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("fixResult"));
} else if(TzsCommonParam.TSRFK.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
......@@ -195,13 +200,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("consult_feedback_type".equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue());
} else if("action_result".equals(alertFormValue.getFieldCode())) {
if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} else if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("action_result",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("action_result"));
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("action_result"));
}
repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId());
......
......@@ -96,7 +96,6 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if(arriveTime != null && dispatchTime != null) {
Long arriveTimes = arriveTime.getTime() - dispatchTime.getTime(); // 相差毫秒数
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");//这里想要只保留分秒可以写成"mm:ss"
formatter.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
String hms = formatter.format(arriveTimes);
rescueProcessDto.setIsTimeout(arriveTimes < 1800000 ? false : true);
rescueProcessDto.setArriveUseTime(hms);
......
......@@ -25,12 +25,6 @@ spring.redis.timeout=1000
jobs.cron = 0 0/1 22-23 * * ?
#jpush 推送配置项
params.isPush = false
params.work.flow.normalProcessDefinitionKey=normalHazardManagement
params.work.flow.processDefinitionKey=hazardManagement
params.work.flow.address=http://172.16.10.80:30040
params.spc.address=http://172.16.3.89:9001
#websocket
params.remoteWebsocketUrl=http://39.100.241.164:8080/
#websocket send message url
......@@ -45,9 +39,9 @@ linux.img.path = /
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super
emqx.password=a123456
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
file.url=http://39.98.45.134:9000/
\ No newline at end of file
......@@ -38,4 +38,13 @@
ALTER TABLE p_point ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '所在建筑名称' AFTER `building_id`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-3">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_check_shot" columnName="org_code"/>
</preConditions>
<comment>p_check_shot modify COLUMN org_code 需求变更</comment>
<sql>
ALTER TABLE p_check_shot modify `org_code` varchar(100) DEFAULT NULL COMMENT '权限系统org code';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<changeSet author="suhuiguang" id="1628836692856-1" runOnChange="true">
<createProcedure procedureName="updatePlanTask" >
DROP PROCEDURE IF EXISTS `updatePlanTask`;
CREATE PROCEDURE `updatePlanTask`(IN `planTaskId` int,IN `pointId` int,IN `planTaskDetailId` int,IN `executorId` int)
CREATE PROCEDURE `updatePlanTask`(IN `planTaskId` int,IN `pointId` int,IN `planTaskDetailId` int,IN `executorId` bigint)
BEGIN
declare num int ;
declare orgCode VARCHAR(50) ;
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerPatrolMapper">
<insert id="save" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
useGeneratedKeys="true">
insert into p_latent_danger_patrol
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="latentDangerId != null">
latent_danger_id,
</if>
<if test="pointClassifyId != null">
point_classify_id,
</if>
<!-- <if test="riskFactorFlowId != null">-->
<!-- risk_factor_flow_id,-->
<!-- </if>-->
<if test="checkId != null">
check_id,
</if>
<if test="itemId != null">
item_id,
</if>
<if test="pointId != null">
point_id,
</if>
<if test="routeId != null">
route_id,
</if>
<if test="routePointItemId != null">
route_point_item_id,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createDate != null">
create_date,
</if>
<if test="updateDate != null">
update_date,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="latentDangerId != null">
#{latentDangerId},
</if>
<if test="pointClassifyId != null">
#{pointClassifyId},
</if>
<!-- <if test="riskFactorFlowId != null">-->
<!-- #{riskFactorFlowId},-->
<!-- </if>-->
<if test="checkId != null">
#{checkId},
</if>
<if test="itemId != null">
#{itemId},
</if>
<if test="pointId != null">
#{pointId},
</if>
<if test="routeId != null">
#{routeId},
</if>
<if test="routePointItemId != null">
#{routePointItemId},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createDate != null">
#{createDate},
</if>
<if test="updateDate != null">
#{updateDate},
</if>
</trim>
</insert>
<update id="update" parameterType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo">
update p_latent_danger_patrol
<set>
<if test="latentDangerId != null">
latent_danger_id = #{latentDangerId},
</if>
<if test="pointClassifyId != null">
point_classify_id = #{pointClassifyId},
</if>
<if test="checkId != null">
check_id = #{checkId},
</if>
<if test="riskFactorFlowId != null">
risk_factor_flow_id = #{riskFactorFlowId},
</if>
<if test="itemId != null">
item_id = #{itemId},
</if>
<if test="pointId != null">
point_id = #{pointId},
</if>
<if test="routeId != null">
route_id = #{routeId},
</if>
<if test="routePointItemId != null">
route_point_item_id = #{routePointItemId},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createDate != null">
create_date = #{createDate},
</if>
<if test="updateDate != null">
update_date = #{updateDate},
</if>
</set>
where id = #{id}
</update>
<delete id="deleteByLatentDangerIds">
update p_latent_danger_patrol set deleted = 1 where latent_danger_id in
<foreach collection="list" index="index" item="latentDangerId" open="(" separator="," close=")">
#{latentDangerId}
</foreach>
</delete>
<select id="getByDangerId" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo">
select
a.*,
b.name as itemName,
b.original_id as itemOriginalId,
b.basis_json as itemBasis,
b.remark as itemRemark,
c.name as pointName,
c.point_no as pointNo,
c.level as pointLevel,
c.charge_dept_id as pointDepartMentId,
c.original_id as pointOriginalId,
d.name as routeName,
e.check_time as checkTime,
e.user_id as checkUserId,
e.dep_id as checkDepartmentId,
f.name as planName,
f.plan_type as planType,
f.execute_rate as executeRate,
g.original_id as classifyOriginalId,
g.name as classifyName
from
p_latent_danger_patrol as a
left join
p_input_item as b on a.item_id = b.id
left join
p_point as c on a.point_id = c.id
left join
p_route as d on a.route_id = d.id
left join
p_check as e on a.check_id = e.id
left join
p_plan as f on e.plan_id = f.id
left join
p_point_classify as g on a.point_classify_id = g.id
where
a.deleted = 0
and
a.latent_danger_id = #{dangerId}
</select>
<select id="listByMap" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo">
select
a.*
from
p_latent_danger_patrol as a
left join
p_latent_danger as b
<where>
<if test="pointId != null">
and a.point_id = #{pointId}
</if>
<if test="itemId != null">
and a.item_id = #{itemId}
</if>
<if test="pointClassifyId != null">
and a.point_classify_id = #{pointClassifyId}
</if>
<if test="dangerType != null">
and b.danger_type = #{dangerType}
</if>
</where>
</select>
<select id="listByPointId" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo">
select
*
from
p_latent_danger_patrol
where
point_id = #{pointId}
</select>
<select id="queryByPointClassifyIds"
resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo">
select * from p_latent_danger_patrol where point_classify_id in
<foreach collection="list" index="index" item="pointClassifyId" open="(" separator="," close=")">
#{pointClassifyId}
</foreach>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentItemMapper">
<insert id="save" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
useGeneratedKeys="true">
insert into spc_risk_judgment_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemFlag != null">
item_flag,
</if>
<if test="itemLevel != null">
item_level,
</if>
<if test="itemType != null">
item_type,
</if>
<if test="itemName != null">
item_name,
</if>
<if test="itemParentId != null">
item_parent_id,
</if>
<if test="itemCanCopy != null">
item_can_copy,
</if>
<if test="selectName != null">
select_name,
</if>
<if test="selectIsNeed != null">
select_is_need,
</if>
<if test="selectIsRequired != null">
select_is_required,
</if>
<if test="selectJson != null">
select_json,
</if>
<if test="inputName != null">
input_name,
</if>
<if test="inputType != null">
input_type,
</if>
<if test="inputCanEdit != null">
input_can_edit,
</if>
<if test="inputIsNeed != null">
input_is_need,
</if>
<if test="inputIsRequired != null">
input_is_required,
</if>
<if test="remarkIsNeed != null">
remark_is_need,
</if>
<if test="remarkIsRequired != null">
remark_is_required,
</if>
<if test="photoIsNeed != null">
photo_is_need,
</if>
<if test="photoIsRequired != null">
photo_is_required,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createDate != null">
create_date,
</if>
<if test="updateDate != null">
update_date,
</if>
<if test="orgCode != null">
org_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemFlag != null">
#{itemFlag},
</if>
<if test="itemLevel != null">
#{itemLevel},
</if>
<if test="itemType != null">
#{itemType},
</if>
<if test="itemName != null">
#{itemName},
</if>
<if test="itemParentId != null">
#{itemParentId},
</if>
<if test="itemCanCopy != null">
#{itemCanCopy},
</if>
<if test="selectName != null">
#{selectName},
</if>
<if test="selectIsNeed != null">
#{selectIsNeed},
</if>
<if test="selectIsRequired != null">
#{selectIsRequired},
</if>
<if test="selectJson != null">
#{selectJson},
</if>
<if test="inputName != null">
#{inputName},
</if>
<if test="inputType != null">
#{inputType},
</if>
<if test="inputCanEdit != null">
#{inputCanEdit},
</if>
<if test="inputIsNeed != null">
#{inputIsNeed},
</if>
<if test="inputIsRequired != null">
#{inputIsRequired},
</if>
<if test="remarkIsNeed != null">
#{remarkIsNeed},
</if>
<if test="remarkIsRequired != null">
#{remarkIsRequired},
</if>
<if test="photoIsNeed != null">
#{photoIsNeed},
</if>
<if test="photoIsRequired != null">
#{photoIsRequired},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createDate != null">
#{createDate},
</if>
<if test="updateDate != null">
#{updateDate},
</if>
<if test="orgCode != null">
#{orgCode},
</if>
</trim>
</insert>
<update id="update" parameterType="com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo">
update spc_risk_judgment_item
<set>
<if test="itemFlag != null">
item_flag = #{itemFlag},
</if>
<if test="itemLevel != null">
item_level = #{itemLevel},
</if>
<if test="itemType != null">
item_type = #{itemType},
</if>
<if test="itemName != null">
item_name = #{itemName},
</if>
<if test="itemParentId != null">
item_parent_id = #{itemParentId},
</if>
<if test="itemCanCopy != null">
item_can_copy = #{itemCanCopy},
</if>
<if test="selectName != null">
select_name = #{selectName},
</if>
<if test="selectIsNeed != null">
select_is_need = #{selectIsNeed},
</if>
<if test="selectIsRequired != null">
select_is_required = #{selectIsRequired},
</if>
<if test="selectJson != null">
select_json = #{selectJson},
</if>
<if test="inputName != null">
input_name = #{inputName},
</if>
<if test="inputTye != null">
input_type = #{inputTye},
</if>
<if test="inputCanEdit != null">
input_can_edit = #{inputCanEdit},
</if>
<if test="inputIsNeed != null">
input_is_need = #{inputIsNeed},
</if>
<if test="inputIsRequired != null">
input_is_required = #{inputIsRequired},
</if>
<if test="remarkIsNeed != null">
remark_is_need = #{remarkIsNeed},
</if>
<if test="remarkIsRequired != null">
remark_is_required = #{remarkIsRequired},
</if>
<if test="photoIsNeed != null">
photo_is_need = #{photoIsNeed},
</if>
<if test="photoIsRequired != null">
photo_is_required = #{photoIsRequired},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createDate != null">
create_date = #{createDate},
</if>
<if test="updateDate != null">
update_date = #{updateDate},
</if>
<if test="orgCode != null">
org_code = #{orgCode},
</if>
</set>
where id = #{id}
</update>
<select id="listAllItemByDepartmentCode" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo">
select
*
from
spc_risk_judgment_item
where
deleted = 0
and
department_code = #{departmentCode}
</select>
<select id="findByItemId" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo">
select * from spc_risk_judgment_item where id = #{itemId}
</select>
</mapper>
\ No newline at end of file
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