Commit 7e613951 authored by chenhao's avatar chenhao

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

parents 68d64cfa 03cf25ae
...@@ -7,7 +7,7 @@ import java.util.Map; ...@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum { public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0), NOTSTARTED("未开始",0),
UNDERWAY("处理中",1), UNDERWAY("待执行",1),
FINISHED("已结束",2), FINISHED("已结束",2),
OVERTIME("已超时",3); 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;
}
...@@ -70,7 +70,7 @@ public class DispatchConsultFeedbackDto extends BaseDto { ...@@ -70,7 +70,7 @@ public class DispatchConsultFeedbackDto extends BaseDto {
private String errorResult; private String errorResult;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String Remark; private String remark;
@ApiModelProperty(value = "维保反馈结果") @ApiModelProperty(value = "维保反馈结果")
private String mainFeedbackResult; private String mainFeedbackResult;
......
...@@ -73,7 +73,7 @@ public class DispatchRepairFeedbackDto extends BaseDto { ...@@ -73,7 +73,7 @@ public class DispatchRepairFeedbackDto extends BaseDto {
private String errorResult; private String errorResult;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String Remark; private String remark;
@ApiModelProperty(value = "回访时间") @ApiModelProperty(value = "回访时间")
private Date feedbackTime; private Date feedbackTime;
......
...@@ -67,7 +67,7 @@ public class DispatchSaveFeedbackDto extends BaseDto { ...@@ -67,7 +67,7 @@ public class DispatchSaveFeedbackDto extends BaseDto {
private String errorResult; private String errorResult;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String Remark; private String fixRemark;
@ApiModelProperty(value = "回访时间") @ApiModelProperty(value = "回访时间")
private Date feedbackTime; private Date feedbackTime;
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -125,9 +126,9 @@ public class FailureDetailsController extends BaseController { ...@@ -125,9 +126,9 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<IPage<FailureDetails>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size,@RequestParam Integer type) { (value = "size") int size, @RequestParam Integer type) {
Page<FailureDetailsDto> page = new Page<FailureDetailsDto>(); Page<FailureDetails> page = new Page<FailureDetails>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
final AgencyUserModel userInfo = getUserInfo(); final AgencyUserModel userInfo = getUserInfo();
...@@ -156,7 +157,7 @@ public class FailureDetailsController extends BaseController { ...@@ -156,7 +157,7 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/list/{currentStatus}") @GetMapping(value = "/list/{currentStatus}")
public ResponseModel<List<FailureDetails>> selectStatusForList(@PathVariable Long currentStatus) { public ResponseModel<List<FailureDetails>> selectStatusForList(@PathVariable Long currentStatus) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsList(currentStatus)); return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureStatus(currentStatus));
} }
/** /**
...@@ -171,22 +172,6 @@ public class FailureDetailsController extends BaseController { ...@@ -171,22 +172,6 @@ public class FailureDetailsController extends BaseController {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(type)); return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(type));
} }
/* *//**c
* 待处理Test
*
* @return
/* *//**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "待处理", notes = "待处理")
@GetMapping(value = "/list/daichuli")
public ResponseModel<Page<FailureDetailsDto>> selectISubmit(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,@RequestParam Long currentStatus) {
Page<FailureDetailsDto> page = new Page<FailureDetailsDto>();
page.setCurrent(current);
page.setSize(size);
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForMe(page,userId,currentStatus));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息") @ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息")
......
...@@ -123,7 +123,7 @@ public class FailureRepairlogController extends BaseController { ...@@ -123,7 +123,7 @@ public class FailureRepairlogController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询报修日志", notes = "查询报修日志") @ApiOperation(httpMethod = "GET",value = "查询报修日志", notes = "查询报修日志")
@GetMapping(value = "/list/{faultId}") @GetMapping(value = "/list/{faultId}")
public ResponseModel<List<FailureRepairlog>> findByFaultIdLog(@RequestParam Long faultId) { public ResponseModel<List<FailureRepairlog>> findByFaultIdLog(@PathVariable Long faultId) {
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.findByfaultIdLog(faultId)); return ResponseHelper.buildResponse(failureRepairlogServiceImpl.findByfaultIdLog(faultId));
} }
} }
...@@ -56,20 +56,20 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur ...@@ -56,20 +56,20 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Transactional @Transactional
public FailureAuditDto savemodel(FailureAuditDto model, ReginParams userInfo) throws Exception { public FailureAuditDto savemodel(FailureAuditDto model, ReginParams userInfo) throws Exception {
if (model.getAuditResult().equals(5)) { /* if (model.getAuditResult().equals(5)) {
model.setAuditTime(new Date()); model.setAuditTime(new Date());
model.setIsDelete(false); model.setIsDelete(false);
this.createWithModel(model); this.createWithModel(model);
return model; return model;
} }*/
Integer auditResult = model.getAuditResult(); Integer auditResult = model.getAuditResult();
//根据审核的结果进行业务操作 //根据审核的结果进行业务操作
if (auditResult.equals(AuditResultEnum.AGREE.getCode())) { if (auditResult.equals(AuditResultEnum.AGREE.getCode())) {
updateStatus(model, FailureStatuEnum.WAITING_MAINTAIN.getCode(), userInfo); updateStatus(model, FailureStatuEnum.WAITING_MAINTAIN, userInfo);
} else if (auditResult.equals(AuditResultEnum.REFUSE.getCode())) { } else if (auditResult.equals(AuditResultEnum.REFUSE.getCode())) {
updateStatus(model, FailureStatuEnum.REFUSE.getCode(), userInfo); updateStatus(model, FailureStatuEnum.REFUSE, userInfo);
} else if (auditResult.equals(AuditResultEnum.SEND_BACK.getCode())) { } else if (auditResult.equals(AuditResultEnum.SEND_BACK.getCode())) {
updateStatus(model, FailureStatuEnum.WAITING_SUBMIT.getCode(), userInfo); updateStatus(model, FailureStatuEnum.WAITING_SUBMIT, userInfo);
} }
return model; return model;
} }
...@@ -78,12 +78,13 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur ...@@ -78,12 +78,13 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 修改故障保修单任务状态 * 修改故障保修单任务状态
*/ */
@Transactional @Transactional
FailureDetailsDto updateStatus(FailureAuditDto model, Integer status, ReginParams userInfo) throws Exception { FailureDetailsDto updateStatus(FailureAuditDto model, FailureStatuEnum status, ReginParams userInfo) throws Exception {
failureDetailsService.checkExcuteTaskAuthMap(model.getSequenceNbr(),userInfo); failureDetailsService.checkExcuteTaskAuthMap(model.getSequenceNbr(),userInfo);
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId()); FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId());
failureDetailsDto.setCurrentStatus(status); failureDetailsDto.setCurrentStatus(status.getCode());
failureDetailsDto.setSequenceNbr(model.getFaultId()); failureDetailsDto.setSequenceNbr(model.getFaultId());
String condition; String condition;
......
...@@ -22,10 +22,10 @@ import com.alibaba.fastjson.JSONArray; ...@@ -22,10 +22,10 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto; 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.dto.FailureStatusCountDto;
...@@ -65,7 +65,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -65,7 +65,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired @Autowired
FailureRepairlogServiceImpl failureRepairlogService; FailureRepairlogServiceImpl failureRepairlogService;
@Autowired @Autowired
IFailureRepairlogService failureRepairlog; IFailureRepairlogService failureRepairlog;
...@@ -80,48 +80,58 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -80,48 +80,58 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 分页查询 * 分页查询
*/ */
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page, Long currentStatus, public IPage<FailureDetails> queryAllPage(long size,
AgencyUserModel userInfo) { long current) {
if (currentStatus == null) { QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
return this.queryForPage(page, "submission_time", true); wrapper.orderByDesc("submission_time");
} IPage<FailureDetails> page = new Page<>(current, size);
return this.queryForPage(page, "submission_time", true, currentStatus); return baseMapper.selectPage(page, wrapper);
} }
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page,
public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page,
AgencyUserModel userInfo, Integer type) { AgencyUserModel userInfo, Integer type) {
if ( type.equals(SELECY_ALL) ) { if ( type.equals(SELECY_ALL) ) {
return this.queryForPage(page, "submission_time", true); return this. queryAllPage(page.getSize(),page.getCurrent());
} }
if (type.equals(SELECY_ISUBMIT)) { if (type.equals(SELECY_ISUBMIT)) {
if (ObjectUtils.isNotEmpty(userInfo)) {
String submissionPid = userInfo.getUserId(); return queryForPage(page, userInfo.getUserId());
return queryForPage(page, submissionPid);
}
} }
return this.queryForPage(page, "submission_time", true); return this. queryForWaitManage(page, userInfo.getUserId());
} }
/** /**
* 我发起分页查询 * 我发起分页查询
*/ */
public Page<FailureDetailsDto> queryForPage(Page<FailureDetailsDto> page, String submissionPid) { public IPage<FailureDetails> queryForPage(Page<FailureDetails> page, String submissionPid) {
if (submissionPid == null) { if (submissionPid == null) {
return null; return null;
} }
return this.queryForPage(page, "submission_time", true, submissionPid); QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid",submissionPid);
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return baseMapper.selectPage(failureDetailsPage, wrapper);
} }
/** /**
* 待处理分页查询 * 待处理分页查询
*/ */
public Page<FailureDetailsDto> queryForMe(Page<FailureDetailsDto> page, String userId,Long currentStatus) { public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, String submissionPid) {
if (userId == null) { if (submissionPid == null) {
return null; return null;
} }
return this.queryForPage(page, "submission_time", true, userId,currentStatus); QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid",submissionPid);
wrapper.lt("current_status",FailureStatuEnum.REFUSE.getCode());
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return baseMapper.selectPage(failureDetailsPage, wrapper);
} }
...@@ -135,9 +145,23 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -135,9 +145,23 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 根据状态查询 * 根据状态查询
*/ */
public List<FailureDetails> queryForFailureDetailsList(Long currentStatus) { public List<FailureDetails> queryForFailureStatus(Long currentStatus) {
String status = new String();
List<FailureStatuEnum> list = new ArrayList<>();
list.add(FailureStatuEnum.WAITING_AUDIT);
list.add(FailureStatuEnum.WAITING_SUBMIT);
list.add(FailureStatuEnum.WAITING_MAINTAIN);
list.add(FailureStatuEnum.WAITING_ACCEPTANCE);
list.add(FailureStatuEnum.REFUSE);
list.add(FailureStatuEnum.FINISH);
for (int i = 0; i < list.size(); i++) {
if (currentStatus.equals(list.get(i).getCode())){
status = list.get(i).getName();
};
}
/*FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{};*/
QueryWrapper<FailureDetails> queryWrapper = new QueryWrapper<>(); QueryWrapper<FailureDetails> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("current_status", currentStatus).orderByDesc("submission_time"); queryWrapper.eq("current_status", status).orderByDesc("submission_time");
return baseMapper.selectList(queryWrapper); return baseMapper.selectList(queryWrapper);
} }
...@@ -162,8 +186,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -162,8 +186,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
int finishStatus=0; int finishStatus=0;
List<FailureStatusCountDto> list = new ArrayList<>(); List<FailureStatusCountDto> list = new ArrayList<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
String[] statusName ={"待审核","待提交","待维修","待验收","已拒绝","已完结"}; List<String> statusName = new ArrayList<>();
statusName.add("待审核");
statusName.add("待提交");
statusName.add("待维修");
statusName.add("待验收");
statusName.add("已拒绝");
statusName.add("已完结");
for (int i = 0; i < failureDetailsDtos.size(); i++) { for (int i = 0; i < failureDetailsDtos.size(); i++) {
if (failureDetailsDtos.get(i).getCurrentStatus().equals(FailureStatuEnum.WAITING_AUDIT.getCode())){ if (failureDetailsDtos.get(i).getCurrentStatus().equals(FailureStatuEnum.WAITING_AUDIT.getCode())){
...@@ -184,20 +214,21 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -184,20 +214,21 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (failureDetailsDtos.get(i).getCurrentStatus().equals(FailureStatuEnum.FINISH.getCode())){ if (failureDetailsDtos.get(i).getCurrentStatus().equals(FailureStatuEnum.FINISH.getCode())){
finishStatus++; finishStatus++;
} }
int[] statusCount = {auditStatus,submitStatus,maintainStatus,acceptanceStatus,refuseStatus,finishStatus};
for (int j = 0; j < 5; j++) { }
FailureStatusCountDto statusCountDto= new FailureStatusCountDto(); int[] statusCount = {auditStatus,submitStatus,maintainStatus,acceptanceStatus,refuseStatus,finishStatus};
statusCountDto.setStatus(statusName[i]); for (int i = 0; i < statusName.size(); i++) {
statusCountDto.setCount(statusCount[i]); FailureStatusCountDto statusCountDto= new FailureStatusCountDto();
list.add(statusCountDto); statusCountDto.setStatus(statusName.get(i));
} statusCountDto.setCount(statusCount[i]);
list.add(statusCountDto);
} }
return list; return list;
} }
/** /**
* 发起故障保修单 * 发起故障保修单
* *
* @throws Exception * @throws Exception
*/ */
@Transactional @Transactional
...@@ -220,13 +251,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -220,13 +251,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto.setProcessId(instance.getString("id")); failureDetailsDto.setProcessId(instance.getString("id"));
FailureDetailsDto model = null; FailureDetailsDto model = null;
try { try {
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
}
// 发起主表流程 并添加至报修日志 // 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date()); failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setFailureCode(buildOrderNo());
failureDetailsDto.setBizCode(buildOrderNo());
failureDetailsDto.setIsDelete(false);
model = this.createWithModel(failureDetailsDto); model = this.createWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
}
Long faultId = model.getSequenceNbr(); Long faultId = model.getSequenceNbr();
String processAuditor = model.getRecUserName(); String processAuditor = model.getRecUserName();
String processResult = "提交报修单"; String processResult = "提交报修单";
...@@ -234,16 +271,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -234,16 +271,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Date processTime = model.getSubmissionTime(); Date processTime = model.getSubmissionTime();
repairlog(faultId, processAuditor, processTime, processDepartment, processResult); repairlog(faultId, processAuditor, processTime, processDepartment, processResult);
FailureAuditDto failureAuditDto = new FailureAuditDto();
/* FailureAuditDto failureAuditDto = new FailureAuditDto();
failureAuditDto.setAuditor(model.getRecUserName()); failureAuditDto.setAuditor(model.getRecUserName());
failureAuditDto.setFaultId(model.getSequenceNbr()); failureAuditDto.setFaultId(model.getSequenceNbr());
failureAuditDto.setAuditOpinion("已发起"); failureAuditDto.setAuditOpinion("已发起");
failureAuditDto.setAuditTime(new Date()); failureAuditDto.setAuditTime(new Date());
failureAuditDto.setIsDelete(true); failureAuditDto.setIsDelete(true);
failureAuditDto.setAuditResult(5); failureAuditDto.setAuditResult(5);
if (ObjectUtils.isNotEmpty(failureAuditDto)) { if (ObjectUtils.isNotEmpty(failureAuditDto)) {
failureAuditServiceImpl.savemodel(failureAuditDto, userInfo); failureAuditServiceImpl.savemodel(failureAuditDto, userInfo);
} }*/
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.info("添加故障维修信息到数据库失败"); logger.info("添加故障维修信息到数据库失败");
...@@ -280,6 +319,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -280,6 +319,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap); workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return false; return false;
} }
return true; return true;
...@@ -375,7 +415,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -375,7 +415,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 獲取待處理的任務數量 * 獲取待處理的任務數量
* *
* @param userInfo * @param userInfo
* @return * @return
*/ */
...@@ -447,7 +487,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -447,7 +487,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
return newDate + result; return newDate + result;
} }
/** /**
* 获取当前登录人能够操作的任务执行Button类型 * 获取当前登录人能够操作的任务执行Button类型
* @param sequenceNbr * @param sequenceNbr
......
...@@ -178,6 +178,7 @@ public class CommonController extends AbstractBaseController { ...@@ -178,6 +178,7 @@ public class CommonController extends AbstractBaseController {
return CommonResponseUtil.success(users); return CommonResponseUtil.success(users);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询公司下的风险模型(厂区、区域、风险点)") @ApiOperation(value = "查询公司下的风险模型(厂区、区域、风险点)")
@GetMapping(value = "/riskSource/list/{orgCode}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @GetMapping(value = "/riskSource/list/{orgCode}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public CommonResponse getRiskSourceList(@PathVariable String orgCode){ public CommonResponse getRiskSourceList(@PathVariable String orgCode){
......
...@@ -196,7 +196,10 @@ public class CheckController extends AbstractBaseController { ...@@ -196,7 +196,10 @@ public class CheckController extends AbstractBaseController {
public CommonResponse saveCheckRecord( public CommonResponse saveCheckRecord(
@ApiParam(value = "检查信息") @RequestBody() CheckRecordParam requestParam) { @ApiParam(value = "检查信息") @RequestBody() CheckRecordParam requestParam) {
try { 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); return CommonResponseUtil.success(checkDto);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -46,6 +46,7 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -46,6 +46,7 @@ public class PlanTaskController extends AbstractBaseController {
/** /**
* 计划执行查询 * 计划执行查询
*
* @param queryRequests * @param queryRequests
* @param commonPageable * @param commonPageable
* @return * @return
...@@ -185,27 +186,6 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -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 { ...@@ -241,8 +221,30 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable)); 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) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情") @ApiOperation(value = "查询维保设施,检查内容详情-mobile")
@GetMapping(value = "/task-point-detail") @GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail( public CommonResponse planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId, @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;
}
...@@ -10,10 +10,8 @@ import java.util.List; ...@@ -10,10 +10,8 @@ import java.util.List;
*/ */
@Data @Data
public class CheckInputParam { public class CheckInputParam {
private long inputItemId; private Long inputItemId;
private String inputValue; private String inputValue;
private String selectName;
private boolean isCheck;
private String remark; private String remark;
private Long routePointItemId; private Long routePointItemId;
private List<CheckShotDto> checkInputShot; private List<CheckShotDto> checkInputShot;
......
...@@ -13,37 +13,27 @@ import java.util.List; ...@@ -13,37 +13,27 @@ import java.util.List;
@ApiModel(value = "任务提交") @ApiModel(value = "任务提交")
public class CheckRecordParam { public class CheckRecordParam {
@ApiModelProperty(value = "任务id",required = true) @ApiModelProperty(value = "任务id", required = true)
private Long planTaskId; private Long planTaskId;
@ApiModelProperty(value = "点id",required = true) @ApiModelProperty(value = "点id", required = true)
private Long pointId; private Long pointId;
@ApiModelProperty(value = "点名称") @ApiModelProperty(value = "任务id")
private String pointName; private String orgCode;
@ApiModelProperty(value = "检查记录id") @ApiModelProperty(value = "备注")
private Long checkId; private String remark;
@ApiModelProperty(value = "执行人id") @ApiModelProperty(value = "维保日期,非必输")
private String userId; private String checkTime;
@ApiModelProperty(value = "任务id") @ApiModelProperty(value = "路线id,非必输")
private String orgCode; private Long routeId;
@ApiModelProperty(value = "备注") /**
private String remark; * 检查项
*/
@ApiModelProperty(value = "检查项", required = true)
@ApiModelProperty(value = "路线id") private List<CheckInputParam> checkItems;
private Long routeId;
@ApiModelProperty(value = "检查时间")
private String checkTime;
/**
* 检查项
*/
@ApiModelProperty(value = "检查项",required = true)
private List<CheckInputParam> checkItems;
} }
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,86 @@ package com.yeejoin.amos.maintenance.business.service.impl; ...@@ -3,145 +3,86 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.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.AppVersionDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao; 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.IAppService;
import com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService; 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.enums.YesOrNoEnum;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
import com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; 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.ArrayList;
import java.util.List; import java.util.List;
@Service("iAppService") @Service("iAppService")
public class AppServiceImpl implements IAppService { public class AppServiceImpl implements IAppService {
@Autowired
private IMsgSubscribeDao msgSubscribeDao;
@Autowired @Autowired
private AppVersionDao appVersionDao; private IMsgSubscribeDao msgSubscribeDao;
@Autowired @Autowired
private RemoteWorkFlowService remoteWorkFlowService; private AppVersionDao appVersionDao;
@Autowired private IMsgSubscribeService msgSubscribeService;
@Autowired @Autowired
private LatentDangerMapper latentDangerMapper; private IMsgSubscribeService msgSubscribeService;
@Autowired @Autowired
private PlanTaskMapper planTaskMapper; 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>() {// 构建查询条件 /**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
@Override *
public Predicate toPredicate(Root<Route> root, CriteriaQuery<?> query, CriteriaBuilder cb) { * @param userDTO
List<Predicate> predicate = new ArrayList<>(); */
if (!ObjectUtils.isEmpty(roleTypeName)) { @Override
if (XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName) public List<MsgSubscribe> saveUserMsgInit(UserMsgInitParam userInitParam) {
|| XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName)) { Long count = msgSubscribeDao.countByUserId(userInitParam.getUserId());
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode + "%")); if (count > 0) { // 已存在用户订阅,直接返回
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)) { return msgSubscribeService.queryMsgSubscribes(userInitParam.getUserId());
String orgCode_ = orgCode; }
if (orgCode.indexOf("-") != -1) { List<MsgSubscribe> msgConfigs = new ArrayList<MsgSubscribe>();
orgCode_ = orgCode.substring(0, orgCode.indexOf("-")); for (MsgSubscribeTypeEnum type : MsgSubscribeTypeEnum.values()) {
} MsgSubscribe msgSub = new MsgSubscribe();
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode_ + "%")); msgSub.setOrgCode(userInitParam.getOrgCode());
} else { msgSub.setUserId(userInitParam.getUserId());
predicate.add(cb.equal(root.get("orgCode").as(String.class), orgCode)); if (type.equals(MsgSubscribeTypeEnum.PLANBEGIN)
} || type.equals(MsgSubscribeTypeEnum.PLANWARN)
} || type.equals(MsgSubscribeTypeEnum.PLANEND)) {
Predicate[] pre = new Predicate[predicate.size()]; msgSub.setAttribute1("False");
return query.where(predicate.toArray(pre)).getRestriction(); msgSub.setAttribute2(10 + "");
} } else if (type.equals(MsgSubscribeTypeEnum.CHECKTYPE)
|| type.equals(MsgSubscribeTypeEnum.CHECKEMAIL)) {
}; msgSub.setAttribute1("error");
List<Route> routeList = iRouteDao.findAll(spec); }
List<Long> routeIdList = new ArrayList<>(); msgSub.setMsgType(type.getName());
for (Route route : routeList) { msgSubscribeDao.saveAndFlush(msgSub);
routeIdList.add(route.getId()); msgConfigs.add(msgSub);
}
String routeIds = StringUtils.join(routeIdList.toArray(), ",");
msgSub.setAttribute1(routeIds);
}*/
msgSub.setMsgType(type.getName());
msgSubscribeDao.saveAndFlush(msgSub);
msgConfigs.add(msgSub);
} }
return msgConfigs; return msgConfigs;
} }
@Override @Override
public List<String> getHaveToDoList(String userId) { public List<String> getHaveToDoList(String userId) {
int taskCount = planTaskMapper.getCurrentPlanTaskCount(userId); int taskCount = planTaskMapper.getCurrentPlanTaskCount(userId);
List<String> havetoDoList = Lists.newArrayList(); List<String> havetoDoList = Lists.newArrayList();
if (taskCount > 0) { if (taskCount > 0) {
havetoDoList.add("planPatrol"); 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; return havetoDoList;
} }
} }
\ No newline at end of file
...@@ -138,11 +138,10 @@ public class CheckServiceImpl implements ICheckService { ...@@ -138,11 +138,10 @@ public class CheckServiceImpl implements ICheckService {
check.setPlanTaskId(recordParam.getPlanTaskId()); check.setPlanTaskId(recordParam.getPlanTaskId());
check.setPlanId(planTask.getPlanId()); check.setPlanId(planTask.getPlanId());
check.setPlanName(detail.get("planName").toString()); check.setPlanName(detail.get("planName").toString());
check.setPointName(detail.get("pointName").toString()); check.setPointName(point.getName());
recordParam.setPointName(detail.get("pointName").toString()); check.setPointId(point.getId());
check.setPointId(recordParam.getPointId());
check.setRemark(recordParam.getRemark()); check.setRemark(recordParam.getRemark());
check.setCheckTime(DateUtil.getLongDate(recordParam.getCheckTime())); check.setCheckTime(new Date());
check.setUploadTime(new Date()); check.setUploadTime(new Date());
check.setOrgCode(recordParam.getOrgCode()); check.setOrgCode(recordParam.getOrgCode());
check.setUserId(mtUserSeq); check.setUserId(mtUserSeq);
...@@ -158,10 +157,12 @@ public class CheckServiceImpl implements ICheckService { ...@@ -158,10 +157,12 @@ public class CheckServiceImpl implements ICheckService {
CheckInput checkInput = new CheckInput(); CheckInput checkInput = new CheckInput();
checkInput.setCreateDate(new Date()); checkInput.setCreateDate(new Date());
checkInput.setOrgCode(recordParam.getOrgCode()); checkInput.setOrgCode(recordParam.getOrgCode());
checkInput.setInputId(Long.valueOf(item.getInputItemId() + "")); checkInput.setInputId(inputItem.getId());
checkInput.setInputName(inputItem.getName()); checkInput.setInputName(inputItem.getName());
checkInput.setInputValue(item.getInputValue());
checkInput.setOrderNo(inputItem.getOrderNo()); checkInput.setOrderNo(inputItem.getOrderNo());
checkInput.setRemark(item.getRemark()); checkInput.setRemark(item.getRemark());
checkInput.setRoutePointItemId(item.getRoutePointItemId());
//1.校验结果 //1.校验结果
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) { if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
paraseSelect(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore()); paraseSelect(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
...@@ -176,15 +177,13 @@ public class CheckServiceImpl implements ICheckService { ...@@ -176,15 +177,13 @@ public class CheckServiceImpl implements ICheckService {
Map<String, Object> unCheckMap = Maps.newHashMap(); Map<String, Object> unCheckMap = Maps.newHashMap();
unCheckMap.put("itemId", item.getInputItemId()); unCheckMap.put("itemId", item.getInputItemId());
unCheckMap.put("routeId", check.getRouteId()); unCheckMap.put("routeId", check.getRouteId());
unCheckMap.put("pointId", recordParam.getPointId()); unCheckMap.put("pointId", point.getId());
unCheckMap.put("name", inputItem.getName()); unCheckMap.put("name", inputItem.getName());
unCheckMap.put("inputValue", item.getInputValue()); unCheckMap.put("inputValue", item.getInputValue());
unqualifiedCheckItemList.add(unCheckMap); unqualifiedCheckItemList.add(unCheckMap);
} else { } else {
checkInput.setIsOk(CheckStatusEnum.QUALIFIED.getCode()); checkInput.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
} }
checkInput.setRoutePointItemId(item.getRoutePointItemId());
checkInput.setInputValue(item.getInputValue());
score += checkInput.getScore(); score += checkInput.getScore();
for (CheckShotDto shotDto : item.getCheckInputShot()) { for (CheckShotDto shotDto : item.getCheckInputShot()) {
CheckShot img = new CheckShot(); CheckShot img = new CheckShot();
...@@ -218,7 +217,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -218,7 +217,7 @@ public class CheckServiceImpl implements ICheckService {
Check finalCheck = check; Check finalCheck = check;
//4.检查项入库 //4.检查项入库
checkItemList.forEach(checkInput -> checkInput.setCheckId(finalCheck.getId())); checkItemList.forEach(checkInput -> checkInput.setCheckId(finalCheck.getId()));
if(!checkItemList.isEmpty()){ if (!checkItemList.isEmpty()) {
checkInputDao.saveAll(checkItemList); checkInputDao.saveAll(checkItemList);
} }
List<CheckShot> allShot = new ArrayList<>(); List<CheckShot> allShot = new ArrayList<>();
...@@ -245,7 +244,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -245,7 +244,7 @@ public class CheckServiceImpl implements ICheckService {
private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception { private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception {
int status; int status;
int count = checkService.checkHasRecord(planTask.getId(), pointId); int count = checkService.checkHasRecord(planTask.getId(), pointId);
if(count > 0){ if (count > 0) {
throw new RuntimeException("任务已执行,不能重复执行"); throw new RuntimeException("任务已执行,不能重复执行");
} }
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(mtUserSeq)) { if (!ToolUtils.transBeanList(planTask.getUserId()).contains(mtUserSeq)) {
......
...@@ -24,6 +24,7 @@ import com.yeejoin.amos.maintenance.business.util.Toke; ...@@ -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.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo; import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo; 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.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone; import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
...@@ -569,6 +570,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -569,6 +570,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
params.put("offset", pageParam.getOffset()); params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize()); params.put("pageSize", pageParam.getPageSize());
content = planTaskMapper.getPlanTasks(params); 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); 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);
}
...@@ -15,11 +15,8 @@ public class CheckParamUtil { ...@@ -15,11 +15,8 @@ public class CheckParamUtil {
String operator = daoCriteria.getOperator(); String operator = daoCriteria.getOperator();
String name = daoCriteria.getPropertyName(); String name = daoCriteria.getPropertyName();
if("checkTime".equals(name)){ if("checkTime".equals(name)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString()); param.setCheckTime(daoCriterias.get(i).getValue().toString());
}else if("userId".equals(name)){ } else if("routeId".equals(name)){
param.setUserId(daoCriterias.get(i).getValue().toString());
}else if("routeId".equals(name)){
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString())); param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){ }else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){
param.setOrgCode(daoCriterias.get(i).getValue().toString()+"%"); param.setOrgCode(daoCriterias.get(i).getValue().toString()+"%");
......
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.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.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto; import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile; import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.UUID;
/** /**
* 通话记录附件 * 通话记录附件
...@@ -40,6 +41,9 @@ public class VoiceRecordFileController extends BaseController { ...@@ -40,6 +41,9 @@ public class VoiceRecordFileController extends BaseController {
@Autowired @Autowired
VoiceRecordFileServiceImpl voiceRecordFileServiceImpl; VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/** /**
* 新增通话记录附件 * 新增通话记录附件
* *
...@@ -49,8 +53,26 @@ public class VoiceRecordFileController extends BaseController { ...@@ -49,8 +53,26 @@ public class VoiceRecordFileController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增通话记录附件", notes = "新增通话记录附件") @ApiOperation(httpMethod = "POST", value = "新增通话记录附件", notes = "新增通话记录附件")
public ResponseModel<VoiceRecordFileDto> save(@RequestBody VoiceRecordFileDto model) { public ResponseModel<VoiceRecordFileDto> save(@RequestBody VoiceRecordFileDto model) {
model = voiceRecordFileServiceImpl.createWithModel(model); if (ValidationUtil.isEmpty(model.getAlertId())
return ResponseHelper.buildResponse(model); || ValidationUtil.isEmpty(model.getTel())){
throw new BadRequest("参数校验失败.");
}
Calendar startTime = Calendar.getInstance();
Calendar endTime = Calendar.getInstance();
endTime.add(Calendar.MINUTE, 6);
model.setTelStartTime(startTime.getTime());
model.setTelEndTime(endTime.getTime());
model.setFilePath(UUID.randomUUID().toString().replace("-",""));
model.setFileType("");
model.setSourceId(-1l);
AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
if(alertDto == null || alertDto.getAlertCalledDto() == null) {
throw new BadRequest("未找到相关警情");
}
model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
} }
/** /**
......
...@@ -83,7 +83,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -83,7 +83,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto(); AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto();
// 获取模板 拼接json // 获取模板 拼接json
QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>(); QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>();
templateQueryWrapper.eq("type_code","RECORD-" + type); if("WXFK-TS".equals(type)) {
templateQueryWrapper.eq("type_code","RECORD-WXFK");
} else {
templateQueryWrapper.eq("type_code","RECORD-" + type);
}
Template template = templateServiceImpl.getOne(templateQueryWrapper); Template template = templateServiceImpl.getOne(templateQueryWrapper);
String content = template.getContent(); String content = template.getContent();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
...@@ -25,12 +25,6 @@ spring.redis.timeout=1000 ...@@ -25,12 +25,6 @@ spring.redis.timeout=1000
jobs.cron = 0 0/1 22-23 * * ? jobs.cron = 0 0/1 22-23 * * ?
#jpush 推送配置项 #jpush 推送配置项
params.isPush = false 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 #websocket
params.remoteWebsocketUrl=http://39.100.241.164:8080/ params.remoteWebsocketUrl=http://39.100.241.164:8080/
#websocket send message url #websocket send message url
...@@ -45,9 +39,9 @@ linux.img.path = / ...@@ -45,9 +39,9 @@ linux.img.path = /
## emqx ## emqx
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1 emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker=tcp://172.16.10.85:1883 emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=super emqx.user-name=admin
emqx.password=a123456 emqx.password=public
emqx.max-inflight=1000 emqx.max-inflight=1000
file.url=http://39.98.45.134:9000/ file.url=http://39.98.45.134:9000/
\ 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 @@ ...@@ -108,9 +108,6 @@
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` 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_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`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 "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <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> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
......
...@@ -178,7 +178,6 @@ ...@@ -178,7 +178,6 @@
pt.id planTaskId, pt.id planTaskId,
pt.org_code orgCode, pt.org_code orgCode,
p.name taskName, p.name taskName,
pt.status,
pt.user_id userId, pt.user_id userId,
date_format( date_format(
pt.begin_time, pt.begin_time,
...@@ -339,9 +338,11 @@ ...@@ -339,9 +338,11 @@
<select id="getPlanTaskPoints" resultType="Map"> <select id="getPlanTaskPoints" resultType="Map">
SELECT SELECT
ptd.id, ptd.id,
p.id as pointId,
p.name, p.name,
p.point_no pointNo, 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, p.belong_system_name as belongSystemName,
ptd.status, ptd.status,
ptd.is_finish as isFinish, ptd.is_finish as isFinish,
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map"> <select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
SELECT SELECT
p.name planName, pt.begin_time beginTime, pt.end_time endTime, pp.name pointName, pp.point_no pointNo, ptd.id planTaskDetailId, pt.route_id routeId, pr.name routeName p.name planName,
pp.name pointName,
ptd.id planTaskDetailId,
pt.route_id routeId,
pr.name routeName
FROM FROM
p_plan_task pt p_plan_task pt
LEFT JOIN p_plan p ON pt.plan_id = p.id LEFT JOIN p_plan p ON pt.plan_id = p.id
......
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