正在显示
1 个修改的文件
包含
26 行增加
和
18 行删除
| @@ -97,29 +97,37 @@ public class PayOrderController { | @@ -97,29 +97,37 @@ public class PayOrderController { | ||
| 97 | */ | 97 | */ |
| 98 | Location location = locationMapper.waterId_eleId(payRecords.getPaylocationname()); | 98 | Location location = locationMapper.waterId_eleId(payRecords.getPaylocationname()); |
| 99 | /** | 99 | /** |
| 100 | - * true 为电 false 为水 | 100 | + * 支付状态 充值状态满足条件进入否则不操作 |
| 101 | */ | 101 | */ |
| 102 | - if (payRecords.getPaytype()){ | ||
| 103 | - int i = electricityMeterService.rechargeDevices(location.getEeid(), String.valueOf(payRecords.getPayfees()), | ||
| 104 | - "0", payRecords.getOrdernumber()); | ||
| 105 | - if (i == 1){ | ||
| 106 | - payRecords.setReamke3("1"); | ||
| 107 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
| 108 | - return i1 == 1? new ResultJson("200", "电费充值成功"): new ResultJson("201", "电费充值失败"); | 102 | + if (payRecords.getPaystatus() == true && "0".equals(payRecords.getReamke3())){ |
| 103 | + /** | ||
| 104 | + * true 为电 false 为水 | ||
| 105 | + */ | ||
| 106 | + if (payRecords.getPaytype()){ | ||
| 107 | + int i = electricityMeterService.rechargeDevices(location.getEeid(), String.valueOf(payRecords.getPayfees()), | ||
| 108 | + "0", payRecords.getOrdernumber()); | ||
| 109 | + if (i == 1){ | ||
| 110 | + payRecords.setReamke3("1"); | ||
| 111 | + int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
| 112 | + return i1 == 1? new ResultJson("200", "电费充值成功"): new ResultJson("201", "电费充值失败"); | ||
| 113 | + }else { | ||
| 114 | + return new ResultJson("201", "电费充值失败"); | ||
| 115 | + } | ||
| 109 | }else { | 116 | }else { |
| 110 | - return new ResultJson("201", "电费充值失败"); | 117 | + ResultJson resultJson = waterMeterService.payWater(String.valueOf(payRecords.getPayfees()), location.getWmid()); |
| 118 | + | ||
| 119 | + if ("200".equals(resultJson.getCode())){ | ||
| 120 | + payRecords.setReamke3("1"); | ||
| 121 | + int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
| 122 | + return i1 == 1? new ResultJson("200", "水费充值成功"): new ResultJson("201", "水费充值失败"); | ||
| 123 | + }else { | ||
| 124 | + resultJson.setCode("201"); | ||
| 125 | + return resultJson; | ||
| 126 | + } | ||
| 111 | } | 127 | } |
| 112 | }else { | 128 | }else { |
| 113 | - ResultJson resultJson = waterMeterService.payWater(String.valueOf(payRecords.getPayfees()), location.getWmid()); | ||
| 114 | 129 | ||
| 115 | - if ("200".equals(resultJson.getCode())){ | ||
| 116 | - payRecords.setReamke3("1"); | ||
| 117 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
| 118 | - return i1 == 1? new ResultJson("200", "水费充值成功"): new ResultJson("201", "水费充值失败"); | ||
| 119 | - }else { | ||
| 120 | - resultJson.setCode("201"); | ||
| 121 | - return resultJson; | ||
| 122 | - } | 130 | + return new ResultJson("201", "充值失败"); |
| 123 | } | 131 | } |
| 124 | } | 132 | } |
| 125 | 133 |
-
请 注册 或 登录 后发表评论