Commit 3b4c9369 authored by suhuiguang's avatar suhuiguang

1.删除隐患

parent 6b9dc633
......@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0),
UNDERWAY("处理中",1),
UNDERWAY("待执行",1),
FINISHED("已结束",2),
OVERTIME("已超时",3);
......
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;
}
......@@ -46,6 +46,7 @@ public class PlanTaskController extends AbstractBaseController {
/**
* 计划执行查询
*
* @param queryRequests
* @param commonPageable
* @return
......@@ -185,27 +186,6 @@ public class PlanTaskController extends AbstractBaseController {
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish", required = false) String isFinish,
@ApiParam(value = "消防系统id", required = true) @RequestParam(value = "systemId", required = false) String systemId,
@ApiParam(value = "设备编号", required = true) @RequestParam(value = "pointNo", required = false) String pointNo,
@ApiParam(value = "设备名称", required = true) @RequestParam(value = "pointName", required = false) String pointName
) {
Map<String, Object> param = new HashMap<>();
param.put("planTaskId", planTaskId);
param.put("buildingId", buildingId);
param.put("isFinish", isFinish);
param.put("systemId", systemId);
param.put("pointNo", pointNo);
param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
/**
* 查询任务列表
*
......@@ -241,8 +221,30 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id") @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态") @RequestParam(value = "isFinish", required = false) String isFinish,
@ApiParam(value = "消防系统id") @RequestParam(value = "systemId", required = false) String systemId,
@ApiParam(value = "设备编号") @RequestParam(value = "pointNo", required = false) String pointNo,
@ApiParam(value = "设备名称") @RequestParam(value = "pointName", required = false) String pointName
) {
Map<String, Object> param = new HashMap<>();
param.put("planTaskId", planTaskId);
param.put("buildingId", buildingId);
param.put("isFinish", isFinish);
param.put("systemId", systemId);
param.put("pointNo", pointNo);
param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情")
@ApiOperation(value = "查询维保设施,检查内容详情-mobile")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId,
......
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.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.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;
}
......@@ -3,145 +3,96 @@ 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.MsgSubscribeTypeEnum;
import com.yeejoin.amos.maintenance.common.enums.YesOrNoEnum;
import com.yeejoin.amos.maintenance.common.remote.RemoteWorkFlowService;
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 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 java.util.ArrayList;
import java.util.List;
@Service("iAppService")
public class AppServiceImpl implements IAppService {
@Autowired
private IMsgSubscribeDao msgSubscribeDao;
@Autowired
private IMsgSubscribeDao msgSubscribeDao;
@Autowired
private AppVersionDao appVersionDao;
@Autowired
private RemoteWorkFlowService remoteWorkFlowService;
@Autowired private IMsgSubscribeService msgSubscribeService;
private RemoteWorkFlowService remoteWorkFlowService;
@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");
}
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"));
}
return havetoDoList;
}
}
}
\ No newline at end of file
......@@ -24,6 +24,7 @@ import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
......@@ -569,6 +570,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize());
content = planTaskMapper.getPlanTasks(params);
content.forEach(r->{
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(r.get("finishStatus").toString()));
r.put("finishStatusDesc",finishStatusDesc);
});
return new PageImpl<>(content, pageParam, total);
}
......
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);
}
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.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
<?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
......@@ -108,9 +108,6 @@
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
<if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if>
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
......
......@@ -178,7 +178,6 @@
pt.id planTaskId,
pt.org_code orgCode,
p.name taskName,
pt.status,
pt.user_id userId,
date_format(
pt.begin_time,
......@@ -339,9 +338,11 @@
<select id="getPlanTaskPoints" resultType="Map">
SELECT
ptd.id,
p.id as pointId,
p.name,
p.point_no pointNo,
concat_ws(' ',p.building_name,p.address) as position,
concat_ws('',p.building_name,p.address) as position,
p.belong_system_id as belongSystemId,
p.belong_system_name as belongSystemName,
ptd.status,
ptd.is_finish as isFinish,
......
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