Browse Source

Merge branch '20210223' of http://114.135.61.188:53000/UIMS/Code into 20210223

lihui007 3 years ago
parent
commit
e84ebfa1ee
30 changed files with 1202 additions and 74 deletions
  1. 10 4
      message/src/main/java/com/huaxu/mq/DispatchMessage.java
  2. 2 2
      message/src/main/java/com/huaxu/util/MessagePush.java
  3. 0 3
      operation_manager/src/main/java/com/huaxu/client/UserCenterClient.java
  4. 35 2
      operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java
  5. 3 2
      operation_manager/src/main/resources/application-dev.properties
  6. 3 2
      operation_manager/src/main/resources/application-prd.properties
  7. 5 4
      operation_manager/src/main/resources/application-sit.properties
  8. 10 1
      readme.md
  9. 59 0
      sms_water/src/main/java/com/huaxu/controller/EquipmentStatisticsController.java
  10. 110 0
      sms_water/src/main/java/com/huaxu/controller/RevenueController.java
  11. 79 0
      sms_water/src/main/java/com/huaxu/controller/WaterPropertyController.java
  12. 42 2
      sms_water/src/main/java/com/huaxu/dao/RevenueMapper.java
  13. 17 0
      sms_water/src/main/java/com/huaxu/dao/WaterPropertyMapper.java
  14. 4 0
      sms_water/src/main/java/com/huaxu/dto/MonthRevenueDto.java
  15. 19 0
      sms_water/src/main/java/com/huaxu/dto/QueryDeviceMonitorDto.java
  16. 20 2
      sms_water/src/main/java/com/huaxu/entity/MonthRevenueEntity.java
  17. 77 0
      sms_water/src/main/java/com/huaxu/entity/WaterPropertyEntity.java
  18. 48 4
      sms_water/src/main/java/com/huaxu/service/RevenueService.java
  19. 91 0
      sms_water/src/main/java/com/huaxu/service/WaterPropertyService.java
  20. 36 1
      sms_water/src/main/java/com/huaxu/service/impl/RevenueServiceImpl.java
  21. 3 1
      sms_water/src/main/resources/application-sit.properties
  22. 1 1
      sms_water/src/main/resources/application.properties
  23. 123 3
      sms_water/src/main/resources/mapper/RevenueMapper.xml
  24. 129 11
      user_center/src/main/java/com/huaxu/controller/VerManageController.java
  25. 0 1
      user_center/src/main/java/com/huaxu/dao/UserTagMapper.java
  26. 7 2
      user_center/src/main/java/com/huaxu/dao/VerManageMapper.java
  27. 40 3
      user_center/src/main/java/com/huaxu/entity/VerManageEntity.java
  28. 23 21
      user_center/src/main/java/com/huaxu/service/VerManageService.java
  29. 0 2
      user_center/src/main/resources/mapper/UserRoleMapper.xml
  30. 206 0
      user_center/src/main/resources/mapper/VerManageMapper.xml

+ 10 - 4
message/src/main/java/com/huaxu/mq/DispatchMessage.java

