| | |
| | | import com.dsh.activity.model.response.HuiminAgreementVO; |
| | | import com.dsh.activity.model.response.HuiminCardVO; |
| | | import com.dsh.activity.service.*; |
| | | |
| | | import com.dsh.activity.util.PayMoneyUtil; |
| | | import com.dsh.activity.util.ResultUtil; |
| | | import com.dsh.activity.util.TokenUtil; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 惠民卡回调 |
| | | * 玩湃惠民卡回调 |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 11:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/huimin/callBack") |
| | | @RequestMapping("/base/huimin/callBack") |
| | | public class HuiminCallBack { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | |
| | | /** |
| | | * 惠民卡支付宝支付回调接口 |
| | | * 玩湃惠民卡支付宝支付回调接口 |
| | | */ |
| | | @PostMapping("/aliPayHuiminCallback") |
| | | public void aliPayHuiminCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | System.err.println("支付宝回调"); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if (null != map) { |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | String transaction_id = map.get("trade_no"); |
| | | TPayHuimin one = payHuiminService.getOne(new LambdaQueryWrapper<TPayHuimin>().eq(TPayHuimin::getCode, out_trade_no)); |
| | | if (one!=null){ |
| | | if (one.getStatus()==2){ |
| | |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | }else{ |
| | | }else if (one.getStatus()==1){ |
| | | one.setOrderNumber(transaction_id); |
| | | one.setStatus(2); |
| | | one.setPaymentTime(new Date()); |
| | | payHuiminService.updateById(one); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | }else{ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡微信支付回调接口 |
| | | * 玩湃惠民卡微信支付回调接口 |
| | | */ |
| | | @PostMapping("/weixinPayHuiminCallback") |
| | | public void weixinPayHuiminCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | System.err.println("微信回调"); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if (null != map) { |
| | | String out_trade_no = map.get("out_trade_no"); |
| | |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | }else{ |
| | | }else if (one.getStatus()==1){ |
| | | one.setOrderNumber(transaction_id); |
| | | one.setStatus(2); |
| | | one.setPaymentTime(new Date()); |
| | | payHuiminService.updateById(one); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | }else{ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡微信退款回调 |
| | | * 玩湃惠民卡微信退款回调 |
| | | * @param request |
| | | * @param response |
| | | */ |