Commit ff9038aa authored by caotao's avatar caotao

新增工单处理状态

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