package com.saye.hrs.controller; import com.saye.hrs.commons.log.LogUtil; import com.saye.hrs.model.WxResult; import com.saye.hrs.model.WxybResult; import com.saye.hrs.service.WxPayService; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; /*** * @title WxPayController * @description TODO 请填写注释 * @author thuang * @create 2023/8/15 9:34 **/ @RestController public class WxPayController { @Resource private WxPayService wxPayService; @PostMapping("/api/addWxPayInfo") public HashMap addWxPayInfo(@RequestBody WxResult reqDTO){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.addWxPayInfo(reqDTO); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="保存微信门诊及医保支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/findWxPayInfo") public HashMap findWxPayInfo(@RequestBody WxResult reqDTO){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { WxResult map = wxPayService.findWxPayInfo(reqDTO); resultMap.put("data",map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询微信门诊及医保支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/addWxybPayInfo") public HashMap addWxybPayInfo(@RequestBody WxybResult reqDTO){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.addWxybPayInfo(reqDTO); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="保存微信医保支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/findWxybPayInfo") public HashMap findWxybPayInfo(@RequestBody WxybResult reqDTO){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { WxybResult map = wxPayService.findWxybPayInfo(reqDTO); resultMap.put("data",map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询微信医保支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/getWxNotSendInfo") public HashMap getWxNotSendInfo(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { List list = wxPayService.getWxNotSendInfo(map); resultMap.put("List",list); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询微信未支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/getWxybNotSendInfo") public HashMap getWxybNotSendInfo(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { List list = wxPayService.getWxybNotSendInfo(map); resultMap.put("List",list); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询微信医保未支付记录失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/addOrderInfo") public HashMap addOrderInfo(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.addOrderInfo(map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="保存订单支付状态失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/updateOrderInfoPay") public HashMap updateOrderInfoPay(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.updateOrderInfoPay(map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="保存订单支付状态失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/updateYBOrderInfoPay") public HashMap updateYBOrderInfoPay(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.updateYBOrderInfoPay(map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="更新订单支付状态失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/updateOrderInfoComplete") public HashMap updateOrderInfoComplete(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.updateOrderInfoComplete(map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="更新订单状态为完成失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/findOrderInfo") public HashMap findOrderInfo(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { List> list = wxPayService.findOrderInfo(map); resultMap.put("list",list); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询未完成订单内容失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } @PostMapping("/api/updateOrderInfoEnd") public HashMap updateOrderInfoEnd(@RequestBody HashMap map){ HashMap resultMap=new HashMap<>(); String errCode="0"; String errMsg=""; try { wxPayService.updateOrderInfoEnd(map); }catch (Exception e){ e.printStackTrace(); errCode="999"; errMsg="查询未完成订单内容失败,原因:"+e.getMessage(); } resultMap.put("errCode",errCode); resultMap.put("errMsg",errMsg); return resultMap; } }