| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(value = "/api/unipay") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "ApiMallMemberController", tags = "支付接口类") |
| | | public class UnipayController { |
| | | |
| | | @Autowired |
| | |
| | | // System.out.println(orderNo); |
| | | // } |
| | | |
| | | // @ApiOperation(value = "获取协议支付签约短信", notes = "获取协议支付签约短信") |
| | | // @PostMapping(value = "getAgreeMentPaySms") |
| | | // public FebsResponse getAgreeMentPaySms(@RequestBody AgreeMentPaySmsDto agreeMentPaySmsDto) { |
| | | // unipayService.getAgreeMentPaySms(agreeMentPaySmsDto); |
| | | // return new FebsResponse().success().message("申请成功"); |
| | | // } |
| | | @ApiOperation(value = "获取协议支付签约短信", notes = "获取协议支付签约短信") |
| | | @PostMapping(value = "getAgreeMentPaySms") |
| | | public FebsResponse getAgreeMentPaySms(@RequestBody AgreeMentPaySmsDto agreeMentPaySmsDto) { |
| | | String agreeMentPaySms = unipayService.getAgreeMentPaySms(agreeMentPaySmsDto); |
| | | if("fail".equals(agreeMentPaySms)){ |
| | | return new FebsResponse().fail().message("获取失败"); |
| | | }else{ |
| | | return new FebsResponse().success().message("获取成功"); |
| | | } |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // String data = "{\\\"bank_trx_no\\\":\\\"0825144603229910\\\",\\\"jp_order_no\\\":\\\"100120220825446322447537651712\\\",\\\"mch_order_no\\\":\\\"2022082514435329133\\\",\\\"order_amount\\\":0.10,\\\"order_desc\\\":\\\"测试\\\",\\\"order_status\\\":\\\"P1000\\\",\\\"pay_success_time\\\":\\\"2022-08-25 14:46:04\\\"}"; |
| | |
| | | orderInfo.setPayResult("1"); |
| | | orderInfo.setPayTime(DateUtil.parse(pay_success_time)); |
| | | orderInfo.setPayTradeNo(jp_order_no); |
| | | orderInfo.setPayOrderNo(orderNo); |
| | | orderInfoMapper.updateById(orderInfo); |
| | | |
| | | boolean hasTc = false; |