lin 4 år sedan
förälder
incheckning
5d8a82715a
15 ändrade filer med 534 tillägg och 16 borttagningar
  1. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/controller/system/ReplaceManageController.java
  2. 70 0
      smart-city-platform/src/main/java/com/bz/smart_city/controller/system/WarningLogController.java
  3. 44 0
      smart-city-platform/src/main/java/com/bz/smart_city/dao/WarningLogMapper.java
  4. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/dao/WaterMeterReplaceLogMapper.java
  5. 38 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/WarningLogDto.java
  6. 9 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/WaterMeterMaintenanceLogDto.java
  7. 50 0
      smart-city-platform/src/main/java/com/bz/smart_city/entity/WarningLog.java
  8. 21 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/WarningLogService.java
  9. 4 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceServiceImpl.java
  10. 54 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/WarningLogServiceImpl.java
  11. 5 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/WaterMeterMaintenanceLogServiceImpl.java
  12. 6 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/assistant/InstallManagerServiceImpl.java
  13. 9 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/udip/UdipUnitService.java
  14. 213 0
      smart-city-platform/src/main/resources/mapper/WarningLogMapper.xml
  15. 9 2
      smart-city-platform/src/main/resources/mapper/WaterMeterReplaceLogMapper.xml

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/controller/system/ReplaceManageController.java

