lihui001 3 年 前
コミット
4f67ff868c

+ 1 - 1
common/src/main/java/com/zcxk/model/LoginUser.java

@@ -63,7 +63,7 @@ public class LoginUser implements UserDetails {
     private List<String> appIds;
 
     @ApiModelProperty(value="物联网客户ID")
-    private String customerId;
+    private Long customerId;
 
     //权限
     private Set<GrantedAuthority> authorities;

+ 4 - 1
user_auth/src/main/java/com/zcxk/entity/User.java

@@ -101,8 +101,11 @@ public class User implements Serializable {
     private String token;
     private Integer roleState;
     private Integer tenantState;
+
     private String iotPhoneNumber;
-    private String customerId;
+
+    @ApiModelProperty(value = "物联网客户ID")
+    private Long customerId;
 
     @ApiModelProperty(value = "登录第三方账号")
     private String loginAccount;

+ 1 - 0
user_auth/src/main/resources/mapper/UserMapper.xml

@@ -25,6 +25,7 @@
         <result property="departmentOrgState" column="departmentOrgState" jdbcType="INTEGER"/>
         <result property="tenantState" column="TENANT_STATE" jdbcType="INTEGER"/>
         <result property="iotPhoneNumber" column="iot_phone_number" jdbcType="VARCHAR"/>
+        <result property="customerId" column="customer_id" jdbcType="LONG"/>
     </resultMap>
 
 

+ 6 - 6
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/config/AccessTokenService.java

@@ -1,7 +1,7 @@
 package com.zcxk.rmcp.pay.config;
 
 import com.alibaba.fastjson.JSONObject;
-import com.zcxk.core.utils.util.RedisUtil;
+import com.zcxk.core.utils.util.RedisUtils;
 import com.zcxk.rmcp.pay.commom.util.HttpRequest;
 
 import lombok.extern.slf4j.Slf4j;
@@ -15,7 +15,7 @@ import java.io.IOException;
 @Service
 public class AccessTokenService {
     @Autowired
-    private RedisUtil redisUtil;
+    private RedisUtils redisUtils;
     @Value("${wechat.oa.appid}")
     private String oaAppid;
     @Value("${wechat.oa.app-secret}")
@@ -32,7 +32,7 @@ public class AccessTokenService {
      */
     public String getOaAccessToken(){
         String token = null;
-        token = redisUtil.get("oaAccessToken");
+        token = redisUtils.get("oaAccessToken");
         if (token != null) {
             return token;
         }else {
@@ -44,7 +44,7 @@ public class AccessTokenService {
                 log.info(jsonObj.toJSONString());
                 String accessTokenTem = jsonObj.getString("access_token");
                 if (accessTokenTem != null && !"".equals(accessTokenTem)) {
-                    redisUtil.setExpire("oaAccessToken",accessTokenTem,300);
+                    redisUtils.setExpire("oaAccessToken",accessTokenTem,300);
                     return accessTokenTem;
                 } else {
                     log.info("请求token错误");
@@ -62,7 +62,7 @@ public class AccessTokenService {
      */
     public String getMpAccessToken(){
         String token = null;
-        token = redisUtil.get("mpAccessToken");
+        token = redisUtils.get("mpAccessToken");
         if (token != null) {
             return token;
         }else {
@@ -74,7 +74,7 @@ public class AccessTokenService {
                 log.info(jsonObj.toJSONString());
                 String accessTokenTem = jsonObj.getString("access_token");
                 if (accessTokenTem != null && !"".equals(accessTokenTem)) {
-                    redisUtil.setExpire("mpAccessToken",accessTokenTem,300);
+                    redisUtils.setExpire("mpAccessToken",accessTokenTem,300);
                     return accessTokenTem;
                 } else {
                     log.info("请求token错误");

+ 4 - 4
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/controller/common/ValidateCodeController.java

@@ -1,6 +1,6 @@
 package com.zcxk.rmcp.pay.controller.common;
 
-import com.zcxk.core.utils.util.RedisUtil;
+import com.zcxk.core.utils.util.RedisUtils;
 import com.zcxk.rmcp.pay.commom.model.AjaxMessage;
 import com.zcxk.rmcp.pay.commom.model.ResultStatus;
 import com.zcxk.rmcp.pay.commom.util.ByteArrayUtils;
@@ -30,7 +30,7 @@ import java.io.OutputStream;
 public class ValidateCodeController {
 
     @Autowired
-    RedisUtil redisUtil;
+    RedisUtils redisUtils;
 
     @GetMapping("/validateCode/image")
     @ApiOperation(value = "获取验证码")
@@ -42,7 +42,7 @@ public class ValidateCodeController {
         ValidateCode validateCode = new ValidateCode(imageCode.getCode(), imageCode.getExpireTime());
         //保存redis
         String key = "validateCode:"+random;
-        redisUtil.setExpire(key.getBytes(), ByteArrayUtils.objectToBytes(validateCode).get(), 300);//5分钟过期
+        redisUtils.setExpire(key.getBytes(), ByteArrayUtils.objectToBytes(validateCode).get(), 300);//5分钟过期
         OutputStream out = response.getOutputStream();
 
         //设置响应头通知浏览器以图片的形式打开
@@ -70,7 +70,7 @@ public class ValidateCodeController {
     ){
         AjaxMessage ajaxMessage = new AjaxMessage();
         String key = "validateCode:"+random;
-        byte[] redisValidateCodeByte = redisUtil.get(key.getBytes());
+        byte[] redisValidateCodeByte = redisUtils.get(key.getBytes());
         if (redisValidateCodeByte == null) {
             ajaxMessage.setMsg(ResultStatus.ERROR);
             return ajaxMessage;

+ 5 - 5
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/controller/pay/archives/PayBaseCustomerandmeterrelaController.java

@@ -1,7 +1,7 @@
 package com.zcxk.rmcp.pay.controller.pay.archives;
 
 import com.alibaba.fastjson.JSONObject;
-import com.zcxk.core.utils.util.RedisUtil;
+import com.zcxk.core.utils.util.RedisUtils;
 import com.zcxk.rmcp.pay.commom.model.AjaxMessage;
 import com.zcxk.rmcp.pay.commom.model.Pagination;
 import com.zcxk.rmcp.pay.commom.model.ResultStatus;
@@ -48,7 +48,7 @@ public class PayBaseCustomerandmeterrelaController {
     private ImportServiceImpl importServiceImpl;
 
     @Autowired
-    private RedisUtil redisUtil;
+    private RedisUtils redisUtils;
 
     @Autowired
     private EstimatedDayService estimatedDayService;
@@ -138,7 +138,7 @@ public class PayBaseCustomerandmeterrelaController {
             String customerId = loginUser != null && loginUser.getCustomerId() != null?loginUser.getCustomerId().toString():"0";
 
             //开户成功后缓存开户信息,下次开户获取其中下拉项
-            redisUtil.set("SaveCustomerCache"+UserUtil.getCurrentUser().getId(), JSONObject.toJSONString(paySaveCustomerDto));
+            redisUtils.set("SaveCustomerCache"+UserUtil.getCurrentUser().getId(), JSONObject.toJSONString(paySaveCustomerDto));
 
             return new AjaxMessage<>(ResultStatus.OK, result);
         }else{
@@ -152,9 +152,9 @@ public class PayBaseCustomerandmeterrelaController {
         LoginUser loginUser = UserUtil.getCurrentUser();
         PaySaveCustomerDto CustomerCache= new PaySaveCustomerDto();
         String key="SaveCustomerCache"+UserUtil.getCurrentUser().getId();
-        if(redisUtil.exists(key)){
+        if(redisUtils.exists(key)){
 
-            String redisString = redisUtil.get(key);
+            String redisString = redisUtils.get(key);
             CustomerCache =JSONObject.parseObject(redisString,PaySaveCustomerDto.class);
         }else{
             CustomerCache.setCalculateway(1);

+ 1 - 4
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/UserServiceImpl.java

@@ -1,6 +1,6 @@
 package com.zcxk.rmcp.pay.service.impl;
 
-import com.zcxk.core.utils.util.RedisUtil;
+import com.zcxk.core.utils.util.RedisUtils;
 import com.zcxk.rmcp.pay.commom.model.Pagination;
 import com.zcxk.rmcp.pay.commom.util.UserUtil;
 import com.zcxk.rmcp.pay.dao.*;
@@ -42,9 +42,6 @@ public class UserServiceImpl implements UserService {
     @Resource
     private SiteMapper siteMapper;
 
-    @Autowired
-    private RedisUtil redisUtil;
-
     @Override
     public int update(User user) {
         return userMapper.update(user);

+ 2 - 2
zoniot-pay/zoniot-pay-web/src/main/resources/application-dev.properties

@@ -82,9 +82,9 @@ spring.rabbitmq.publisher-confirm-type=correlated
 spring.rabbitmq.publisher-returns=true
 spring.rabbitmq.template.mandatory=true
 
-#mongodb url
+#mongo url
 spring.data.mongodb.uri=mongodb://10.0.0.63:27017/meter-reading-database
-#spring.data.mongodb.uri=mongodb://127.0.0.1:27017/meter-reading-database
+#spring.data.mongo.uri=mongo://127.0.0.1:27017/meter-reading-database
 logging.level.org.springframework.data.mongodb.core=DEBUG
 receive.exchange.name=messageExchangeTest
 dispath.routing.key=dipathKeyTest1

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/resources/application-sit.properties

@@ -92,7 +92,7 @@ iot.device.routing.key=iot_device_key_dev
 iot.delete.device.routing.key=iot_device_delete_key_dev
 
 iot.delete.device.queue=iot_device_delete_queue
-#mongodb url
+#mongo url
 spring.data.mongodb.uri=mongodb://10.0.0.63:27017/meter-reading-database
 logging.level.org.springframework.data.mongodb.core=DEBUG
 

+ 1 - 0
zoniot-water/zoniot-water-web/src/main/java/com/zcxk/water/web/service/impl/AlarmTypeServiceImpl.java

@@ -285,6 +285,7 @@ public class AlarmTypeServiceImpl implements AlarmTypeService {
         }else {
             alarmType.setAlarmRuleNum(0);
         }
+        alarmType.setCustomerId(loginUser.getCustomerId());
         alarmType.setTenantId(loginUser.getTenantId());
         alarmType.setCompanyOrgId(loginUser.getCompanyId());
         alarmType.setDeptOrgId(loginUser.getDepartmentId());