|
@@ -2021,8 +2021,12 @@ public class TOrderController {
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
- equipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
- }
|
|
|
+ if (!order.getIsNotified().equals("1")) {
|
|
|
+ String paySuccess = equipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
+ if (paySuccess.equals("success")) {
|
|
|
+ order.setIsNotified("1");
|
|
|
+ }
|
|
|
+ } }
|
|
|
orderService.updateById(order);
|
|
|
// equipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
try {
|
|
@@ -2033,14 +2037,19 @@ public class TOrderController {
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- try {
|
|
|
+ // try {
|
|
|
+ LambdaQueryWrapper<TOrderTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(TOrderTask::getSn, sn);
|
|
|
+ TOrderTask oldOrderTask = orderTaskService.getOne(queryWrapper);
|
|
|
+ if (oldOrderTask == null) {
|
|
|
TOrderTask orderTask = new TOrderTask();
|
|
|
BeanUtils.copyPropertiesIgnoreNull(order, orderTask, true);
|
|
|
orderTask.setAgencyId(order.getId());
|
|
|
orderTaskService.save(orderTask);
|
|
|
- }catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
+// }catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
//传送数据
|
|
|
sentJingZhun(order);
|
|
|
return R.ok("支付成功");
|
|
@@ -2049,8 +2058,12 @@ public class TOrderController {
|
|
|
String gtClientId = equipment.getGtClientId();
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", order.getSn());
|
|
|
- equipmentService.sentMessage(equipment.getClientId(),PushUtils.buildJson("pay_faile", kindData.toString()).toString());
|
|
|
- order.setNote(gtClientId + "支付失败");
|
|
|
+ if (!order.getIsNotified().equals("2")) {
|
|
|
+ String payFail = equipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("pay_faile", kindData.toString()).toString());
|
|
|
+ if (payFail.equals("success")) {
|
|
|
+ order.setIsNotified("2");
|
|
|
+ }
|
|
|
+ } order.setNote(gtClientId + "支付失败");
|
|
|
orderService.updateById(order);
|
|
|
return R.fail(ResponseCodesEnum.A0001,"支付失败");
|
|
|
}
|
|
@@ -2063,7 +2076,7 @@ public class TOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/notify", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Object refund(HttpServletRequest request) {
|
|
|
+ public String notify(HttpServletRequest request) {
|
|
|
|
|
|
String r6_Status = request.getParameter("r6_Status");
|
|
|
|
|
@@ -2152,7 +2165,12 @@ public class TOrderController {
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
- equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
+ if (!order.getIsNotified().equals("1")) {
|
|
|
+ String paySuccess = equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
+ if (paySuccess.equals("success")) {
|
|
|
+ order.setIsNotified("1");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
orderService.updateById(order);
|
|
|
|
|
@@ -2164,14 +2182,19 @@ public class TOrderController {
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- try {
|
|
|
+// try {
|
|
|
+ LambdaQueryWrapper<TOrderTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(TOrderTask::getSn, sn);
|
|
|
+ TOrderTask oldOrderTask = orderTaskService.getOne(queryWrapper);
|
|
|
+ if (oldOrderTask == null) {
|
|
|
TOrderTask orderTask = new TOrderTask();
|
|
|
BeanUtils.copyPropertiesIgnoreNull(order, orderTask, true);
|
|
|
orderTask.setAgencyId(order.getId());
|
|
|
orderTaskService.save(orderTask);
|
|
|
- }catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
+// }catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
//传送数据
|
|
|
sentJingZhun(order);
|
|
|
return "success";
|
|
@@ -2180,12 +2203,16 @@ public class TOrderController {
|
|
|
String gtClientId = byClientId.getGtClientId();
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", order.getSn());
|
|
|
- equipmentService.sentMessage(byClientId.getClientId(),PushUtils.buildJson("pay_faile", kindData.toString()).toString());
|
|
|
+ if (!order.getIsNotified().equals("2")) {
|
|
|
+ String payFail = equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("pay_faile", kindData.toString()).toString());
|
|
|
+ if (payFail.equals("success")) {
|
|
|
+ order.setIsNotified("2");
|
|
|
+ }
|
|
|
+ }
|
|
|
order.setNote(gtClientId + "支付失败");
|
|
|
orderService.updateById(order);
|
|
|
+ return "success";
|
|
|
}
|
|
|
-
|
|
|
- return "success";
|
|
|
}
|
|
|
|
|
|
//发送两次mq
|