@@ -83,7 +83,7 @@ public class ReplaceManageController {
 
 
     @GetMapping("getAreaList")
-    @ApiOperation(value = "查询换表记区域列表")
+    @ApiOperation(value = "查询换表记区域列表")
     public AjaxMessage<List<BuildingSelectDto>> getAreaList(
             @ApiParam(value = "设备id", required = false) @RequestParam(required = false) Long deviceId,
             @ApiParam(value = "设备编号/电子号/档案号", required = false) @RequestParam(required = false) String deviceNo,

+ 70 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/system/WarningLogController.java

@@ -0,0 +1,70 @@
+package com.bz.smart_city.controller.system;
+
+import com.bz.smart_city.commom.model.AjaxMessage;
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.commom.model.ResultStatus;
+import com.bz.smart_city.dto.BuildingSelectDto;
+import com.bz.smart_city.dto.WarningLogDto;
+import com.bz.smart_city.service.WarningLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Controller
+@ResponseBody
+@RequestMapping("system/warningLog")
+@Api(tags = "预警记录")
+public class WarningLogController {
+
+    @Autowired
+    private WarningLogService warningLogService;
+
+    @GetMapping("getList")
+    @ApiOperation(value = "查询预警记录列表")
+    public AjaxMessage<Pagination<WarningLogDto>> getList(
+            @ApiParam(value = "设备编号/电子号", required = false) @RequestParam(required = false) String deviceNo,
+            @ApiParam(value = "预警类型 1:较上日用水量激增30% 2:连续无用水量超过7天", required = false) @RequestParam(required = false) Integer warningType,
+            @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String clientName,
+            @ApiParam(value = "反馈状态 0:待反馈 1:已确认无异常 2:已反馈信息", required = false) @RequestParam(required = false) Integer feedbackStatus,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate,
+            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer provinceId,
+            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer cityId,
+            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer regionId,
+            @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer communityId,
+            @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId,
+            @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<WarningLogDto> pageInfo = warningLogService.getList(
+                deviceNo,warningType,clientName,feedbackStatus,provinceId,cityId,regionId,communityId,buildingId,
+                startDate,endDate, pageNum, pageSize);
+        return new AjaxMessage<>(ResultStatus.OK, pageInfo);
+    }
+
+    @GetMapping("getAreaList")
+    @ApiOperation(value = "查询预警记录区域列表")
+    public AjaxMessage<List<BuildingSelectDto>> getAreaList(
+            @ApiParam(value = "设备编号/电子号", required = false) @RequestParam(required = false) String deviceNo,
+            @ApiParam(value = "预警类型 1:较上日用水量激增30% 2:连续无用水量超过7天", required = false) @RequestParam(required = false) Integer warningType,
+            @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String clientName,
+            @ApiParam(value = "反馈状态 0:待反馈 1:已确认无异常 2:已反馈信息", required = false) @RequestParam(required = false) Integer feedbackStatus,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate
+    ){
+        List<BuildingSelectDto> list = warningLogService.getAreaList(
+                deviceNo,warningType,clientName,feedbackStatus,startDate,endDate
+        );
+        return new AjaxMessage<>(ResultStatus.OK, list);
+    }
+}

+ 44 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/WarningLogMapper.java

@@ -0,0 +1,44 @@
+package com.bz.smart_city.dao;
+
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.dto.BuildingSelectInfoDto;
+import com.bz.smart_city.dto.WarningLogDto;
+import com.bz.smart_city.entity.ProgramItem;
+import com.bz.smart_city.entity.WarningLog;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Mapper
+public interface WarningLogMapper {
+    int insertSelective(WarningLog record);
+
+    int updateByPrimaryKeySelective(WarningLog record);
+
+    List<WarningLogDto> getList(
+            @Param("siteId") Integer siteId,
+            @Param("deviceNo") String deviceNo,
+            @Param("warningType") Integer warningType,
+            @Param("clientName") String clientName,
+            @Param("feedbackStatus") Integer feedbackStatus,
+            @Param("provinceId") Integer provinceId,
+            @Param("cityId") Integer cityId,
+            @Param("regionId") Integer regionId,
+            @Param("communityId") Integer communityId,
+            @Param("buildingId") Integer buildingId,
+            @Param("startDate") LocalDateTime startDate,
+            @Param("endDate") LocalDateTime endDate,
+            @Param("programItems") List<ProgramItem> programItems);
+
+    List<BuildingSelectInfoDto> getAreaList(
+            @Param("siteId") Integer siteId,
+            @Param("deviceNo") String deviceNo,
+            @Param("warningType") Integer warningType,
+            @Param("clientName") String clientName,
+            @Param("feedbackStatus") Integer feedbackStatus,
+            @Param("startDate") LocalDateTime startDate,
+            @Param("endDate") LocalDateTime endDate,
+            @Param("programItems") List<ProgramItem> programItems);
+}

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

@@ -20,7 +20,7 @@ public interface WaterMeterReplaceLogMapper {
 
     int batchInsert(@Param("list") List<WaterMeterReplaceLog> list);
 
-    WaterMeterReplaceLog findByMainLogId(@Param("mainLogId") Integer mainLogId);
+    WaterMeterReplaceLogDto findByMainLogId(@Param("mainLogId") Integer mainLogId);
 
     List<WaterMeterReplaceLogDto> findList(
             @Param("siteId") Integer siteId,

+ 38 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/WarningLogDto.java

@@ -0,0 +1,38 @@
+package com.bz.smart_city.dto;
+
+import com.bz.smart_city.entity.WarningLog;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class WarningLogDto extends WarningLog {
+
+    @ApiModelProperty(value="客户编号", position = 101)
+    private String accountNumber;
+
+    @ApiModelProperty(value="客户名称", position = 102)
+    private String accountName;
+
+    @ApiModelProperty(value="客手机号", position = 103)
+    private String accountPhone;
+
+    @ApiModelProperty(value = "设备编号", position = 104)
+    private String deviceNo;
+
+    @ApiModelProperty(value = "水表电子号", position = 105)
+    private String waterMeterNo;
+
+    @ApiModelProperty(value = "系列", position = 106)
+    private String equipmentType;
+
+    @ApiModelProperty(value = "型号", position = 107)
+    private String model;
+
+    @ApiModelProperty(value = "厂商名称", position = 108)
+    private String manufacturerName;
+
+    @ApiModelProperty(value = "位置描述", position = 109)
+    private String locDesc;
+}

+ 9 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/WaterMeterMaintenanceLogDto.java

@@ -46,6 +46,15 @@ public class WaterMeterMaintenanceLogDto extends WaterMeterMaintenanceLog {
     @ApiModelProperty(value = "新表设备类型id", position = 111)
     private Integer newDeviceTypeId;
 
+    @ApiModelProperty(value = "新设备系列", position = 105)
+    private String newEquipmentType;
+
+    @ApiModelProperty(value = "新设备型号", position = 106)
+    private String newModel;
+
+    @ApiModelProperty(value = "新厂商名称", position = 107)
+    private String newManufacturerName;
+
     @ApiModelProperty(value = "照片url", position = 112)
     private List<String> imageUrls;
 

+ 50 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/WarningLog.java

@@ -0,0 +1,50 @@
+package com.bz.smart_city.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+@ApiModel(value="com-bz-smart_city-entity-WarningLog")
+@Data
+public class WarningLog {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    @ApiModelProperty(value="客户id")
+    private Integer clientUserId;
+
+    @ApiModelProperty(value="设备id")
+    private Long deviceId;
+
+    @ApiModelProperty(value="预警类型 1:较上日用水量激增30% 2:连续无用水量超过7天")
+    private Integer warningType;
+
+    @ApiModelProperty(value="反馈状态 0:待反馈 1:已确认无异常 2:已反馈信息")
+    private Integer feedbackStatus;
+
+    @ApiModelProperty(value="反馈内容")
+    private String feedbackContent;
+
+    @JsonIgnore
+    @ApiModelProperty(value="")
+    private Integer status;
+
+    @JsonIgnore
+    @ApiModelProperty(value="")
+    private String createBy;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value="")
+    private LocalDateTime dateCreate;
+
+    @JsonIgnore
+    @ApiModelProperty(value="")
+    private String updateBy;
+
+    @JsonIgnore
+    @ApiModelProperty(value="")
+    private LocalDateTime dateUpdate;
+}

+ 21 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/WarningLogService.java

@@ -0,0 +1,21 @@
+package com.bz.smart_city.service;
+
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.dto.BuildingSelectDto;
+import com.bz.smart_city.dto.WarningLogDto;
+import com.bz.smart_city.entity.WarningLog;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+public interface WarningLogService{
+
+
+    int insertSelective(WarningLog record);
+
+    int updateByPrimaryKeySelective(WarningLog record);
+
+    Pagination<WarningLogDto> getList(String deviceNo, Integer warningType, String clientName, Integer feedbackStatus, Integer provinceId, Integer cityId, Integer regionId, Integer communityId, Integer buildingId, LocalDateTime startDate, LocalDateTime endDate, int pageNum, int pageSize);
+
+    List<BuildingSelectDto> getAreaList(String deviceNo, Integer warningType, String clientName, Integer feedbackStatus, LocalDateTime startDate, LocalDateTime endDate);
+}

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

@@ -557,7 +557,10 @@ public  class DeviceServiceImpl implements DeviceService {
         device.setWaterMeterNo(deviceDataDto.getWaterMeterNo());
         device.setWaterMeterFileNo(deviceDataDto.getWaterMeterFileNo());
         device.setCustomerId(deviceDataDto.getCustomerId());
-        device.setUdipId(udipId);
+        if (udipId != null) {
+            device.setUdipId(udipId);
+            device.setRegisterStatus(1);
+        }
         int result = this.updateByPrimaryKeySelective(device);
 
 

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

@@ -0,0 +1,54 @@
+package com.bz.smart_city.service.impl;
+
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.commom.util.UserUtil;
+import com.bz.smart_city.dto.BuildingSelectDto;
+import com.bz.smart_city.dto.BuildingSelectInfoDto;
+import com.bz.smart_city.dto.LoginUser;
+import com.bz.smart_city.dto.WarningLogDto;
+import com.bz.smart_city.service.BuildingService;
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.bz.smart_city.entity.WarningLog;
+import com.bz.smart_city.dao.WarningLogMapper;
+import com.bz.smart_city.service.WarningLogService;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+public class WarningLogServiceImpl implements WarningLogService{
+
+    @Resource
+    private WarningLogMapper warningLogMapper;
+
+    @Autowired
+    private BuildingService buildingService;
+
+    @Override
+    public int insertSelective(WarningLog record) {
+        return warningLogMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(WarningLog record) {
+        return warningLogMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public Pagination<WarningLogDto> getList(String deviceNo, Integer warningType, String clientName, Integer feedbackStatus, Integer provinceId, Integer cityId, Integer regionId, Integer communityId, Integer buildingId, LocalDateTime startDate, LocalDateTime endDate, int pageNum, int pageSize) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        PageHelper.startPage(pageNum,pageSize);
+        List<WarningLogDto> list =  warningLogMapper.getList(loginUser.getSiteId(),deviceNo,warningType,clientName,feedbackStatus,provinceId,cityId,regionId,communityId,buildingId,startDate,endDate,UserUtil.getCurrentSiteProgramItems(loginUser));
+        return new Pagination<>(list);
+    }
+
+    @Override
+    public List<BuildingSelectDto> getAreaList(String deviceNo, Integer warningType, String clientName, Integer feedbackStatus, LocalDateTime startDate, LocalDateTime endDate) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        List<BuildingSelectInfoDto> buildingList = warningLogMapper.getAreaList(loginUser.getSiteId(),deviceNo,warningType,clientName,feedbackStatus,startDate,endDate,UserUtil.getCurrentSiteProgramItems(loginUser));
+        return buildingService.areaList(buildingList);
+    }
+}

+ 5 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/WaterMeterMaintenanceLogServiceImpl.java

@@ -6,10 +6,7 @@ import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.commom.util.UserUtil;
 import com.bz.smart_city.dao.*;
 import com.bz.smart_city.dao.assistant.InstallListMapper;
-import com.bz.smart_city.dto.DeviceErrorDto;
-import com.bz.smart_city.dto.DeviceTypeDto;
-import com.bz.smart_city.dto.LoginUser;
-import com.bz.smart_city.dto.WaterMeterMaintenanceLogDto;
+import com.bz.smart_city.dto.*;
 import com.bz.smart_city.entity.*;
 import com.bz.smart_city.entity.assistant.InstallList;
 import com.bz.smart_city.service.WorkOrderService;
@@ -219,7 +216,7 @@ public class WaterMeterMaintenanceLogServiceImpl implements WaterMeterMaintenanc
 
         WaterMeterMaintenanceLogDto waterMeterMaintenanceLogDto = waterMeterMaintenanceLogMapper.findByOrdeNo(ordeNo);
         if (waterMeterMaintenanceLogDto != null) {
-            WaterMeterReplaceLog waterMeterReplaceLog = waterMeterReplaceLogMapper.findByMainLogId(waterMeterMaintenanceLogDto.getId());
+            WaterMeterReplaceLogDto waterMeterReplaceLog = waterMeterReplaceLogMapper.findByMainLogId(waterMeterMaintenanceLogDto.getId());
             waterMeterMaintenanceLogDto.setNewWaterNo(waterMeterReplaceLog.getNewWaterNo());
             waterMeterMaintenanceLogDto.setOldWaterNo(waterMeterReplaceLog.getOldWaterNo());
             waterMeterMaintenanceLogDto.setNewBeginWsv(waterMeterReplaceLog.getNewBeginWsv());
@@ -230,6 +227,9 @@ public class WaterMeterMaintenanceLogServiceImpl implements WaterMeterMaintenanc
             waterMeterMaintenanceLogDto.setOldSimNo(waterMeterReplaceLog.getOldSimNo());
             waterMeterMaintenanceLogDto.setNewDeviceFlagNo(waterMeterReplaceLog.getNewDeviceFlagNo());
             waterMeterMaintenanceLogDto.setOldDeviceFlagNo(waterMeterReplaceLog.getOldDeviceFlagNo());
+            waterMeterMaintenanceLogDto.setNewEquipmentType(waterMeterReplaceLog.getNewEquipmentType());
+            waterMeterMaintenanceLogDto.setNewModel(waterMeterReplaceLog.getNewModel());
+            waterMeterMaintenanceLogDto.setNewManufacturerName(waterMeterReplaceLog.getNewManufacturerName());
             //获取图片
             waterMeterMaintenanceLogDto.setImageUrls(waterMeterMaintenanceImagesMapper.findByMainLogId(waterMeterMaintenanceLogDto.getId()));
             return waterMeterMaintenanceLogDto;

+ 6 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/assistant/InstallManagerServiceImpl.java

@@ -618,6 +618,7 @@ public class InstallManagerServiceImpl implements InstallManagerService, Initial
 			InstallListUpdate.setNewMeterStart(waterMeterReplaceInputDto.getNewBeginWsv());
 			InstallListUpdate.setOldMeterEnd(waterMeterReplaceInputDto.getOldEndWsv());
 			InstallListUpdate.setDeviceTypeId(waterMeterReplaceInputDto.getNewDeviceTypeId());
+			InstallListUpdate.setOldImageUrl(waterMeterReplaceInputDto.getImageUrl());
 			InstallListUpdate.setIsAccepted(0);
 			InstallListUpdate.setDateUpdate(LocalDateTime.now());
 			installListMapper.updateByPrimaryKeySelective(InstallListUpdate);
@@ -669,7 +670,11 @@ public class InstallManagerServiceImpl implements InstallManagerService, Initial
 		String udipId =  udipUnitService.updateUdipUnit(deviceTemp.getUdipId(),dto.getDeviceNo(),dto.getCustomerId(),deviceTypeDto);
 		// 5,更新设备记录
 		DeviceDto d = convertInstallList(dto);
-		d.setUdipId(udipId);
+		if (udipId != null) {
+			d.setUdipId(udipId);
+			d.setRegisterStatus(1);
+		}
+		d.setDateUpdate(LocalDateTime.now());
 		deviceMapper.updateByPrimaryKeySelective(d);
 		// 6,维护设备维度信息
 		deviceDimInfoMapper.delByDeviceId(d.getId(), dto.getUpdateBy());

+ 9 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/udip/UdipUnitService.java

@@ -32,7 +32,9 @@ public class UdipUnitService {
     private DeviceTypeMapper deviceTypeMapper;
 
     public String saveUdipUnit(String identifier, Integer customerId,  DeviceTypeDto deviceType){
-
+        if(deviceType.getIsRegister() == 0){
+            return null;
+        }
         if (deviceType.getEnEquipmentType() == null || deviceType.getEnModel() == null || deviceType.getEnManufacturerName() == null) {
             return null;
         }
@@ -48,7 +50,7 @@ public class UdipUnitService {
         try {
 
             String result = HttpRequest.doPost(url, JSON.toJSONString(udipUnit));
-            log.info("msg result=" + result);
+            log.info("saveUdipUnit msg result=" + result);
             JSONObject jsonObject = JSONObject.parseObject(result);
             Integer status = jsonObject.getInteger("status");
             if(status == 0){
@@ -64,7 +66,9 @@ public class UdipUnitService {
     }
 
     public String updateUdipUnit(String udipId, String identifier, Integer customerId, DeviceTypeDto deviceType){
-
+        if(deviceType.getIsRegister() == 0){
+            return null;
+        }
         if (udipId != null && !"".equals(udipId)) {
             String url = unitUrl+"/unit/units/"+udipId;
             UdipUnitDTO udipUnit = new UdipUnitDTO();
@@ -78,7 +82,7 @@ public class UdipUnitService {
             try {
 
                 String result = HttpRequest.doPost(url,JSON.toJSONString(udipUnit));
-                log.info("msg udipId={} result={}",udipId , result);
+                log.info("updateUdipUnit msg udipId={} result={}",udipId , result);
                 JSONObject jsonObject = JSONObject.parseObject(result);
                 Integer status = jsonObject.getInteger("status");
                 if(status == 0){
@@ -103,7 +107,7 @@ public class UdipUnitService {
             try {
 
                 String result = HttpRequest.doDelete(url,null);
-                log.info("msg result=" + result);
+                log.info("deleteUdipUnit msg result=" + result);
                 JSONObject jsonObject = JSONObject.parseObject(result);
                 Integer status = jsonObject.getInteger("status");
                 if(status == 0){

+ 213 - 0
smart-city-platform/src/main/resources/mapper/WarningLogMapper.xml

@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bz.smart_city.dao.WarningLogMapper">
+  <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.WarningLog">
+    <!--@mbg.generated-->
+    <!--@Table sc_warning_log-->
+    <id column="id" property="id" />
+    <result column="client_user_id" property="clientUserId" />
+    <result column="device_id" property="deviceId" />
+    <result column="warning_type" property="warningType" />
+    <result column="feedback_status" property="feedbackStatus" />
+    <result column="feedback_content" property="feedbackContent" />
+    <result column="status" property="status" />
+    <result column="create_by" property="createBy" />
+    <result column="date_create" property="dateCreate" />
+    <result column="update_by" property="updateBy" />
+    <result column="date_update" property="dateUpdate" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, client_user_id, device_id, warning_type, feedback_status, feedback_content, `status`, 
+    create_by, date_create, update_by, date_update
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bz.smart_city.entity.WarningLog" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into sc_warning_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="clientUserId != null">
+        client_user_id,
+      </if>
+      <if test="deviceId != null">
+        device_id,
+      </if>
+      <if test="warningType != null">
+        warning_type,
+      </if>
+      <if test="feedbackStatus != null">
+        feedback_status,
+      </if>
+      <if test="feedbackContent != null">
+        feedback_content,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="dateCreate != null">
+        date_create,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+      <if test="dateUpdate != null">
+        date_update,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="clientUserId != null">
+        #{clientUserId},
+      </if>
+      <if test="deviceId != null">
+        #{deviceId},
+      </if>
+      <if test="warningType != null">
+        #{warningType},
+      </if>
+      <if test="feedbackStatus != null">
+        #{feedbackStatus},
+      </if>
+      <if test="feedbackContent != null">
+        #{feedbackContent},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="dateCreate != null">
+        #{dateCreate},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+      <if test="dateUpdate != null">
+        #{dateUpdate},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.bz.smart_city.entity.WarningLog">
+    <!--@mbg.generated-->
+    update sc_warning_log
+    <set>
+      <if test="clientUserId != null">
+        client_user_id = #{clientUserId},
+      </if>
+      <if test="deviceId != null">
+        device_id = #{deviceId},
+      </if>
+      <if test="warningType != null">
+        warning_type = #{warningType},
+      </if>
+      <if test="feedbackStatus != null">
+        feedback_status = #{feedbackStatus},
+      </if>
+      <if test="feedbackContent != null">
+        feedback_content = #{feedbackContent},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="dateCreate != null">
+        date_create = #{dateCreate},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+      <if test="dateUpdate != null">
+        date_update = #{dateUpdate},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+
+  <select id="getList" resultType="com.bz.smart_city.dto.WarningLogDto">
+    select
+    swl.*,
+    scu.accountnumber as account_number,
+    scu.username as account_name,
+    scu.mobile_phone as account_phone,
+    sd.device_no,
+    sd.water_meter_no,
+    sd.loc_desc,
+    sdt1.equipment_type as equipment_type,
+    sdt1.model as model,
+    sdm1.name as manufacturer_name
+    from sc_warning_log swl
+    left join sc_device sd on(sd.id = swl.device_id)
+    left join sc_building sb on(sb.id = sd.building_id)
+    left join sc_client_user scu on(scu.id = swl.client_user_id)
+    left join sc_device_type sdt1 on(sdt1.id = sd.device_type)
+    left join sc_device_manufacturer sdm1 on(sdm1.id = sdt1.manufacturer_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 swl.status = 1 and sd.status = 1
+    <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},'%')
+    )</if>
+    <if test="warningType != null"> and swl.warning_type = #{warningType}</if>
+    <if test="clientName != null and clientName != ''"> and (
+      scu.username LIKE concat('%',#{clientName},'%') or scu.mobile_phone LIKE concat('%',#{clientName},'%') or scu.accountnumber LIKE concat('%',#{clientName},'%')
+    )</if>
+    <if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
+    <if test="provinceId != null"> and sb.province = #{provinceId}</if>
+    <if test="cityId != null"> and sb.city = #{cityId}</if>
+    <if test="regionId != null"> and sb.region = #{regionId}</if>
+    <if test="communityId != null"> and sb.community = #{communityId}</if>
+    <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
+    <if test="startDate != null"> and swl.date_create <![CDATA[ >= ]]> #{startDate}</if>
+    <if test="endDate != null"> and swl.date_create <![CDATA[ <= ]]> #{endDate}</if>
+    <if test="programItems != null and programItems.size() != 0"> and
+      <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
+        sdd.${item.dimensionCode} = #{item.dimensionValue}
+      </foreach>
+    </if>
+    order by swl.date_create desc
+  </select>
+
+  <select id="getAreaList" resultType="com.bz.smart_city.dto.BuildingSelectInfoDto">
+    select
+    b.id,
+    b.name,
+    b.province,
+    b.city,
+    b.region,
+    b.community,
+    b.longitude,
+    b.latitude,
+    t1.device_count
+    from sc_building b
+    right join (
+    select sd.building_id,count(1) as device_count
+    from sc_warning_log swl
+    left join sc_device sd on(sd.id = swl.device_id)
+    left join sc_client_user scu on(scu.id = swl.client_user_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 swl.status = 1 and sd.status = 1
+    <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},'%')
+      )</if>
+    <if test="warningType != null"> and swl.warning_type = #{warningType}</if>
+    <if test="clientName != null and clientName != ''"> and (
+      scu.username LIKE concat('%',#{clientName},'%') or scu.mobile_phone LIKE concat('%',#{clientName},'%') or scu.accountnumber LIKE concat('%',#{clientName},'%')
+      )</if>
+    <if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
+    <if test="startDate != null"> and swl.date_create <![CDATA[ >= ]]> #{startDate}</if>
+    <if test="endDate != null"> and swl.date_create <![CDATA[ <= ]]> #{endDate}</if>
+    <if test="programItems != null and programItems.size() != 0"> and
+      <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
+        sdd.${item.dimensionCode} = #{item.dimensionValue}
+      </foreach>
+    </if>
+    GROUP BY sd.building_id
+    ) t1 on (t1.building_id = b.id)
+    where b.status = 1
+  </select>
+</mapper>

+ 9 - 2
smart-city-platform/src/main/resources/mapper/WaterMeterReplaceLogMapper.xml

@@ -288,8 +288,15 @@
         </foreach>
     </insert>
 
-    <select id="findByMainLogId" resultMap="BaseResultMap">
-        select <include refid="Base_Column_List"/> from sc_water_meter_replace_log where status = 1 and main_log_id = #{mainLogId} 
+    <select id="findByMainLogId" resultType="com.bz.smart_city.dto.WaterMeterReplaceLogDto">
+        select rl.*,
+        sdt1.equipment_type as new_equipment_type,
+        sdt1.model as new_model,
+        sdm1.name as new_manufacturer_name
+        from sc_water_meter_replace_log rl
+        left join sc_device_type sdt1 on(sdt1.id = rl.new_device_type_id)
+        left join sc_device_manufacturer sdm1 on(sdm1.id = sdt1.manufacturer_id)
+        where rl.status = 1 and rl.main_log_id = #{mainLogId}
     </select>
 
     <select id="findList" resultType="com.bz.smart_city.dto.WaterMeterReplaceLogDto">