TtqfController.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package com.ydtech.modules.ttqf.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.ydtech.core.page.HttpResult;
  4. import com.ydtech.modules.ttqf.QuartzManager;
  5. import com.ydtech.modules.ttqf.RegularlyPaymentStatus;
  6. import com.ydtech.modules.ttqf.RegularlyUpdateStatus;
  7. import com.ydtech.modules.ttqf.RetrieveTTQFApi;
  8. import com.ydtech.modules.ttqf.service.TtqfService;
  9. import org.springframework.web.bind.annotation.*;
  10. import javax.annotation.Resource;
  11. import java.util.HashMap;
  12. @RestController
  13. @RequestMapping("ttqf")
  14. public class TtqfController {
  15. private static RegularlyPaymentStatus paymentStatus;
  16. @Resource
  17. private TtqfService ttqfService;
  18. @Resource
  19. private void setPaymentStatus(RegularlyPaymentStatus regularlyPaymentStatus){
  20. paymentStatus = regularlyPaymentStatus;
  21. }
  22. /**
  23. * 接收打款通知回调
  24. * @param obj
  25. * @return
  26. */
  27. @PostMapping("paymentNotice")
  28. public JSONObject paymentNotice(@RequestBody String obj){
  29. return ttqfService.paymentNotice(obj);
  30. }
  31. /**
  32. * 接收用户签约回调
  33. * @param obj
  34. * @return
  35. */
  36. @PostMapping("userSign")
  37. public JSONObject userSign(@RequestBody String obj){
  38. return ttqfService.userSign(obj);
  39. }
  40. /**
  41. * 账单下载
  42. * @param type 必填,1:日账单2:月账单
  43. * @param date 日账单: yyyy-MM-dd 月账单:yyyy-MM
  44. * @return
  45. */
  46. @PostMapping("billDownload")
  47. public HttpResult billDownload(@RequestParam("type")Integer type, @RequestParam("date")String date){
  48. return ttqfService.billDownload(type,date);
  49. }
  50. /**
  51. * 电子回执单下载
  52. * @param mchOrderNo 商户订单号与天天企赋业务订单号二选一
  53. * @param orderNo 商户订单号与天天企赋业务订单号二选一
  54. * @return
  55. */
  56. @PostMapping("receiptDownload")
  57. public HttpResult receiptDownload(@RequestParam("mchOrderNo")String mchOrderNo,@RequestParam("orderNo")String orderNo){
  58. return ttqfService.receiptDownload(mchOrderNo,orderNo);
  59. }
  60. @GetMapping("xx/{de}")
  61. public String xx(@PathVariable("de")String de) throws Exception {
  62. paymentStatus.updatePaymentStatus(de);
  63. return "";
  64. }
  65. @GetMapping("aa/{de}")
  66. public String getss(@PathVariable("de")String de) throws Exception {
  67. RetrieveTTQFApi.extractBalance("",de);
  68. return "";
  69. }
  70. @GetMapping("test")
  71. public void test() throws Exception {
  72. HashMap<String, String> hashMap = new HashMap<>();
  73. hashMap.put("userId","11111111111111");
  74. QuartzManager manager = QuartzManager.getInstance();
  75. manager.getContext().put("flag",true);
  76. manager.addJob("jobName","jobGroup", RegularlyUpdateStatus.class,"*/5 * * * * ?",hashMap);
  77. manager.start();
  78. }
  79. }