|
|
|
@ -7,10 +7,7 @@ import com.mh.user.annotation.SysLogger;
|
|
|
|
|
import com.mh.user.entity.BuildingEntity; |
|
|
|
|
import com.mh.user.entity.DeviceInstallEntity; |
|
|
|
|
import com.mh.user.model.DeviceModel; |
|
|
|
|
import com.mh.user.service.BuildingService; |
|
|
|
|
import com.mh.user.service.DealDataService; |
|
|
|
|
import com.mh.user.service.DeviceInstallService; |
|
|
|
|
import com.mh.user.service.SummaryService; |
|
|
|
|
import com.mh.user.service.*; |
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCell; |
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet; |
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
@ -34,6 +31,10 @@ public class DeviceInstallController {
|
|
|
|
|
@Autowired |
|
|
|
|
BuildingService buildingService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private NowDataService nowDataService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final DealDataService dealDataService; |
|
|
|
|
|
|
|
|
|
public DeviceInstallController(DealDataService dealDataService) |
|
|
|
@ -54,6 +55,21 @@ public class DeviceInstallController {
|
|
|
|
|
public HttpResult updateDevice(@RequestBody DeviceInstallEntity deviceInstallEntity) { |
|
|
|
|
// 根据id查询对应的deviceInstall
|
|
|
|
|
DeviceInstallEntity oldEntity = deviceInstallService.selectDeviceById(deviceInstallEntity.getId()); |
|
|
|
|
|
|
|
|
|
// 更新对应的实时记录内容
|
|
|
|
|
if (oldEntity.getDeviceType().equals("热泵")) { |
|
|
|
|
String oldPumpId = oldEntity.getDeviceAddr(); |
|
|
|
|
String oldPumpName = oldEntity.getDeviceName(); |
|
|
|
|
String oldBuildingId = oldEntity.getBuildingId(); |
|
|
|
|
|
|
|
|
|
String pumpId = deviceInstallEntity.getDeviceAddr(); |
|
|
|
|
String pumpName = deviceInstallEntity.getDeviceName(); |
|
|
|
|
String buildingId = deviceInstallEntity.getBuildingId(); |
|
|
|
|
String buildingName = deviceInstallEntity.getBuildingName(); |
|
|
|
|
|
|
|
|
|
nowDataService.updatePumpName(oldPumpId, oldPumpName, oldBuildingId, pumpId, pumpName, buildingId, buildingName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 删除全部的device_code_param值
|
|
|
|
|
deviceInstallService.deleteParamCode(oldEntity); |
|
|
|
|
// 设置校验位
|
|
|
|
|