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 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(); } }