Commit a249edcc authored by chenhao's avatar chenhao

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

parents c433afe1 8a62f863
...@@ -23,14 +23,13 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> { ...@@ -23,14 +23,13 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
/** /**
* 查询全部 分页 * 查询全部 分页
* *
* @param page * @param current 当前页
* @return * @return
*/ */
// IPage<FailureDetails> selectAllPage(Page page);
IPage<FailureDetails> selectAllPage(Page<FailureDetails> page, Long currentStatus, List<FailureDetails> selectAllPage(Long current,Long size, Long currentStatus,
String startTime,String endTime, Integer submissionPid); String startTime,String endTime, Integer submissionPid);
/*IPage<FailureDetails> selectAllPage(int current,int size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);*/
/** /**
* 查询我发起的 分页 * 查询我发起的 分页
* current 当前页 * current 当前页
...@@ -38,31 +37,94 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> { ...@@ -38,31 +37,94 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
* *
* @return * @return
*/ */
IPage<FailureDetails> selectISubPage(Page page, String submissionPid); List<FailureDetails> selectISubPage(Long current,Long size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/** /**
* 查询待处理 分页 * 查询待处理 分页
* *
* @param page * @param
* @return * @return
*/ */
IPage<FailureDetails> selectInProcessing(Page page); List<FailureDetails> selectInProcessing(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
IPage<FailureDetails> selectStatusWaitTj(Page page); * 查询待处理 应急指挥科人员分页
*
IPage<FailureDetails> selectStatusWaitWx(); * @param
* @return
*/
List<FailureDetails> selectStatusWaitTj(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
* 查询待处理 维修人员分页
*
* @param
* @return
*/
List<FailureDetails> selectStatusWaitWx(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusCount(); /**
* 统计 全部
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusCount(Long currentStatus,String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusWx();
List<StatusDto> selectStatusFq(); /**
* 统计 维修人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusWx(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 应急指挥科人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusFq(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 我发起
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusFqp(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 领导
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusLeader(Long currentStatus,String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusFqp(Integer submissionPid);
List<StatusDto> selectStatusLeader();
} }
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto; import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto; import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
...@@ -55,8 +57,8 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> { ...@@ -55,8 +57,8 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
* 查询包含特岗人数及的具体信息 * 查询包含特岗人数及的具体信息
* @return * @return
*/ */
List<LinkageUnitDto> getEmergencyLinkageUnitList(String unitName, Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitTypeCode, String emergencyLinkageUnitCode); String linkageUnitType, String emergencyLinkageUnitCode);
List<LinkageUnitDto> exportToExcel(); List<LinkageUnitDto> exportToExcel();
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
FROM FROM
cb_failure_details cb_failure_details
<where> <where>
<if test="currentStatus!= null "> <if test="currentStatus!= null ">
and current_status = #{currentStatus} and current_status = #{currentStatus}
</if> </if>
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
and submission_pid = #{submissionPid} and submission_pid = #{submissionPid}
</if> </if>
</where> </where>
order by submission_time DESC order by submission_time DESC limit #{current},#{size}
</select> </select>
...@@ -47,11 +46,22 @@ ...@@ -47,11 +46,22 @@
submission_branch, submission_branch,
submission_branch_id submission_branch_id
FROM cb_failure_details FROM cb_failure_details
WHERE submission_pid = #{submissionPid} <where>
<if test="currentStatus!= null ">
and current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
order by submission_time DESC order by submission_time DESC
limit #{current},#{size}
</select> </select>
<select id="selectInProcessing" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"> <select id="selectInProcessing" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails">
SELECT sequence_nbr, SELECT sequence_nbr,
current_status, current_status,
...@@ -66,9 +76,22 @@ ...@@ -66,9 +76,22 @@
submission_branch, submission_branch,
submission_branch_id submission_branch_id
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 3 <where>
OR cb_failure_details.current_status = 0 <if test="currentStatus == null ">
and current_status in (0,3)
</if>
<if test="currentStatus != null ">
current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
order by submission_time DESC order by submission_time DESC
limit #{current},#{size}
</select> </select>
<select id="selectStatusWaitTj" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"> <select id="selectStatusWaitTj" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails">
...@@ -85,9 +108,19 @@ ...@@ -85,9 +108,19 @@
submission_branch, submission_branch,
submission_branch_id submission_branch_id
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 1 <where>
<if test="currentStatus != null ">
and current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
order by submission_time DESC order by submission_time DESC
limit #{current},#{size}
</select> </select>
<select id="selectStatusWaitWx" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"> <select id="selectStatusWaitWx" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails">
...@@ -104,10 +137,22 @@ ...@@ -104,10 +137,22 @@
submission_branch, submission_branch,
submission_branch_id submission_branch_id
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 6 <where>
OR cb_failure_details.current_status = 2 <if test="currentStatus == null ">
current_status IN (2,6)
</if>
<if test="currentStatus != null ">
current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
order by submission_time DESC order by submission_time DESC
limit #{current},#{size}
</select> </select>
<select id="selectStatusCount" resultType="com.yeejoin.amos.boot.module.common.api.dto.StatusDto"> <select id="selectStatusCount" resultType="com.yeejoin.amos.boot.module.common.api.dto.StatusDto">
...@@ -115,6 +160,17 @@ ...@@ -115,6 +160,17 @@
count(cb_failure_details.current_status) count(cb_failure_details.current_status)
AS currentStatusCount AS currentStatusCount
FROM cb_failure_details FROM cb_failure_details
<where>
<if test="currentStatus!= null ">
and current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
GROUP BY cb_failure_details.current_status GROUP BY cb_failure_details.current_status
</select> </select>
...@@ -123,8 +179,20 @@ ...@@ -123,8 +179,20 @@
count(cb_failure_details.current_status) count(cb_failure_details.current_status)
AS currentStatusCount AS currentStatusCount
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 6 <where>
OR cb_failure_details.current_status = 2 <if test="currentStatus == null ">
and current_status in (2,6)
</if>
<if test="currentStatus != null ">
and current_status #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
GROUP BY cb_failure_details.current_status GROUP BY cb_failure_details.current_status
</select> </select>
...@@ -133,7 +201,17 @@ ...@@ -133,7 +201,17 @@
count(cb_failure_details.current_status) count(cb_failure_details.current_status)
AS currentStatusCount AS currentStatusCount
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 1 <where>
<if test="currentStatus == null ">
and current_status = 1
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
GROUP BY cb_failure_details.current_status GROUP BY cb_failure_details.current_status
</select> </select>
...@@ -143,8 +221,17 @@ ...@@ -143,8 +221,17 @@
count(cb_failure_details.current_status) count(cb_failure_details.current_status)
AS currentStatusCount AS currentStatusCount
FROM cb_failure_details FROM cb_failure_details
WHERE cb_failure_details.current_status = 0 <where>
or cb_failure_details.current_status = 3 <if test="currentStatus == null ">
and current_status in (0,3)
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
GROUP BY cb_failure_details.current_status GROUP BY cb_failure_details.current_status
</select> </select>
...@@ -154,7 +241,17 @@ ...@@ -154,7 +241,17 @@
count(cb_failure_details.current_status) count(cb_failure_details.current_status)
AS currentStatusCount AS currentStatusCount
FROM cb_failure_details FROM cb_failure_details
WHERE submission_pid = #{submissionPid} <where>
<if test="currentStatus!= null ">
and current_status = #{currentStatus}
</if>
<if test="startTime!= null and endTime != null">
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionPid!= null ">
and submission_pid = #{submissionPid}
</if>
</where>
GROUP BY cb_failure_details.current_status GROUP BY cb_failure_details.current_status
</select> </select>
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
<select id="getEmergencyLinkageUnitList" <select id="getEmergencyLinkageUnitList"
resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"> resultType="java.util.Map">
SELECT SELECT
clu.sequence_nbr as sequenceNbr, clu.sequence_nbr as sequenceNbr,
clu.unit_name as unitName, clu.unit_name as unitName,
......
...@@ -14,10 +14,12 @@ public enum OrderByEnum { ...@@ -14,10 +14,12 @@ public enum OrderByEnum {
*/ */
TIME_DESC("时间倒序", "1", "beginTime desc"), TIME_DESC("时间倒序", "1", "beginTime desc"),
TIME_ASC("时间正序", "2", "beginTime asc"), TIME_ASC("时间正序", "2", "beginTime asc"),
PLAN_TASK_NUM_ASC("计划维保设施数正序", "3", "taskPlanNum asc"), PLAN_TASK_NUM_ASC("检查设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"), PLAN_TASK_NUM_DESC("检查设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"), FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"); FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
PLAN_TASK_ITEM_NUM_ASC("检查项正序", "7", "itemNum asc"),
PLAN_TASK_ITEM_NUM_DESC("检查项正序", "8", "itemNum desc");
/** /**
* 名字 * 名字
......
...@@ -4,9 +4,10 @@ import java.util.ArrayList; ...@@ -4,9 +4,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public enum PlanTaskDetailIsFinishEnum { public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未完成",0), UNFINISHED("未开始",0),
FINISHED("已完成",1), EXECUTION("执行中",1),
OVERTIME("超时漏检",2); FINISHED("已完成",2),
OVERTIME("超时漏检",3);
/** /**
* 名称 * 名称
......
...@@ -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.supervision.common.enums;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author DELL
*
*/
public enum TaskCheckTypeEnum {
/**
* 维保任务排序
*/
RCJC("日常检查", "1"),
ZXJC("专项检查", "2");
/**
* 名字
*/
private String name;
/**
* 编号
*/
private String code;
TaskCheckTypeEnum(String name, String code) {
this.code = code;
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public static List<Map<String, Object>> getEnumList() {
return Arrays.stream(TaskCheckTypeEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put(e.getCode(), e.getName());
return map;
}).collect(Collectors.toList());
}
public static TaskCheckTypeEnum getEumByCode(String code) throws Exception {
Optional<TaskCheckTypeEnum> op = Arrays.stream(TaskCheckTypeEnum.values()).filter(e->e.getCode().equals(code)).findFirst();
return op.orElseThrow(()->new Exception("非法的条件"));
}
}
...@@ -7,8 +7,6 @@ import javax.servlet.http.HttpServletRequest; ...@@ -7,8 +7,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -52,7 +50,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -52,7 +50,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping(value = "/common/failure-details") @RequestMapping(value = "/common/failure-details")
public class FailureDetailsController extends BaseController { public class FailureDetailsController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class);
@Autowired @Autowired
FailureDetailsServiceImpl failureDetailsServiceImpl; FailureDetailsServiceImpl failureDetailsServiceImpl;
...@@ -113,24 +110,28 @@ public class FailureDetailsController extends BaseController { ...@@ -113,24 +110,28 @@ public class FailureDetailsController extends BaseController {
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param size 每页大小
* @return * @return
*/ */
@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<IPage<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<IPage<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") Long current, @RequestParam
(value = "size") int size, @RequestParam Integer type, Long currentStatus, (value = "size") Long size, @RequestParam Integer type, Long currentStatus,
Integer submissionPid, Integer userId,
String startTime, String endTime) { String startTime, String endTime) {
Page<FailureDetails> page = new Page<FailureDetails>(); Page<FailureDetails> page = new Page<FailureDetails>();
if (current > 0) {
page.setCurrent((current - 1) * size);
} else {
page.setCurrent(current); page.setCurrent(current);
}
page.setSize(size); page.setSize(size);
ReginParams userInfo = getSelectedOrgInfo(); ReginParams userInfo = getSelectedOrgInfo();
IPage<FailureDetailsDto> failureDetailDTOsIPage = new Page<>(); IPage<FailureDetailsDto> failureDetailDTOsIPage = new Page<>();
//IPage<FailureDetails> failureDetailsIPage = failureDetailsServiceImpl.queryForFailureDetailsPage((current - 1) * size,size,userInfo,currentStatus, startTime,endTime,submissionPid,type); IPage<FailureDetails> failureDetailsIPage = failureDetailsServiceImpl.queryForFailureDetailsPage(page, userInfo, currentStatus, startTime, endTime, userId, type);
IPage<FailureDetails> failureDetailsIPage = failureDetailsServiceImpl.queryForFailureDetailsPage(page, userInfo, currentStatus, startTime, endTime, submissionPid, type);
BeanUtils.copyProperties(failureDetailsIPage, FailureDetailsDto.class); BeanUtils.copyProperties(failureDetailsIPage, FailureDetailsDto.class);
List<FailureDetails> records = failureDetailsIPage.getRecords(); List<FailureDetails> records = failureDetailsIPage.getRecords();
...@@ -148,17 +149,6 @@ public class FailureDetailsController extends BaseController { ...@@ -148,17 +149,6 @@ public class FailureDetailsController extends BaseController {
return ResponseHelper.buildResponse(failureDetailDTOsIPage); return ResponseHelper.buildResponse(failureDetailDTOsIPage);
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FailureDetailsDto>> selectForList() {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsList());
}
/** /**
* 根据状态查询当前下全部数据 * 根据状态查询当前下全部数据
...@@ -181,15 +171,15 @@ public class FailureDetailsController extends BaseController { ...@@ -181,15 +171,15 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询当前状态任务数量", notes = "查询当前状态任务数量") @ApiOperation(httpMethod = "GET", value = "查询当前状态任务数量", notes = "查询当前状态任务数量")
@GetMapping(value = "/list/count") @GetMapping(value = "/list/count")
public ResponseModel<List<CurrentStatusDto>> selectStatusCount(Integer type) { public ResponseModel<List<CurrentStatusDto>> selectStatusCount(Integer type, Long currentStatus, String startTime, String endTime, Integer userId) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(getSelectedOrgInfo(), type)); return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(getSelectedOrgInfo(), type, currentStatus, startTime, endTime, userId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "流程信息", notes = "流程信息") @ApiOperation(httpMethod = "GET", value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory") @GetMapping(value = "/processHistory/{sequenceNbr}")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) { public ResponseModel<Object> selectHistoryt(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr)); return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
} }
...@@ -206,7 +196,6 @@ public class FailureDetailsController extends BaseController { ...@@ -206,7 +196,6 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/getCurrentTask/{sequenceNbr}") @GetMapping(value = "/getCurrentTask/{sequenceNbr}")
public ResponseModel<Object> getCurrentTask(@PathVariable Long sequenceNbr) { public ResponseModel<Object> getCurrentTask(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentTask(sequenceNbr)); return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentTask(sequenceNbr));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -216,13 +205,6 @@ public class FailureDetailsController extends BaseController { ...@@ -216,13 +205,6 @@ public class FailureDetailsController extends BaseController {
return ResponseHelper.buildResponse(workflowFeignService.thighLine(instanceId)); return ResponseHelper.buildResponse(workflowFeignService.thighLine(instanceId));
} }
// @TycloudOperation(ApiLevel = UserType.AGENCY)
//
// @GetMapping(value = "/activityHistory/gettingLineImg/{sequenceNbr}")
// public ResponseModel<Object> gothLineImg(@PathVariable Long sequenceNbr, HttpServletResponse resp) {
// String processId = failureDetailsServiceImpl.queryBySeq(sequenceNbr).getProcessId();
// return ResponseHelper.buildResponse(workflowFeignService.thighLineImg(processId, resp));
// }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询状态枚举", notes = "查询状态枚举") @ApiOperation(httpMethod = "GET", value = "查询状态枚举", notes = "查询状态枚举")
...@@ -232,7 +214,7 @@ public class FailureDetailsController extends BaseController { ...@@ -232,7 +214,7 @@ public class FailureDetailsController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping (value = "/downloadFile/{sequenceNbr}") @GetMapping(value = "/downloadFile/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "流程图高亮图片", notes = "流程图高亮图片") @ApiOperation(httpMethod = "GET", value = "流程图高亮图片", notes = "流程图高亮图片")
public ResponseEntity<String> downloadFile(@PathVariable Long sequenceNbr, HttpServletRequest request, HttpServletResponse response) throws Exception { public ResponseEntity<String> downloadFile(@PathVariable Long sequenceNbr, HttpServletRequest request, HttpServletResponse response) throws Exception {
String processId = failureDetailsServiceImpl.queryBySeq(sequenceNbr).getProcessId(); String processId = failureDetailsServiceImpl.queryBySeq(sequenceNbr).getProcessId();
......
...@@ -384,10 +384,9 @@ public class WaterResourceController extends BaseController { ...@@ -384,10 +384,9 @@ public class WaterResourceController extends BaseController {
@GetMapping(value = "/select_list") @GetMapping(value = "/select_list")
public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr, public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr,
Long belongFightingSystemId, Long belongBuildingId, Long belongFightingSystemId, Long belongBuildingId,
String belongBuilding, String resourceType) { String belongBuilding, String resourceType, String classifyId) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name, sequenceNbr, return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name,
belongFightingSystemId, belongBuildingId, sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType, classifyId));
belongBuilding, resourceType));
} }
/** /**
......
...@@ -73,77 +73,62 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -73,77 +73,62 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public static Integer SELECY_ISUBMIT = 8; public static Integer SELECY_ISUBMIT = 8;
public String[] roleName = {"maintenance_department_maintenance_personnel", "emergency_command_staff"}; public String[] roleName = {"maintenance_department_maintenance_personnel", "emergency_command_staff"};
/** /**
* 分页查询 * 分页查询接口
* @param type 查询类型
* @param currentStatus 状态
* @param startTime 起始时间
* @param startTime 结束时间
* @param userId 用户id
*/ */
public IPage<FailureDetails> queryAllPage(long size, long current) { public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
Page pages = new Page<>(current, size); String startTime, String endTime, Integer userId, Integer type) {
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper(); //当传递类型参数为全部查询时
lambdaQueryWrapper.orderByDesc(FailureDetails::getSubmissionTime);
return page(pages, lambdaQueryWrapper);
}
public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page, ReginParams userInfo,Long currentStatus,
String startTime,String endTime,Integer submissionPid,Integer type) {
if (type.equals(SELECY_ALL)) { if (type.equals(SELECY_ALL)) {
return this.baseMapper.selectAllPage(page,currentStatus,startTime ,endTime,submissionPid);
List<FailureDetails> list = this.baseMapper.selectAllPage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
//当传递类型参数为我提交时
if (type.equals(SELECY_ISUBMIT)) { if (type.equals(SELECY_ISUBMIT)) {
return baseMapper.selectISubPage(page, userInfo.getUserModel().getUserId()); List<FailureDetails> list = baseMapper.selectISubPage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
return this.queryForWaitManage(page, userInfo); //否则就查询待处理
return this.queryForWaitManage(page, userInfo, currentStatus, startTime, endTime, userId);
} }
/* public IPage<FailureDetails> queryForFailureDetailsPage(int current,int size, ReginParams userInfo,Long currentStatus,
String startTime,String endTime,Integer submissionPid,Integer type) {
if (type.equals(SELECY_ALL)) {
return this.baseMapper.selectAllPage(current,size,currentStatus,startTime ,endTime,submissionPid);
}
*//* if (type.equals(SELECY_ISUBMIT)) {
return baseMapper.selectISubPage(page, userInfo.getUserModel().getUserId());
}
return this.queryForWaitManage(page, userInfo);*//*
return null;
}*/
/**
* 我发起分页查询
*/
public IPage<FailureDetails> queryForPage(Page<FailureDetails> page, String submissionPid) {
if (submissionPid == null) {
return null;
}
Page pages = new Page<>(page.getCurrent(), page.getSize());
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(FailureDetails::getSubmissionPid, submissionPid);
lambdaQueryWrapper.orderByDesc(FailureDetails::getSubmissionTime);
return page(pages, lambdaQueryWrapper);
}
/** /**
* 待处理分页查询 * 待处理分页查询
*/ */
public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, ReginParams userInfo) { public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
String startTime, String endTime, Integer userId) {
if (userInfo.getRole().getRoleName().equals(roleName[0])) { if (userInfo.getRole().getRoleName().equals(roleName[0])) {
return baseMapper.selectStatusWaitWx(); IPage<FailureDetails> wxIpage = new Page<>();
List<FailureDetails> list = baseMapper.selectStatusWaitWx(page.getCurrent(), page.getSize(),currentStatus, startTime, endTime, userId);
wxIpage.setRecords(list);
return wxIpage;
} else if (userInfo.getRole().getRoleName().equals(roleName[1])) { } else if (userInfo.getRole().getRoleName().equals(roleName[1])) {
return baseMapper.selectStatusWaitTj(page); currentStatus = FailureStatuEnum.WAITING_SUBMIT.getCode().longValue();
List<FailureDetails> list = baseMapper.selectStatusWaitTj(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
return baseMapper.selectInProcessing(page); List<FailureDetails> list = baseMapper.selectInProcessing(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
/** /**
* 列表查询 示例
*/
public List<FailureDetailsDto> queryForFailureDetailsList() {
return this.queryForList("", false);
}
/**
* 根据状态查询 * 根据状态查询
*/ */
...@@ -181,18 +166,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -181,18 +166,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 查询任务状态数量 * 查询任务状态数量
*/ */
public List<CurrentStatusDto> queryStatusCount(ReginParams userInfo, Integer type) { public List<CurrentStatusDto> queryStatusCount(ReginParams userInfo, Integer type, Long currentStatus, String startTime, String endTime, Integer userId) {
List<StatusDto> statusDtos = null; List<StatusDto> statusDtos = null;
if (type.equals(SELECY_STATUS) &&userInfo.getRole().getRoleName().equals(roleName[0])) { if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[0])) {
statusDtos = baseMapper.selectStatusWx(); statusDtos = baseMapper.selectStatusWx(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[1])) { } else if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[1])) {
statusDtos = baseMapper.selectStatusFq(); statusDtos = baseMapper.selectStatusFq(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_ISUBMIT)) { } else if (type.equals(SELECY_ISUBMIT)) {
statusDtos = baseMapper.selectStatusFqp(Integer.parseInt(userInfo.getUserModel().getUserId())); statusDtos = baseMapper.selectStatusFqp(currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
} else if (type.equals(SELECY_ALL)){ } else if (type.equals(SELECY_ALL)) {
statusDtos = baseMapper.selectStatusCount(); statusDtos = baseMapper.selectStatusCount(currentStatus, startTime, endTime, userId);
}else { } else {
statusDtos = baseMapper.selectStatusLeader(); statusDtos = baseMapper.selectStatusLeader(currentStatus, startTime, endTime, userId);
} }
List<CurrentStatusDto> currentStatusDtoList = new ArrayList<>(); List<CurrentStatusDto> currentStatusDtoList = new ArrayList<>();
statusDtos.forEach(e -> { statusDtos.forEach(e -> {
...@@ -527,16 +512,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -527,16 +512,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
list.add(detail); list.add(detail);
} }
// datArray.stream().forEach(i -> {
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
// // 从流程记录表中拿到处理人的名称
// FailureRepairlog failureRepairlog = failureRepairlogService
// .findByprocessAuditor(detail.getString("operator"));
// detail.replace("operator", failureRepairlog.getProcessAuditorName());
// list.add(detail);
// }
// });
} }
return list; return list;
} }
...@@ -629,7 +604,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -629,7 +604,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
} }
return list; return list;
} }
} }
\ No newline at end of file
...@@ -73,10 +73,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -73,10 +73,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
@Override @Override
public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page, public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page,
@Condition(Operator.eq) Boolean isDelete, @Condition(Operator.like) String unitName, @Condition(Operator.eq) Boolean isDelete, @Condition(Operator.like) String unitName,
@Condition(Operator.eq) String linkageUnitTypeCode, @Condition(Operator.eq) String emergencyLinkageUnitCode, @Condition(Operator.eq) String linkageUnitType, @Condition(Operator.eq) String emergencyLinkageUnitCode,
String inAgreement) { String inAgreement) {
List<LinkageUnitDto> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(unitName, linkageUnitTypeCode, emergencyLinkageUnitCode); Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType, emergencyLinkageUnitCode);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList), Map.class); List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode()); List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
linkageUnitListMap.forEach(i -> { linkageUnitListMap.forEach(i -> {
...@@ -87,7 +87,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -87,7 +87,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
} }
}); });
}); });
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList), List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()),
LinkageUnitDto.class); LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> { List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date(); Date now = new Date();
...@@ -103,7 +103,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -103,7 +103,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>(); Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>();
page1.setCurrent(page.getCurrent()); page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize()); page1.setSize(page.getSize());
page1.setTotal(linkageUnitList.size()); // TOTAL 需要统计所有存在的数据BUG2590 by kongfm page1.setTotal(linkageUnitList.getTotal()); // TOTAL 需要统计所有存在的数据BUG2590 by kongfm
page1.setRecords(detaiList); page1.setRecords(detaiList);
return page1; return page1;
} }
......
...@@ -82,9 +82,10 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -82,9 +82,10 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long belongFightingSystemId, @Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long belongBuildingId, @Condition(Operator.eq) Long belongBuildingId,
@Condition(Operator.like) String belongBuilding, @Condition(Operator.like) String belongBuilding,
@Condition(Operator.eq) String resourceType) { @Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId) {
return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId, return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId,
belongBuilding, resourceType); belongBuilding, resourceType, equipId);
} }
......
...@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo; import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo; import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -43,10 +44,6 @@ import com.yeejoin.amos.supervision.business.util.CommonResponseUtil; ...@@ -43,10 +44,6 @@ import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.business.util.FileHelper; import com.yeejoin.amos.supervision.business.util.FileHelper;
import com.yeejoin.amos.supervision.business.util.PlanTaskPageParamUtil; import com.yeejoin.amos.supervision.business.util.PlanTaskPageParamUtil;
import com.yeejoin.amos.supervision.business.util.Toke; import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.common.enums.OrderByEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailStatusEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.common.enums.TaskIsOrderEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest; import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
...@@ -56,6 +53,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify; ...@@ -56,6 +53,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController @RestController
@RequestMapping(value = "/api/planTask") @RequestMapping(value = "/api/planTask")
...@@ -489,43 +488,71 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -489,43 +488,71 @@ public class PlanTaskController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务") @ApiOperation(value = "消防监督任务查询-mobile", notes = "根据用户条件查询所有计划任务")
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryLoginUserPlanTask( public ResponseModel qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId, @ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期") @RequestParam(value = "startTime") String startTime, @ApiParam(value = "开始日期") @RequestParam(value = "startTime") String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endTime") String endTime, @ApiParam(value = "结束日期") @RequestParam(value = "endTime") String endTime,
@ApiParam(value = "维保状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus, @ApiParam(value = "检查状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy") String orderBy, @ApiParam(value = "排序条件") @RequestParam(value = "orderBy") String orderBy,
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId, @ApiParam(value = "被检查单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber, @ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception { @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); // String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity()); // Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap); // params.putAll(authMap);
params.put("userId", userId);
params.put("companyId", companyId); params.put("companyId", companyId);
params.put("orgCode", loginOrgCode); params.put("orgCode", loginOrgCode);
params.put("userId", userId); params.put("taskType", taskType);
params.put("startTime", startTime); params.put("startTime", startTime);
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("executorId", executorId);
params.put("finishStatus", finishStatus); params.put("finishStatus", finishStatus);
params.put("taskType", TaskCheckTypeEnum.getEumByCode(taskType).getName());
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy()); params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
@RequestMapping(value = "/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel qryPlanTaskDetailById(
@ApiParam(value = "检查计划任务ID", required = true) @RequestParam Long planTaskId) {
ResponseModel result = null;
try { try {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable)); Map<String, Object> response = new HashMap<String, Object>();
Map task = planTaskService.queryPlanTaskById(planTaskId);
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
result = ResponseHelper.buildResponse("该计划已刷新,请重新选择!!!");
} else {
List points = planTaskService.getPlanTaskPoints(planTaskId);
String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) {
task.put("userId", userId);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
response.put("planTask", task);
response.put("points", points);
result = ResponseHelper.buildResponse(response);
}
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage()); e.printStackTrace();
} }
return result;
} }
public static Object nvl(Object param) { public static Object nvl(Object param) {
return param != null ? param : null; return param != null ? param : null;
} }
/** /**
* 查询任务列表 * 查询任务列表
*/ */
......
...@@ -61,6 +61,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify; ...@@ -61,6 +61,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController @RestController
@RequestMapping(value = "/api/point") @RequestMapping(value = "/api/point")
...@@ -804,4 +806,11 @@ public class PointController extends AbstractBaseController { ...@@ -804,4 +806,11 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.success(iPointService.getRegionTress()); return CommonResponseUtil.success(iPointService.getRegionTress());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检点详情<font color='blue'>手机app</font>)", notes = "查询巡检点详情<font color='blue'>手机app</font>)")
@GetMapping(value = "/detail/item", produces = "application/json;charset=UTF-8")
public ResponseModel queryItemDetailByPointId(@ApiParam(value = "巡检点id", required = true) @RequestParam(name = "pointId") Long id) {
return ResponseHelper.buildResponse(iPointService.queryItemDetailByPointId(id));
}
} }
...@@ -156,4 +156,6 @@ public interface PointMapper extends BaseMapper { ...@@ -156,4 +156,6 @@ public interface PointMapper extends BaseMapper {
* 根据路线id查询所有点 * 根据路线id查询所有点
*/ */
List<Long> getPointoriginalidbyrouteid(@Param(value = "routeId") Long routeId); List<Long> getPointoriginalidbyrouteid(@Param(value = "routeId") Long routeId);
List<Map<String, Object>> queryItemsByPointId(@Param(value = "pointId") Long pointId);
} }
...@@ -30,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CalDateVo; ...@@ -30,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CalDateVo;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo; import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo; import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
...@@ -577,13 +578,27 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -577,13 +578,27 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (total == 0) { if (total == 0) {
return new PageImpl<>(content, pageParam, total); return new PageImpl<>(content, pageParam, total);
} }
params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize());
content = planTaskMapper.getPlanTasks(params); content = planTaskMapper.getPlanTasks(params);
content.forEach(c -> {
if (c.containsKey("finishStatus")) {
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(c.get("finishStatus").toString()));
c.put("finishStatusDesc", finishStatusDesc);
}
});
return new PageImpl<>(content, pageParam, total); return new PageImpl<>(content, pageParam, total);
} }
@Override @Override
public Map queryPlanTaskById(Long planTaskId) { public Map queryPlanTaskById(Long planTaskId) {
return planTaskMapper.queryPlanTaskById(planTaskId); Map map = new HashMap();
map = planTaskMapper.queryPlanTaskById(planTaskId);
if (map.containsKey("finishStatus")) {
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(map.get("finishStatus").toString()));
map.put("finishStatusDesc", finishStatusDesc);
}
return map;
} }
@Override @Override
......
...@@ -131,6 +131,9 @@ public class PointServiceImpl implements IPointService { ...@@ -131,6 +131,9 @@ public class PointServiceImpl implements IPointService {
@Autowired @Autowired
Sequence sequence; Sequence sequence;
@Value("${file.url}")
private String fileUrl;
@Override @Override
@Transactional @Transactional
public Point addPoint(PointParam pointParam) { public Point addPoint(PointParam pointParam) {
...@@ -1205,4 +1208,17 @@ public class PointServiceImpl implements IPointService { ...@@ -1205,4 +1208,17 @@ public class PointServiceImpl implements IPointService {
iPointDao.delPointByPointNo(id); iPointDao.delPointByPointNo(id);
} }
@Override
public List<Map<String, Object>> queryItemDetailByPointId(Long id) {
List<Map<String, Object>> list = pointMapper.queryItemsByPointId(id);
if (0 < list.size()) {
for (Map<String, Object> map : list) {
if (map.containsKey("picJson") && !ObjectUtils.isEmpty(map.get("picJson"))) {
map.put("remark", fileUrl + map.get("remark"));
}
}
}
return list;
}
} }
...@@ -327,4 +327,6 @@ public interface IPointService { ...@@ -327,4 +327,6 @@ public interface IPointService {
*/ */
void delPointByPointNo(Long id); void delPointByPointNo(Long id);
List<Map<String, Object>> queryItemDetailByPointId(Long id);
} }
...@@ -158,4 +158,14 @@ ...@@ -158,4 +158,14 @@
ALTER TABLE `p_plan_task_detail` ADD COLUMN `major_danger_num` int(11) DEFAULT 0 COMMENT '重大隐患个数' AFTER `safety_danger_num`; ALTER TABLE `p_plan_task_detail` ADD COLUMN `major_danger_num` int(11) DEFAULT 0 COMMENT '重大隐患个数' AFTER `safety_danger_num`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1629863569-1">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_plan_task_detail" columnName="is_finish"/>
</preConditions>
<comment>p_plan_task_detail modify column is_finish</comment>
<sql>
alter table `p_plan_task_detail` modify column `is_finish` int(11) COMMENT '0-未开始,1-执行中,2-已完成,3-超时漏检(有一个检查项漏检则为漏检)' after `create_date`;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
pt.id planTaskId, pt.id planTaskId,
pt.org_code orgCode, pt.org_code orgCode,
p.name taskName, p.name taskName,
p.check_type_name checkTypeName,
pt.status, pt.status,
pt.user_id userId, pt.user_id userId,
date_format( date_format(
...@@ -200,11 +201,14 @@ ...@@ -200,11 +201,14 @@
pt.route_id, pt.route_id,
pt.user_name userName, pt.user_name userName,
r.owner_id, r.owner_id,
R.owner_name as ownerName R.owner_name as ownerName,
ptd.item_num AS itemNum,
ptd.executor_id AS executorId
FROM FROM
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
...@@ -212,6 +216,9 @@ ...@@ -212,6 +216,9 @@
<sql id="mobile-plan-task-where"> <sql id="mobile-plan-task-where">
<where> <where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if> <if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="executorId != null and executorId > 0 "> and find_in_set(#{executorId},a.executorId)>0</if>
<if test="companyId != null"> and a.owner_id = #{companyId}</if>
<if test="taskType != null"> and a.checkTypeName = #{taskType}</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if> <if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND ( AND (
...@@ -233,15 +240,15 @@ ...@@ -233,15 +240,15 @@
) )
) )
</if> </if>
<choose> <!-- <choose>-->
<when test="identityType==1"> <!-- <when test="identityType==1">-->
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} ) <!-- And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )-->
<if test="companyId != null"> and a.owner_id = #{companyId}</if> <!-- <if test="companyId != null"> and a.owner_id = #{companyId}</if>-->
</when> <!-- </when>-->
<when test="identityType==2"> <!-- <when test="identityType==2">-->
And a.owner_id = #{companyId} <!-- And a.owner_id = #{companyId}-->
</when> <!-- </when>-->
</choose> <!-- </choose>-->
</where> </where>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if> <if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
</sql> </sql>
...@@ -258,11 +265,13 @@ ...@@ -258,11 +265,13 @@
pt.org_code as orgCode, pt.org_code as orgCode,
pt.begin_time as beginTime, pt.begin_time as beginTime,
pt.end_time as endTime, pt.end_time as endTime,
r.owner_id r.owner_id,
ptd.item_num AS itemNum
FROM FROM
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
</select> </select>
...@@ -282,6 +291,10 @@ ...@@ -282,6 +291,10 @@
count(a.finish) taskPlanNum, count(a.finish) taskPlanNum,
a.finishStatus, a.finishStatus,
a.batchNo, a.batchNo,
a.itemNum,
a.remain,
a.safetyNum,
a.majorNum,
a.inOrder a.inOrder
FROM FROM
( (
...@@ -304,6 +317,10 @@ ...@@ -304,6 +317,10 @@
pt.finish_num finishNum, pt.finish_num finishNum,
pt.finish_status finishStatus, pt.finish_status finishStatus,
pt.batch_no batchNo, pt.batch_no batchNo,
ptd.item_num itemNum,
(ptd.item_num - ptd.executed_num) remain,
ptd.safety_danger_num safetyNum,
ptd.major_danger_num majorNum,
CASE ptd.`status` CASE ptd.`status`
WHEN 1 THEN WHEN 1 THEN
1 1
...@@ -527,7 +544,6 @@ ...@@ -527,7 +544,6 @@
<if test="endTime != null and endTime != '' "> and pt.begin_time <![CDATA[<=]]> #{endTime} </if> <if test="endTime != null and endTime != '' "> and pt.begin_time <![CDATA[<=]]> #{endTime} </if>
</where> </where>
) a ) a
</select> </select>
<select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" parameterType="long"> <select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
......
...@@ -1139,4 +1139,28 @@ ...@@ -1139,4 +1139,28 @@
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
</select> </select>
<select id="queryItemsByPointId" resultType="map">
SELECT
ppi.id,
ppi.input_item_id itemId,
ppi.point_id pointId,
pii.name itemName,
pii.item_type itemTyp,
pii.data_json dataJson,
pii.remark remark,
pii.picture_json picJson,
CASE pii.`input_type`
WHEN 0 THEN
'手动录入'
ELSE
'同步'
END inputType
FROM
p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
WHERE
ppi.point_id = #{pointId} AND pii.is_delete = 0
ORDER BY pii.order_no
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment