kongdeqiang
2024-04-22 7bc78d8f70a4d11e46f8bd640228804a3dd0dc68
src/main/java/com/boying/controller/phone/PayController.java
@@ -15,7 +15,10 @@
import com.boying.service.*;
import com.boying.util.HTTPEntityUtil;
import com.google.gson.Gson;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.PostMapping;
@@ -44,12 +47,14 @@
@RestController
@RequestMapping("ffzf/ffPay")
@RequiredArgsConstructor
@Tag(description = "ffzf/ffPay" , name = "对接财政支付接口" )
public class PayController extends BaseController {
    private final OrderRecordService orderRecordService;
    private final TicketService ticketService;
    private final TicketBlackService ticketBlackService;
    private final OutParkService outParkService;
    @Autowired
    private final SystemConfigProperties systemConfigProperties;
    private final ParkService parkService;
    private final WhiteListService whiteListService;
@@ -65,6 +70,7 @@
    //生成电子缴款码
    @PostMapping("zhiFa")
    @Operation(summary = "执法生成缴款码" , description = "执法生成缴款码" )
    public Object zhiFa(Long id){
        Ticket ticket = ticketService.getById(id);
        if(ticket.getPayStatus()==1){
@@ -166,6 +172,7 @@
    //支付接口通知
    @PostMapping("result")
    @Operation(summary = "缴费结果通知" , description = "缴费结果通知" )
    public String result(HttpServletRequest request, String payKey, String payerTypeCode, String payerNum, String payCode, Double amt, String status, String errorInfo, String sign, String signType) throws Exception{
        try {
           // updateOrderRecord(payCode,status);
@@ -177,6 +184,7 @@
    //生成电子缴款码
    @PostMapping("park2")
    @Operation(summary = "财政缴费更新生成缴款码" , description = "财政缴费更新生成缴款码" )
    public Object park2(Long id){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        String logs = sdf.format(new Date())+"开始扫码缴费------》\n";
@@ -275,6 +283,7 @@
     * 缴款书
     */
    @PostMapping("park")
    @Operation(summary = "对接邮储生成缴款书" , description = "对接邮储生成缴款书" )
    public Object park(Long id){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        String logs = sdf.format(new Date())+"开始扫码缴费------》\n";
@@ -387,6 +396,7 @@
     * 获取执法id
     */
    @PostMapping("getZhifaId")
    @Operation(summary = "更新大厅缴款码" , description = "更新大厅缴款码" )
    public Object getZhifaId(){
        QueryWrapper<NowPayOrder> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -405,6 +415,7 @@
     * 缴款书
     */
    @PostMapping("zhifa")
    @Operation(summary = "执法缴费(新)" , description = "执法缴费(新)" )
    public Object zhifa(Long id){
        System.out.println(id+"开始缴费");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
@@ -417,9 +428,9 @@
            writeTxt(logs);
            return R.failed("本罚单无需支付费用");
        }
        if(StringUtils.isNotBlank(ticket.getPayCode()) && ticket.getStatus() == 0){
        if(StringUtils.isNotBlank(ticket.getPayCode()) && ticket.getPayStatus() == 0){
            return R.ok("生成电子罚单缴款码", "https://hbfs.govpay.ccb.com/online/fssm?fee=130000000001&PyfScnCgycd=01&pyfTpcd=3&BNo="+ticket.getPayCode());
        }else if(StringUtils.isNotBlank(ticket.getPayCode()) && ticket.getStatus() == 1){
        }else if(StringUtils.isNotBlank(ticket.getPayCode()) && ticket.getPayStatus() == 1){
            return R.failed("已缴费");
        }
        if(StringUtils.isBlank(ticket.getPayCode())){
@@ -540,6 +551,12 @@
            if(status.equals("03")){
                ticket.setPayStatus(1);
                dealCar(ticket.getCarNo());
                if(StringUtils.isBlank(ticket.getNumber()) || "--".equals(ticket.getNumber())){
                    ticket = ticketService.getNumber(ticket);
                    ticket.setPush(0);
                    ticketService.uploadInfo(ticket);
                    return;
                }
            }
            if(status.equals("04")||status.equals("05")||status.equals("06")){
                ticket.setPayStatus(2);
@@ -561,9 +578,13 @@
            wrapper1.lambda()
                    .eq(TicketBlack::getCarNo,carNo);
            List<TicketBlack> all = ticketBlackService.list(wrapper1);
            for(TicketBlack ticketBlack:all){
                ticketBlack.setStatus(1);
                ticketBlack.setBlackType(0);
            if(all.size()>0){
                TicketBlack ticketBlack = all.get(0);
                ticketBlack.setViolationCount(ticketBlack.getViolationCount() == 0?0:ticketBlack.getViolationCount() - 1);
                if(ticketBlack.getIsActive() == 0){
                    ticketBlack.setStatus(1);
                    ticketBlack.setBlackType(0);
                }
                ticketBlackService.saveOrUpdate(ticketBlack);
            }
        }