Browse Source

BUG修复

lin 3 years ago
parent
commit
9d89d4754d
29 changed files with 226 additions and 37 deletions
  1. 6 3
      smart-city-platform/src/main/java/com/bz/smart_city/controller/DeviceController.java
  2. 2 1
      smart-city-platform/src/main/java/com/bz/smart_city/controller/common/CommonController.java
  3. 13 0
      smart-city-platform/src/main/java/com/bz/smart_city/controller/water/WaterMeterReadController.java
  4. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/dao/BuildingMapper.java
  5. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceMapper.java
  6. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceTypeMapper.java
  7. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/dao/MeterReadRecordMapper.java
  8. 3 1
      smart-city-platform/src/main/java/com/bz/smart_city/dao/assistant/InstallListMapper.java
  9. 19 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/MeasuringData.java
  10. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/entity/MeterReadRecord.java
  11. 1 0
      smart-city-platform/src/main/java/com/bz/smart_city/rabbitmq/model/RabbitDeviceParamData.java
  12. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/BuildingService.java
  13. 2 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceService.java
  14. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceTypeService.java
  15. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/MeterReadRecordService.java
  16. 2 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/BuildingServiceImpl.java
  17. 18 7
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceServiceImpl.java
  18. 6 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceTypeServiceImpl.java
  19. 14 7
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/GeneralRabbitSyncService.java
  20. 80 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/MeterReadRecordServiceImpl.java
  21. 1 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/WaterMeterReplaceLogServiceImpl.java
  22. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/udip/HlhtService.java
  23. 2 2
      smart-city-platform/src/main/resources/application-dev.properties
  24. 1 0
      smart-city-platform/src/main/resources/json/deviceCustomColumn.json
  25. 12 4
      smart-city-platform/src/main/resources/mapper/DeviceMapper.xml
  26. 17 0
      smart-city-platform/src/main/resources/mapper/DeviceTypeMapper.xml
  27. 5 0
      smart-city-platform/src/main/resources/mapper/InstallListMapper.xml
  28. 6 0
      smart-city-platform/src/main/resources/mapper/MeterReadRecordMapper.xml
  29. 4 0
      smart-city-platform/src/main/resources/mapper/WaterMeterErrorDaysMapper.xml

+ 6 - 3
smart-city-platform/src/main/java/com/bz/smart_city/controller/DeviceController.java

