Commit 0fc27454 authored by tangwei's avatar tangwei

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

parents 58a5849a fe8c14a1
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
......@@ -62,12 +62,12 @@ public interface WorkflowFeignService {
JSONObject getTasksNoAuth(@RequestParam(value="processDefinitionKey", required=false) String processDefinitionKey,
@RequestParam(value="userId", required=false) String userId) ;
/**
* 流程实例-分页
* 流程信息
* @param processDefinitionKey
* @param userId
* @return
*/
@RequestMapping(value = "/activitiHistory/processes", method = RequestMethod.GET)
JSONObject getInstance(@RequestParam(value="name", required=false) String name) ;
@RequestMapping(value = "/activitiHistory/processes/historytasks/list/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryHistoryTaskListByProcessId(@PathVariable("processInstanceId") String processInstanceId);
}
......@@ -101,9 +101,5 @@ public class FailureDetails extends BaseEntity {
*/
@TableField("process_id")
private String processId;
@TableField ("current_role")
private String currentRole;
}
package com.yeejoin.amos.boot.module.common.api.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 流程日志
......@@ -16,12 +17,16 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
//@Accessors(chain = true)
@TableName("cb_failure_repairlog")
public class FailureRepairlog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 流程处理人
*/
@TableField("process_auditor_id")
private Long processAuditorId;
/**
* 流程处理人
*/
......@@ -33,7 +38,11 @@ public class FailureRepairlog extends BaseEntity {
*/
@TableField("process_department")
private String processDepartment;
/**
* 处理人所属部门Id
*/
@TableField("process_department_id")
private Long processDepartmentId;
/**
* 流程处理结果
*/
......
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
/**
* 流程日志接口类
......@@ -8,5 +9,8 @@ package com.yeejoin.amos.boot.module.common.api.service;
* @date 2021-08-12
*/
public interface IFailureRepairlogService {
public FailureRepairlog findByprocessAuditorId(Long userId);
public FailureRepairlog findByFaultId(Long faultId) ;
}
package com.yeejoin.amos.maintenance.common.enums;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未完成",0),
......@@ -25,6 +25,14 @@ public enum PlanTaskDetailIsFinishEnum {
this.value = value;
}
public static List<Map<String, Object>> getEnumList() {
return Arrays.stream(PlanTaskDetailIsFinishEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put(String.valueOf(e.getValue()), e.getName());
return map;
}).collect(Collectors.toList());
}
public static String getName(int value) {
for (PlanTaskDetailIsFinishEnum c : PlanTaskDetailIsFinishEnum.values()) {
......
......@@ -26,6 +26,22 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
public class Point extends BasicEntity {
private static final long serialVersionUID = 1L;
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
/**
* 参考地址
*/
......@@ -143,6 +159,18 @@ public class Point extends BasicEntity {
@Column(name="point_no")
private String pointNo;
/**
* 所在建筑
*/
private String buildingId;
/**
* 所在建筑名称
*/
private String buildingName;
public String getEquipmentId() {
return equipmentId;
}
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 警情查询DTO
*/
@Data
@ApiModel(value="AlertCalledDto", description="警情接警填报记录")
public class AlertCalledQueryDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "工单编号", index = 0)
@ApiModelProperty(value = "工单编号")
private String workOrderNumber;
@ExcelProperty(value = "接警人", index = 1)
@ApiModelProperty(value = "接警人")
private String creator;
@ExcelProperty(value = "求援人", index = 2)
@ApiModelProperty(value = "求援人")
private String emergency;
@ExcelProperty(value = "求援时间", index = 3)
@ApiModelProperty(value = "求援时间")
private Date emergencyTime;
@ExcelIgnore
@ApiModelProperty(value = "求援时间开始")
private Date emergencyTimeStart;
@ExcelIgnore
@ApiModelProperty(value = "求援时间结束")
private Date emergencyTimeEnd;
@ExcelProperty(value = "求援电话", index = 4)
@ApiModelProperty(value = "求援电话")
private String emergencyCall;
@ExcelProperty(value = "电梯识别码", index = 5)
@ApiModelProperty(value = "电梯识别码")
private String deviceId;
@ExcelProperty(value = "电梯地址", index = 6)
@ApiModelProperty(value = "电梯地址")
private String elevatorAddress;
@ExcelProperty(value = "所属区域", index = 7)
@ApiModelProperty(value = "所属区域")
private String address;
@ExcelProperty(value = "警情类型", index = 8)
@ApiModelProperty(value = "警情类型")
private String alertType;
@ExcelProperty(value = "警情来源", index = 9)
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ExcelProperty(value = "处置环节", index = 10)
@ApiModelProperty(value = "处置环节")
private String alertStage;
@ExcelProperty(value = "完成状态", index = 11)
@ApiModelProperty(value = "完成状态")
private String alertStatus;
@ExcelIgnore
@ApiModelProperty(value = "页码")
private Integer pageNum;
@ExcelIgnore
@ApiModelProperty(value = "条数")
private Integer pageSize;
}
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
......@@ -26,4 +28,11 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
@Param("orgCode") String orgCode,
@Param("recUserId") String recUserId
);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(@Param("alertCalledQueryDto") AlertCalledQueryDto alertCalledQueryDto);
}
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import java.util.List;
/**
* 警情接警填报记录接口类
......@@ -24,4 +27,19 @@ public interface IAlertCalledService {
*
* **/
AlertCalledFormDto selectAlertCalledByIdNoCache(Long id);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto);
/**
* 根据警情id 更新警情状态
* @param alertId
* @param alertStage
* @return
*/
Boolean updateAlertStageByAlertId(Long alertId, String alertStage);
}
......@@ -23,4 +23,83 @@
or rec_user_id = #{recUserId}
</if>
</select>
<select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto">
SELECT
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.emergency_person AS emergency,
a.call_time AS emergencyTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
e.address AS elevatorAddress,
a.region_code AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
'完成'
ELSE
''
END AS alertStatus
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.rescue_code = a.device_id
WHERE 1=1
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{alertCalledQueryDto.workOrderNumber}),'%')
</if>
<if test="alertCalledQueryDto.creator != null and alertCalledQueryDto.creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{alertCalledQueryDto.creator}),'%')
</if>
<if test="alertCalledQueryDto.emergency != null and alertCalledQueryDto.emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergency}),'%')
</if>
<if test="alertCalledQueryDto.emergencyTimeStart != null ">
and #{alertCalledQueryDto.emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
</if>
<if test="alertCalledQueryDto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{alertCalledQueryDto.emergencyTimeEnd}
</if>
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="alertCalledQueryDto.emergencyCall != null and alertCalledQueryDto.emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergencyCall}),'%')
</if>
<if test="alertCalledQueryDto.deviceId != null and alertCalledQueryDto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{alertCalledQueryDto.deviceId}),'%')
</if>
<if test="alertCalledQueryDto.elevatorAddress != null and alertCalledQueryDto.elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{alertCalledQueryDto.elevatorAddress}),'%')
</if>
<if test="alertCalledQueryDto.address != null and alertCalledQueryDto.address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{alertCalledQueryDto.address}),'%')
</if>
<if test="alertCalledQueryDto.alertType != null and alertCalledQueryDto.alertType != ''">
AND a.alarm_type_code = #{alertCalledQueryDto.alertType}
</if>
<if test="alertCalledQueryDto.alertSource != null and alertCalledQueryDto.alertSource != ''">
AND a.alert_source_code = #{alertCalledQueryDto.alertSource}
</if>
<if test="alertCalledQueryDto.alertStage != null and alertCalledQueryDto.alertStage != ''">
AND a.alert_stage_code = #{alertCalledQueryDto.alertStage}
</if>
<if test="alertCalledQueryDto.alertStatus != null and alertCalledQueryDto.alertStatus != ''">
AND a.alert_status = #{alertCalledQueryDto.alertStatus}
</if>
ORDER BY a.rec_date
<if test="alertCalledQueryDto.pageNum != null and alertCalledQueryDto.pageSize != ''">
limit #{alertCalledQueryDto.pageNum},#{alertCalledQueryDto.pageSize}
</if>
</select>
</mapper>
......@@ -183,5 +183,10 @@ public class FailureDetailsController extends BaseController {
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
}
......@@ -3,20 +3,17 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
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.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
......@@ -57,7 +54,12 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
*/
public FailureAuditDto savemodel(FailureAuditDto model, ReginParams userInfo) throws Exception {
this.createWithModel(model);
if (model.getAuditResult().equals(5)) {
model.setAuditTime(new Date());
model.setIsDelete(false);
this.createWithModel(model);
return model;
}
Integer auditResult = model.getAuditResult();
//根据审核的结果进行业务操作
if (auditResult.equals(AuditResultEnum.AGREE.getCode())) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -29,10 +30,12 @@ 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.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
/**
......@@ -62,6 +65,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired
FailureRepairlogServiceImpl failureRepairlogService;
@Autowired
IFailureRepairlogService failureRepairlog;
public static String EMERGENCY_COMMAND = "应急指挥科";
......@@ -170,14 +176,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
}
/* failureDetailsDto.set */
/* failureDetailsDto.set */
// 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date());
model = this.createWithModel(failureDetailsDto);
Long faultId = model.getSequenceNbr();
String processAuditor = model.getRecUserName();
String processResult = "提交报修单";
String processDepartment = null;
String processDepartment = "1111";
Date processTime = model.getSubmissionTime();
repairlog(faultId, processAuditor, processTime, processDepartment, processResult);
......@@ -185,8 +191,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureAuditDto.setAuditor(model.getRecUserName());
failureAuditDto.setFaultId(model.getSequenceNbr());
failureAuditDto.setAuditOpinion("已发起");
failureAuditServiceImpl.savemodel(failureAuditDto, null);
failureAuditDto.setAuditTime(new Date());
failureAuditDto.setIsDelete(true);
failureAuditDto.setAuditResult(5);
if (ObjectUtils.isNotEmpty(failureAuditDto)) {
failureAuditServiceImpl.savemodel(failureAuditDto, userInfo);
}
} catch (Exception e) {
e.printStackTrace();
logger.info("添加故障维修信息到数据库失败");
return false;
// return CommonResponseUtil.failure("添加失败");
......@@ -208,12 +220,13 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureRepairlogDto.setProcessTime(processTime);
failureRepairlogDto.setProcessDepartment(processDepartment);
failureRepairlogDto.setProcessResult(processResult);
failureRepairlogDto.setIsDelete(false);
failureRepairlogService.createWithModel(failureRepairlogDto);
}
public boolean excuteTask(Long sequenceNbr, ReginParams userInfo, String condition) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
conditionMap.put("condition", Integer.parseInt(condition));
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
......@@ -291,8 +304,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if (name.contains(EMERGENCY_COMMAND)) {
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
......@@ -333,10 +346,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
wrapper.eq(FailureDetails::getProcessId, procressId);
FailureDetails failureDetails = this.baseMapper.selectOne(wrapper);
// 通过故障报修单查找创建人的部门ID
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(failureDetails.getSequenceNbr());
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(failureDetails.getSequenceNbr());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if (task.getString("name").contains(EMERGENCY_COMMAND)) {
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
countNum++;
continue;
......@@ -355,8 +368,24 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Object getCurrentProcessHistoryTask(Long id) {
FailureDetailsDto failureDetailsDto = this.queryBySeq(id);
String processId = failureDetailsDto.getProcessId();
return logger;
JSONObject object= workflowFeignService.queryHistoryTaskListByProcessId(processId);
JSONArray datArray=null;
if(ObjectUtils.isNotEmpty(object)) {
datArray=object.getJSONArray("data");
}
List<Object> list = new ArrayList<Object>();
if(datArray!=null) {
datArray.stream().forEach(i->{
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
//从流程记录表中拿到处理人的名称
FailureRepairlog failureRepairlog=failureRepairlogService.findByprocessAuditorId(Long.parseLong(detail.getString("operator")));
detail.replace("operator", failureRepairlog.getProcessAuditor());
list.add(object);
}
});
}
return list;
}
public static String buildOrderNo() {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Date;
import java.util.List;
/**
* 服务实现类
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 流程日志服务实现类
......@@ -42,4 +45,20 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
queryWrapper.eq("fault_id", faultId).orderByAsc("process_time");
return baseMapper.selectList(queryWrapper);
}
public FailureRepairlog findByprocessAuditorId(Long userId) {
QueryWrapper<FailureRepairlog> queryWrapper = new QueryWrapper<FailureRepairlog>();
queryWrapper.eq("process_auditor_id", userId);
queryWrapper.last("LIMIT 1");
return baseMapper.selectOne(queryWrapper);
}
public FailureRepairlog findByFaultId(Long faultId) {
LambdaQueryWrapper<FailureRepairlog> wrapper = new LambdaQueryWrapper<FailureRepairlog>();
wrapper.eq(FailureRepairlog::getIsDelete, false);
wrapper.eq(FailureRepairlog::getFaultId, faultId);
wrapper.orderByAsc(FailureRepairlog::getProcessTime);
wrapper.last("LIMIT 1");
return this.baseMapper.selectOne(wrapper);
}
}
\ No newline at end of file
......@@ -401,4 +401,13 @@ public class InputItemController extends AbstractBaseController {
List<InputItemTemplateVo> itemTemplateVoList = ExcelUtils.importExcel(file, 1, 1, InputItemTemplateVo.class);
return CommonResponseUtil.success(inputItemService.uploadListByTemplate(itemTemplateVoList, orgCode, userId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "校验填写项是否合格")
@GetMapping(value = "/check-is-ok")
public CommonResponse checkIsOk(
@ApiParam(value = "检查项id",required = true) @RequestParam(value = "inputItemId") Long inputItemId,
@ApiParam(value = "填写内容",required = true) @RequestParam(value = "inputValue") String inputValue){
return CommonResponseUtil.success(inputItemService.checkIsOk(inputItemId,inputValue));
}
}
......@@ -32,4 +32,6 @@ public interface InputItemMapper {
List<PointInputItemVo> queryCustomInputItemByPointId(@Param("pointId") Long pointId, @Param("equipmentId") String equipmentName);
Integer insertList(List<InputItem> list);
List<Map<String, Object>> queryInputItemInRountPoint(String routePointId);
}
......@@ -77,10 +77,10 @@ public interface PlanTaskMapper extends BaseMapper {
Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId);
/**
* 通过计划任务Id获取任务所有点信息
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(@Param(value="planTaskId") Long planTaskId);
List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有可以做的任务个数
* @param userId
......
......@@ -15,8 +15,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "SELECT COUNT( point_id ) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int countRoutePoint(Long routeId);
@Query(value = "SELECT * FROM `p_route_point` where point_id = ?1", nativeQuery = true)
List<RoutePoint> queryByPointId(Long pointId);
@Query(value = "SELECT IfNULL(max(order_no),0) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int maxRoutePointOrderNo(Long routeId);
......@@ -38,11 +36,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "select point_id from p_route_point WHERE route_id = ?1", nativeQuery = true)
List<Long> findAllByRouteId(Long routeId);
@Modifying
@Transactional
@Query(value = "delete from p_route_point WHERE point_id in (?1)", nativeQuery = true)
void delRoutePointByPointId(List<Long> pointIds);
@Query(value = "SELECT id FROM p_route_point WHERE point_id IN (?1)", nativeQuery = true)
List<BigInteger> queryRoutePointByPointId(List<Long> pointIds);
......
......@@ -15,6 +15,10 @@ public class CheckInputParam {
return checkInputImg;
}
public CheckInputParam(String inputValue){
this.inputValue = inputValue;
}
public void setCheckInputImg(List<String> checkInputImg) {
this.checkInputImg = checkInputImg;
}
......
......@@ -398,7 +398,7 @@ public class CheckServiceImpl implements ICheckService {
checkDao.deleteBatch(list);
}
private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json);
String checkType = jsonObject.getString("CheckType");
int score = 0;
......@@ -431,7 +431,7 @@ public class CheckServiceImpl implements ICheckService {
return checkInput;
}
private CheckInput paraseNumber(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseNumber(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json);
String OkUpStr = jsonObject.get("OkUp").toString();
;
......@@ -472,7 +472,7 @@ public class CheckServiceImpl implements ICheckService {
return checkInput;
}
private CheckInput paraseSelect(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseSelect(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONArray jsonArray = JSONArray.parseArray(json);
int score = 0;
if (!ObjectUtils.isEmpty(jsonArray)) {
......
......@@ -2,10 +2,12 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.maintenance.business.param.CheckInputParam;
import com.yeejoin.amos.maintenance.business.param.InputItemPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService;
import com.yeejoin.amos.maintenance.business.service.intfc.IInputItemService;
......@@ -14,10 +16,9 @@ import com.yeejoin.amos.maintenance.business.vo.InputItemTemplateVo;
import com.yeejoin.amos.maintenance.business.vo.InputItemVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.maintenance.dao.entity.CatalogTree;
import com.yeejoin.amos.maintenance.dao.entity.CheckInput;
import com.yeejoin.amos.maintenance.dao.entity.InputItem;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -230,4 +231,18 @@ public class InputItemServiceImpl implements IInputItemService {
return inputItemMapper.insertList(list);
}
@Override
public Boolean checkIsOk(Long inputItemId, String inputValue) {
InputItem inputItem = inputItemDao.findById(inputItemId).orElseThrow(() -> new RuntimeException("检查项不存在"));
CheckInput checkInput = new CheckInput();
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseSelect(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_NUMBER.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseNumber(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_TEXT.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseText(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
}
return checkInput.getIsOk().equals(XJConstant.OK);
}
}
......@@ -7,13 +7,13 @@ import com.google.common.base.Joiner;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.maintenance.business.feign.Business;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
......@@ -30,15 +30,13 @@ import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.dao.entity.Check;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import com.yeejoin.amos.maintenance.dao.entity.PlanTask;
import com.yeejoin.amos.maintenance.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.maintenance.dao.entity.*;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import com.yeejoin.amos.maintenance.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -85,10 +83,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private ICheckService checkService;
@Autowired
private Business business;
private EquipFeign equipFeign;
@Autowired
private EquipFeign equipFeign;
IPointDao iPointDao;
@Autowired
IPlanTaskDetailDao iPlanTaskDetailDao;
@Autowired
InputItemMapper inputItemMapper;
@Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
......@@ -582,8 +586,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public List getPlanTaskPoints(Long planTaskId) {
return planTaskMapper.getPlanTaskPoints(planTaskId);
public List getPlanTaskPoints(Map<String, Object> param) {
return planTaskMapper.getPlanTaskPoints(param);
}
@Override
......@@ -1009,4 +1013,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
return result;
}
@Override
public Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId) {
Map<String,Object> result = new LinkedHashMap<>();
Optional<RoutePoint> rOp = iRoutePointDao.findById(Long.parseLong(routePointId));
RoutePoint routePoint = rOp.orElseThrow(()->new RuntimeException("计划清单不存在该点"));
Point point = iPointDao.findById(routePoint.getPointId()).orElseThrow(()->new RuntimeException("维保项不存在"));
PlanTaskDetail planTaskDetail = iPlanTaskDetailDao.findById(Long.parseLong(planTaskDetailId)).orElseThrow(()->new RuntimeException("任务不存在"));
PlanTask planTask = iplanTaskDao.findById(planTaskDetail.getTaskNo()).orElseThrow(()->new RuntimeException("主任务不存在"));
Map<String,Object> facility = this.buildFacilityDetail(point,planTask);
List<Map<String, Object>> itemList = this.buildCheckInputItem(routePointId);
result.put("facility",facility);
result.put("itemList",itemList);
return result;
}
private List<Map<String, Object>> buildCheckInputItem(String routePointId) {
return inputItemMapper.queryInputItemInRountPoint(routePointId);
}
private Map<String, Object> buildFacilityDetail(Point point, PlanTask planTask) {
Map<String,Object> facility = new LinkedHashMap<>();
facility.put("name",point.getName());
facility.put("pointId",point.getId());
facility.put("point_no",point.getPointNo());
facility.put("position",point.getBuildingName() + point.getAddress());
facility.put("userName",planTask.getUserName());
facility.put("riskAndManage",point.getRemark());
return facility;
}
}
......@@ -112,4 +112,6 @@ public interface IInputItemService {
Boolean uploadListByTemplate(List<InputItemTemplateVo> itemTemplateVoList, String orgCode, String userId) throws Exception;
Integer insertList(List<InputItem> list);
Boolean checkIsOk(Long inputItemId, String inputValue);
}
......@@ -91,10 +91,10 @@ public interface IPlanTaskService {
/**
* 根据计划ID获取所有的 任务计划巡检点
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(Long planTaskId);
List getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有有的计划任务
......@@ -149,4 +149,13 @@ public interface IPlanTaskService {
List<Map<String,Object>> queryPlanTaskTimeAxis(Long userId,Integer createDate);
List<Map<String,Object>> queryTimeAxis(Long userId,Integer createDate);
/**
* 任务点详情
*
* @param planTaskDetailId 子表id
* @param routePointId 关系表id
* @return Map<String, Object>
*/
Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId);
}
......@@ -9,11 +9,15 @@ import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
......@@ -28,13 +32,16 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.opc.internal.FileHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -44,6 +51,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.Arrays;
......@@ -341,4 +349,30 @@ public class AlertCalledController extends BaseController {
}
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@PostMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(@RequestBody AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(), alertCalledQueryDto.getPageSize());
long totle = list.size();
result.setRecords(list);
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@PostMapping("/exportSelectRecord")
public void exportAlertCalled(@RequestBody AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
String fileName = "警情事件记录" + new Date().getTime();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
}
}
......@@ -70,33 +70,4 @@ public class RescueProcessController extends BaseController {
return ResponseHelper.buildResponse(rescueProcessServiceImpl.getProcessByAlertId(alertId));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "救援过程表分页查询", notes = "救援过程表分页查询")
public ResponseModel<Page<RescueProcessDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<RescueProcessDto> page = new Page<RescueProcessDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rescueProcessServiceImpl.queryForRescueProcessPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "救援过程表列表全部数据查询", notes = "救援过程表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<RescueProcessDto>> selectForList() {
return ResponseHelper.buildResponse(rescueProcessServiceImpl.queryForRescueProcessList());
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -9,13 +12,17 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
......@@ -23,14 +30,22 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
......@@ -62,9 +77,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
private ElevatorServiceImpl iElevatorService;
@Autowired
private RepairConsultServiceImpl repairConsultService;
@Autowired
AlertCalledMapper alertCalledMapper;
@Autowired
......@@ -151,6 +163,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledFormVo;
}
@Override
public List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = alertCalledMapper.queryAlertListByQueryDto(alertCalledQueryDto);
return list;
}
@Override
public Boolean updateAlertStageByAlertId(Long alertId, String alertStage) {
UpdateWrapper<AlertCalled> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("sequence_nbr",alertId);
AlertStageEnums stage = AlertStageEnums.getEnumByCode(alertStage);
updateWrapper.set("alert_stage_code",stage.getId());
updateWrapper.set("alert_stage",stage.getValue());
return this.update(updateWrapper);
}
/**
*
......
......@@ -200,12 +200,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String createTime = sdf.format(alertCalledDto.getCallTime());
String rescueCode = alertCalledDto.getDeviceId();
String emergencyCall = alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone();
String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone() == null ? "" : alertCalledDto.getContactPhone();
// 电梯数据
Elevator elevator = elevatorServiceImpl.selectByAlertId(alertId);
String address = elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory();
String address = elevator.getAddress() == null ? "" : elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory() == null ? "" : elevator.getUseSiteCategory() ;
String useUnit = elevator.getUseUnit();
content = content.replace("$call_time",createTime).replace("$address",address).replace("$rescue_code",rescueCode).replace("$use_site_category",useSiteCategory);
String typeCode = "";
......@@ -230,22 +231,22 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
switch(alertTypeCode) {
case "KRJY" : // 困人救援
dispatchTaskDto.setIsSaveTask(true);
String trappedNum = dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time");
String trappedNum = dynamicParms.get("trapped_num") == null ? "" : dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num") == null ? "" : dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light") == null ? "" : dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time") == null ? "" : dynamicParms.get("trapped_time");
content = content.replace("$trapped_num",trappedNum).replace("$trapped_floor_num",trappedFloorNum);
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$is_light",isLight).replace("$trapped_time",trappedTime);
break;
case "GZWX" : // 故障维修
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
case "TSZX" : // 投诉咨询
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
......
......@@ -93,11 +93,18 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String emergency_call = alertCalledVo.getEmergencyCall();
String area = alertCalledVo.getAddress();
String alertType = alertCalledVo.getAlarmType();
if(createUser == null)
throw new BadRequest("坐席人缺失");
if(emergency_call == null)
throw new BadRequest("求援人缺失");
if(area == null)
throw new BadRequest("区域缺失");
if(alertType == null)
throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType);
} else if("PQ".equals(type)) {
String createUser = user.getUserName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName();
String person = dispatchTask.getResponseUserName();
......@@ -119,6 +126,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
} else if("DD".equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS);
......@@ -161,6 +169,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
}
});
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
type = "WXFK";
} else if("BXFK".equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
......@@ -192,7 +201,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("action_result"));
}
repairConsult.setType(type);
repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStatus(AlertStageEnums.getEnumByCode(type).getValue());
repairConsult.setDescription(content);
......
......@@ -142,6 +142,13 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchTask.getAlertId(),"PQ", dispatchTask.getSequenceNbr(),sendUser);
}
}
rescueProcessDto.setSequenceNbr(rescueProcess.getSequenceNbr());
rescueProcessDto.setRecDate(rescueProcess.getRecDate());
rescueProcessDto.setRecUserId(rescueProcess.getRecUserId());
rescueProcessDto.setRecUserName(rescueProcess.getRecUserName());
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
Boolean flag =this.updateById(rescueProcess);
if(rescueProcessDto.getArriveByUser()) { // 手动到达
DispatchPaperFormDto dispatchPaperDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(rescueProcessDto.getAlertId());
if (dispatchPaperDto == null || dispatchPaperDto.getDispatchPaper() == null) {
......@@ -172,11 +179,7 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(rescueProcessDto.getAlertId(),"JC",taskId,sendUser); //保存接警日志
}
rescueProcessDto.setSequenceNbr(rescueProcess.getSequenceNbr());
rescueProcessDto.setRecDate(rescueProcess.getRecDate());
rescueProcessDto.setRecUserId(rescueProcess.getRecUserId());
rescueProcessDto.setRecUserName(rescueProcess.getRecUserName());
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
return this.updateById(rescueProcess);
return flag;
}
}
\ No newline at end of file
......@@ -16,4 +16,26 @@
ALTER TABLE p_point ADD COLUMN `last_check_id` varchar(32) DEFAULT NULL COMMENT '最近检查记录(漏检不算)' AFTER `original_id`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_id"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_id 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_id` varchar(32) DEFAULT NULL COMMENT '所在建筑' AFTER `address`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_name"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_name 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '所在建筑名称' AFTER `building_id`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -230,6 +230,26 @@
and org_Code = #{orgCode}
</if>
</select>
<select id="queryInputItemInRountPoint" resultType="java.util.Map">
SELECT
pii.id,
pii.`name` inputName,
pii.item_type itemType,
pii.test_requirement testRequirement,
pii.data_json dataJson,
pii.is_must isMust,
pii.picture_json pictureJson,
pii.order_no orderNo,
prpi.id as routePointItemId
FROM
p_route_point_item prpi
LEFT JOIN p_point_inputitem ppii ON ppii.id = prpi.point_input_item_id
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE
prpi.route_point_id = #{routePointId}
ORDER BY
prpi.order_no
</select>
<insert id="insertList" parameterType="java.util.List">
INSERT INTO p_input_item (
`org_code`, `name`, `item_type`,
......
......@@ -336,28 +336,32 @@
where 1 = 1
<if test="planTaskId != null and planTaskId >0 "> and a.planTaskId = #{planTaskId} </if>
</select>
<select id="getPlanTaskPoints" resultType="Map">
SELECT
ptd.id,
p.name,
p.id pointId,
p.point_no pointNO,
p.offline,
p.point_no pointNo,
concat_ws(' ',p.building_name,p.address) as position,
p.belong_system_name as belongSystemName,
ptd.status,
ptd.is_finish finish,
p.is_fixed isFixed,
pt.route_id routeId,
ptd.is_finish as isFinish,
pt.route_id as routeId,
c.id checkId,
prp.order_no orderNo
prp.order_no orderNo,
prp.id as routePointId
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
WHERE
p.is_delete = 0
<if test="planTaskId != null and planTaskId > 0 ">and pt.id = #{planTaskId}</if>
p.is_delete = 0 and pt.id = #{planTaskId}
<if test="buildingId != null and buildingId != ''">and find_in_set(p.building_id,#{buildingId})</if>
<if test="isFinish != null and isFinish != ''">and ptd.is_finish = #{isFinish}</if>
<if test="systemId != null and systemId != ''">and p.belong_system_id = #{systemId}</if>
<if test="pointNo != null and pointNo != ''">and p.point_no = #{pointNo}</if>
<if test="pointName != null and pointName != ''">and p.name like CONCAT ('%',#{pointName},'%')</if>
ORDER BY orderNo
</select>
......@@ -712,100 +716,6 @@
<if test="routeId != null">prp.route_id = #{routeId}</if>
<if test="pointId != null">and prp.point_id = #{pointId}</if>
</where>
<!--
SELECT
ii.*, pii.classify_ids, group_concat(ppc.name) classifyNames
FROM
p_input_item ii
LEFT JOIN p_point_inputitem pii ON pii.input_item_id = ii.id
LEFT JOIN p_point_classify ppc on pii.classify_ids REGEXP CONCAT(
'^',
ppc.id,
',|,',
ppc.id,
',|,',
ppc.id,
'$',
'|^',
ppc.id,
'$'
)
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id,
(
SELECT
id AS route_point_id
FROM
p_route_point rp
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
GROUP BY ii.id,
ii.org_code,
ii.name,
ii.order_no,
ii.item_type,
ii.is_must,
ii.is_score,
ii.default_value,
ii.is_multiline,
ii.catalog_id,
ii.input_json,
ii.data_json,
ii.remark,
ii.picture_json,
ii.create_by,
ii.create_date,
ii.is_delete,
ii.level
, pii.classify_ids
SELECT
*
FROM
p_point_inputitem
WHERE
id IN (
SELECT
point_input_item_id
FROM
p_route_point_item prpi,
(
SELECT
id AS route_point_id
FROM
p_route_point
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
) -->
</select>
<select id="queryPointClassifyByRouteIdAndPointId" resultType="Map">
SELECT
ppc.id,
ppc.point_id pointId,
ppc.`name`,
ppc.order_no orderNo
FROM
`p_route_point_item` prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE
prp.route_id = #{routeId}
AND prp.point_id = #{pointId}
GROUP BY
ppc.id,
ppc.point_id,
ppc.`name`,
ppc.order_no
</select>
<select id="queryLeavePlanTask" resultMap="LeavePlanTaskMap">
......
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