...
|
...
|
@@ -97,29 +97,37 @@ public class PayOrderController { |
|
|
*/
|
|
|
Location location = locationMapper.waterId_eleId(payRecords.getPaylocationname());
|
|
|
/**
|
|
|
* true 为电 false 为水
|
|
|
* 支付状态 充值状态满足条件进入否则不操作
|
|
|
*/
|
|
|
if (payRecords.getPaytype()){
|
|
|
int i = electricityMeterService.rechargeDevices(location.getEeid(), String.valueOf(payRecords.getPayfees()),
|
|
|
"0", payRecords.getOrdernumber());
|
|
|
if (i == 1){
|
|
|
payRecords.setReamke3("1");
|
|
|
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
|
|
|
return i1 == 1? new ResultJson("200", "电费充值成功"): new ResultJson("201", "电费充值失败");
|
|
|
if (payRecords.getPaystatus() == true && "0".equals(payRecords.getReamke3())){
|
|
|
/**
|
|
|
* true 为电 false 为水
|
|
|
*/
|
|
|
if (payRecords.getPaytype()){
|
|
|
int i = electricityMeterService.rechargeDevices(location.getEeid(), String.valueOf(payRecords.getPayfees()),
|
|
|
"0", payRecords.getOrdernumber());
|
|
|
if (i == 1){
|
|
|
payRecords.setReamke3("1");
|
|
|
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
|
|
|
return i1 == 1? new ResultJson("200", "电费充值成功"): new ResultJson("201", "电费充值失败");
|
|
|
}else {
|
|
|
return new ResultJson("201", "电费充值失败");
|
|
|
}
|
|
|
}else {
|
|
|
return new ResultJson("201", "电费充值失败");
|
|
|
ResultJson resultJson = waterMeterService.payWater(String.valueOf(payRecords.getPayfees()), location.getWmid());
|
|
|
|
|
|
if ("200".equals(resultJson.getCode())){
|
|
|
payRecords.setReamke3("1");
|
|
|
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
|
|
|
return i1 == 1? new ResultJson("200", "水费充值成功"): new ResultJson("201", "水费充值失败");
|
|
|
}else {
|
|
|
resultJson.setCode("201");
|
|
|
return resultJson;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
ResultJson resultJson = waterMeterService.payWater(String.valueOf(payRecords.getPayfees()), location.getWmid());
|
|
|
|
|
|
if ("200".equals(resultJson.getCode())){
|
|
|
payRecords.setReamke3("1");
|
|
|
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
|
|
|
return i1 == 1? new ResultJson("200", "水费充值成功"): new ResultJson("201", "水费充值失败");
|
|
|
}else {
|
|
|
resultJson.setCode("201");
|
|
|
return resultJson;
|
|
|
}
|
|
|
return new ResultJson("201", "充值失败");
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|