Commit aba7510b authored by tangwei's avatar tangwei

修改工单

parent 6a36113d
......@@ -116,11 +116,19 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
hygfMaintenanceTickets.setStationContact(jpStation.getStationContact());
//业主姓名
hygfMaintenanceTickets.setOwnerName(jpStation.getUserName());
if (ObjectUtil.isEmpty(hygfMaintenanceTickets.getStationContact())) {
hygfMaintenanceTickets.setStationContact(jpStation.getUserName());
}
}
hygfMaintenanceTickets.setInverterSn(sncode);
if(specialMap.containsKey("creatorUserId")){
hygfMaintenanceTickets.setCreatorUserId(specialMap.get("creatorUserId").toString());
}
if(specialMap.containsKey("warningLevel")){
hygfMaintenanceTickets.setWarningLevel(specialMap.get("warningLevel").toString());
}
......
......@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -16,6 +17,7 @@ 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.tdenginemapper.TdHygfJpInverterWarnMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
......@@ -71,6 +73,13 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
}
public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
if(hygfMaintenanceTicketsDto.getWarningId()==null){
HYGFMaintenanceTickets fMaintenanceTickets=new HYGFMaintenanceTickets();
BeanUtils.copyProperties(hygfMaintenanceTicketsDto,fMaintenanceTickets);
this.save(fMaintenanceTickets);
}else{
HashMap<String, Object> messageMain = new HashMap<>();
HashMap<String, Object> rawData = new HashMap<>();
HashMap<String, Object> bizInfo = new HashMap<>();
......@@ -87,6 +96,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
specialMap.put("warningId", hygfMaintenanceTicketsDto.getWarningId());
specialMap.put("taskStartTime", hygfMaintenanceTicketsDto.getTaskStartTime());
specialMap.put("taskEndTime", hygfMaintenanceTicketsDto.getTaskEndTime());
specialMap.put("creatorUserId", hygfMaintenanceTicketsDto.getCreatorUserId());
if (ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())) {
//告警内容
specialMap.put("warningContent", hygfMaintenanceTicketsDto.getWarningContent());
......@@ -119,6 +132,8 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
bizInfo.put("warningTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN));
bizInfo.put("warningObjectName", hygfMaintenanceTicketsDto.getStationName());
rawData.put("traceId", hygfMaintenanceTicketsDto.getInverterSn());
rawData.put("bizInfo", bizInfo);
rawData.put("indexKey", hygfMaintenanceTicketsDto.getInverterSn());
......@@ -172,6 +187,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
} catch (Exception exception) {
exception.printStackTrace();
}
}
}
public HYGFMaintenanceTicketsDto updateHYGFMaintenanceTicketsDto(HYGFMaintenanceTicketsDto 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