正在显示
6 个修改的文件
包含
33 行增加
和
8 行删除
| 1 | package com.sunyo.energy.location.controller; | 1 | package com.sunyo.energy.location.controller; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.google.gson.internal.$Gson$Preconditions; | ||
| 4 | import com.sunyo.energy.location.controller.response.ResultJson; | 5 | import com.sunyo.energy.location.controller.response.ResultJson; |
| 5 | import com.sunyo.energy.location.dao.PayRecordsMapper; | 6 | import com.sunyo.energy.location.dao.PayRecordsMapper; |
| 6 | import com.sunyo.energy.location.dao.PayResponseMapper; | 7 | import com.sunyo.energy.location.dao.PayResponseMapper; |
| @@ -107,7 +108,12 @@ public class PayRseponeController { | @@ -107,7 +108,12 @@ public class PayRseponeController { | ||
| 107 | payResponse.setPaytype(PAYTYPE); | 108 | payResponse.setPaytype(PAYTYPE); |
| 108 | payResponse.setSign(SIGN); | 109 | payResponse.setSign(SIGN); |
| 109 | try { | 110 | try { |
| 111 | + | ||
| 110 | int msg = 0; | 112 | int msg = 0; |
| 113 | + /** | ||
| 114 | + * 解决建行反馈多次原因 | ||
| 115 | + */ | ||
| 116 | + if(payResponseMapperl.count(ORDERID) == 0){ | ||
| 111 | int i = payResponseMapperl.insertSelective(payResponse); | 117 | int i = payResponseMapperl.insertSelective(payResponse); |
| 112 | log.info("插入数据库{},信息{}",i, payResponse); | 118 | log.info("插入数据库{},信息{}",i, payResponse); |
| 113 | if (i > 0) { | 119 | if (i > 0) { |
| @@ -125,15 +131,10 @@ public class PayRseponeController { | @@ -125,15 +131,10 @@ public class PayRseponeController { | ||
| 125 | if ("Y".equals(SUCCESS)) { | 131 | if ("Y".equals(SUCCESS)) { |
| 126 | payRecords.setOrdernumber(ORDERID); | 132 | payRecords.setOrdernumber(ORDERID); |
| 127 | payRecords.setReamke3("1"); | 133 | payRecords.setReamke3("1"); |
| 128 | - } else { | ||
| 129 | - payRecords.setOrdernumber(ORDERID); | ||
| 130 | - payRecords.setReamke3("0"); | ||
| 131 | - } | ||
| 132 | /** | 134 | /** |
| 133 | * 修改订单支付状态 | 135 | * 修改订单支付状态 |
| 134 | */ | 136 | */ |
| 135 | payRecordsMapper.updateOrderStatus(payRecords); | 137 | payRecordsMapper.updateOrderStatus(payRecords); |
| 136 | - | ||
| 137 | // 查询是水还是电 | 138 | // 查询是水还是电 |
| 138 | boolean selectType = payRecordsMapper.selectType(ORDERID); | 139 | boolean selectType = payRecordsMapper.selectType(ORDERID); |
| 139 | if (selectType) { | 140 | if (selectType) { |
| @@ -210,8 +211,22 @@ public class PayRseponeController { | @@ -210,8 +211,22 @@ public class PayRseponeController { | ||
| 210 | } | 211 | } |
| 211 | } | 212 | } |
| 212 | 213 | ||
| 214 | + } else { | ||
| 215 | + payRecords.setOrdernumber(ORDERID); | ||
| 216 | + payRecords.setReamke3("0"); | ||
| 217 | + /** | ||
| 218 | + * 修改订单支付状态 | ||
| 219 | + */ | ||
| 220 | + payRecordsMapper.updateOrderStatus(payRecords); | ||
| 221 | + } | ||
| 213 | } | 222 | } |
| 214 | return i == 1 ? new ResultJson("200", "支付回执信息接受成功") : new ResultJson("500", "支付回执信息接受失败"); | 223 | return i == 1 ? new ResultJson("200", "支付回执信息接受成功") : new ResultJson("500", "支付回执信息接受失败"); |
| 224 | + }else { | ||
| 225 | + return 1 == 1 ? new ResultJson("200", "2次调用") : new ResultJson("500", "2次调用"); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + | ||
| 229 | + | ||
| 215 | }catch (Exception e){ | 230 | }catch (Exception e){ |
| 216 | e.printStackTrace(); | 231 | e.printStackTrace(); |
| 217 | log.info("系统异常-----------"); | 232 | log.info("系统异常-----------"); |
| @@ -219,4 +234,5 @@ public class PayRseponeController { | @@ -219,4 +234,5 @@ public class PayRseponeController { | ||
| 219 | } | 234 | } |
| 220 | } | 235 | } |
| 221 | 236 | ||
| 237 | + | ||
| 222 | } | 238 | } |
| @@ -12,7 +12,7 @@ public interface PayRecordsMapper { | @@ -12,7 +12,7 @@ public interface PayRecordsMapper { | ||
| 12 | 12 | ||
| 13 | int insertSelective(PayRecords record); | 13 | int insertSelective(PayRecords record); |
| 14 | 14 | ||
| 15 | - PayRecords selectByPrimaryKey(Integer id); | 15 | + PayRecords selectByPrimaryKey(@Param(value = "orderNumber") String orderNumber); |
| 16 | 16 | ||
| 17 | int updateByPrimaryKeySelective(PayRecords record); | 17 | int updateByPrimaryKeySelective(PayRecords record); |
| 18 | 18 |
| 1 | package com.sunyo.energy.location.dao; | 1 | package com.sunyo.energy.location.dao; |
| 2 | 2 | ||
| 3 | import com.sunyo.energy.location.model.PayResponse; | 3 | import com.sunyo.energy.location.model.PayResponse; |
| 4 | +import org.apache.ibatis.annotations.Param; | ||
| 4 | 5 | ||
| 5 | public interface PayResponseMapper { | 6 | public interface PayResponseMapper { |
| 6 | int deleteByPrimaryKey(String id); | 7 | int deleteByPrimaryKey(String id); |
| @@ -14,4 +15,6 @@ public interface PayResponseMapper { | @@ -14,4 +15,6 @@ public interface PayResponseMapper { | ||
| 14 | int updateByPrimaryKeySelective(PayResponse record); | 15 | int updateByPrimaryKeySelective(PayResponse record); |
| 15 | 16 | ||
| 16 | int updateByPrimaryKey(PayResponse record); | 17 | int updateByPrimaryKey(PayResponse record); |
| 18 | + | ||
| 19 | + int count(@Param("order") String orderId); | ||
| 17 | } | 20 | } |
| @@ -237,6 +237,7 @@ public class WaterMeterServiceImp implements WaterMeterService { | @@ -237,6 +237,7 @@ public class WaterMeterServiceImp implements WaterMeterService { | ||
| 237 | String s = AllUtils.nubmerDivision(payFees); | 237 | String s = AllUtils.nubmerDivision(payFees); |
| 238 | // 查询累计充值量 | 238 | // 查询累计充值量 |
| 239 | WaterMeterSacc waterMeterSacc = waterMeterSaccMapper.selectByPrimaryKey(AllUtils.wmIdUtils(wmId)); | 239 | WaterMeterSacc waterMeterSacc = waterMeterSaccMapper.selectByPrimaryKey(AllUtils.wmIdUtils(wmId)); |
| 240 | + // 需要通知外部水表接口的累计充值量 | ||
| 240 | String allSacc = AllUtils.nubmerAdd(s, waterMeterSacc.getWmSacc()); | 241 | String allSacc = AllUtils.nubmerAdd(s, waterMeterSacc.getWmSacc()); |
| 241 | Map<String, Object> datas = new HashMap<>(); | 242 | Map<String, Object> datas = new HashMap<>(); |
| 242 | datas.put("MtId", wmId); | 243 | datas.put("MtId", wmId); |
| @@ -23,11 +23,11 @@ | @@ -23,11 +23,11 @@ | ||
| 23 | id, payFees, payUserId, payTime, payLocationId, payStatus, payType, payFessType, | 23 | id, payFees, payUserId, payTime, payLocationId, payStatus, payType, payFessType, |
| 24 | orderNumber, reamke1, reamke2, reamke3, reamke4, payUserName, payLocationName, payTypeAddress | 24 | orderNumber, reamke1, reamke2, reamke3, reamke4, payUserName, payLocationName, payTypeAddress |
| 25 | </sql> | 25 | </sql> |
| 26 | - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> | 26 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> |
| 27 | select | 27 | select |
| 28 | <include refid="Base_Column_List"/> | 28 | <include refid="Base_Column_List"/> |
| 29 | from pay_records | 29 | from pay_records |
| 30 | - where id = #{id,jdbcType=INTEGER} | 30 | + where orderNumber = #{orderNumber,jdbcType=INTEGER} |
| 31 | </select> | 31 | </select> |
| 32 | 32 | ||
| 33 | <select id="findAll" resultMap="BaseResultMap"> | 33 | <select id="findAll" resultMap="BaseResultMap"> |
| @@ -31,6 +31,11 @@ | @@ -31,6 +31,11 @@ | ||
| 31 | from pay_response | 31 | from pay_response |
| 32 | where ID = #{id,jdbcType=VARCHAR} | 32 | where ID = #{id,jdbcType=VARCHAR} |
| 33 | </select> | 33 | </select> |
| 34 | + | ||
| 35 | + <select id="count" resultType="int" parameterType="string"> | ||
| 36 | + select count(*) from pay_response where ORDERID = #{order,jdbcType=VARCHAR} and SUCCESS = 'Y' | ||
| 37 | + </select> | ||
| 38 | + | ||
| 34 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | 39 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
| 35 | delete from pay_response | 40 | delete from pay_response |
| 36 | where ID = #{id,jdbcType=VARCHAR} | 41 | where ID = #{id,jdbcType=VARCHAR} |
-
请 注册 或 登录 后发表评论