Browse Source

按月交费功能开发完成

Your Name 3 years ago
parent
commit
4663c61971

+ 6 - 2
java110-core/src/main/java/com/java110/core/cache/JedisClientTemplate.java

@@ -40,7 +40,7 @@ public class JedisClientTemplate implements Jedis {
     public String set(String key, String value, String nxxx, String expx, int time) {
 //        redisTemplate.opsForValue().set(key, value,nxxx,expx,time);
 //        return "";
-        return redisTemplate.execute(new RedisCallback() {
+        Object ext = redisTemplate.execute(new RedisCallback() {
             public String doInRedis(RedisConnection connection) {
                 //redis.clients.jedis.Jedis jedis = (redis.clients.jedis.Jedis) connection.getNativeConnection();
                 Object nativeConnection = connection.getNativeConnection();
@@ -55,7 +55,11 @@ public class JedisClientTemplate implements Jedis {
                 }
                 return "";
             }
-        }, true).toString();
+        }, true);
+        if (ext == null) {
+            return "";
+        }
+        return ext.toString();
     }
 
 

+ 5 - 2
service-fee/src/main/java/com/java110/fee/cmd/fee/PayMonthFeeCmd.java

@@ -3,6 +3,7 @@ package com.java110.fee.cmd.fee;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
@@ -148,6 +149,7 @@ public class PayMonthFeeCmd extends Cmd {
 
 
     @Override
+    @Java110Transactional
     public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         String userId = context.getReqHeaders().get("user-id");
         UserDto userDto = new UserDto();
@@ -233,7 +235,7 @@ public class PayMonthFeeCmd extends Cmd {
             payFeeDetailMonthDto.setDetailId(payFeeDetailPo.getDetailId());
 
         } finally {
-            DistributedLock.releaseDistributedLock(requestId, key);
+            DistributedLock.releaseDistributedLock(key, requestId);
         }
         //车辆延期
         updateOwnerCarEndTime(payFeePo, reqJson, feeDtos.get(0));
@@ -363,7 +365,8 @@ public class PayMonthFeeCmd extends Cmd {
         for (PayFeeDetailMonthDto tmpFeeDetailMonthDto : feeDetailMonthDtos) {
             if (Integer.parseInt(tmpFeeDetailMonthDto.getDetailYear()) <= Integer.parseInt(tmpPayFeeDetailMonthDto.getDetailYear())
                     && Integer.parseInt(tmpFeeDetailMonthDto.getDetailMonth()) < Integer.parseInt(tmpPayFeeDetailMonthDto.getDetailMonth())) {
-                throw new CmdException("未连续缴费,请选择" + tmpFeeDetailMonthDto.getDetailYear() + "-" + tmpFeeDetailMonthDto.getDetailMonth() + " ," + tmpFeeDetailMonthDto.getFeeName());
+                throw new CmdException("未连续缴费,请选择" + tmpFeeDetailMonthDto.getDetailYear() + "-" + tmpFeeDetailMonthDto.getDetailMonth()
+                        + " ," + tmpPayFeeDetailMonthDto.getFeeName());
             }
             if (Integer.parseInt(tmpFeeDetailMonthDto.getDetailYear()) == Integer.parseInt(tmpPayFeeDetailMonthDto.getDetailYear())
                     && Integer.parseInt(tmpFeeDetailMonthDto.getDetailMonth()) == Integer.parseInt(tmpPayFeeDetailMonthDto.getDetailMonth())) {