@@ -43,6 +43,7 @@ public class DeviceController {
     @GetMapping("/pageList")
     @ApiOperation(value = "获取设备分页")
     public AjaxMessage<Pagination<DeviceDto>> devicePageList(
+            @ApiParam(value = "系统ids", required = false) @RequestParam(required = false) List<Integer> sysIds,
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
             @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
             @ApiParam(value = "设备类型id", required = false) @RequestParam(required = false) Integer deviceTypeId,
@@ -73,7 +74,7 @@ public class DeviceController {
             @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
             @ApiParam(value = "条数,非必传,默认15条", required = false, defaultValue = "15") @RequestParam(required = false, defaultValue = "15") int pageSize
     ) {
-        Pagination<DeviceDto> pageInfo = deviceService.getList(sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+        Pagination<DeviceDto> pageInfo = deviceService.getList(sysIds,sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
                 province, city, region, community, concentratorId,concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId, days,
                 deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading, sortColumn, sortOrder, pageNum, pageSize);
         return new AjaxMessage<>(ResultStatus.OK, pageInfo);
@@ -97,6 +98,7 @@ public class DeviceController {
     @GetMapping("/getDeviceListExcel")
     @ApiOperation(value = "导出设备列表excel")
     public AjaxMessage getDeviceListExcel(
+            @ApiParam(value = "系统ids", required = false) @RequestParam(required = false) List<Integer> sysIds,
             @ApiParam(value = "别名", required = false) @RequestParam(required = false) String alias,
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
             @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
@@ -127,7 +129,7 @@ public class DeviceController {
             @ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false,defaultValue = "DESC") String sortOrder,
             HttpServletResponse httpServletResponse
     ) {
-        deviceService.getDeviceListExcel(alias,sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+        deviceService.getDeviceListExcel(sysIds,alias,sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
                 province, city, region, community,concentratorId, concentratorNo, collectorId,collectorNo,channelNumberId, errorType, customerId, days,
                 deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading, sortColumn, sortOrder, httpServletResponse);
         return new AjaxMessage<>(ResultStatus.OK,"导出执行成功,请稍后在消息查看导出文件并下载。");
@@ -213,6 +215,7 @@ public class DeviceController {
     @GetMapping("/deviceAreaList")
     @ApiOperation(value = "获取设备数量区域列表")
     public AjaxMessage<List<BuildingSelectDto>> deviceAreaList(
+            @ApiParam(value = "系统ids", required = false) @RequestParam(required = false) List<Integer> sysIds,
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
             @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
             @ApiParam(value = "设备类型id", required = false) @RequestParam(required = false) Integer deviceTypeId,
@@ -239,7 +242,7 @@ public class DeviceController {
             @ApiParam(value = "开始当前读数", required = false) @RequestParam(required = false) Double startReading,
             @ApiParam(value = "结束当前读数", required = false) @RequestParam(required = false) Double endReading
     ) {
-        List<BuildingSelectDto> list = buildingService.deviceAreaList(sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+        List<BuildingSelectDto> list = buildingService.deviceAreaList(sysIds,sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
                 province, city, region, community, concentratorId,concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId, days,
                 deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading);
         return new AjaxMessage<>(ResultStatus.OK, list);

+ 2 - 1
smart-city-platform/src/main/java/com/bz/smart_city/controller/common/CommonController.java

@@ -122,10 +122,11 @@ public class CommonController {
     @GetMapping("/getDeviceTypeList")
     @ApiOperation(value = "获取系列(设备类型)列表")
     public AjaxMessage<List<DeviceTypeDto>> getDeviceTypeList(
+            @ApiParam(value = "系统ids", required = false) @RequestParam(required = false) List<Integer> sysIds,
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
             @ApiParam(value = "设备类型 1:传感器 2;网关设备 3:集中器 4:采集器", required = false) @RequestParam(required = false) Integer type
     ) {
-        List<DeviceTypeDto> list = deviceTypeService.getDeviceTypeList(sysId, type);
+        List<DeviceTypeDto> list = deviceTypeService.getDeviceTypeList(sysIds,sysId, type);
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
 

+ 13 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/water/WaterMeterReadController.java

@@ -1163,4 +1163,17 @@ public class WaterMeterReadController {
 
 		return new AjaxMessage<>(ResultStatus.OK,gdService.allReadFreeze(condition));
 	}
+
+	@ResponseBody
+	@PostMapping("/mater/updateReading")
+	@ApiOperation(value = "更新读数")
+	public AjaxMessage updateReading(
+			@ApiParam(value = "id", required = true) @RequestParam(required = true) Long id,
+			@ApiParam(value = "读数", required = true) @RequestParam(required = true) Double readData
+	) {
+
+		meterReadRecordService.updateReading(id,readData);
+
+		return new AjaxMessage<>(ResultStatus.OK);
+	}
 }

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/BuildingMapper.java

@@ -73,7 +73,7 @@ public interface BuildingMapper {
 
     List<Building> findByIds(@Param("ids") List<Integer> ids);
 
-    List<BuildingSelectInfoDto> deviceCountAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorId") Integer concentratorId, @Param("concentratorNo") String concentratorNo, @Param("collectorId") Integer collectorId, @Param("collectorNo") String collectorNo, @Param("channelNumberId") Integer channelNumberId, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus, @Param("registerStatus") Integer registerStatus, @Param("issueStatus") Integer issueStatus, @Param("syncStatus") Integer syncStatus, @Param("startReading") Double startReading, @Param("endReading") Double endReading);
+    List<BuildingSelectInfoDto> deviceCountAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysIds")List<Integer> sysIds,@Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorId") Integer concentratorId, @Param("concentratorNo") String concentratorNo, @Param("collectorId") Integer collectorId, @Param("collectorNo") String collectorNo, @Param("channelNumberId") Integer channelNumberId, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus, @Param("registerStatus") Integer registerStatus, @Param("issueStatus") Integer issueStatus, @Param("syncStatus") Integer syncStatus, @Param("startReading") Double startReading, @Param("endReading") Double endReading);
 
     List<BuildingSelectInfoDto> abnormalAreaBuildingList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("floor") Integer floor, @Param("measuringId") Integer measuringId, @Param("deviceId") Long deviceId, @Param("deviceNo") String deviceNo, @Param("location") String location, @Param("alarmCategory") Integer alarmCategory, @Param("handleStatus") Integer handleStatus, @Param("alarmTypeId") Integer alarmTypeId, @Param("equipmentId") Integer equipmentId, @Param("manufacturerId") Integer manufacturerId, @Param("customerId") Integer customerId, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("communityId") Integer communityId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
 

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceMapper.java

@@ -27,7 +27,7 @@ public interface DeviceMapper {
     int updateByPrimaryKeySelective(@Param("device") Device device);
 
     //查询设备列表
-    List<DeviceDto> getList(@Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems,
+    List<DeviceDto> getList(@Param("sysIds")List<Integer> sysIds,@Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems,
                             @Param("deviceNo") String deviceNo, @Param("status") Integer status,
                             @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province,
                             @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorId") Integer concentratorId, @Param("concentratorNo") String concentratorNo,

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceTypeMapper.java

@@ -27,6 +27,8 @@ public interface DeviceTypeMapper {
 
     List<DeviceTypeDto> getDeviceTypeList(@Param("sysId") Integer sysId, @Param("type") Integer type);
 
+    List<DeviceTypeDto> getDeviceTypeListV2(@Param("sysIds") List<Integer> sysIds,@Param("sysId") Integer sysId, @Param("type") Integer type);
+
     List<TreeDataDto> getTreeData(@Param("sysId") Integer sysId, @Param("type") Integer type);
 
     List<TreeDataDto> getTreeDataByManufacturerId(@Param("channelId") Integer channelId, @Param("manufacturerId") Integer manufacturerId);

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/MeterReadRecordMapper.java

@@ -113,4 +113,6 @@ public interface MeterReadRecordMapper {
     List<RequestMaterInfo> getReadingMeter(@Param("customerId") Integer customerId, @Param("date") Integer date, @Param("meterNo") String meterNo);
 
     List<MeterReadRecord> findById(@Param("ids") List<Long> ids);
+
+    MeterReadRecord getById(@Param("id") Long id);
 }

+ 3 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/assistant/InstallListMapper.java

@@ -72,5 +72,7 @@ public interface InstallListMapper {
     List<MeterAcceptDto> meterAccept(@Param("createDate") String createDate, @Param("customerId") Integer customerId, @Param("fileNo") List<String> fileNo);
 
     void updateMeterNo(@Param("meterNo") String meterNo, @Param("meterCode") String meterCode,
-                       @Param("customerId")int customerId);
+                       @Param("customerId") int customerId);
+
+    void delByDeviceId(@Param("deviceId") Long deviceId);
 }

+ 19 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/MeasuringData.java

@@ -0,0 +1,19 @@
+package com.bz.smart_city.dto;
+
+import lombok.Data;
+
+
+/**
+ * 
+ * @Description  测点数据
+ * @author wilian.peng
+ * @date 2018年12月21日 上午10:38:01
+ */
+@Data
+public class MeasuringData  {
+	private String measuringCode ; // 测点代码
+	private String measuringVaule; // 测点值
+	private String measuringName ; // 测点名称
+	private String measuringUnit ; // 测点单位
+
+}

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/entity/MeterReadRecord.java

@@ -103,7 +103,7 @@ public class MeterReadRecord {
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value="创建时间")
-    private LocalDateTime dateCreate = LocalDateTime.now();
+    private LocalDateTime dateCreate;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value="更新时间")

+ 1 - 0
smart-city-platform/src/main/java/com/bz/smart_city/rabbitmq/model/RabbitDeviceParamData.java

@@ -10,6 +10,7 @@ public class RabbitDeviceParamData {
     private Integer taskId;
     private Integer userId;
     private String alias;
+    private List<Integer> sysIds;
     private Integer sysId;
     private Integer buildingId;
     private Integer siteId;

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/BuildingService.java

@@ -83,7 +83,7 @@ public interface BuildingService{
 
     public List<BuildingSelectDto> areaList(List<BuildingSelectInfoDto> buildingList);
 
-    List<BuildingSelectDto> deviceAreaList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, Integer isTag, Integer floor, Integer province, Integer city, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Double startReading, Double endReading);
+    List<BuildingSelectDto> deviceAreaList(List<Integer> sysIds,Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, Integer isTag, Integer floor, Integer province, Integer city, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Double startReading, Double endReading);
 
     List<BuildingSelectDto> abnormalAreaBuildingList(Integer sysId, Integer buildingId, Integer floor, Integer measuringId, Long deviceId, String deviceNo, String location, Integer alarmCategory, Integer handleStatus, Integer alarmTypeId, Integer equipmentId, Integer manufacturerId, Integer customerId, Integer province, Integer city, Integer region, Integer communityId, LocalDateTime startDate, LocalDateTime endDate);
 

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceService.java

@@ -40,7 +40,7 @@ public interface DeviceService{
     DeviceDto getDeviceLastReceiveTime(Long deviceId);
 
     Pagination<DeviceDto> getList(
-            Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+            List<Integer> sysIds,Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
             String locDesc, Integer province, Integer city, Integer region, Integer community,
             Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,
             Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId,
@@ -49,7 +49,7 @@ public interface DeviceService{
 
     List<DeviceDto> getWaterMeterListByDeviceNo(String deviceNo,String waterMeterNo);
 
-    void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+    void getDeviceListExcel(List<Integer> sysIds,String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
                             String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType,
                             Integer customerId, Integer days,  Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
     void getDeviceListTxt(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceTypeService.java

@@ -29,7 +29,7 @@ public interface DeviceTypeService {
 
     void edit(DeviceTypeDto deviceTypeDto);
 
-    List<DeviceTypeDto> getDeviceTypeList(Integer sysId, Integer type);
+    List<DeviceTypeDto> getDeviceTypeList(List<Integer> sysIds,Integer sysId, Integer type);
 
     List<TreeDataDto> getTreeData(Integer sysId, Integer type);
     

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/MeterReadRecordService.java

@@ -82,4 +82,6 @@ public interface MeterReadRecordService{
     void getConsumptionExcel(CommonQueryCondition condition, HttpServletResponse httpServletResponse);
 
     void executeWaterConsumptionExcel(RabbitWaterConsumptionData data);
+
+    void updateReading(Long id, Double readData);
 }

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/BuildingServiceImpl.java

@@ -928,7 +928,7 @@ public class BuildingServiceImpl implements BuildingService {
 
     @Override
     public List<BuildingSelectDto> deviceAreaList(
-            Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+            List<Integer> sysIds, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
             String locDesc, Integer province, Integer city, Integer region, Integer community,
             Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,
             Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId,
@@ -937,7 +937,7 @@ public class BuildingServiceImpl implements BuildingService {
     ) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         //查询用户数据项下的建筑列表
-        List<BuildingSelectInfoDto> buildingList = buildingMapper.deviceCountAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), sysId, buildingId, deviceNo, status,  floor, locDesc, province, city, region, community,concentratorId, concentratorNo,collectorId, collectorNo,channelNumberId, errorType, customerId, days,deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus,startReading,endReading);
+        List<BuildingSelectInfoDto> buildingList = buildingMapper.deviceCountAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser),sysIds, sysId, buildingId, deviceNo, status,  floor, locDesc, province, city, region, community,concentratorId, concentratorNo,collectorId, collectorNo,channelNumberId, errorType, customerId, days,deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus,startReading,endReading);
 
         return this.areaList(buildingList);
     }

+ 18 - 7
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceServiceImpl.java

@@ -6,6 +6,7 @@ import com.bz.smart_city.commom.model.Pagination;
 import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.commom.util.*;
 import com.bz.smart_city.dao.*;
+import com.bz.smart_city.dao.assistant.InstallListMapper;
 import com.bz.smart_city.dto.*;
 import com.bz.smart_city.dto.assistant.InstallListDTO;
 import com.bz.smart_city.dto.assistant.PlanBuildingDTO;
@@ -134,6 +135,8 @@ public  class DeviceServiceImpl implements DeviceService {
     private RabbitTemplate rabbitTemplate;
     @Autowired
     private DeviceCommandService deviceCommandService;
+    @Autowired
+    private InstallListMapper installListMapper;
 
     @Value("${spring.rabbitmq.exchange}")
     private String exchange;
@@ -198,11 +201,11 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public Pagination<DeviceDto> getList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize) {
+    public Pagination<DeviceDto> getList(List<Integer> sysIds,Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         PageHelper.startPage(pageNum, pageSize);
-        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
+        List<DeviceDto> list = deviceMapper.getList(sysIds, sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
                 floor, locDesc, province, city, region, community,concentratorId, concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId,
                 days,deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus,startReading,endReading, sortColumn, sortOrder);
         return new Pagination<>(list);
@@ -215,11 +218,12 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
+    public void getDeviceListExcel(List<Integer> sysIds, String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         String title = "设备列表";
 
         RabbitDeviceParamData paramData = new RabbitDeviceParamData();
+        paramData.setSysIds(sysIds);
         paramData.setAlias(alias);
         paramData.setUserId(loginUser.getId());
         paramData.setSysId(sysId);
@@ -252,13 +256,18 @@ public  class DeviceServiceImpl implements DeviceService {
         paramData.setProgramItemList(UserUtil.getCurrentSiteProgramItems(loginUser));
         paramData.setTitle(title);
 
-
+        String fileName = "";
         Channel channel = channelMapper.findById(sysId);
 
 
         DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
         LocalDateTime date = LocalDateTime.now();
-        String fileName = channel.getChannelName()+ title + "-" + date.format(f) + ".xls";
+        if (channel != null) {
+            fileName = channel.getChannelName()+ title + "-" + date.format(f) + ".xls";
+        }else {
+            fileName = title + "-" + date.format(f) + ".xls";
+        }
+
 
         Task task = new Task();
         task.setName(fileName);
@@ -286,7 +295,7 @@ public  class DeviceServiceImpl implements DeviceService {
     @Override
     public void getDeviceListTxt(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
+        List<DeviceDto> list = deviceMapper.getList(null,sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
                 floor, locDesc, province, city, region, community, concentratorId, concentratorNo, collectorId, collectorNo, null, errorType, customerId,
                 days, deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus, startReading, endReading, sortColumn, sortOrder);
         StringBuffer buff = new StringBuffer();
@@ -324,7 +333,7 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     public void executeDeviceListExcel(RabbitDeviceParamData paramData){
-        List<DeviceDto> list = deviceMapper.getList(paramData.getSysId(), paramData.getBuildingId(), paramData.getSiteId(), paramData.getProgramItemList(), paramData.getDeviceNo(), paramData.getStatus(),
+        List<DeviceDto> list = deviceMapper.getList(paramData.getSysIds(),paramData.getSysId(), paramData.getBuildingId(), paramData.getSiteId(), paramData.getProgramItemList(), paramData.getDeviceNo(), paramData.getStatus(),
                 paramData.getFloor(), paramData.getLocDesc(), paramData.getProvince(), paramData.getCity(), paramData.getRegion(), paramData.getCommunity(), paramData.getConcentratorId(), paramData.getConcentratorNo(), paramData.getCollectorId(), paramData.getCollectorNo(), null, paramData.getErrorType(), paramData.getCustomerId(),
                 paramData.getDays(), paramData.getDeviceTypeId(), paramData.getValveStatus(), paramData.getRegisterStatus(), paramData.getIssueStatus(), paramData.getSyncStatus(), paramData.getStartReading(), paramData.getEndReading(), paramData.getSortColumn(), paramData.getSortOrder());
         Task taskTemp = taskMapper.findById(paramData.getTaskId());
@@ -819,6 +828,8 @@ public  class DeviceServiceImpl implements DeviceService {
         //5、删除远传水表信息
         waterRelatedDeviceMapper.delByDeviceId(id);
 
+        installListMapper.delByDeviceId(id);
+
         //6、删除udip平台集成元
         udipUnitService.deleteUdipUnit(deviceTemp.getUdipId());
 

+ 6 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceTypeServiceImpl.java

@@ -180,8 +180,12 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
     }
 
     @Override
-    public List<DeviceTypeDto> getDeviceTypeList(Integer sysId, Integer type) {
-        return deviceTypeMapper.getDeviceTypeList(sysId, type);
+    public List<DeviceTypeDto> getDeviceTypeList(List<Integer> sysIds,Integer sysId, Integer type) {
+        if (sysIds != null && sysIds.size() > 0) {
+            return deviceTypeMapper.getDeviceTypeListV2(sysIds,sysId, type);
+        }else {
+            return deviceTypeMapper.getDeviceTypeList(sysId, type);
+        }
     }
 
     @Override

+ 14 - 7
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/GeneralRabbitSyncService.java

@@ -295,13 +295,20 @@ public class GeneralRabbitSyncService {
 
     protected void sendMessage(ScRabbitConfig config, String message){
         log.info("begin send message ,config = {},message = {}", config, message);
-        //设置当前线程lookupKey,内部由ThreadLocal实现
-        SimpleResourceHolder.bind(rabbitTemplate.getConnectionFactory(), config.getCode());
-        //业务操作会根据线程中的lookupKey从routeConnectionFactory的targetConnectionFactories中选择对应的connectionFactory
-        rabbitTemplate.convertAndSend(config.getExchange(),config.getRoutingKey(), message);
-        //操作完以后记得解绑。不影响线程的后序其他工厂操作
-        SimpleResourceHolder.unbind(rabbitTemplate.getConnectionFactory());
-        log.info("end send message ,config = {},message = {}", config, message);
+        try {
+            //设置当前线程lookupKey,内部由ThreadLocal实现
+            SimpleResourceHolder.bind(rabbitTemplate.getConnectionFactory(), config.getCode());
+            //业务操作会根据线程中的lookupKey从routeConnectionFactory的targetConnectionFactories中选择对应的connectionFactory
+            rabbitTemplate.convertAndSend(config.getExchange(),config.getRoutingKey(), message);
+        }catch (Exception e){
+            log.info("send message error e = {}",e.getMessage());
+        }finally {
+            //操作完以后记得解绑。不影响线程的后序其他工厂操作
+            SimpleResourceHolder.unbind(rabbitTemplate.getConnectionFactory());
+        }
+
+
+        log.info("end send message");
     }
 
     /**

+ 80 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/MeterReadRecordServiceImpl.java

@@ -16,6 +16,10 @@ import org.springframework.amqp.rabbit.connection.SimpleResourceHolder;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.data.mongodb.core.query.Update;
 import org.springframework.jdbc.datasource.DataSourceUtils;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -23,6 +27,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -105,6 +110,10 @@ public class MeterReadRecordServiceImpl implements MeterReadRecordService{
 	private String queue;
 	@Autowired
 	private RabbitTemplate rabbitTemplate;
+	@Resource
+	private WaterMeterErrorDaysMapper waterMeterErrorDaysMapper;
+	@Autowired
+	MongoTemplate mongoTemplate ;
 
 	@Override
 	public Pagination<MeterReadRecord> queryMeterReadRecord(MeterReadRecord param, int pageNum, int pageSize) {
@@ -1248,4 +1257,75 @@ public class MeterReadRecordServiceImpl implements MeterReadRecordService{
 		String fullPath = filesPath + "/file/" + name + ".xls";
 		return fullPath;
 	}
+
+	@Override
+	public void updateReading(Long id, Double readData) {
+
+		Integer date = Integer.valueOf(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")));
+		MeterReadRecord meterReadRecord = meterReadRecordMapper.getById(id);
+		if(!meterReadRecord.getReadDate().equals(date)){
+			throw new ServiceException(-900, "只能修改当天抄表数据");
+		}
+		Double lastCost = 0.0;
+		if (meterReadRecord.getLastValid() != null) {
+			lastCost = new BigDecimal((readData - Double.valueOf(meterReadRecord.getLastValid()))).setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue();
+		}
+
+		MeterReadRecord record = new MeterReadRecord();
+		record.setId(id);
+		record.setReadStatus("2");
+		record.setReadData(readData.toString());
+		record.setReadTime(new Date());
+		record.setLastCost(BigDecimal.valueOf(lastCost));
+		meterReadRecordMapper.updateByPrimaryKeySelective(record);
+
+
+		Device device = new Device();
+		device.setId(meterReadRecord.getDeviceId());
+		device.setDateUpdate(LocalDateTime.now());
+		device.setDeviceStatus(4);
+		deviceMapper.updateByPrimaryKeySelective(device);
+
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+		String lastUpdateTime = sdf.format(new Date());
+		// 构造上报时间测点数据
+		Map<String, MeasuringData> measuringDataMap = new HashMap<>();
+		MeasuringData tmd = new MeasuringData();
+		tmd.setMeasuringCode("TIME");
+		tmd.setMeasuringName("上报时间");
+		tmd.setMeasuringVaule(lastUpdateTime);
+		measuringDataMap.put("TIME", tmd);
+		// 以设备号为KEY,对应测点数据为值放入到缓存
+		redisUtil.set(String.valueOf(device.getId()), JSON.toJSONString(measuringDataMap));
+
+		WaterMeterErrorDays waterMeterErrorDaysNew = new WaterMeterErrorDays();
+		waterMeterErrorDaysNew.setDeviceId(meterReadRecord.getDeviceId());
+		waterMeterErrorDaysNew.setMeterReading(readData);
+		waterMeterErrorDaysNew.setDateUpdate(LocalDateTime.now());
+		int result = waterMeterErrorDaysMapper.updateByPrimaryKeySelective(waterMeterErrorDaysNew);
+		if(result == 0){
+			waterMeterErrorDaysNew.setStatus(1);
+			waterMeterErrorDaysNew.setDateCreate(LocalDateTime.now());
+			waterMeterErrorDaysMapper.insertSelective(waterMeterErrorDaysNew);
+		}
+
+
+		// 更新Mongo中的抄表记录
+		Query condition = new Query();
+		condition.addCriteria(Criteria.where("readDate").is(meterReadRecord.getReadDate()));
+		condition.addCriteria(Criteria.where("deviceId").is(meterReadRecord.getDeviceId()));
+		condition.addCriteria(Criteria.where("status").is(1));
+
+		Update param = new Update();
+
+		param.set("lastCost",lastCost);
+		param.set("readData",readData.toString());
+		param.set("lastValid",readData.toString());
+		param.set("readStatus","2");
+		param.set("readTime",new Date());
+		param.set("dateUpdate",new Date());
+		param.set("updateBy","system");
+
+		mongoTemplate.updateFirst(condition,param,"sc_meter_read_record");
+	}
 }

+ 1 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/WaterMeterReplaceLogServiceImpl.java

@@ -307,6 +307,7 @@ public class WaterMeterReplaceLogServiceImpl implements WaterMeterReplaceLogServ
         log.info("waterMeterReplaceData:" + json);
         kafkaTemplate.send(acceptMeterReplaceTopic,json);
 
+
         log.info("end submitWaterMeterReplace remoteMeterFlag={}",remoteMeterFlag);
     }
 }

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/udip/HlhtService.java

@@ -125,7 +125,7 @@ public class HlhtService {
         return syncStatus;
     }
 
-    private Boolean synDeviceReplaceRecord(DeviceReplace deviceReplace){
+    public Boolean synDeviceReplaceRecord(DeviceReplace deviceReplace){
         log.info("begin synDeviceReplaceRecord");
         Boolean syncStatus = false;
         if (deviceReplace.getMetercode() != null && !StringUtils.equals("",deviceReplace.getMetercode())) {

+ 2 - 2
smart-city-platform/src/main/resources/application-dev.properties

@@ -178,8 +178,8 @@ payfee.bank.customerId=47
 sync.customer.wuhan.id=136
 
 #mongodb url
-#spring.data.mongodb.uri=mongodb://114.135.61.188:17017/meter-reading-database
-spring.data.mongodb.uri=mongodb://water:zcxk100@114.135.61.189:27071/meter-reading-database?authSource=meter-reading-database
+spring.data.mongodb.uri=mongodb://114.135.61.188:17017/meter-reading-database
+#spring.data.mongodb.uri=mongodb://water:zcxk100@114.135.61.189:27071/meter-reading-database?authSource=meter-reading-database
 logging.level.org.springframework.data.mongodb.core=DEBUG
 account_userInfo_url=http://114.135.61.188:58084/api/pay/getAccountInfoByMetercode
 sync_customer_no_url=http://114.135.61.188:58084/api/customer/synCustomer

+ 1 - 0
smart-city-platform/src/main/resources/json/deviceCustomColumn.json

@@ -1,6 +1,7 @@
 {
   "general": ["deviceNo", "deviceModel", "customerName", "deviceStatus", "buildingName", "locDesc", "dateCreate", "lastReceiveTime"],
   "loraMeter": ["deviceNo", "waterMeterFileNo", "waterMeterNo", "deviceModel", "customerName", "deviceStatus", "lastErrorType", "meterReading","communityName", "buildingName", "locDesc", "syncStatus", "valveStatus","lastReceiveTime","userName","userPhone"],
+  "generalDeviceList": ["deviceNo", "waterMeterFileNo", "waterMeterNo", "deviceModel", "customerName", "deviceStatus", "lastErrorType", "meterReading","communityName", "buildingName", "locDesc", "valveStatus","lastReceiveTime","installTime","userName","userPhone"],
   "photoelectricMeter": ["waterMeterNo","waterMeterFileNo", "deviceModel", "customerName", "deviceStatus", "concentratorName", "channelNumberName","collectorName", "issueStatus", "meterReading","communityName", "buildingName", "installTime","locDesc","valveStatus","lastReceiveTime","userName","userPhone"],
   "nbiotMeter": ["deviceNo", "waterMeterNo","waterMeterFileNo", "deviceModel", "customerName", "deviceStatus", "lastErrorType", "meterReading","communityName", "buildingName", "locDesc", "registerStatus", "valveStatus","lastReceiveTime","userName","userPhone"],
   "waterQualityMeter": ["deviceNo", "deviceModel", "customerName", "deviceStatus", "buildingName", "locDesc", "lastReceiveTime"],

+ 12 - 4
smart-city-platform/src/main/resources/mapper/DeviceMapper.xml

@@ -373,7 +373,7 @@
         sd.sync_status
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
-        left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
+        left join sc_device_manufacturer sdm on (sdm.id = sdt.manufacturer_id and sdm.status = 1)
         left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)
         left join sc_channel sc on (sc.id = sd.sys_id and sc.status = 1)
         left join sc_community scom on ( scom.id = sb.community and scom.status = 1)
@@ -386,6 +386,10 @@
         left join sc_install_list sil on (sil.device_id = sd.id)
         <if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
         where sd.status = 1
+        <if test="sysIds != null and sysIds.size() != 0">
+            and sd.sys_id in
+            <foreach collection="sysIds" item="item" open="(" separator="," close=")">#{item} </foreach>
+        </if>
         <if test="sysId != null"> AND sd.sys_id = #{sysId}</if>
         <if test="buildingId != null"> AND sd.building_id = #{buildingId}</if>
         <if test="siteId != null"> AND sd.site_id = #{siteId}</if>
@@ -448,6 +452,10 @@
         <if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
         where sd.status = 1
         <if test="sysId != null"> AND sd.sys_id = #{sysId}</if>
+        <if test="sysIds != null and sysIds.size() != 0">
+            and sd.sys_id in
+            <foreach collection="sysIds" item="item" open="(" separator="," close=")">#{item} </foreach>
+        </if>
         <if test="buildingId != null"> AND sd.building_id = #{buildingId}</if>
         <if test="siteId != null"> AND sd.site_id = #{siteId}</if>
         <if test="deviceNo != null and deviceNo != ''"> AND (sd.device_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_file_no LIKE concat('%',#{deviceNo},'%'))</if>
@@ -621,7 +629,7 @@
         sd.sync_status
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
-        left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
+        left join sc_device_manufacturer sdm on (sdm.id = sdt.manufacturer_id and sdm.status = 1)
         left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)
         left join sc_channel sc on (sc.id = sd.sys_id and sc.status = 1)
         left join sc_community scom on ( scom.id = sb.community and scom.status = 1)
@@ -793,7 +801,7 @@
         scn.channel_name as channel_number_name
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
-        left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
+        left join sc_device_manufacturer sdm on (sdm.id = sdt.manufacturer_id and sdm.status = 1)
         left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)
         left join sc_channel sc on (sc.id = sd.sys_id and sc.status = 1)
         left join sc_community scom on ( scom.id = sb.community and scom.status = 1)
@@ -1165,7 +1173,7 @@
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
         left join sc_w_meter_type swmt on (swmt.device_type_id = sd.device_type and swmt.status = 1)
-        left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
+        left join sc_device_manufacturer sdm on (sdm.id = sdt.manufacturer_id and sdm.status = 1)
         left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)
         left join sc_channel sc on (sc.id = sd.sys_id and sc.status = 1)
         left join sc_community scom on ( scom.id = sb.community and scom.status = 1)

+ 17 - 0
smart-city-platform/src/main/resources/mapper/DeviceTypeMapper.xml

@@ -136,6 +136,23 @@
         <if test="type != null"> and sdt.device_type = #{type}</if>
     </select>
 
+    <select id="getDeviceTypeListV2" resultType="com.bz.smart_city.dto.DeviceTypeDto">
+        select
+        sdt.*,
+        sdm.name as manufacturer_name
+        from sc_device_type sdt
+        left join sc_device_manufacturer sdm on (sdm.id = sdt.manufacturer_id and sdm.status = 1)
+        where sdt.status = 1
+         and sdt.id in (
+            select device_type_id from sc_channel_device_type_use scdtu where scdtu.status = 1
+            <if test="sysIds != null and sysIds.size() != 0">
+                and scdtu.channel_id in
+                <foreach collection="sysIds" item="item" open="(" separator="," close=")">#{item} </foreach>
+            </if>
+            )
+        <if test="type != null"> and sdt.device_type = #{type}</if>
+    </select>
+
 <!--    <select id="getTreeData" resultType="com.bz.smart_city.dto.TreeDataDto">
         select id,name as label,name as `value`
         from sc_device_manufacturer

+ 5 - 0
smart-city-platform/src/main/resources/mapper/InstallListMapper.xml

@@ -930,4 +930,9 @@
       and sil.metercode in <foreach collection="fileNo" item="item" open="(" separator="," close=")">#{item}</foreach>
     </if>
   </select>
+
+  <delete id="delByDeviceId">
+    update sc_install_list set status=0,date_update=now()
+    where device_id=#{deviceId}
+    </delete>
 </mapper>

+ 6 - 0
smart-city-platform/src/main/resources/mapper/MeterReadRecordMapper.xml

@@ -1908,5 +1908,11 @@
         where status = 1
         and id in <foreach collection="ids" item="item" open="(" separator="," close=")">#{item}</foreach>
     </select>
+
+    <select id="getById" resultMap="BaseResultMap">
+        select id,device_id,concentrator_id,collector_id,building_id,read_status,read_date from sc_meter_read_record
+        where status = 1
+        and id = #{id}
+    </select>
 </mapper>
 

+ 4 - 0
smart-city-platform/src/main/resources/mapper/WaterMeterErrorDaysMapper.xml

@@ -74,6 +74,7 @@
             <if test="waterMeterErrorDays.days!=null"> `days`,</if>
             <if test="waterMeterErrorDays.startDate!=null"> start_date,</if>
             <if test="waterMeterErrorDays.lastErrorType!=null"> last_error_type,</if>
+            <if test="waterMeterErrorDays.meterReading!=null"> meter_reading,</if>
             <if test="waterMeterErrorDays.endDate!=null"> end_date,</if>
             <if test="waterMeterErrorDays.status!=null"> `status`,</if>
             <if test="waterMeterErrorDays.dateCreate!=null"> date_create,</if>
@@ -93,6 +94,8 @@
             </if>
             <if test="waterMeterErrorDays.lastErrorType!=null">#{waterMeterErrorDays.lastErrorType,jdbcType=VARCHAR},
             </if>
+            <if test="waterMeterErrorDays.meterReading!=null">#{waterMeterErrorDays.meterReading,jdbcType=VARCHAR},
+            </if>
             <if test="waterMeterErrorDays.endDate!=null">#{waterMeterErrorDays.endDate,jdbcType=INTEGER},
             </if>
             <if test="waterMeterErrorDays.status!=null">#{waterMeterErrorDays.status,jdbcType=INTEGER},
@@ -152,6 +155,7 @@
         <set>
             <if test="waterMeterErrorDays.days != null"> `days`= #{waterMeterErrorDays.days,jdbcType=INTEGER},</if>
             <if test="waterMeterErrorDays.startDate != null"> start_date= #{waterMeterErrorDays.startDate,jdbcType=INTEGER},</if>
+            <if test="waterMeterErrorDays.meterReading != null"> meter_reading= #{waterMeterErrorDays.meterReading,jdbcType=VARCHAR},</if>
             <if test="waterMeterErrorDays.lastErrorType != null"> last_error_type= #{waterMeterErrorDays.lastErrorType,jdbcType=VARCHAR},</if>
             <if test="waterMeterErrorDays.endDate != null"> end_date= #{waterMeterErrorDays.endDate,jdbcType=INTEGER},</if>
             <if test="waterMeterErrorDays.status != null"> `status`= #{waterMeterErrorDays.status,jdbcType=INTEGER},</if>