@@ -79,11 +79,10 @@ public class DispatchMessage {
         messageDto.setDate(date);
         List<String> connectInfos = redisUtil.opsForList().range(userConnections, 0, size);
         if(channel==1){
-            List<String>alias=new ArrayList<>();
-            alias.add(receiveMessage.getUserId()+"");
-            MessagePush.sendAlias(receiveMessage.getMessageContent(),alias);
-            //app推送
+            sendAppMsg(receiveMessage.getUserId()+"",receiveMessage.getMessageContent());
+
         }else{
+
             connectInfos.forEach(connectInfo ->{
                 WebsocketConnectInfo websocketConnectInfo =
                         JSONObject.parseObject(connectInfo, WebsocketConnectInfo.class);
@@ -101,4 +100,11 @@ public class DispatchMessage {
         }
 
     }
+    //app推送
+    private void sendAppMsg(String userId,String content){
+        List<String>alias=new ArrayList<>();
+        alias.add(userId);
+        MessagePush.sendAlias(content,alias);
+
+    }
 }

+ 2 - 2
message/src/main/java/com/huaxu/util/MessagePush.java

@@ -19,9 +19,9 @@ import cn.jpush.api.push.model.notification.Notification;
 
 public class MessagePush {
 	
-	private static String appKey = "8b94a0726cd533c79231e524";
+	private static String appKey = "2236e5bfdef11ea5b2f445dd";
 
-	private static String masterSecret = "767651790ef301e33e017244";
+	private static String masterSecret = "2feddd47211d8f2bb2350236";
 
 	/**
 	 * 给所有平台的所有用户发通知

+ 0 - 3
operation_manager/src/main/java/com/huaxu/client/UserCenterClient.java

@@ -4,11 +4,8 @@ import com.huaxu.config.FeignConfig;
 
 import com.huaxu.dict.Dict;
 import com.huaxu.model.AjaxMessage;
-import com.huaxu.model.ResultStatus;
 import com.huaxu.task.entity.UserEntity;
 import com.huaxu.org.Org;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.*;
 

+ 35 - 2
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -8,7 +8,6 @@ import com.huaxu.common.ConvertXY;
 import com.huaxu.common.FileUploadUtil;
 import com.huaxu.common.MyPoint;
 import com.huaxu.entity.Message;
-import com.huaxu.evaluation.service.EvaluationCycleService;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
 import com.huaxu.model.Pagination;
@@ -45,6 +44,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
+import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -84,9 +84,11 @@ public class WorkOrderManageController {
     @Value("${UMIS.sys_video_path}")
     private String videoDir;
 
+    @Value("{UMIS.sys_app_package_path}")
+    private String appPackageDir;
+
     /**select
      * 新增一条数据
-     *
      * @param workOrderManage 实体类
      * @return Response对象
      */
@@ -355,6 +357,37 @@ public class WorkOrderManageController {
         return new AjaxMessage<>(ResultStatus.OK, avatar);
     }
 
+    @ApiOperation(value = "上传APP安装包")
+    @RequestMapping(value = "addAppPackage", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<String> addAppPackage(@ApiParam(value = "上传APP安装包", required = true) @RequestParam("avatarfile") MultipartFile file) {
+        String avatar = "";
+        if (!file.isEmpty()) {
+            try {
+                //上传简单文件名
+                String originalFilename = file.getOriginalFilename();
+                String suffixName = originalFilename.substring(originalFilename.lastIndexOf("."));
+                //存储路径
+                if(!suffixName.toLowerCase().equals(".apk")&&!suffixName.toLowerCase().equals(".ipa")){
+                    return new AjaxMessage<>(ResultStatus.ERROR, "上传文件类型不正确");
+                }
+                long size = file.getSize();
+                if (size >  1024 * 1024 * 200) {
+                    return   new AjaxMessage<>(ResultStatus.ERROR, "文件不能超过200M");
+                }
+                avatar = new StringBuffer(appPackageDir).append(originalFilename).toString();
+                File dest = new File(avatar);
+                if(!dest.getParentFile().exists()){
+                    dest.getParentFile().mkdirs();
+                }
+                file.transferTo(new File(avatar));
+            } catch (IOException e) {
+                return new AjaxMessage<>(ResultStatus.ERROR, e.getMessage());
+            }
+        }
+        return new AjaxMessage<>(ResultStatus.OK, avatar);
+    }
+
     @GetMapping("/event/select")
     @ApiOperation(value = "查询事件隐患/所有工单")
     public AjaxMessage<Pagination<WorkOrderManageDto>> selectEvent(

+ 3 - 2
operation_manager/src/main/resources/application-dev.properties

@@ -44,8 +44,8 @@ security.oauth2.resource.user-info-uri=http://localhost:8321/user/principal
 security.oauth2.resource.prefer-token-info=false
 
 
-spring.servlet.multipart.max-file-size=100MB
-spring.servlet.multipart.max-request-size=100MB
+spring.servlet.multipart.max-file-size=200MB
+spring.servlet.multipart.max-request-size=200MB
 spring.servlet.multipart.location=${logging.path}/data
 
 #kafka server
@@ -84,6 +84,7 @@ spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
 UMIS.sys_config_path=/UMIS_USER_IMAGES/
 UMIS.sys_excel_path=/UMIS_USER_EXCEL/
 UMIS.sys_video_path=/UMIS_USER_VIDEOS/
+UMIS.sys_app_package_path=/UMIS_USER_APP_PACKAGE/
 wf.svg.file.path=D:/test/
 
 #=====================ÐÂÔö²ÎÊýÏ̳߳ØÅäÖÃ

+ 3 - 2
operation_manager/src/main/resources/application-prd.properties

@@ -44,8 +44,8 @@ security.oauth2.resource.user-info-uri=http://localhost:8321/user/principal
 security.oauth2.resource.prefer-token-info=false
 
 
-spring.servlet.multipart.max-file-size=100MB
-spring.servlet.multipart.max-request-size=100MB
+spring.servlet.multipart.max-file-size=200MB
+spring.servlet.multipart.max-request-size=200MB
 spring.servlet.multipart.location=${logging.path}/data
 
 #kafka server
@@ -85,6 +85,7 @@ spring.cloud.nacos.discovery.server-addr=10.0.0.136:8848
 UMIS.sys_config_path=/UMIS_USER_IMAGES/
 UMIS.sys_excel_path=/UMIS_USER_EXCEL/
 UMIS.sys_video_path=/UMIS_USER_VIDEOS/
+UMIS.sys_app_package_path=/UMIS_USER_APP_PACKAGE/
 wf.svg.file.path=D:/test/
 
 # 设置 feign 客户端超时时间(OpenFeign 默认支持 ribbon)

+ 5 - 4
operation_manager/src/main/resources/application-sit.properties

@@ -44,8 +44,8 @@ security.oauth2.resource.user-info-uri=http://localhost:8321/user/principal
 security.oauth2.resource.prefer-token-info=false
 
 
-spring.servlet.multipart.max-file-size=100MB
-spring.servlet.multipart.max-request-size=100MB
+spring.servlet.multipart.max-file-size=200MB
+spring.servlet.multipart.max-request-size=200MB
 spring.servlet.multipart.location=${logging.path}/data
 
 #kafka server
@@ -82,8 +82,9 @@ dispath.queue=dispathTest1
 #nacos
 spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
 UMIS.sys_config_path=/UMIS_USER_IMAGES/
-UMIS.sys_excel_path=/UMIS_USER_EXCEL/
-UMIS.sys_video_path=/UMIS_USER_VIDEOS/
+UMIS.sys_excel_path=/UMIS_USER_EXCEL
+UMIS.sys_video_path=/UMIS_USER_VIDEOS//
+UMIS.sys_app_package_path=/UMIS_USER_APP_PACKAGE/
 wf.svg.file.path=D:/test/
 
 # 设置 feign 客户端超时时间(OpenFeign 默认支持 ribbon)

+ 10 - 1
readme.md

@@ -246,4 +246,13 @@ CREATE TABLE `uims_ver_manage` (
   PRIMARY KEY (`ID`)
 ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci COMMENT='APP版本表';
 
-=========已升级到正式环境20210527==================================================================================
+
+
+
+=========已升级到正式环境20210527==================================================================================
+## sms 调度数据库
+ALTER TABLE sms_water_property ADD TENANT_ID varchar(100) null COMMENT '租户标识'
+,ADD COMPANY_ORG_ID varchar(11) null COMMENT '所属公司'
+,ADD STATUS smallint(6) null COMMENT '数据删除标记';
+ALTER TABLE sms_month_revenue ADD GENERAL_USER_USAGE_RECEIVED decimal(18,4) null COMMENT '普通用户实收金额',
+ADD BIG_USER_USAGE_RECEIVED decimal(18,4) null COMMENT '大用户实收金额' ;

+ 59 - 0
sms_water/src/main/java/com/huaxu/controller/EquipmentStatisticsController.java

@@ -0,0 +1,59 @@
+package com.huaxu.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.huaxu.dto.QueryDeviceMonitorDto;
+import com.huaxu.entity.DeviceParmEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.util.UserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+
+@RestController
+@RequestMapping("/equipmentStatistics")
+public class EquipmentStatisticsController {
+    @Autowired
+    RestTemplate restTemplate;
+    @Value("${get_map_info_url}")
+    private String getMapInfoUrl;
+    @Value("${get_device_url}")
+    private String getDeviceUrl;
+    @GetMapping("/getTheMapInformationOfTheDevice")
+   private AjaxMessage getTheMapInformationOfTheDevice(QueryDeviceMonitorDto queryDeviceMonitorDto){
+        queryDeviceMonitorDto.setTenantId(UserUtil.getCurrentUser().getTenantId());
+        return new AjaxMessage<>(ResultStatus.OK, JSON.parse(sendApiReQuest(getMapInfoUrl,JSON.toJSONString(queryDeviceMonitorDto))));
+   }
+    @GetMapping("/getDeviceListInformation")
+    private AjaxMessage getDeviceListInformation(QueryDeviceMonitorDto queryDeviceMonitorDto){
+        queryDeviceMonitorDto.setTenantId(UserUtil.getCurrentUser().getTenantId());
+        String result=sendApiReQuest(getDeviceUrl,JSON.toJSONString(queryDeviceMonitorDto));
+        JSONObject info = JSON.parseObject(result);
+        if(info.getInteger("total")==0){
+            info.put("list",new ArrayList<>());
+        }
+        return new AjaxMessage<>(ResultStatus.OK, info);
+    }
+    private  String sendApiReQuest(String path , String args){
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<>(args, headers);
+        ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(path, formEntity,
+                String.class);
+        JSONObject info = JSON.parseObject(stringResponseEntity.getBody());
+        String result=null;
+        if(info.getInteger("status")==0){
+            result=info.getString("data");
+        }
+        return result;
+    }
+}

+ 110 - 0
sms_water/src/main/java/com/huaxu/controller/RevenueController.java

@@ -6,6 +6,7 @@ import com.huaxu.common.StringUtils;
 import com.huaxu.dto.*;
 import com.huaxu.entity.AlarmSetting;
 import com.huaxu.entity.MonthRevenueEntity;
+import com.huaxu.entity.MonthSellwaterEntity;
 import com.huaxu.entity.SceneEntity;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
@@ -107,11 +108,120 @@ public class RevenueController {
         }
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
+    /**
+     * 同步水表数量
+     *
+     * @return
+     */
     @RequestMapping(value = "syncMeterCount", method = RequestMethod.GET)
     @ApiOperation(value = "同步水表数量")
     public AjaxMessage<Integer> syncMeterCount() {
         revenueService.syncMeterCount();
         return new AjaxMessage<>(ResultStatus.OK);
     }
+    /**
+     * 新增营收数据
+     *
+     * @return
+     */
+    @RequestMapping(value = "addRevenue", method = RequestMethod.POST)
+    @ApiOperation(value = "新增营收数据")
+    public AjaxMessage<Integer> addRevenue(
+            @ApiParam(value = "营收数据", required = true) @RequestBody MonthRevenueDto monthRevenueDto) {
+        try{
+            LoginUser loginUser = UserUtil.getCurrentUser();
+            //插入营收数据
+            monthRevenueDto.setCreateBy(loginUser.getUsername());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            monthRevenueDto.setCollectDate(sdf.parse(monthRevenueDto.getCollectDateString()));
+            monthRevenueDto.setTenantId(loginUser.getTenantId());
+            convertWRevenue(monthRevenueDto);
+            revenueService.insert(monthRevenueDto);
+            //插入售水数据
+            for (MonthSellwaterEntity entity : monthRevenueDto.getMonthSellList()) {
+                entity.setTenantId(loginUser.getTenantId());
+                entity.setCreateBy(loginUser.getUsername());
+                entity.setCompanyOrgId(monthRevenueDto.getCompanyOrgId());
+                entity.setCollectDate(monthRevenueDto.getCollectDate());
+                if(entity.getWaterUsage() != null){
+                    entity.setWaterUsage(entity.getWaterUsage()/10000);
+                }
+                revenueService.insertSellWater(entity);
+            }
+            return new AjaxMessage<>(ResultStatus.OK);
+        }catch (Exception e){
+            return new AjaxMessage<>(ResultStatus.ERROR);
+        }
 
+    }
+    /**
+     * 修改营收数据
+     *
+     * @return
+     */
+    @RequestMapping(value = "updateRevenue", method = RequestMethod.POST)
+    @ApiOperation(value = "修改营收数据")
+    public AjaxMessage<Integer> updateRevenue(
+            @ApiParam(value = "营收数据", required = true) @RequestBody MonthRevenueDto monthRevenueDto) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        //修改营收数据
+        monthRevenueDto.setUpdateBy(loginUser.getUsername());
+        convertWRevenue(monthRevenueDto);
+        revenueService.updateRevenue(monthRevenueDto);
+        //修改售水数据
+        for (MonthSellwaterEntity entity : monthRevenueDto.getMonthSellList()) {
+            entity.setUpdateBy(loginUser.getUsername());
+            if(entity.getWaterUsage() != null){
+                entity.setWaterUsage(entity.getWaterUsage()/10000);
+            }
+            if(entity.getId() == null){
+                revenueService.insertSellWater(entity);
+            }else{
+                revenueService.updateSellWater(entity);
+            }
+        }
+        return new AjaxMessage<>(ResultStatus.OK);
+    }
+    /**
+     * 将营收数据转换成万
+     *
+     */
+    public void convertWRevenue(MonthRevenueDto monthRevenueDto){
+        if(monthRevenueDto.getBigUserUsage() != null){
+            monthRevenueDto.setBigUserUsage(monthRevenueDto.getBigUserUsage()/10000);
+        }
+        if(monthRevenueDto.getGeneralUserUsage() != null){
+            monthRevenueDto.setGeneralUserUsage(monthRevenueDto.getGeneralUserUsage()/10000);
+        }
+        if(monthRevenueDto.getReceivableTotalAmount() != null){
+            monthRevenueDto.setReceivableTotalAmount(monthRevenueDto.getReceivableTotalAmount()/10000);
+        }
+        if(monthRevenueDto.getBigUserUsageReceived() != null){
+            monthRevenueDto.setBigUserUsageReceived(monthRevenueDto.getBigUserUsageReceived()/10000);
+        }
+        if(monthRevenueDto.getGeneralUserUsageReceived() != null){
+            monthRevenueDto.setGeneralUserUsageReceived(monthRevenueDto.getGeneralUserUsageReceived()/10000);
+        }
+        if(monthRevenueDto.getReceivedTotalAmount() != null){
+            monthRevenueDto.setReceivedTotalAmount(monthRevenueDto.getReceivedTotalAmount()/10000);
+        }
+    }
+    /**
+     * 查询营收数据列表
+     *
+     * @return
+     */
+    @RequestMapping(value = "selectList", method = RequestMethod.GET)
+    @ApiOperation(value = "查询营收数据列表")
+    public AjaxMessage<List<MonthRevenueDto>> selectList(
+            @ApiParam(value = "公司机构id", required = true)@RequestParam Integer companyOrgId,
+            @ApiParam(value = "开始日期(yyyy-MM)", required = true)@RequestParam String startDate,
+            @ApiParam(value = "结束日期(yyyy-MM)", required = true)@RequestParam String endDate) {
+        MonthRevenueDto monthRevenueDto=new MonthRevenueDto();
+        monthRevenueDto.setCompanyOrgId(companyOrgId);
+        monthRevenueDto.setStartDate(startDate);
+        monthRevenueDto.setEndDate(endDate);
+        List<MonthRevenueDto> result = revenueService.selectList(monthRevenueDto);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
 }

+ 79 - 0
sms_water/src/main/java/com/huaxu/controller/WaterPropertyController.java

@@ -0,0 +1,79 @@
+package com.huaxu.controller;
+
+
+import com.huaxu.entity.WaterPropertyEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.LoginUser;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.WaterPropertyService;
+import com.huaxu.util.UserUtil;
+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.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用水性质控制层
+ *
+ * @author yjy
+ * @since 2021-5-31
+ */
+@RestController
+@RequestMapping("/waterProperty")
+@Api(tags = "用水性质")
+public class WaterPropertyController {
+    /**
+     * 服务对象
+     */
+    @Autowired
+    private WaterPropertyService waterPropertyService;
+
+    @RequestMapping(value = "insert", method = RequestMethod.POST)
+    @ApiOperation(value = "增加用水性质信息")
+    public AjaxMessage<Boolean> insert(@ApiParam(value = "用水性质", required = true) @RequestBody WaterPropertyEntity waterPropertyEntity) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        waterPropertyEntity.setTenantId(currentUser.getTenantId());
+        waterPropertyEntity.setCreateBy(currentUser.getUsername());
+        waterPropertyEntity.setStatus(1);
+        return new AjaxMessage<>(ResultStatus.OK, waterPropertyService.insert(waterPropertyEntity));
+    }
+
+    @RequestMapping(value = "delete", method = RequestMethod.GET)
+    @ApiOperation(value = "删除用水性质信息")
+    public AjaxMessage<Boolean> delete(@ApiParam(value = "用水性质id", required = true) @RequestParam Integer id) {
+        return new AjaxMessage<>(ResultStatus.OK, waterPropertyService.delete(id));
+    }
+
+    @RequestMapping(value = "update", method = RequestMethod.POST)
+    @ApiOperation(value = "修改用水性质信息")
+    public AjaxMessage<Boolean> update(@ApiParam(value = "用水性质", required = true) @RequestBody WaterPropertyEntity waterPropertyEntity) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        waterPropertyEntity.setUpdateBy(currentUser.getUsername());
+        return new AjaxMessage<>(ResultStatus.OK, waterPropertyService.update(waterPropertyEntity));
+    }
+
+    @RequestMapping(value = "select", method = RequestMethod.GET)
+    @ApiOperation(value = "查询用水性质信息")
+    public AjaxMessage<List<WaterPropertyEntity>> select(@ApiParam(value = "所属公司id", required = true) @RequestParam Integer companyOrgId) {
+        if(companyOrgId==null){
+            LoginUser currentUser = UserUtil.getCurrentUser();
+            companyOrgId=currentUser.getCompanyId();
+        }
+        return new AjaxMessage<>(ResultStatus.OK, waterPropertyService.select(companyOrgId));
+    }
+
+    @RequestMapping(value = "save", method = RequestMethod.POST)
+    @ApiOperation(value = "批量保存用水性质列表")
+    public AjaxMessage<Boolean> insert(@ApiParam(value = "用水性质列表", required = true) @RequestBody List<WaterPropertyEntity> waterPropertyList) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        for(WaterPropertyEntity waterPropertyEntity:waterPropertyList){
+            waterPropertyEntity.setTenantId(currentUser.getTenantId());
+            waterPropertyEntity.setCreateBy(currentUser.getUsername());
+            waterPropertyEntity.setStatus(1);
+        }
+        return new AjaxMessage<>(ResultStatus.OK, waterPropertyService.save(waterPropertyList));
+    }
+}

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.huaxu.dto.*;
 import com.huaxu.entity.AlarmDetailsEntity;
 import com.huaxu.entity.MonthRevenueEntity;
+import com.huaxu.entity.MonthSellwaterEntity;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -12,7 +13,7 @@ import java.util.List;
 
 /**
  * @description
- * @auto yjy
+ * @author yjy
  * @data 2021-2-24
  */
 @Mapper
@@ -20,58 +21,97 @@ public interface RevenueMapper {
 
     /**
      * 查询本月售水信息
+     * @param monthSellwaterDto 售水信息
      * @return
      */
     List<MonthSellwaterDto> selectMonthSell(MonthSellwaterDto monthSellwaterDto);
 
     /**
      * 查询近6个月的售水量
+     * @param monthSellwaterDto 售水信息
      * @return
      */
     List<MonthSellwaterDto> selectMonthSellTotal(MonthSellwaterDto monthSellwaterDto);
 
     /**
      * 查询近几个月的月营收情况
+     * @param monthRevenueDto 营收信息
      * @return
      */
     List<MonthRevenueDto> selectMonthRevenue(MonthRevenueDto monthRevenueDto);
 
     /**
      * 查询本月各分公司的营收情况
+     * @param monthRevenueDto 营收信息
      * @return
      */
     List<MonthRevenueDto> selectCompanyRevenue(MonthRevenueDto monthRevenueDto);
 
     /**
      * 查询App总览售水数据
+     * @param monthRevenueDto 营收信息
+     * @return
      */
     List<MonthRevenueDto> selectOverviewRevenue(MonthRevenueDto monthRevenueDto);
 
-
+    /**
+     * 查询App总览售水环比
+     * @param monthRevenueDto 营收信息
+     * @return
+     */
     List<MonthRevenueDto> selectRevenueByDate(MonthRevenueDto monthRevenueDto);
 
     /**
      * 查询是否当月有营收数据
+     * @param tenantId 租户id
      * @return
      */
     Integer isExistThisMonthRevenue(String tenantId);
 
     /**
      * 插入营收数据
+     * @param monthRevenueEntity 营收数据
      * @return
      */
     Integer insert(MonthRevenueEntity monthRevenueEntity);
 
     /**
      * 修改营收数据
+     * @param monthRevenueEntity 营收数据
      * @return
      */
     Integer update(MonthRevenueEntity monthRevenueEntity);
 
     /**
      * 查询该租户一级公司id
+     * @param tenantId 租户id
      * @return
      */
     Integer selectCompanyIdByTenant(String tenantId);
 
+    /**
+     * 插入售水数据
+     * @param monthSellwaterEntity 售水信息
+     * @return
+     */
+    Integer insertSellWater(MonthSellwaterEntity monthSellwaterEntity);
+    /**
+     * 修改售水数据
+     * @param monthSellwaterEntity 售水信息
+     * @return
+     */
+    Integer updateSellWater(MonthSellwaterEntity monthSellwaterEntity);
+    /**
+     * 修改营业数据
+     * @param monthRevenueEntity 营业信息
+     * @return
+     */
+    Integer updateRevenue(MonthRevenueEntity monthRevenueEntity);
+    /**
+     * 查询月营收情况
+     * @param monthRevenueDto 营业信息查询条件
+     * @return
+     */
+    List<MonthRevenueDto> selectList(MonthRevenueDto monthRevenueDto);
+
 }

+ 17 - 0
sms_water/src/main/java/com/huaxu/dao/WaterPropertyMapper.java

@@ -0,0 +1,17 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huaxu.entity.WaterPropertyEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ *
+ * 用水性质设置Dao接口
+ *
+ * @author yjy
+ * @since 2021-5-31
+ */
+@Mapper
+public interface WaterPropertyMapper extends BaseMapper<WaterPropertyEntity> {
+
+}

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

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.huaxu.common.converter.Double1Serializer;
 import com.huaxu.entity.MonthRevenueEntity;
+import com.huaxu.entity.MonthSellwaterEntity;
 import com.huaxu.model.ProgramItem;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -62,4 +63,7 @@ public class MonthRevenueDto extends MonthRevenueEntity {
     @JsonIgnore
     private String userType;
 
+    @ApiModelProperty(value = "用水性质列表")
+    private List<MonthSellwaterEntity> monthSellList;
+
 }

+ 19 - 0
sms_water/src/main/java/com/huaxu/dto/QueryDeviceMonitorDto.java

@@ -0,0 +1,19 @@
+package com.huaxu.dto;
+
+import lombok.Data;
+
+@Data
+public class QueryDeviceMonitorDto {
+    private Integer type;
+    private Integer province;
+    private Integer city;
+    private Integer region;
+    private Integer community;
+    private Integer buildingId;
+    private String keywords;
+    private String tenantId;
+    private Integer page;
+    private Integer size;
+    private String northEast;
+    private String southWest;
+}

+ 20 - 2
sms_water/src/main/java/com/huaxu/entity/MonthRevenueEntity.java

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.huaxu.common.converter.Double1Serializer;
+import com.huaxu.common.converter.Double3Serializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -46,9 +49,11 @@ public class MonthRevenueEntity implements Serializable {
     private Integer meterReadingCount;
 
     @ApiModelProperty(value = "抄表总水量")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double meterReadingUsage;
 
     @ApiModelProperty(value = "计费总水量")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double chargingUsage;
 
     @ApiModelProperty(value = "抄表完成率")
@@ -64,20 +69,33 @@ public class MonthRevenueEntity implements Serializable {
     private Double receivableTotalAmount;
 
     @ApiModelProperty(value = "实收总金额")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double receivedTotalAmount;
 
     @ApiModelProperty(value = "开票总金额")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double invoicedTotalAmount;
 
     @ApiModelProperty(value = "欠费总金额")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double arrearsTotalAmount;
 
-    @ApiModelProperty(value = "普通客户用水")
+    @ApiModelProperty(value = "普通客户应收金额")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double generalUserUsage;
 
-    @ApiModelProperty(value = "大客户用水")
+    @ApiModelProperty(value = "大客户应收金额")
+    @JsonSerialize(using = Double3Serializer.class)
     private Double bigUserUsage;
 
+    @ApiModelProperty(value = "普通客户实收金额")
+    @JsonSerialize(using = Double3Serializer.class)
+    private Double generalUserUsageReceived;
+
+    @ApiModelProperty(value = "大客户实收金额")
+    @JsonSerialize(using = Double3Serializer.class)
+    private Double bigUserUsageReceived;
+
     @ApiModelProperty(value = "备注")
     private String remark;
 

+ 77 - 0
sms_water/src/main/java/com/huaxu/entity/WaterPropertyEntity.java

@@ -0,0 +1,77 @@
+package com.huaxu.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用水性质(sms_water_property)实体类
+ *
+ * @author yjy
+ * @since 2021-5-31
+ */
+@Data
+@ApiModel
+@TableName("sms_water_property")
+public class WaterPropertyEntity implements Serializable {
+    private static final long serialVersionUID = 460807634914426955L;
+    /**
+     * 主键
+     */
+    @ApiModelProperty(value = "主键")
+    @TableId(type= IdType.AUTO)
+    private Integer id;
+    /**
+     * 租户标识
+     */
+    @ApiModelProperty(value = "租户标识")
+    private String tenantId;
+    /**
+     * 所属公司
+     */
+    @ApiModelProperty(value = "所属公司")
+    private Long companyOrgId;
+    /**
+     * 用水性质
+     */
+    @ApiModelProperty(value = "用水性质")
+    private String propertyName;
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+    /**
+     * 数据删除标识
+     */
+    @ApiModelProperty(value = "数据删除标识")
+    @TableLogic
+    private Integer status;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date dateCreate;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date dateUpdate;
+}

+ 48 - 4
sms_water/src/main/java/com/huaxu/service/RevenueService.java

@@ -4,30 +4,35 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.huaxu.dto.*;
 import com.huaxu.entity.AlarmDetailsEntity;
 import com.huaxu.entity.MonthRevenueEntity;
+import com.huaxu.entity.MonthSellwaterEntity;
 
 import java.util.List;
 
 /**
+ * @author yjy
  * @description
- * @auto yjy
  * @data 2021-2-24
  */
 public interface RevenueService {
 
     /**
      * 查询本月售水信息
+     * @param companyOrgId 公司id
      * @return
      */
     List<MonthSellwaterDto> selectMonthSell(Integer companyOrgId);
 
     /**
      * 查询近6个月总售水量
+     * @param companyOrgId 公司id
      * @return
      */
     List<MonthSellwaterDto> selectMonthSellTotal(Integer companyOrgId);
 
     /**
      * 查询月营收情况
+     * @param companyOrgId 公司id
+     * @param months 几个月
      * @return
      */
     List<MonthRevenueDto> selectMonthRevenue(Integer companyOrgId,Integer months);
@@ -38,31 +43,45 @@ public interface RevenueService {
      */
     List<MonthRevenueDto> selectCompanyRevenue();
 
-
-    //查询App总览售水数据
+    /**
+     * 查询App总览售水数据
+     * @param companyOrgId 公司id
+     * @param months 几个月
+     * @return
+     */
     List<MonthRevenueDto> selectOverviewRevenue(Integer companyOrgId,Integer months);
 
-    //查询App总览售水环比
+    /**
+     * 查询App总览售水环比
+     * @param companyOrgId 公司id
+     * @param startDate 开始时间
+     * @param endDate 结束时间
+     * @return
+     */
     List<MonthRevenueDto> selectRevenueByDate(Integer companyOrgId, String startDate, String endDate);
 
     /**
      * 查询是否当月有营收数据
+     * @param tenantId 租户id
      * @return
      */
     Integer isExistThisMonthRevenue(String tenantId);
 
     /**
      * 插入营收数据
+   * @param monthRevenueEntity 营收数据
      * @return
      */
     Integer insert(MonthRevenueEntity monthRevenueEntity);
     /**
      * 修改营收数据
+     * @param monthRevenueEntity 营收数据
      * @return
      */
     Integer update(MonthRevenueEntity monthRevenueEntity);
     /**
      * 查询该租户一级公司id
+     * @param tenantId 租户id
      * @return
      */
     Integer selectCompanyIdByTenant(String tenantId);
@@ -72,5 +91,30 @@ public interface RevenueService {
      */
     void syncMeterCount();
 
+    /**
+     * 插入售水数据
+     * @param monthSellwaterEntity 售水信息
+     * @return
+     */
+    Integer insertSellWater(MonthSellwaterEntity monthSellwaterEntity);
+    /**
+     * 修改售水数据
+     * @param monthSellwaterEntity 售水信息
+     * @return
+     */
+    Integer updateSellWater(MonthSellwaterEntity monthSellwaterEntity);
+
+    /**
+     * 修改营业数据
+     * @param monthRevenueEntity 营业信息
+     * @return
+     */
+    Integer updateRevenue(MonthRevenueEntity monthRevenueEntity);
 
+    /**
+     * 查询月营收情况
+     * @param monthRevenueDto 营业信息查询条件
+     * @return
+     */
+    List<MonthRevenueDto> selectList(MonthRevenueDto monthRevenueDto);
 }

+ 91 - 0
sms_water/src/main/java/com/huaxu/service/WaterPropertyService.java

@@ -0,0 +1,91 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaxu.dao.WaterPropertyMapper;
+import com.huaxu.dto.OnlineDataDto;
+import com.huaxu.entity.WaterPropertyEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 用水性质服务接口
+ *
+ * @author yjy
+ * @since 2021-5-31
+ */
+@Service
+public class WaterPropertyService extends ServiceImpl<WaterPropertyMapper, WaterPropertyEntity> {
+
+    /**
+     * 增加数据
+     *
+     * @param waterPropertyEntity
+     * @return
+     * */
+    public boolean insert(WaterPropertyEntity waterPropertyEntity) {
+        return this.save(waterPropertyEntity);
+    }
+    /**
+     * 删除数据
+     *
+     * @param id
+     * @return
+     * */
+    public boolean delete(Integer id) {
+        return this.removeById(id);
+    }
+    /**
+     * 修改数据
+     *
+     * @param waterPropertyEntity
+     * @return
+     * */
+    public boolean update(WaterPropertyEntity waterPropertyEntity) {
+        return this.updateById(waterPropertyEntity);
+    }
+    /**
+     * 查询数据
+     *
+     * @param companyOrgId
+     * @return
+     * */
+    public List<WaterPropertyEntity> select(Integer companyOrgId) {
+        return this.list(new QueryWrapper<WaterPropertyEntity>().eq("COMPANY_ORG_ID", companyOrgId));
+    }
+    /**
+     * 保存数据
+     *
+     * @param waterPropertyList
+     * @return
+     * */
+    public boolean save(List<WaterPropertyEntity> waterPropertyList) {
+        boolean flag=true;
+        try {
+            if(waterPropertyList.size()>0){
+                //删除多余的数据
+                List<WaterPropertyEntity> oldList=this.list(new QueryWrapper<WaterPropertyEntity>()
+                        .eq("COMPANY_ORG_ID", waterPropertyList.get(0).getCompanyOrgId()));
+                List<Integer> newIdList=waterPropertyList.stream().map(WaterPropertyEntity::getId).collect(Collectors.toList());
+                List<Integer> removeIds=new ArrayList<>();
+                //原来数据中id 没有 现在的id的 为要删除的数据
+                for(WaterPropertyEntity entity : oldList){
+                    if(!newIdList.contains(entity.getId())){
+                        removeIds.add(entity.getId());
+                    }
+                }
+                if(removeIds.size()>0){
+                    flag=this.removeByIds(removeIds);
+                }
+                //新增和修改数据
+                flag=this.saveOrUpdateBatch(waterPropertyList);
+            }
+        }catch (Exception e){
+            flag=false;
+        }
+        return flag;
+    }
+}

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

@@ -3,6 +3,7 @@ package com.huaxu.service.impl;
 import com.huaxu.dao.RevenueMapper;
 import com.huaxu.dto.*;
 import com.huaxu.entity.MonthRevenueEntity;
+import com.huaxu.entity.MonthSellwaterEntity;
 import com.huaxu.model.LoginUser;
 import com.huaxu.quartz.entity.QuartzEntity;
 import com.huaxu.quartz.job.SyncMeterCountJob;
@@ -21,7 +22,7 @@ import java.util.*;
 
 /**
  * @description
- * @auto yjy
+ * @author yjy
  * @data 2021-2-24
  */
 @Service
@@ -257,4 +258,38 @@ public class RevenueServiceImpl implements RevenueService, InitializingBean {
             }
         }
     }
+
+    /**
+     * 插入售水数据
+     * @return
+     */
+    @Override
+    public  Integer insertSellWater(MonthSellwaterEntity monthSellwaterEntity) {
+        return revenueMapper.insertSellWater(monthSellwaterEntity);
+    }
+    /**
+     * 修改售水数据
+     * @return
+     */
+    @Override
+    public  Integer updateSellWater(MonthSellwaterEntity monthSellwaterEntity) {
+        return revenueMapper.updateSellWater(monthSellwaterEntity);
+    }
+    /**
+     * 修改营业数据
+     * @return
+     */
+    @Override
+    public  Integer updateRevenue(MonthRevenueEntity monthRevenueEntity) {
+        return revenueMapper.updateRevenue(monthRevenueEntity);
+    }
+    /**
+     * 查询月营收情况
+     * @param monthRevenueDto 营业信息查询条件
+     * @return
+     */
+    @Override
+    public List<MonthRevenueDto> selectList(MonthRevenueDto monthRevenueDto){
+        return revenueMapper.selectList(monthRevenueDto);
+    }
 }

+ 3 - 1
sms_water/src/main/resources/application-sit.properties

@@ -163,4 +163,6 @@ aysnc.queue-capacity=100000
 #线程名称前缀
 aysnc.thread-name-prefix=aysnc-thread-
 #指令下发调用接口地址
-send.setsetup.url=http://114.135.61.188:48322/center/command/send
+send.setsetup.url=http://114.135.61.188:48322/center/command/send
+get_map_info_url=http://114.135.61.188:58080/api/platform/getTheMapInformationOfTheDevice
+get_device_url=http://114.135.61.188:58080/api/platform/getDeviceListInformation

+ 1 - 1
sms_water/src/main/resources/application.properties

@@ -1,2 +1,2 @@
 #开发环境:dev  测试环境:sit  线上环境:prd
-spring.profiles.active=dev
+spring.profiles.active=sit

+ 123 - 3
sms_water/src/main/resources/mapper/RevenueMapper.xml

@@ -1,6 +1,24 @@
 <?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.huaxu.dao.RevenueMapper">
+    <!-- 结果集 -->
+    <resultMap type="com.huaxu.dto.MonthRevenueDto" id="revenueDtoMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="collectDateString" column="collect_date_string" jdbcType="VARCHAR"/>
+        <result property="receivableTotalAmount" column="receivable_total_amount" jdbcType="VARCHAR"/>
+        <result property="receivedTotalAmount" column="received_total_amount" jdbcType="VARCHAR"/>
+        <result property="meterReadingUsage" column="meter_reading_usage" jdbcType="VARCHAR"/>
+        <result property="generalUserUsage" column="general_user_usage" jdbcType="VARCHAR"/>
+        <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">
+            <result property="id" column="sell_id" jdbcType="INTEGER"/>
+            <result property="propertyId" column="property_id" jdbcType="INTEGER"/>
+            <result property="waterUsage" column="water_usage" jdbcType="VARCHAR"/>
+        </collection>
+    </resultMap>
+
     <!--查询本月售水信息-->
     <select id="selectMonthSell" resultType="com.huaxu.dto.MonthSellwaterDto">
         select t2.property_name ,sum(t1.water_usage) water_usage
@@ -177,11 +195,12 @@
         insert into sms_month_revenue(`tenant_id`, `company_org_id`, `collect_date`, `user_meter_count`, `user_meter_add_count`,
         `meter_reading_count`, `meter_reading_usage`, `charging_usage`, `meter_reading_finished_rate`, `meter_reading_arrival_rate`,
         `meter_reading_error_rate`, `receivable_total_amount`, `received_total_amount`, `invoiced_total_amount`,
-        `arrears_total_amount`, `general_user_usage`, `big_user_usage`, `remark`, `date_create`, `create_by`, `date_update`, `update_by`)
+        `arrears_total_amount`, `general_user_usage`, `big_user_usage`, `remark`, `date_create`, `create_by`, `date_update`, `update_by`,
+        `general_user_usage_received`, `big_user_usage_received`)
         values (#{tenantId},#{companyOrgId},#{collectDate},#{userMeterCount},#{userMeterAddCount},#{meterReadingCount},
         #{meterReadingUsage},#{chargingUsage},#{meterReadingFinishedRate},#{meterReadingArrivalRate},#{meterReadingErrorRate},
         #{receivableTotalAmount},#{receivedTotalAmount},#{invoicedTotalAmount},#{arrearsTotalAmount},#{generalUserUsage},
-        #{bigUserUsage},#{remark},now(),null,now(),null)
+        #{bigUserUsage},#{remark},now(),null,now(),null,#{generalUserUsageReceived},#{bigUserUsageReceived})
     </insert>
     <!-- 通过租户id修改当月数据 -->
     <update id="update">
@@ -193,7 +212,7 @@
             <if test="userMeterAddCount != null and userMeterAddCount != 0">
                 user_meter_add_count  = #{userMeterAddCount},
             </if>
-            DATE_UPDATE  = now()
+            date_update  = now()
         </set>
         where tenant_id  = #{tenantId} and collect_date>=date_format(curdate(), '%Y-%m-1' )
     </update>
@@ -203,4 +222,105 @@
         from  uims.uims_org
         where parent_org_id=0 and tenant_id=#{tenantId}
     </select>
+    <!-- 新增售水信息-->
+    <insert id="insertSellWater">
+        insert into sms_month_sellwater (tenant_id,company_org_id,property_id,collect_date,water_usage,remark,create_by)
+        values(#{tenantId}, #{companyOrgId}, #{propertyId}, #{collectDate}, #{waterUsage},#{remark},#{createBy})
+    </insert>
+    <!-- 通过id修改营收数据 -->
+    <update id="updateRevenue">
+        update  sms_month_revenue
+        <set>
+            <if test="collectDate != null">
+                collect_date  = #{collectDate},
+            </if>
+            <if test="userMeterAddCount != null">
+                user_meter_add_count  = #{userMeterAddCount},
+            </if>
+            <if test="userMeterCount != null">
+                user_meter_count  = #{userMeterCount},
+            </if>
+            <if test="meterReadingCount != null">
+                meter_reading_count  = #{meterReadingCount},
+            </if>
+            <if test="meterReadingUsage != null">
+                meter_reading_usage  = #{meterReadingUsage},
+            </if>
+            <if test="chargingUsage != null">
+                charging_usage  = #{chargingUsage},
+            </if>
+            <if test="meterReadingFinishedRate != null">
+                meter_reading_finished_rate  = #{meterReadingFinishedRate},
+            </if>
+            <if test="meterReadingArrivalRate != null">
+                meter_reading_arrival_rate  = #{meterReadingArrivalRate},
+            </if>
+            <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>
+            <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>
+            <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>
+        </set>
+        where id  = #{id}
+    </update>
+    <!-- 通过id修改售水数据 -->
+    <update id="updateSellWater">
+        update  sms_month_sellwater
+        <set>
+            <if test="collectDate != null">
+                collect_date  = #{collectDate},
+            </if>
+            <if test="waterUsage != null">
+                water_usage  = #{waterUsage},
+            </if>
+            <if test="remark != null">
+                remark  = #{remark},
+            </if>
+            <if test="updateBy != null">
+                update_by  = #{updateBy},
+            </if>
+        </set>
+        where id  = #{id}
+    </update>
+    <!-- 通过公司id查询营收数据 -->
+    <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_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
+        left join sms_month_sellwater t3 on t2.id=t3.property_id and date_format(t1.collect_date,'%Y-%m-%d')= date_format(t3.collect_date,'%Y-%m-%d')
+        where t1.company_org_id = #{companyOrgId} and t1.collect_date >= concat(#{startDate}, '-1')
+            and t1.collect_date  &lt; concat(#{endDate}, '-1') + interval 1 month
+        order by t1.collect_date
+    </select>
 </mapper>

+ 129 - 11
user_center/src/main/java/com/huaxu/controller/VerManageController.java

@@ -2,23 +2,24 @@ package com.huaxu.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.huaxu.entity.App;
+
+import com.huaxu.entity.Dict;
+import com.huaxu.entity.UserEntity;
 import com.huaxu.entity.VerManageEntity;
 import com.huaxu.model.*;
-import com.huaxu.service.AppService;
+import com.huaxu.service.DictService;
+import com.huaxu.service.UserService;
 import com.huaxu.service.VerManageService;
 import com.huaxu.util.UserUtil;
 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.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * app版本表控制层
@@ -36,13 +37,130 @@ public class VerManageController {
     @Autowired
     private VerManageService verManageService;
 
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private DictService dictService;
+
     /**
      * 查询app版本信息
      * @return 单条数据
      */
-    @RequestMapping(value = "selectVer", method = RequestMethod.GET)
+    @RequestMapping(value = "findVerManage", method = RequestMethod.GET)
     @ApiOperation(value = "查询app版本信息")
-    public AjaxMessage<VerManageEntity> selectVer() {
-        return new AjaxMessage<>(ResultStatus.OK, verManageService.selectVer());
+    public AjaxMessage<Pagination<VerManageEntity>> findVerManage(
+            @ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
+            @ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
+            @ApiParam(value = "版本ID", required = false) @RequestParam(required = false) String verId,
+            @ApiParam(value = "产品类型", required = false) @RequestParam(required = false) String productType) {
+        IPage<VerManageEntity> iPage = new Page<>(pageNum, pageSize);
+        iPage = verManageService.findVerManage(iPage,verId,productType);
+        Pagination<VerManageEntity> pages = new Pagination<>(iPage);
+        setName(pages.getList());
+        return new AjaxMessage<>(ResultStatus.OK, pages);
+    }
+
+    /**
+     * 新增APP版本信息
+     */
+    @PostMapping(value = "addVerManage")
+    @ApiOperation(value = "新增版本管理")
+    public AjaxMessage<Object> addVerManage(
+            @ApiParam(value = "新增版本管理", required = true) @RequestBody VerManageEntity verManageEntity) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        verManageEntity.setCreateBy(loginUser.getId().toString());
+        verManageEntity.setStatus(1);
+        int result = verManageService.insertSelective(verManageEntity);
+        if(result>0){
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+        return new AjaxMessage<>(ResultStatus.ERROR);
+    }
+
+
+    /**
+     * 修改APP版本信息
+     */
+    @PostMapping(value = "updateVerManage")
+    @ApiOperation(value = "修改版本管理")
+    public AjaxMessage<Object> updateVerManage(
+            @ApiParam(value = "修改版本管理", required = true) @RequestBody VerManageEntity verManageEntity) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        verManageEntity.setUpdateBy(loginUser.getId().toString());
+        int result = verManageService.updateByPrimaryKeySelective(verManageEntity);
+        if(result>0){
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+        return new AjaxMessage<>(ResultStatus.ERROR);
+    }
+
+
+    /**
+     * 删除APP版本信息
+     */
+    @PostMapping(value = "deleteVerManage")
+    @ApiOperation(value = "删除版本管理")
+    public AjaxMessage<Object> deleteVerManage(
+            @ApiParam(value = "要删除的版本ID,多个ID之间用逗号隔开", required = true) @RequestBody String ids){
+        String [] idArray = ids.split(",");
+        if(idArray.length==0){
+            return new AjaxMessage<>(ResultStatus.ERROR,"参数异常");
+        }
+        List<String> idList = Arrays.asList(idArray);
+        int result = verManageService.deleteSelective(idList);
+        if(result>0){
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+        return new AjaxMessage<>(ResultStatus.ERROR);
+    }
+
+
+    /**
+     * 获取并设置用户、任务工单类型名称
+     * @param result
+     */
+    private void setName(List<VerManageEntity> result){
+        if(result.size()>0){
+            try{
+                List<Integer> idList = new ArrayList<Integer>();
+                for(VerManageEntity verManageEntity:result) {
+                    try {
+                        if (verManageEntity.getCreateBy() != null) {
+                            idList.add(Integer.valueOf(verManageEntity.getCreateBy()));
+                        }
+                        if (verManageEntity.getUpdateBy() != null) {
+                            idList.add(Integer.valueOf(verManageEntity.getUpdateBy()));
+                        }
+                    }catch (Exception e){
+
+                    }
+                }
+                List<UserEntity> userEntityList=userService.findUserIdsByUserIds(idList);
+                Map<Long,String> userMap = userEntityList.stream().collect(Collectors.toMap(UserEntity::getId, UserEntity::getUsername));
+                String parentDictCodes="SYSTEM_PRODUCT_TYPE";
+                Map<String,String> dictMap=new HashMap<>();
+                for(String parentDictCode:parentDictCodes.split(",")){
+                    Dict dict=new Dict();
+                    dict.setParentDictCode(parentDictCode);
+                    dictMap.putAll(dictService.selectList(dict).stream().collect(Collectors.toMap(Dict::getDictCode, Dict::getDictValue)));
+                }
+                for(int i = 0; i < result.size(); i++) {
+                    VerManageEntity verManage = result.get(i);
+                    try {
+                        verManage.setProductTypeName(dictMap.get(verManage.getProductType()));
+                        if (verManage.getCreateBy() != null) {
+                            verManage.setCreateByName(userMap.get(Long.valueOf(verManage.getCreateBy())));
+                        }
+                        if (verManage.getUpdateBy() != null) {
+                            verManage.setUpdateByName(userMap.get(Long.valueOf(verManage.getUpdateBy())));
+                        }
+                    }catch (Exception e){
+                    }
+                }
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+        }
     }
 }

+ 0 - 1
user_center/src/main/java/com/huaxu/dao/UserTagMapper.java

@@ -27,7 +27,6 @@ public interface UserTagMapper extends BaseMapper<UserTagEntity> {
 
     UserTagEntity findUserTagById(Serializable id);
 
-
     List<UserTagEntity> findList(UserTagEntity userTagEntity);
 
     /**删除相关方法  使用mybatis-plus集成的 **/

+ 7 - 2
user_center/src/main/java/com/huaxu/dao/VerManageMapper.java

@@ -3,12 +3,10 @@ package com.huaxu.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.huaxu.entity.UserEntity;
 import com.huaxu.entity.VerManageEntity;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -20,4 +18,11 @@ import java.util.List;
 @Mapper
 public interface VerManageMapper extends BaseMapper<VerManageEntity> {
 
+    Page<VerManageEntity> findVerManage(IPage<VerManageEntity> page, @Param("verId") String verId, @Param("productType") String productType);
+
+    int insertSelective(VerManageEntity verManageEntity);
+
+    int updateByPrimaryKeySelective(VerManageEntity verManageEntity);
+
+    int deleteSelective(@Param("ids") List<String> ids);
 }

+ 40 - 3
user_center/src/main/java/com/huaxu/entity/VerManageEntity.java

@@ -2,15 +2,12 @@ package com.huaxu.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.huaxu.model.ProgramItem;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
-import java.util.List;
 
 /**
  * uims_ver_manage
@@ -49,6 +46,10 @@ public class VerManageEntity implements Serializable {
     @ApiModelProperty(value = "创建者")
     private String createBy;
 
+    /** 创建者 */
+    @ApiModelProperty(value = "创建者")
+    private String createByName;
+
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间")
@@ -58,8 +59,44 @@ public class VerManageEntity implements Serializable {
     @ApiModelProperty(value = "更新者")
     private String updateBy;
 
+    /** 更新者 */
+    @ApiModelProperty(value = "更新者")
+    private String updateByName;
+
     /** 更新时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间")
     private Date dateUpdate;
+
+    /** 手机系统 */
+    @ApiModelProperty(value = "手机系统")
+    private String mobileOS;
+
+    /** 当前版本 */
+    @ApiModelProperty(value = "当前版本")
+    private String curAppVer;
+
+    /** 产品类型 */
+    @ApiModelProperty(value = "产品类型")
+    private String productType;
+
+    /** 产品类型 */
+    @ApiModelProperty(value = "产品类型名称")
+    private String productTypeName;
+
+    /** 强制升级版本 */
+    @ApiModelProperty(value = "强制升级版本")
+    private String forcedUpgradeVer;
+    
+    /** 下载地址 */
+    @ApiModelProperty(value = "下载地址")
+    private String download;
+
+    /** 是否最新版本 */
+    @ApiModelProperty(value = "是否最新版本")
+    private Integer isNewestVer;
+
+    /** 状态 */
+    @ApiModelProperty(value = "状态")
+    private Integer status;
 }

+ 23 - 21
user_center/src/main/java/com/huaxu/service/VerManageService.java

@@ -1,35 +1,19 @@
 package com.huaxu.service;
 
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.huaxu.common.ToolUtil;
-import com.huaxu.dao.OrgMapper;
-import com.huaxu.dao.UserMapper;
 import com.huaxu.dao.VerManageMapper;
-import com.huaxu.dto.MaintainerCountDto;
-import com.huaxu.dto.UserListDto;
+
 import com.huaxu.entity.*;
-import com.huaxu.model.LoginUser;
-import com.huaxu.util.ByteArrayUtils;
-import com.huaxu.util.RedisUtil;
-import com.huaxu.util.UserUtil;
+
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
+
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.client.RestTemplate;
 
-import javax.annotation.Resource;
-import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
+
 
 /**
  *
@@ -39,6 +23,8 @@ import java.util.stream.Collectors;
  */
 @Service
 public class VerManageService extends ServiceImpl<VerManageMapper, VerManageEntity> {
+	@Autowired
+	private VerManageMapper verManageMapper;
 
 	public VerManageEntity selectVer(){
 		VerManageEntity res=null;
@@ -48,4 +34,20 @@ public class VerManageService extends ServiceImpl<VerManageMapper, VerManageEnti
 		}
 		return res;
 	}
+
+	public Page<VerManageEntity> findVerManage(IPage<VerManageEntity> page,String verId, String productType){
+		return verManageMapper.findVerManage(page, verId, productType);
+	}
+
+	public int insertSelective(VerManageEntity verManageEntity){
+		return verManageMapper.insertSelective(verManageEntity);
+	}
+
+	public int updateByPrimaryKeySelective(VerManageEntity verManageEntity){
+		return verManageMapper.updateByPrimaryKeySelective(verManageEntity);
+	}
+
+	public int deleteSelective(List<String> ids){
+		return verManageMapper.deleteSelective(ids);
+	}
 }

+ 0 - 2
user_center/src/main/resources/mapper/UserRoleMapper.xml

@@ -4,7 +4,6 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huaxu.dao.UserRoleMapper">
 
-
     <resultMap type="UserRoleEntity" id="UserRoleResult">
         <result property="id" column="id"/>
         <result property="userId" column="user_id"/>
@@ -60,7 +59,6 @@
         SELECT
         <include refid="userRoleColumns"/>
         FROM uims_user_role a
-
         <where>
             a.status=1
             <if test="userRole.userId != null ">and a.user_id = #{userRole.userId}</if>

+ 206 - 0
user_center/src/main/resources/mapper/VerManageMapper.xml

@@ -0,0 +1,206 @@
+<?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.huaxu.dao.VerManageMapper">
+    <resultMap type="VerManageEntity" id="VerManageResult">
+        <result property="id"    column="id"    />
+        <result property="verId"    column="ver_id"    />
+        <result property="verUrl"    column="ver_url"    />
+        <result property="isForcedUpgrade"    column="is_forced_upgrade"    />
+        <result property="remark"    column="remark"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="dateCreate"    column="date_create"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="dateUpdate"    column="date_update"    />
+        <result property="mobileOS"    column="mobile_os"    />
+        <result property="curAppVer"    column="cur_app_ver"    />
+        <result property="productType"    column="product_type"    />
+        <result property="forcedUpgradeVer"    column="forced_upgrade_ver"    />
+        <result property="isNewestVer"    column="is_newest_ver"    />
+        <result property="download"    column="download"    />
+    </resultMap>
+
+    <!--  实体  -->
+    <sql id="verManageColumns">
+         a.id as "id" ,
+         a.ver_id as "verId" ,
+         a.ver_url as "verUrl" ,
+         a.is_forced_upgrade as "isForcedUpgrade" ,
+         a.remark as "remark" ,
+         a.date_create as "dateCreate" ,
+         a.date_update as "dateUpdate" ,
+         a.create_by as "createBy" ,
+         a.update_by as "updateBy" ,
+         a.mobile_os as "mobileOS" ,
+         a.cur_app_ver as "curAppVer" ,
+         a.product_type as "productType" ,
+         a.forced_upgrade_ver as "forcedUpgradeVer" ,
+         a.is_newest_ver as "isNewestVer" ,
+         a.download as "download"
+     </sql>
+
+    <!--  根据主键获取实体   -->
+    <select id="findVerManage" resultType="com.huaxu.entity.VerManageEntity">
+        SELECT
+        <include refid="verManageColumns"/>
+        FROM uims_ver_manage a
+        WHERE a.status=1
+        <if test="verId != null">
+            and a.ver_id like concat(concat('%',#{verId}) ,'%')
+        </if>
+        <if test="productType != null">
+            and a.product_type = #{productType}
+        </if>
+    </select>
+
+    <insert id="insertSelective" parameterType="com.huaxu.entity.VerManageEntity" >
+        insert into uims_ver_manage
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="verId != null" >
+                ver_id,
+            </if>
+            <if test="verUrl != null" >
+                ver_url,
+            </if>
+            <if test="download != null" >
+                download,
+            </if>
+            <if test="isForcedUpgrade != null" >
+                is_forced_upgrade,
+            </if>
+            <if test="remark != null" >
+                remark,
+            </if>
+            <if test="dateUpdate != null" >
+                date_update,
+            </if>
+            <if test="createBy != null" >
+                create_by,
+            </if>
+            <if test="updateBy != null" >
+                update_by,
+            </if>
+            <if test="mobileOS != null" >
+                mobile_os,
+            </if>
+            <if test="curAppVer != null" >
+                cur_app_ver,
+            </if>
+            <if test="productType != null" >
+                product_type,
+            </if>
+            <if test="forcedUpgradeVer != null" >
+                forced_upgrade_ver,
+            </if>
+            <if test="isNewestVer != null" >
+                is_newest_ver,
+            </if>
+            <if test="status != null" >
+               status,
+            </if>
+            date_create,
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="verId != null" >
+                #{verId,jdbcType=VARCHAR},
+            </if>
+            <if test="verUrl != null" >
+                #{verUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="download != null" >
+                #{download,jdbcType=VARCHAR},
+            </if>
+            <if test="isForcedUpgrade != null" >
+                #{isForcedUpgrade,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="dateUpdate != null" >
+                #{dateUpdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="createBy != null" >
+                #{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateBy != null" >
+                #{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="mobileOS != null" >
+                #{mobileOS,jdbcType=VARCHAR},
+            </if>
+            <if test="curAppVer != null" >
+                #{curAppVer,jdbcType=VARCHAR},
+            </if>
+            <if test="productType != null" >
+                #{productType,jdbcType=VARCHAR},
+            </if>
+            <if test="forcedUpgradeVer != null" >
+                #{forcedUpgradeVer,jdbcType=VARCHAR},
+            </if>
+            <if test="isNewestVer != null" >
+                #{isNewestVer,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                #{status,jdbcType=INTEGER},
+            </if>
+            SYSDATE(),
+        </trim>
+    </insert>
+
+    <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.entity.VerManageEntity" >
+        update uims_ver_manage
+        <set >
+            <if test="verId != null" >
+                ver_id = #{verId,jdbcType=VARCHAR},
+            </if>
+            <if test="verUrl != null" >
+                ver_url = #{verUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="download != null" >
+                download = #{download,jdbcType=VARCHAR},
+            </if>
+            <if test="isForcedUpgrade != null" >
+                is_forced_upgrade = #{isForcedUpgrade,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null" >
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="dateUpdate != null" >
+                date_update = #{dateUpdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null" >
+                create_by = #{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="mobileOS != null" >
+                mobile_os = #{mobileOS,jdbcType=VARCHAR},
+            </if>
+            <if test="curAppVer != null" >
+                cur_app_ver = #{curAppVer,jdbcType=VARCHAR},
+            </if>
+            <if test="productType != null" >
+                product_type = #{productType,jdbcType=VARCHAR},
+            </if>
+            <if test="forcedUpgradeVer != null" >
+                forced_upgrade_ver = #{forcedUpgradeVer,jdbcType=VARCHAR},
+            </if>
+            <if test="isNewestVer != null" >
+                is_newest_ver = #{isNewestVer,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                status = #{status,jdbcType=INTEGER},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <delete id="deleteSelective" parameterType="map">
+        update uims_ver_manage
+        set status = 0
+        where id in
+        <foreach collection="ids" item="item" open="(" close=")" separator=",">
+            #{item,jdbcType=INTEGER}
+        </foreach>
+    </delete>
+
+</mapper>