kongdeqiang
2023-12-12 0423dcc11fe7bfcfc107198bbe4cbe34d77ace6f
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -16,6 +16,7 @@
import com.boying.util.HTTPEntityUtil;
import com.google.gson.Gson;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -52,6 +53,7 @@
    private final OrderRecordService orderRecordService;
    private final TicketService ticketService;
    private final TicketBlackService ticketBlackService;
    private final SystemConfigProperties systemConfigProperties;
    private final WhiteListService whiteListService;
    private final EnterParkService enterParkService;
@@ -149,6 +151,10 @@
    public Object parkXT(Long id){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        OutPark outPark =  outParkService.getById(id);
        System.out.println("id:"+id);
        if(id == null){
            return R.failed("未找到数据,请稍后重新点击");
        }
        if(outPark.getPrice()==0){
            updateOutPark(outPark.getId(),"03");
            return R.failed("本次停车无需支付费用");
@@ -220,14 +226,14 @@
        Map<String,Object> map = new HashMap<>();
        map.put("encoding","UTF-8");
        map.put("signMethod","01");
        map.put("sdkAppId","8202309110000001");
        map.put("sdkAppId",systemConfigProperties.getXTYHMERID());
        map.put("txnType","1007");
        map.put("txnSubType","100702");
        map.put("txnAccType","03");
        map.put("aesWay","01");
        map.put("merId","8202309110000001");
        map.put("merName","邯郸市峰峰矿区滏源建设发展有限公司");
        map.put("backEndUrl","http://39.96.92.240:8089/ffzf/api/getResult");
        map.put("merId",systemConfigProperties.getXTYHMERID());
        map.put("merName",systemConfigProperties.getXTYHMERNAME());
        map.put("backEndUrl",systemConfigProperties.getXTYHRESULT());
        map.put("txnOrderId",outPark.getId()+""+format);
        map.put("txnOrderTime",format);
        map.put("txnOrderBody",outPark.getCarNo()+"泊车缴费");
@@ -296,6 +302,7 @@
     */
    @PostMapping("payByWX")
    public Object payByWX(Long id,String openId){
        System.out.println("开始支付");
        OutPark outPark =  outParkService.getById(id);
        String xtyhpay = systemConfigProperties.getXTYHPAY();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
@@ -304,17 +311,17 @@
        Map<String,Object> map = new HashMap<>();
        map.put("encoding","UTF-8");
        map.put("signMethod","01");
        map.put("sdkAppId","8202309110000001");
        map.put("sdkAppId",systemConfigProperties.getXTYHMERID());
        map.put("txnType","1006");
        map.put("txnSubType","100603");
        map.put("txnAccType","02");
        map.put("secMerAppId","wx46e756aed958f895");
        map.put("secMerAppId",systemConfigProperties.getXTYHAPPID());
        map.put("txnSubOpenid",openId);
        map.put("txnProductId",outPark.getId()+"");
        map.put("aesWay","01");
        map.put("merId","8202309110000001");
        map.put("merName","邯郸市峰峰矿区滏源建设发展有限公司");
        map.put("backEndUrl","http://39.96.92.240:8089/ffzf/api/getResult");
        map.put("merId",systemConfigProperties.getXTYHMERID());
        map.put("merName",systemConfigProperties.getXTYHMERNAME());
        map.put("backEndUrl",systemConfigProperties.getXTYHRESULT());
        map.put("txnOrderId",outPark.getId()+""+format);
        map.put("txnOrderTime",format);
        map.put("txnOrderBody",outPark.getCarNo()+"泊车缴费");
@@ -429,6 +436,7 @@
            if(respCode.equals("0000")){
                //交易成功,根据流水号查询出场记录
                OutPark byPayCode = outParkService.findByPayCode(respTxnSsn);
                writeTxt2(byPayCode.getId()+"收到回执\n");
                if(byPayCode == null){
                    return R.failed("未查询到订单");
                }else {