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> {
/**
* 查询全部 分页
*
* @param page
* @param current 当前页
* @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);
/*IPage<FailureDetails> selectAllPage(int current,int size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);*/
/**
* 查询我发起的 分页
* current 当前页
......@@ -38,31 +37,94 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
*
* @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
*/
IPage<FailureDetails> selectInProcessing(Page page);
IPage<FailureDetails> selectStatusWaitTj(Page page);
IPage<FailureDetails> selectStatusWaitWx();
List<FailureDetails> selectInProcessing(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
* 查询待处理 应急指挥科人员分页
*
* @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;
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.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
......@@ -55,8 +57,8 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
* 查询包含特岗人数及的具体信息
* @return
*/
List<LinkageUnitDto> getEmergencyLinkageUnitList(String unitName,
String linkageUnitTypeCode, String emergencyLinkageUnitCode);
Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitType, String emergencyLinkageUnitCode);
List<LinkageUnitDto> exportToExcel();
......
......@@ -132,7 +132,7 @@
<select id="getEmergencyLinkageUnitList"
resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto">
resultType="java.util.Map">
SELECT
clu.sequence_nbr as sequenceNbr,
clu.unit_name as unitName,
......
......@@ -14,10 +14,12 @@ public enum OrderByEnum {
*/
TIME_DESC("时间倒序", "1", "beginTime desc"),
TIME_ASC("时间正序", "2", "beginTime asc"),
PLAN_TASK_NUM_ASC("计划维保设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"),
PLAN_TASK_NUM_ASC("检查设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("检查设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc");
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
PLAN_TASK_ITEM_NUM_ASC("检查项正序", "7", "itemNum asc"),
PLAN_TASK_ITEM_NUM_DESC("检查项正序", "8", "itemNum desc");
/**
* 名字
......
......@@ -4,9 +4,10 @@ import java.util.ArrayList;
import java.util.List;
public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未完成",0),
FINISHED("已完成",1),
OVERTIME("超时漏检",2);
UNFINISHED("未开始",0),
EXECUTION("执行中",1),
FINISHED("已完成",2),
OVERTIME("超时漏检",3);
/**
* 名称
......
......@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0),
UNDERWAY("处理中",1),
UNDERWAY("待执行",1),
FINISHED("已结束",2),
OVERTIME("已超时",3);
......
package com.yeejoin.amos.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;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -52,7 +50,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping(value = "/common/failure-details")
public class FailureDetailsController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class);
@Autowired
FailureDetailsServiceImpl failureDetailsServiceImpl;
......@@ -113,24 +110,28 @@ public class FailureDetailsController extends BaseController {
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @param size 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public ResponseModel<IPage<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, @RequestParam Integer type, Long currentStatus,
Integer submissionPid,
public ResponseModel<IPage<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") Long current, @RequestParam
(value = "size") Long size, @RequestParam Integer type, Long currentStatus,
Integer userId,
String startTime, String endTime) {
Page<FailureDetails> page = new Page<FailureDetails>();
page.setCurrent(current);
if (current > 0) {
page.setCurrent((current - 1) * size);
} else {
page.setCurrent(current);
}
page.setSize(size);
ReginParams userInfo = getSelectedOrgInfo();
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, submissionPid, type);
IPage<FailureDetails> failureDetailsIPage = failureDetailsServiceImpl.queryForFailureDetailsPage(page, userInfo, currentStatus, startTime, endTime, userId, type);
BeanUtils.copyProperties(failureDetailsIPage, FailureDetailsDto.class);
List<FailureDetails> records = failureDetailsIPage.getRecords();
......@@ -148,17 +149,6 @@ public class FailureDetailsController extends BaseController {
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 {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询当前状态任务数量", notes = "查询当前状态任务数量")
@GetMapping(value = "/list/count")
public ResponseModel<List<CurrentStatusDto>> selectStatusCount(Integer type) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(getSelectedOrgInfo(), type));
public ResponseModel<List<CurrentStatusDto>> selectStatusCount(Integer type, Long currentStatus, String startTime, String endTime, Integer userId) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(getSelectedOrgInfo(), type, currentStatus, startTime, endTime, userId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
@GetMapping(value = "/processHistory/{sequenceNbr}")
public ResponseModel<Object> selectHistoryt(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
......@@ -206,7 +196,6 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/getCurrentTask/{sequenceNbr}")
public ResponseModel<Object> getCurrentTask(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentTask(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -216,13 +205,6 @@ public class FailureDetailsController extends BaseController {
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)
@ApiOperation(httpMethod = "GET", value = "查询状态枚举", notes = "查询状态枚举")
......@@ -232,7 +214,7 @@ public class FailureDetailsController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping (value = "/downloadFile/{sequenceNbr}")
@GetMapping(value = "/downloadFile/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "流程图高亮图片", notes = "流程图高亮图片")
public ResponseEntity<String> downloadFile(@PathVariable Long sequenceNbr, HttpServletRequest request, HttpServletResponse response) throws Exception {
String processId = failureDetailsServiceImpl.queryBySeq(sequenceNbr).getProcessId();
......
......@@ -384,10 +384,9 @@ public class WaterResourceController extends BaseController {
@GetMapping(value = "/select_list")
public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr,
Long belongFightingSystemId, Long belongBuildingId,
String belongBuilding, String resourceType) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name, sequenceNbr,
belongFightingSystemId, belongBuildingId,
belongBuilding, resourceType));
String belongBuilding, String resourceType, String classifyId) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name,
sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType, classifyId));
}
/**
......
......@@ -73,77 +73,62 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public static Integer SELECY_ISUBMIT = 8;
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) {
Page pages = new Page<>(current, size);
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) {
public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
String startTime, String endTime, Integer userId, Integer type) {
//当传递类型参数为全部查询时
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)) {
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])) {
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])) {
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
/**
* 查询任务状态数量
*/
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;
if (type.equals(SELECY_STATUS) &&userInfo.getRole().getRoleName().equals(roleName[0])) {
statusDtos = baseMapper.selectStatusWx();
if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[0])) {
statusDtos = baseMapper.selectStatusWx(currentStatus, startTime, endTime, userId);
} 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)) {
statusDtos = baseMapper.selectStatusFqp(Integer.parseInt(userInfo.getUserModel().getUserId()));
} else if (type.equals(SELECY_ALL)){
statusDtos = baseMapper.selectStatusCount();
}else {
statusDtos = baseMapper.selectStatusLeader();
statusDtos = baseMapper.selectStatusFqp(currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
} else if (type.equals(SELECY_ALL)) {
statusDtos = baseMapper.selectStatusCount(currentStatus, startTime, endTime, userId);
} else {
statusDtos = baseMapper.selectStatusLeader(currentStatus, startTime, endTime, userId);
}
List<CurrentStatusDto> currentStatusDtoList = new ArrayList<>();
statusDtos.forEach(e -> {
......@@ -527,16 +512,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
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;
}
......@@ -629,7 +604,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
}
return list;
}
}
\ No newline at end of file
......@@ -73,10 +73,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
@Override
public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page,
@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) {
List<LinkageUnitDto> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(unitName, linkageUnitTypeCode, emergencyLinkageUnitCode);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList), Map.class);
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType, emergencyLinkageUnitCode);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
linkageUnitListMap.forEach(i -> {
......@@ -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);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date();
......@@ -103,7 +103,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>();
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
page1.setTotal(linkageUnitList.size()); // TOTAL 需要统计所有存在的数据BUG2590 by kongfm
page1.setTotal(linkageUnitList.getTotal()); // TOTAL 需要统计所有存在的数据BUG2590 by kongfm
page1.setRecords(detaiList);
return page1;
}
......
......@@ -82,9 +82,10 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long belongBuildingId,
@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,
belongBuilding, resourceType);
belongBuilding, resourceType, equipId);
}
......
......@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
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.feign.RemoteSecurityService;
import org.slf4j.Logger;
......@@ -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.PlanTaskPageParamUtil;
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.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
......@@ -56,6 +53,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@RequestMapping(value = "/api/planTask")
......@@ -489,43 +488,71 @@ public class PlanTaskController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务")
@ApiOperation(value = "消防监督任务查询-mobile", notes = "根据用户条件查询所有计划任务")
@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 = "startTime") String startTime,
@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 = "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 = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap);
// ReginParams reginParams = getSelectedOrgInfo();
// String loginOrgCode = getOrgCode(reginParams);
// Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
// params.putAll(authMap);
params.put("userId", userId);
params.put("companyId", companyId);
params.put("orgCode", loginOrgCode);
params.put("userId", userId);
params.put("taskType", taskType);
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("executorId", executorId);
params.put("finishStatus", finishStatus);
params.put("taskType", TaskCheckTypeEnum.getEumByCode(taskType).getName());
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
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 {
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) {
return CommonResponseUtil.failure(e.getMessage());
e.printStackTrace();
}
return result;
}
public static Object nvl(Object param) {
return param != null ? param : null;
}
/**
* 查询任务列表
*/
......
......@@ -61,6 +61,8 @@ import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@RequestMapping(value = "/api/point")
......@@ -804,4 +806,11 @@ public class PointController extends AbstractBaseController {
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 {
* 根据路线id查询所有点
*/
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;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
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.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
......@@ -577,13 +578,27 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (total == 0) {
return new PageImpl<>(content, pageParam, total);
}
params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize());
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);
}
@Override
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
......
......@@ -131,6 +131,9 @@ public class PointServiceImpl implements IPointService {
@Autowired
Sequence sequence;
@Value("${file.url}")
private String fileUrl;
@Override
@Transactional
public Point addPoint(PointParam pointParam) {
......@@ -1205,4 +1208,17 @@ public class PointServiceImpl implements IPointService {
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 {
*/
void delPointByPointNo(Long id);
List<Map<String, Object>> queryItemDetailByPointId(Long id);
}
......@@ -158,4 +158,14 @@
ALTER TABLE `p_plan_task_detail` ADD COLUMN `major_danger_num` int(11) DEFAULT 0 COMMENT '重大隐患个数' AFTER `safety_danger_num`;
</sql>
</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>
\ No newline at end of file
......@@ -178,6 +178,7 @@
pt.id planTaskId,
pt.org_code orgCode,
p.name taskName,
p.check_type_name checkTypeName,
pt.status,
pt.user_id userId,
date_format(
......@@ -200,11 +201,14 @@
pt.route_id,
pt.user_name userName,
r.owner_id,
R.owner_name as ownerName
R.owner_name as ownerName,
ptd.item_num AS itemNum,
ptd.executor_id AS executorId
FROM
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_plan_task_detail ptd ON ptd.task_no = pt.id
) a
<include refid="mobile-plan-task-where" />
limit #{offset},#{pageSize}
......@@ -212,8 +216,11 @@
<sql id="mobile-plan-task-where">
<where>
<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="startTime != null and startTime != '' and endTime != null and endTime != '' ">
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
......@@ -233,15 +240,15 @@
)
)
</if>
<choose>
<when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.owner_id = #{companyId}</if>
</when>
<when test="identityType==2">
And a.owner_id = #{companyId}
</when>
</choose>
<!-- <choose>-->
<!-- <when test="identityType==1">-->
<!-- And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )-->
<!-- <if test="companyId != null"> and a.owner_id = #{companyId}</if>-->
<!-- </when>-->
<!-- <when test="identityType==2">-->
<!-- And a.owner_id = #{companyId}-->
<!-- </when>-->
<!-- </choose>-->
</where>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
</sql>
......@@ -258,11 +265,13 @@
pt.org_code as orgCode,
pt.begin_time as beginTime,
pt.end_time as endTime,
r.owner_id
r.owner_id,
ptd.item_num AS itemNum
FROM
p_plan_task pt
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_plan_task_detail ptd ON ptd.task_no = pt.id
) a
<include refid="mobile-plan-task-where" />
</select>
......@@ -282,6 +291,10 @@
count(a.finish) taskPlanNum,
a.finishStatus,
a.batchNo,
a.itemNum,
a.remain,
a.safetyNum,
a.majorNum,
a.inOrder
FROM
(
......@@ -304,6 +317,10 @@
pt.finish_num finishNum,
pt.finish_status finishStatus,
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`
WHEN 1 THEN
1
......@@ -527,7 +544,6 @@
<if test="endTime != null and endTime != '' "> and pt.begin_time <![CDATA[<=]]> #{endTime} </if>
</where>
) a
</select>
<select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
......
......@@ -1139,4 +1139,28 @@
WHERE
prp.route_id = #{routeId}
</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>
\ 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