| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- package com.ydtech.modules.ttqf.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.ydtech.core.page.HttpResult;
- import com.ydtech.modules.ttqf.QuartzManager;
- import com.ydtech.modules.ttqf.RegularlyPaymentStatus;
- import com.ydtech.modules.ttqf.RegularlyUpdateStatus;
- import com.ydtech.modules.ttqf.RetrieveTTQFApi;
- import com.ydtech.modules.ttqf.service.TtqfService;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import java.util.HashMap;
- @RestController
- @RequestMapping("ttqf")
- public class TtqfController {
- private static RegularlyPaymentStatus paymentStatus;
- @Resource
- private TtqfService ttqfService;
- @Resource
- private void setPaymentStatus(RegularlyPaymentStatus regularlyPaymentStatus){
- paymentStatus = regularlyPaymentStatus;
- }
- /**
- * 接收打款通知回调
- * @param obj
- * @return
- */
- @PostMapping("paymentNotice")
- public JSONObject paymentNotice(@RequestBody String obj){
- return ttqfService.paymentNotice(obj);
- }
- /**
- * 接收用户签约回调
- * @param obj
- * @return
- */
- @PostMapping("userSign")
- public JSONObject userSign(@RequestBody String obj){
- return ttqfService.userSign(obj);
- }
- /**
- * 账单下载
- * @param type 必填,1:日账单2:月账单
- * @param date 日账单: yyyy-MM-dd 月账单:yyyy-MM
- * @return
- */
- @PostMapping("billDownload")
- public HttpResult billDownload(@RequestParam("type")Integer type, @RequestParam("date")String date){
- return ttqfService.billDownload(type,date);
- }
- /**
- * 电子回执单下载
- * @param mchOrderNo 商户订单号与天天企赋业务订单号二选一
- * @param orderNo 商户订单号与天天企赋业务订单号二选一
- * @return
- */
- @PostMapping("receiptDownload")
- public HttpResult receiptDownload(@RequestParam("mchOrderNo")String mchOrderNo,@RequestParam("orderNo")String orderNo){
- return ttqfService.receiptDownload(mchOrderNo,orderNo);
- }
- @GetMapping("xx/{de}")
- public String xx(@PathVariable("de")String de) throws Exception {
- paymentStatus.updatePaymentStatus(de);
- return "";
- }
- @GetMapping("aa/{de}")
- public String getss(@PathVariable("de")String de) throws Exception {
- RetrieveTTQFApi.extractBalance("",de);
- return "";
- }
- @GetMapping("test")
- public void test() throws Exception {
- HashMap<String, String> hashMap = new HashMap<>();
- hashMap.put("userId","11111111111111");
- QuartzManager manager = QuartzManager.getInstance();
- manager.getContext().put("flag",true);
- manager.addJob("jobName","jobGroup", RegularlyUpdateStatus.class,"*/5 * * * * ?",hashMap);
- manager.start();
- }
- }
|