Commit a42a9ec5 authored by tangwei's avatar tangwei

增加场站信息

parent f6054a48
......@@ -12,8 +12,11 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.JpStation;
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.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.MaintenanceMapper;
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;
......@@ -40,6 +43,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
@Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
@Autowired
JpStationMapper jpStationMapper;
@Autowired
MaintenanceMapper maintenanceMapper;
/**
* 分页查询
......@@ -75,6 +82,42 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
if(hygfMaintenanceTicketsDto.getWarningId()==null){
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().eq("third_station_id", hygfMaintenanceTicketsDto.getStationId()));
if (ObjectUtil.isEmpty(jpStation)) {
jpStation = jpStationMapper.selectById(hygfMaintenanceTicketsDto.getStationId());
}
if (ObjectUtil.isNotEmpty(jpStation)) {
//场站名称
hygfMaintenanceTicketsDto.setStationName(jpStation.getName());
//区域公司编码
hygfMaintenanceTicketsDto.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
//经销商orgCode
hygfMaintenanceTicketsDto.setAmosCompanyCode(jpStation.getAmosCompanyCode());
//地址
hygfMaintenanceTicketsDto.setStationAddress(jpStation.getAddress());
//经度
hygfMaintenanceTicketsDto.setStationLongitude(jpStation.getLongitude());
//纬度
hygfMaintenanceTicketsDto.setStationLatitude(jpStation.getLatitude());
//电站联系人电话
hygfMaintenanceTicketsDto.setStationContactPhone(jpStation.getUserPhone());
// 电站联系人
hygfMaintenanceTicketsDto.setStationContact(jpStation.getStationContact());
//业主姓名
hygfMaintenanceTicketsDto.setOwnerName(jpStation.getUserName());
if (ObjectUtil.isEmpty(hygfMaintenanceTicketsDto.getStationContact())) {
hygfMaintenanceTicketsDto.setStationContact(jpStation.getUserName());
}
}
MaintenanceDto maintenance = maintenanceMapper.selectOneById(Long.valueOf(hygfMaintenanceTicketsDto.getMaintenancePersonId()));
if (ObjectUtil.isNotEmpty(maintenance)) {
hygfMaintenanceTicketsDto.setMaintenancePersonName(maintenance.getName());
hygfMaintenanceTicketsDto.setMaintenancePersonPhone(maintenance.getTelephone());
}
HYGFMaintenanceTickets fMaintenanceTickets=new HYGFMaintenanceTickets();
BeanUtils.copyProperties(hygfMaintenanceTicketsDto,fMaintenanceTickets);
this.save(fMaintenanceTickets);
......
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