Commit ff9038aa authored by caotao's avatar caotao

新增工单处理状态

parent 79dd6a46
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -221,4 +222,6 @@ public class TdHygfJpInverterWarnDto {
private Long sequenceNbr;
private String ticketStatus ;
private List<HYGFMaintenanceTickets> listTickets;
}
......@@ -74,9 +74,9 @@
<if test="state != null and state != ''">
AND `state` = #{state}
</if>
<if test="handlerStatus != null and handlerStatus != ''">
AND handler_status = #{handlerStatus}
</if>
<!-- <if test="handlerStatus != null and handlerStatus != ''">-->
<!-- AND handler_status = #{handlerStatus}-->
<!-- </if>-->
<if test="level != null and level != ''">
AND `level` = #{level}
</if>
......@@ -118,9 +118,9 @@
<if test="state != null and state != ''">
AND handler_status = #{state}
</if>
<if test="handlerStatus != null and handlerStatus != ''">
AND handler_status = #{handlerStatus}
</if>
<!-- <if test="handlerStatus != null and handlerStatus != ''">-->
<!-- AND handler_status = #{handlerStatus}-->
<!-- </if>-->
<if test="level != null and level != ''">
AND level = #{level}
</if>
......
......@@ -2,14 +2,17 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
......@@ -49,6 +52,8 @@ public class TdHygfJpInverterWarnController extends BaseController {
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Autowired
JpStationMapper jpStationMapper;
@Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
/**
* 新增户用光伏监盘逆变器报警表
......@@ -126,7 +131,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表分页查询", notes = "户用光伏监盘逆变器报警表分页查询")
public ResponseModel<Page<TdHygfJpInverterWarnDto>> queryForPage(@RequestParam(value = "current") int current,
......@@ -179,11 +184,6 @@ public class TdHygfJpInverterWarnController extends BaseController {
public ResponseModel< Map<String,Object> > selectcount(JpStationDto reviewDto) {
LambdaQueryWrapper<JpStation> qugda=new LambdaQueryWrapper<>();
//获取当前人管理场站
if(reviewDto.getThirdStationId()==null){
//获取当前人管理场站
......@@ -194,8 +194,6 @@ public class TdHygfJpInverterWarnController extends BaseController {
if(pPersonStation==null||pPersonStation.isEmpty()){
return ResponseHelper.buildResponse(null);
}
List ids=null;
if(pPersonStation!=null&&!pPersonStation.isEmpty()){
ids=new ArrayList();
......@@ -293,6 +291,17 @@ public class TdHygfJpInverterWarnController extends BaseController {
}
result.setTotal(tdHygfJpInverterWarnServiceImpl.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content,handlerStatus));
List<Long> waringIds = maps.stream().map(tdHygfJpInverterWarnDto -> tdHygfJpInverterWarnDto.getCreatedTime()).collect(Collectors.toList());
List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id",waringIds));
maps.forEach(tdHygfJpInverterWarnDto -> {
Set<String> status = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if(status.contains("未处理")){
tdHygfJpInverterWarnDto.setTicketStatus("处理中");
}
if(status.contains("已处理")&&status.size()==1){
tdHygfJpInverterWarnDto.setTicketStatus("已处理");
}
});
result.setRecords(maps);
return ResponseHelper.buildResponse(result);
}
......
......@@ -49,10 +49,10 @@ public class TdHygfJpInverterWarnServiceImpl
int pageNum = (int) pageParam.getCurrent();
int pageSize = (int) pageParam.getSize();
PageHelper.startPage(pageNum, pageSize);
// if (tdHygfJpInverterWarnDto.getState() != null) {
// String[] s = tdHygfJpInverterWarnDto.getState().split(",");
// tdHygfJpInverterWarnDto.setStates(Arrays.asList(s));
// }
if (tdHygfJpInverterWarnDto.getState() != null) {
String[] s = tdHygfJpInverterWarnDto.getState().split(",");
tdHygfJpInverterWarnDto.setStates(Arrays.asList(s));
}
if (tdHygfJpInverterWarnDto.getStationName() != null) {
LambdaQueryWrapper<JpStation> wapper = new LambdaQueryWrapper<JpStation>().like(JpStation::getName,
tdHygfJpInverterWarnDto.getStationName());
......@@ -63,10 +63,10 @@ public class TdHygfJpInverterWarnServiceImpl
List<String> ids = sList.stream().map(i -> i.getThirdStationId()).collect(Collectors.toList());
tdHygfJpInverterWarnDto.setStationIds(ids);
}
if (tdHygfJpInverterWarnDto.getHandlerStatus() != null) {
String[] s = tdHygfJpInverterWarnDto.getHandlerStatus().split(",");
tdHygfJpInverterWarnDto.setListHandlerStatus(Arrays.asList(s));
}
// if (tdHygfJpInverterWarnDto.getHandlerStatus() != null) {
// String[] s = tdHygfJpInverterWarnDto.getHandlerStatus().split(",");
// tdHygfJpInverterWarnDto.setListHandlerStatus(Arrays.asList(s));
// }
List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
if (tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
list = this.baseMapper.list(tdHygfJpInverterWarnDto);
......@@ -89,6 +89,15 @@ public class TdHygfJpInverterWarnServiceImpl
});
}
}
List<Long> waringIds = list.stream().map(tdHygfJpInverterWarnDto1 -> tdHygfJpInverterWarnDto1.getCreatedTime()).collect(Collectors.toList());
List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id",waringIds));
Set<String> status = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if(status.contains("未处理")){
tdHygfJpInverterWarnDto.setTicketStatus("处理中");
}
if(status.contains("已处理")&&status.size()==1){
tdHygfJpInverterWarnDto.setTicketStatus("已处理");
}
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
pagenew.setCurrent(pageNum);
......@@ -134,8 +143,14 @@ public class TdHygfJpInverterWarnServiceImpl
}
}
if(hygfMaintenanceTickets.size()>0){
HYGFMaintenanceTickets hygfMaintenanceTickets1 =hygfMaintenanceTickets.get(0);
BeanUtil.copyProperties(hygfMaintenanceTickets1,tdHygfJpInverterWarnDto, "handlerStatus");
Set<String> status = hygfMaintenanceTickets.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if(status.contains("未处理")){
tdHygfJpInverterWarnDto.setTicketStatus("处理中");
}
if(status.contains("已处理")&&status.size()==1){
tdHygfJpInverterWarnDto.setTicketStatus("已处理");
}
tdHygfJpInverterWarnDto.setListTickets(hygfMaintenanceTickets);
}
return tdHygfJpInverterWarnDto;
}
......
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