Commit 4c1b31af authored by caotao's avatar caotao

户用光伏-运维工单分页详情接口调整

parent c4621d32
...@@ -87,7 +87,7 @@ public class HYGFMaintenanceTicketsDto extends BaseDto { ...@@ -87,7 +87,7 @@ public class HYGFMaintenanceTicketsDto extends BaseDto {
* 是否替换备件 * 是否替换备件
*/ */
private String isReplaceSpareParts; private Boolean isReplaceSpareParts =false;
/** /**
* 运维人员附件 * 运维人员附件
*/ */
......
...@@ -16,7 +16,7 @@ import java.util.List; ...@@ -16,7 +16,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_maintenance_tickets") @TableName(value = "hygf_maintenance_tickets",autoResultMap = true)
public class HYGFMaintenanceTickets extends BaseEntity { public class HYGFMaintenanceTickets extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
...@@ -100,7 +100,7 @@ public class HYGFMaintenanceTickets extends BaseEntity { ...@@ -100,7 +100,7 @@ public class HYGFMaintenanceTickets extends BaseEntity {
* 是否替换备件 * 是否替换备件
*/ */
@TableField("is_repleace_spare_parts") @TableField("is_repleace_spare_parts")
private String isReplaceSpareParts; private Boolean isReplaceSpareParts =false;
/** /**
* 运维人员附件 * 运维人员附件
*/ */
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
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.module.hygf.api.dto.HYGFMaintenanceTicketsDto; import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.HYGFMaintenanceTicketsServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.HYGFMaintenanceTicketsServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -46,15 +47,13 @@ public class HYGFMaintenanceTicketsController extends BaseController { ...@@ -46,15 +47,13 @@ public class HYGFMaintenanceTicketsController extends BaseController {
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PostMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新运维工单", notes = "根据sequenceNbr更新运维工单") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新运维工单", notes = "根据sequenceNbr更新运维工单")
public ResponseModel<HYGFMaintenanceTicketsDto> updateBySequenceNbrMaintenance(@RequestBody HYGFMaintenanceTicketsDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<HYGFMaintenanceTicketsDto> updateBySequenceNbrMaintenance(@RequestBody HYGFMaintenanceTicketsDto model) {
model.setSequenceNbr(sequenceNbr); return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.updateHYGFMaintenanceTicketsDto(model));
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.updateWithModel(model));
} }
/** /**
...@@ -76,11 +75,11 @@ public class HYGFMaintenanceTicketsController extends BaseController { ...@@ -76,11 +75,11 @@ public class HYGFMaintenanceTicketsController extends BaseController {
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/getDeatil")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个运维工单", notes = "根据sequenceNbr查询单个运维工单") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个运维工单", notes = "根据sequenceNbr查询单个运维工单")
public ResponseModel<HYGFMaintenanceTicketsDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<HYGFMaintenanceTickets> selectOne(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.getDetailBySequenceNbr(sequenceNbr));
} }
/** /**
......
...@@ -119,7 +119,7 @@ public class MaintenanceResultHandlerMessage extends EmqxListener { ...@@ -119,7 +119,7 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
hygfMaintenanceTicketsMapper.insert(hygfMaintenanceTickets); hygfMaintenanceTicketsMapper.insert(hygfMaintenanceTickets);
tdHygfJpInverterWarn.setHandlerStatus("未处理"); tdHygfJpInverterWarn.setHandlerStatus("处理中");
tdHygfJpInverterWarnMapper.insert(tdHygfJpInverterWarn); tdHygfJpInverterWarnMapper.insert(tdHygfJpInverterWarn);
log.info("创建运维工单成功{}", JSON.toJSONString(hygfMaintenanceTickets)); log.info("创建运维工单成功{}", JSON.toJSONString(hygfMaintenanceTickets));
} }
......
...@@ -4,14 +4,16 @@ import cn.hutool.core.date.DatePattern; ...@@ -4,14 +4,16 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.dto.*; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets; import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IHYGFMaintenanceTicketsService; import com.yeejoin.amos.boot.module.hygf.api.service.IHYGFMaintenanceTicketsService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
...@@ -22,20 +24,25 @@ import java.util.ArrayList; ...@@ -22,20 +24,25 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@Slf4j
@Service @Service
public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenanceTicketsDto, HYGFMaintenanceTickets, HYGFMaintenanceTicketsMapper> implements IHYGFMaintenanceTicketsService { public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenanceTicketsDto, HYGFMaintenanceTickets, HYGFMaintenanceTicketsMapper> implements IHYGFMaintenanceTicketsService {
public static final String WARNING_RESULT_MESSAGE = "hygfmaintenance/warning/result"; public static final String WARNING_RESULT_MESSAGE = "hygfmaintenance/warning/result";
@Autowired @Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<HYGFMaintenanceTicketsDto> queryForHYGFMaintenanceTicketsDtoPage(int current,int size ,HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) { public Page<HYGFMaintenanceTicketsDto> queryForHYGFMaintenanceTicketsDtoPage(int current, int size, HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
PageHelper.startPage(current,size); PageHelper.startPage(current, size);
List<HYGFMaintenanceTicketsDto> hygfMaintenanceTicketsDtos = this.getBaseMapper().qureyListByQueryparams(hygfMaintenanceTicketsDto); List<HYGFMaintenanceTicketsDto> hygfMaintenanceTicketsDtos = this.getBaseMapper().qureyListByQueryparams(hygfMaintenanceTicketsDto);
PageInfo<HYGFMaintenanceTicketsDto> page =new PageInfo<>(hygfMaintenanceTicketsDtos); PageInfo<HYGFMaintenanceTicketsDto> page = new PageInfo<>(hygfMaintenanceTicketsDtos);
Page<HYGFMaintenanceTicketsDto> pageNew = new Page<>(); Page<HYGFMaintenanceTicketsDto> pageNew = new Page<>();
pageNew.setCurrent(current); pageNew.setCurrent(current);
pageNew.setTotal(page.getTotal()); pageNew.setTotal(page.getTotal());
...@@ -44,10 +51,14 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -44,10 +51,14 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
return pageNew; return pageNew;
} }
public List<String> queryInverterSncodesByStationId(String stationId){ public List<String> queryInverterSncodesByStationId(String stationId) {
return this.getBaseMapper().queryInverterSncodesByStationId(stationId); return this.getBaseMapper().queryInverterSncodesByStationId(stationId);
} }
public HYGFMaintenanceTickets getDetailBySequenceNbr(Long sequenceNbr) {
return this.getBaseMapper().selectById(sequenceNbr);
}
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
...@@ -56,54 +67,54 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -56,54 +67,54 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
} }
public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) { public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
HashMap<String,Object> messageMain = new HashMap<>(); HashMap<String, Object> messageMain = new HashMap<>();
HashMap<String,Object> rawData = new HashMap<>(); HashMap<String, Object> rawData = new HashMap<>();
HashMap<String,Object> bizInfo = new HashMap<>(); HashMap<String, Object> bizInfo = new HashMap<>();
HashMap<String,Object> specialMap = new HashMap<>(); HashMap<String, Object> specialMap = new HashMap<>();
List<RiskDynamicDetailsVo> riskDynamicDetailsVoList = new ArrayList<>(); List<RiskDynamicDetailsVo> riskDynamicDetailsVoList = new ArrayList<>();
RiskDynamicDetailsVo riskDynamicDetailsVo = new RiskDynamicDetailsVo(); RiskDynamicDetailsVo riskDynamicDetailsVo = new RiskDynamicDetailsVo();
riskDynamicDetailsVo.setSpecialMap(specialMap); riskDynamicDetailsVo.setSpecialMap(specialMap);
//电站id //电站id
specialMap.put("stationId",hygfMaintenanceTicketsDto.getStationId()); specialMap.put("stationId", hygfMaintenanceTicketsDto.getStationId());
//电站名称 //电站名称
specialMap.put("stationName",hygfMaintenanceTicketsDto.getStationName()); specialMap.put("stationName", hygfMaintenanceTicketsDto.getStationName());
specialMap.put("inverterSncode",hygfMaintenanceTicketsDto.getInverterSn()); specialMap.put("inverterSncode", hygfMaintenanceTicketsDto.getInverterSn());
//告警id //告警id
specialMap.put("warningId",hygfMaintenanceTicketsDto.getWarningId()); specialMap.put("warningId", hygfMaintenanceTicketsDto.getWarningId());
specialMap.put("taskStartTime",hygfMaintenanceTicketsDto.getTaskStartTime()); specialMap.put("taskStartTime", hygfMaintenanceTicketsDto.getTaskStartTime());
specialMap.put("taskEndTime",hygfMaintenanceTicketsDto.getTaskEndTime()); specialMap.put("taskEndTime", hygfMaintenanceTicketsDto.getTaskEndTime());
if(ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())){ if (ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())) {
//告警内容 //告警内容
specialMap.put("warningContent",hygfMaintenanceTicketsDto.getWarningContent()); specialMap.put("warningContent", hygfMaintenanceTicketsDto.getWarningContent());
//告警等级 //告警等级
specialMap.put("warningLevel",hygfMaintenanceTicketsDto.getWarningLevel()); specialMap.put("warningLevel", hygfMaintenanceTicketsDto.getWarningLevel());
//告警状态 //告警状态
specialMap.put("warningStatus",hygfMaintenanceTicketsDto.getWarningStatus()); specialMap.put("warningStatus", hygfMaintenanceTicketsDto.getWarningStatus());
//告警开始时间 //告警开始时间
specialMap.put("warningStartTime",hygfMaintenanceTicketsDto.getWarningStartTime()); specialMap.put("warningStartTime", hygfMaintenanceTicketsDto.getWarningStartTime());
} }
specialMap.put("maintenancePersonId",hygfMaintenanceTicketsDto.getMaintenancePersonId()); specialMap.put("maintenancePersonId", hygfMaintenanceTicketsDto.getMaintenancePersonId());
//电站联系人 //电站联系人
specialMap.put("stationContact",hygfMaintenanceTicketsDto.getStationContact()); specialMap.put("stationContact", hygfMaintenanceTicketsDto.getStationContact());
//电站电话 //电站电话
specialMap.put("stationContactPhone",hygfMaintenanceTicketsDto.getStationContactPhone()); specialMap.put("stationContactPhone", hygfMaintenanceTicketsDto.getStationContactPhone());
//场站地址 //场站地址
specialMap.put("stationAddress",hygfMaintenanceTicketsDto.getStationAddress()); specialMap.put("stationAddress", hygfMaintenanceTicketsDto.getStationAddress());
riskDynamicDetailsVoList.add(riskDynamicDetailsVo); riskDynamicDetailsVoList.add(riskDynamicDetailsVo);
bizInfo.put("sourceAttributionDesc",hygfMaintenanceTicketsDto.getStationName()); bizInfo.put("sourceAttributionDesc", hygfMaintenanceTicketsDto.getStationName());
bizInfo.put("sourceAttribution",hygfMaintenanceTicketsDto.getStationName()); bizInfo.put("sourceAttribution", hygfMaintenanceTicketsDto.getStationName());
bizInfo.put("dynamicDetails",riskDynamicDetailsVoList); bizInfo.put("dynamicDetails", riskDynamicDetailsVoList);
bizInfo.put("warningObjectCode",hygfMaintenanceTicketsDto.getInverterSn()); bizInfo.put("warningObjectCode", hygfMaintenanceTicketsDto.getInverterSn());
bizInfo.put("warningTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN)); bizInfo.put("warningTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN));
bizInfo.put("warningObjectName",hygfMaintenanceTicketsDto.getStationName()); bizInfo.put("warningObjectName", hygfMaintenanceTicketsDto.getStationName());
rawData.put("traceId",hygfMaintenanceTicketsDto.getInverterSn()); rawData.put("traceId", hygfMaintenanceTicketsDto.getInverterSn());
rawData.put("bizInfo",bizInfo); rawData.put("bizInfo", bizInfo);
rawData.put("indexKey",hygfMaintenanceTicketsDto.getInverterSn()); rawData.put("indexKey", hygfMaintenanceTicketsDto.getInverterSn());
rawData.put("dataSource","户用光伏-告警"); rawData.put("dataSource", "户用光伏-告警");
rawData.put("indexValue",hygfMaintenanceTicketsDto.getInverterSn()); rawData.put("indexValue", hygfMaintenanceTicketsDto.getInverterSn());
messageMain.put("rawData",rawData); messageMain.put("rawData", rawData);
// BizMessage bizMessage = new BizMessage(); // BizMessage bizMessage = new BizMessage();
// bizMessage.setIndexKey(hygfMaintenanceTicketsDto.getStationName()); // bizMessage.setIndexKey(hygfMaintenanceTicketsDto.getStationName());
// bizMessage.setIndexValue(hygfMaintenanceTicketsDto.getInverterSn()); // bizMessage.setIndexValue(hygfMaintenanceTicketsDto.getInverterSn());
...@@ -152,4 +163,19 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -152,4 +163,19 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
exception.printStackTrace(); exception.printStackTrace();
} }
} }
public HYGFMaintenanceTicketsDto updateHYGFMaintenanceTicketsDto(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
hygfMaintenanceTicketsDto.setHandlerStatus("已处理");
hygfMaintenanceTicketsDto.setTaskEndTime(new Date());
this.updateWithModel(hygfMaintenanceTicketsDto);
if(ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())){
TdHygfJpInverterWarn tdHygfJpInverterWarn = tdHygfJpInverterWarnMapper.getInverTerWarnByparams(hygfMaintenanceTicketsDto.getWarningId(), hygfMaintenanceTicketsDto.getInverterSn(), hygfMaintenanceTicketsDto.getStationId());
if (ObjectUtil.isNotEmpty(tdHygfJpInverterWarn)) {
tdHygfJpInverterWarn.setHandlerStatus("已处理");
}
tdHygfJpInverterWarnMapper.insert(tdHygfJpInverterWarn);
}
log.info("更新运维工单成功{}", JSON.toJSONString(hygfMaintenanceTicketsDto));
return hygfMaintenanceTicketsDto;
}
} }
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