Browse Source

Merge remote-tracking branch 'origin/20210223' into 20210223

wangyangyang 3 years ago
parent
commit
1d97be6310

+ 1 - 1
common/src/main/java/com/huaxu/model/ResultStatus.java

@@ -123,7 +123,7 @@ public enum ResultStatus {
     SCENE_NAME_ALREADY_EXISTS(900015,"场景名称重复"),
     SCENE_PARENT_ALREADY_EXISTS(900016,"上级场景不能选择当前编辑场景"),
     DEVICE_PARENT_ALREADY_EXISTS(900017,"未选择任何设备或标签信息"),
-    EXIST_IS_REVENUE_ERROR(800004,"该公司存在该月营收数据不能新增"),
+    EXIST_IS_REVENUE_ERROR(800004,"该公司存在该月营收数据不能保存"),
 
     // 用户授权统一认证
     USER_AUTH_APPID_NOT_FOUND(910001,"appId不存在"),

+ 68 - 48
operation_manager/src/main/java/com/huaxu/common/ConvertXY.java

@@ -74,37 +74,47 @@ public class ConvertXY {
 	public static MyPoint ConvertXYToXian80(String x, String y,String moveXY) {
 		MyPoint pPoint = new MyPoint();
 		double dblLon = Double.parseDouble(x), dblLat = Double.parseDouble(y);
-		StringBuilder dblX80 = new StringBuilder();
-		StringBuilder dblY80 = new StringBuilder();
-		ICoordinate pCoordinate = CoordinateFactory.CreateCoordinate(Spheroid.Xian80);
-		pCoordinate.GaussPrjCalculate(dblLon, dblLat, dblX80, dblY80);
-		double X80 = Double.parseDouble(String.format("%.4f", Double.parseDouble(dblX80.toString())));
-		double Y80 = Double.parseDouble(String.format("%.4f", Double.parseDouble(dblY80.toString())));
-		X80 += -196600;
-		Y80 += 270;
-		int moveX=0,moveY=0;
-		if(!StringUtils.isEmpty(moveXY)){
-			moveX=Integer.parseInt(moveXY.split(",")[0]);
-			moveY=Integer.parseInt(moveXY.split(",")[1]);
+		if(dblLon <= 0 && dblLat <= 0){
+			pPoint.X = 0;
+			pPoint.Y = 0;
+		}else{
+			StringBuilder dblX80 = new StringBuilder();
+			StringBuilder dblY80 = new StringBuilder();
+			ICoordinate pCoordinate = CoordinateFactory.CreateCoordinate(Spheroid.Xian80);
+			pCoordinate.GaussPrjCalculate(dblLon, dblLat, dblX80, dblY80);
+			double X80 = Double.parseDouble(String.format("%.4f", Double.parseDouble(dblX80.toString())));
+			double Y80 = Double.parseDouble(String.format("%.4f", Double.parseDouble(dblY80.toString())));
+			X80 += -196600;
+			Y80 += 270;
+			int moveX=0,moveY=0;
+			if(!StringUtils.isEmpty(moveXY)){
+				moveX=Integer.parseInt(moveXY.split(",")[0]);
+				moveY=Integer.parseInt(moveXY.split(",")[1]);
+			}
+			pPoint.X = X80+moveX;
+			pPoint.Y = Y80+moveY;
 		}
-		pPoint.X = X80+moveX;
-		pPoint.Y = Y80+moveY;
 		return pPoint;
 	}
 
 	/* 经纬度转墨卡托投影坐标 */
 	public static MyPoint ConvertXYToMercato(String x, String y,String moveXY) {
 		MyPoint mercator = new MyPoint();
-		double dblLon = Double.parseDouble(x) * 20037508.34 / 180;
-		double dblLat = Math.log(Math.tan((90 + Double.parseDouble(y)) * Math.PI / 360)) / (Math.PI / 180);
-		dblLat = dblLat * 20037508.34 / 180;
-		int moveX=0,moveY=0;
-		if(!StringUtils.isEmpty(moveXY)){
-			moveX=Integer.parseInt(moveXY.split(",")[0]);
-			moveY=Integer.parseInt(moveXY.split(",")[1]);
+		if(Double.parseDouble(x) <= 0 && Double.parseDouble(y) <= 0){
+			mercator.X = 0;
+			mercator.Y = 0;
+		}else{
+			double dblLon = Double.parseDouble(x) * 20037508.34 / 180;
+			double dblLat = Math.log(Math.tan((90 + Double.parseDouble(y)) * Math.PI / 360)) / (Math.PI / 180);
+			dblLat = dblLat * 20037508.34 / 180;
+			int moveX=0,moveY=0;
+			if(!StringUtils.isEmpty(moveXY)){
+				moveX=Integer.parseInt(moveXY.split(",")[0]);
+				moveY=Integer.parseInt(moveXY.split(",")[1]);
+			}
+			mercator.X = dblLon+moveX;
+			mercator.Y = dblLat+moveY;
 		}
-		mercator.X = dblLon+moveX;
-		mercator.Y = dblLat+moveY;
 		return mercator;
 	}
 
@@ -118,23 +128,28 @@ public class ConvertXY {
 	 */
 	public static MyPoint ConvertXian80ToXY(String x, String y,String moveXY) {
 		MyPoint pPoint = new MyPoint();
-		double dx = Double.parseDouble(x)+196600, dy = Double.parseDouble(y)-270;
-		int moveX=0,moveY=0;
-		if(!StringUtils.isEmpty(moveXY)){
-			moveX=Integer.parseInt(moveXY.split(",")[0]);
-			moveY=Integer.parseInt(moveXY.split(",")[1]);
+		if(Double.parseDouble(x) <= 0 && Double.parseDouble(y) <= 0){
+			pPoint.X =0;
+			pPoint.Y =0;
+		}else{
+			double dx = Double.parseDouble(x)+196600, dy = Double.parseDouble(y)-270;
+			int moveX=0,moveY=0;
+			if(!StringUtils.isEmpty(moveXY)){
+				moveX=Integer.parseInt(moveXY.split(",")[0]);
+				moveY=Integer.parseInt(moveXY.split(",")[1]);
+			}
+			dx -= moveX;
+			dy -= moveY;
+			StringBuilder dblLon = new StringBuilder();
+			StringBuilder dblLat = new StringBuilder();
+			ICoordinate pCoordinate = CoordinateFactory.CreateCoordinate(Spheroid.WGS84);
+			pCoordinate.GaussPrjInvCalculate(dx, dy, dblLon, dblLat);
+			double X84 = Double.parseDouble(String.format("%.6f", Double.parseDouble(dblLon.toString())));
+			double Y84 = Double.parseDouble(String.format("%.6f", Double.parseDouble(dblLat.toString())));
+
+			pPoint.X =X84;
+			pPoint.Y =Y84;
 		}
-		dx -= moveX;
-		dy -= moveY;
-		StringBuilder dblLon = new StringBuilder();
-		StringBuilder dblLat = new StringBuilder();
-		ICoordinate pCoordinate = CoordinateFactory.CreateCoordinate(Spheroid.WGS84);
-		pCoordinate.GaussPrjInvCalculate(dx, dy, dblLon, dblLat);
-		double X84 = Double.parseDouble(String.format("%.6f", Double.parseDouble(dblLon.toString())));
-		double Y84 = Double.parseDouble(String.format("%.6f", Double.parseDouble(dblLat.toString())));
-
-		pPoint.X =X84;
-		pPoint.Y =Y84;
 		return pPoint;
 	}
 
@@ -143,16 +158,21 @@ public class ConvertXY {
 		MyPoint lngLat = new MyPoint();
 		double lng = Double.parseDouble(x);
 		double lat = Double.parseDouble(y);
-		int moveX=0,moveY=0;
-		if(!StringUtils.isEmpty(moveXY)){
-			moveX=Integer.parseInt(moveXY.split(",")[0]);
-			moveY=Integer.parseInt(moveXY.split(",")[1]);
+		if(lng<=0 && lat<=0){
+			lngLat.X=0;
+			lngLat.Y=0;
+		}else{
+			int moveX=0,moveY=0;
+			if(!StringUtils.isEmpty(moveXY)){
+				moveX=Integer.parseInt(moveXY.split(",")[0]);
+				moveY=Integer.parseInt(moveXY.split(",")[1]);
+			}
+			lng -= moveX;
+			lat -= moveY;
+			lngLat.X = lng / 20037508.34 * 180;
+			double mmy = lat / 20037508.34 * 180;
+			lngLat.Y = 180 / Math.PI * (2 * Math.atan(Math.exp(mmy * Math.PI / 180)) - Math.PI / 2);
 		}
-		lng -= moveX;
-		lat -= moveY;
-		lngLat.X = lng / 20037508.34 * 180;
-		double mmy = lat / 20037508.34 * 180;
-		lngLat.Y = 180 / Math.PI * (2 * Math.atan(Math.exp(mmy * Math.PI / 180)) - Math.PI / 2);
 		return lngLat;
 	}
 

+ 18 - 11
sms_water/src/main/java/com/huaxu/controller/RevenueController.java

@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.client.RestTemplate;
 
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -134,7 +135,7 @@ public class RevenueController {
             @ApiParam(value = "营收数据", required = true) @RequestBody MonthRevenueDto monthRevenueDto) {
         try{
             //判断该机构是否有该月的数据
-            if(revenueService.isExistMonthRevenue(monthRevenueDto.getCompanyOrgId(),monthRevenueDto.getCollectDateString())>0){
+            if(revenueService.isExistMonthRevenue(monthRevenueDto.getCompanyOrgId(),monthRevenueDto.getCollectDateString(),null)>0){
                 return new AjaxMessage<>(ResultStatus.EXIST_IS_REVENUE_ERROR);
             }
             LoginUser loginUser = UserUtil.getCurrentUser();
@@ -172,14 +173,21 @@ public class RevenueController {
     public AjaxMessage<Integer> updateRevenue(
             @ApiParam(value = "营收数据", required = true) @RequestBody MonthRevenueDto monthRevenueDto) {
         try{
+            //判断该机构是否有该月的数据
+            if(revenueService.isExistMonthRevenue(monthRevenueDto.getCompanyOrgId(),monthRevenueDto.getCollectDateString(),monthRevenueDto.getId())>0){
+                return new AjaxMessage<>(ResultStatus.EXIST_IS_REVENUE_ERROR);
+            }
             LoginUser loginUser = UserUtil.getCurrentUser();
             //修改营收数据
             monthRevenueDto.setUpdateBy(loginUser.getUsername());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            monthRevenueDto.setCollectDate(sdf.parse(monthRevenueDto.getCollectDateString()));
             oneConvertWan(monthRevenueDto);
             revenueService.updateRevenue(monthRevenueDto);
             //修改售水数据
             for (MonthSellwaterEntity entity : monthRevenueDto.getMonthSellList()) {
                 entity.setUpdateBy(loginUser.getUsername());
+                entity.setCollectDate(sdf.parse(monthRevenueDto.getCollectDateString()));
                 if(entity.getWaterUsage() != null){
                     entity.setWaterUsage(entity.getWaterUsage()/10000);
                 }
@@ -187,8 +195,6 @@ public class RevenueController {
                     entity.setTenantId(loginUser.getTenantId());
                     entity.setCreateBy(loginUser.getUsername());
                     entity.setCompanyOrgId(monthRevenueDto.getCompanyOrgId());
-                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
-                    entity.setCollectDate(sdf.parse(monthRevenueDto.getCollectDateString()));
                     revenueService.insertSellWater(entity);
                 }else{
                     revenueService.updateSellWater(entity);
@@ -310,26 +316,27 @@ public class RevenueController {
         }
         int no=1;
         List<List<String>> excelResult=new  ArrayList<>();
+        DecimalFormat df = new DecimalFormat("0.###");
         for(MonthRevenueDto item : result){
             List<String> datalist=new ArrayList<>();
             datalist.add(String.valueOf(no++));
             datalist.add(item.getCollectDateString().replace("-","年")+"月");
-            datalist.add(String.valueOf(item.getMeterReadingUsage()));
+            datalist.add(item.getMeterReadingUsage()==null?"-":df.format(item.getMeterReadingUsage()));
             for(WaterPropertyEntity water :waterPropertyList){
                 List<MonthSellwaterEntity> sellWaterList = item.getMonthSellList().stream().filter((MonthSellwaterEntity m)
                         -> m.getPropertyId().equals(water.getId())).collect(Collectors.toList());
                 if(sellWaterList.size()>0){
-                    datalist.add(sellWaterList.get(0).getWaterUsage()==null?"-":String.valueOf(sellWaterList.get(0).getWaterUsage()));
+                    datalist.add(sellWaterList.get(0).getWaterUsage()==null?"-":df.format(sellWaterList.get(0).getWaterUsage()));
                 }else{
                     datalist.add("-");
                 }
             }
-            datalist.add(String.valueOf(item.getReceivableTotalAmount()));
-            datalist.add(String.valueOf(item.getBigUserUsage()));
-            datalist.add(String.valueOf(item.getGeneralUserUsage()));
-            datalist.add(String.valueOf(item.getReceivedTotalAmount()));
-            datalist.add(String.valueOf(item.getBigUserUsageReceived()));
-            datalist.add(String.valueOf(item.getGeneralUserUsageReceived()));
+            datalist.add(item.getReceivableTotalAmount()==null?"-":df.format(item.getReceivableTotalAmount()));
+            datalist.add(item.getBigUserUsage()==null?"-":df.format(item.getBigUserUsage()));
+            datalist.add(item.getGeneralUserUsage()==null?"-":df.format(item.getGeneralUserUsage()));
+            datalist.add(item.getReceivedTotalAmount()==null?"-":df.format(item.getReceivedTotalAmount()));
+            datalist.add(item.getBigUserUsageReceived()==null?"-":df.format(item.getBigUserUsageReceived()));
+            datalist.add(item.getGeneralUserUsageReceived()==null?"-":df.format(item.getGeneralUserUsageReceived()));
             excelResult.add(datalist);
         }
         String filePath = ExcelUtil.writeSimpleExcelWithHeader(baseDir,"营收报表",reportTitle,excelResult);

+ 2 - 1
sms_water/src/main/java/com/huaxu/dao/RevenueMapper.java

@@ -117,7 +117,8 @@ public interface RevenueMapper {
      * 查询某月是否有营收数据
      * @param companyOrgId 机构id
      * @param collectDateString 时间
+     * @param id 主键
      * @return
      */
-    Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString);
+    Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString,Integer id);
 }

+ 1 - 1
sms_water/src/main/java/com/huaxu/dto/MonthRevenueDto.java

@@ -64,6 +64,6 @@ public class MonthRevenueDto extends MonthRevenueEntity {
     private String userType;
 
     @ApiModelProperty(value = "用水性质列表")
-    private List<MonthSellwaterEntity> monthSellList;
+    private List<MonthSellwaterDto> monthSellList;
 
 }

+ 9 - 0
sms_water/src/main/java/com/huaxu/dto/alarm/DataAlarmDto.java

@@ -1,5 +1,6 @@
 package com.huaxu.dto.alarm;
 
+import com.huaxu.common.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -31,4 +32,12 @@ public class DataAlarmDto implements Serializable {
 
     @ApiModelProperty(value = "大小")
     private int pageSize;
+
+    public String getBeginTime(){
+        return StringUtils.isEmpty(beginTime) ? null : beginTime + " 00:00:00";
+    }
+
+    public String getEndTime(){
+        return StringUtils.isEmpty(endTime) ? null : endTime + " 23:59:59";
+    }
 }

+ 6 - 0
sms_water/src/main/java/com/huaxu/quartz/job/MonitorDataReportByDayJob.java

@@ -1,5 +1,7 @@
 package com.huaxu.quartz.job;
 
+import com.huaxu.quartz.service.DataAlarmDayJobService;
+import com.huaxu.quartz.service.DataAlarmHourJobService;
 import com.huaxu.service.MonitorDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
@@ -7,6 +9,7 @@ import org.quartz.JobExecutionContext;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.io.Serializable;
 
 /**
@@ -21,6 +24,8 @@ public  class MonitorDataReportByDayJob implements Job, Serializable {
     @Autowired
     private MonitorDataService monitorDataService;
 
+    @Resource
+    private DataAlarmHourJobService dataAlarmHourJobService;
 
 
     @Override
@@ -28,6 +33,7 @@ public  class MonitorDataReportByDayJob implements Job, Serializable {
         try {
             log.info("日报报任务开始执行");
             monitorDataService.getMonitorDataReportByHour();
+            dataAlarmHourJobService.execute();
             log.info("日报任务执行结束");
         } catch (Exception e) {
             e.printStackTrace();

+ 7 - 0
sms_water/src/main/java/com/huaxu/quartz/job/MonitorDataReportByMonthJob.java

@@ -1,5 +1,7 @@
 package com.huaxu.quartz.job;
 
+import com.huaxu.quartz.service.DataAlarmDayJobService;
+import com.huaxu.quartz.service.DataAlarmMonthJobService;
 import com.huaxu.service.MonitorDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
@@ -8,6 +10,7 @@ import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.io.Serializable;
 
 /**
@@ -23,11 +26,15 @@ public  class MonitorDataReportByMonthJob implements Job, Serializable {
     @Autowired
     private MonitorDataService monitorDataService;
 
+    @Resource
+    private DataAlarmDayJobService dataAlarmDayJobService;
+
     @Override
     public void execute(JobExecutionContext context) throws JobExecutionException {
         try{
             log.info("月报报任务开始执行");
             monitorDataService.getMonitorDataByDay();
+            dataAlarmDayJobService.execute();
             log.info("月报任务执行结束");
         }catch (Exception e){
             e.printStackTrace();

+ 6 - 0
sms_water/src/main/java/com/huaxu/quartz/job/MonitorDataReportByYearJob.java

@@ -1,5 +1,6 @@
 package com.huaxu.quartz.job;
 
+import com.huaxu.quartz.service.DataAlarmMonthJobService;
 import com.huaxu.service.MonitorDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
@@ -8,6 +9,7 @@ import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.io.Serializable;
 
 /**
@@ -23,11 +25,15 @@ public  class MonitorDataReportByYearJob implements Job, Serializable {
     @Autowired
     private MonitorDataService monitorDataService;
 
+    @Resource
+    private DataAlarmMonthJobService dataAlarmMonthJobService;
+
     @Override
     public void execute(JobExecutionContext context) throws JobExecutionException {
         try{
             log.info("年报报任务开始执行");
             monitorDataService.getMonitorDataByMonth();
+            dataAlarmMonthJobService.execute();
             log.info("年报任务执行结束");
         }catch (Exception e){
             e.printStackTrace();

+ 1 - 1
sms_water/src/main/java/com/huaxu/rabbitmq/DataAlarmHandler.java

@@ -32,6 +32,6 @@ public class DataAlarmHandler implements CommandLineRunner {
 
     @Override
     public void run(String... args) throws Exception {
-        monitorDataService.getMonitorDataReportByHour();
+         //monitorDataService.getMonitorDataReportByHour();
     }
 }

+ 2 - 1
sms_water/src/main/java/com/huaxu/service/RevenueService.java

@@ -122,7 +122,8 @@ public interface RevenueService {
      * 查询某月是否有营收数据
      * @param companyOrgId 机构id
      * @param collectDateString 时间
+   * @param id 主键
      * @return
      */
-    Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString);
+    Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString,Integer id);
 }

+ 38 - 3
sms_water/src/main/java/com/huaxu/service/impl/MonitorDataServiceImpl.java

@@ -13,7 +13,13 @@ import com.huaxu.service.MonitorDataService;
 import com.huaxu.util.ByteArrayUtils;
 import com.huaxu.util.DatesUtil;
 import com.huaxu.util.RedisUtil;
+import com.mongodb.BasicDBObject;
+import com.mongodb.Block;
+import com.mongodb.DBCursor;
+import com.mongodb.DBObject;
+import com.mongodb.client.FindIterable;
 import lombok.extern.slf4j.Slf4j;
+import org.bson.Document;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort;
@@ -125,7 +131,7 @@ public class MonitorDataServiceImpl implements MonitorDataService , Initializing
         return monitorDataEntity;
     }
 
-    @Override
+   @Override
     public List<DayReportEntity> getMonitorDataGroupByHour(LocalDateTime dateTime ,List<Integer> deviceIds ){
         if (dateTime == null ){
             return null;
@@ -138,8 +144,6 @@ public class MonitorDataServiceImpl implements MonitorDataService , Initializing
         if(deviceIds!=null && deviceIds.size() > 0){
             criteria.and("deviceId").in(deviceIds);
         }
-        Criteria criteria1 = new Criteria();
-        criteria1.and("dataValues.dataValue").gt(0);
         AggregationOptions aggregationOptions = AggregationOptions.builder().allowDiskUse(true).build();
         Aggregation agg = Aggregation.newAggregation(
                 // 查询条件
@@ -164,6 +168,37 @@ public class MonitorDataServiceImpl implements MonitorDataService , Initializing
         return durationData.getMappedResults();
     }
 
+    /*@Override
+    public List<DayReportEntity> getMonitorDataGroupByHour(LocalDateTime dateTime ,List<Integer> deviceIds ){
+        if (dateTime == null ){
+            return null;
+        }
+        Criteria criteria = new Criteria();
+        criteria.and("year").is(dateTime.getYear());
+        criteria.and("month").is(dateTime.getMonthValue());
+        criteria.and("day").is(dateTime.getDayOfMonth());
+        criteria.and("hour").is(dateTime.getHour());
+        if(deviceIds!=null && deviceIds.size() > 0){
+            criteria.and("deviceId").in(deviceIds);
+        }
+        BasicDBObject query = new BasicDBObject();
+        query.put("year",dateTime.getYear());
+        query.put("month",dateTime.getMonthValue());
+        query.put("day",dateTime.getDayOfMonth());
+        query.put("hour",dateTime.getHour());
+        if (deviceIds != null && deviceIds.size() > 0) {
+            query.put("deviceId",new BasicDBObject("$in", deviceIds));
+        }
+        FindIterable<Document> iter = mongoTemplate.getCollection("SMS_MONITOR_DATA").find(query, Document.class);
+        iter.forEach(new Block<Document>() {
+            @Override
+            public void apply(Document entity) {
+                System.out.println(entity.toJson());
+            }
+        });
+        return null;
+    }*/
+
 
     @Override
     public void getMonitorDataReportByHour(){

+ 2 - 2
sms_water/src/main/java/com/huaxu/service/impl/RevenueServiceImpl.java

@@ -297,7 +297,7 @@ public class RevenueServiceImpl implements RevenueService, InitializingBean {
      * @return
      */
     @Override
-    public  Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString) {
-        return revenueMapper.isExistMonthRevenue(companyOrgId,collectDateString);
+    public  Integer isExistMonthRevenue(Integer companyOrgId,String collectDateString,Integer id) {
+        return revenueMapper.isExistMonthRevenue(companyOrgId,collectDateString,id);
     }
 }

+ 14 - 26
sms_water/src/main/resources/mapper/RevenueMapper.xml

@@ -12,10 +12,11 @@
         <result property="bigUserUsage" column="big_user_usage" jdbcType="VARCHAR"/>
         <result property="generalUserUsageReceived" column="general_user_usage_received" jdbcType="VARCHAR"/>
         <result property="bigUserUsageReceived" column="big_user_usage_received" jdbcType="VARCHAR"/>
-        <collection property="monthSellList" ofType="com.huaxu.entity.MonthSellwaterEntity" javaType="list">
+        <collection property="monthSellList" ofType="com.huaxu.dto.MonthSellwaterDto" javaType="list">
             <result property="id" column="sell_id" jdbcType="INTEGER"/>
             <result property="propertyId" column="property_id" jdbcType="INTEGER"/>
             <result property="waterUsage" column="water_usage" jdbcType="VARCHAR"/>
+            <result property="propertyName" column="property_name" jdbcType="VARCHAR"/>
         </collection>
     </resultMap>
 
@@ -243,9 +244,7 @@
             <if test="meterReadingCount != null">
                 meter_reading_count  = #{meterReadingCount},
             </if>
-            <if test="meterReadingUsage != null">
-                meter_reading_usage  = #{meterReadingUsage},
-            </if>
+            meter_reading_usage  = #{meterReadingUsage},
             <if test="chargingUsage != null">
                 charging_usage  = #{chargingUsage},
             </if>
@@ -258,36 +257,24 @@
             <if test="meterReadingErrorRate != null">
                 meter_reading_error_rate  = #{meterReadingErrorRate},
             </if>
-            <if test="receivableTotalAmount != null">
-                receivable_total_amount  = #{receivableTotalAmount},
-            </if>
-            <if test="receivedTotalAmount != null">
-                received_total_amount  = #{receivedTotalAmount},
-            </if>
+            receivable_total_amount  = #{receivableTotalAmount},
+            received_total_amount  = #{receivedTotalAmount},
             <if test="invoicedTotalAmount != null">
                 invoiced_total_amount  = #{invoicedTotalAmount},
             </if>
             <if test="arrearsTotalAmount != null">
                 arrears_total_amount  = #{arrearsTotalAmount},
             </if>
-            <if test="generalUserUsage != null">
-                general_user_usage  = #{generalUserUsage},
-            </if>
-            <if test="bigUserUsage != null">
-                big_user_usage  = #{bigUserUsage},
-            </if>
+            general_user_usage  = #{generalUserUsage},
+            big_user_usage  = #{bigUserUsage},
             <if test="remark != null">
                 remark  = #{remark},
             </if>
             <if test="updateBy != null">
                 update_by  = #{updateBy},
             </if>
-            <if test="generalUserUsageReceived != null">
-                general_user_usage_received  = #{generalUserUsageReceived},
-            </if>
-            <if test="bigUserUsageReceived != null">
-                big_user_usage_received  = #{bigUserUsageReceived},
-            </if>
+            general_user_usage_received  = #{generalUserUsageReceived},
+            big_user_usage_received  = #{bigUserUsageReceived},
         </set>
         where id  = #{id}
     </update>
@@ -298,9 +285,7 @@
             <if test="collectDate != null">
                 collect_date  = #{collectDate},
             </if>
-            <if test="waterUsage != null">
-                water_usage  = #{waterUsage},
-            </if>
+            water_usage  = #{waterUsage},
             <if test="remark != null">
                 remark  = #{remark},
             </if>
@@ -314,7 +299,7 @@
     <select id="selectList" resultMap="revenueDtoMap">
         select t1.id,date_format(t1.collect_date,'%Y-%m') as collect_date_string,meter_reading_usage*10000 as meter_reading_usage
                ,receivable_total_amount*10000 as receivable_total_amount,received_total_amount*10000 as received_total_amount,big_user_usage*10000 as big_user_usage
-               ,general_user_usage*10000 as general_user_usage,t2.id as property_id,t3.id as sell_id,t3.water_usage*10000 as water_usage
+               ,general_user_usage*10000 as general_user_usage,t2.id as property_id,t3.id as sell_id,t3.water_usage*10000 as water_usage,t2.property_name
                ,general_user_usage_received*10000 as general_user_usage_received,big_user_usage_received*10000 as big_user_usage_received
         from sms_month_revenue t1
         left join sms_water_property t2 on t1.company_org_id=t2.company_org_id and t1.tenant_id=t2.tenant_id and t2.status=1
@@ -329,5 +314,8 @@
         from  sms_month_revenue t1
         where date_format(t1.collect_date, '%Y-%m' ) = #{collectDateString}
             and t1.company_org_Id=#{companyOrgId}
+            <if test="id != null">
+                and id != #{id}
+            </if>
     </select>
 </mapper>