| | |
| | | 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; |
| | |
| | | @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; |
| | |
| | | |
| | | //生成电子缴款码 |
| | | @PostMapping("zhiFa") |
| | | @Operation(summary = "执法生成缴款码" , description = "执法生成缴款码" ) |
| | | public Object zhiFa(Long id){ |
| | | Ticket ticket = ticketService.getById(id); |
| | | if(ticket.getPayStatus()==1){ |
| | |
| | | |
| | | //支付接口通知 |
| | | @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); |
| | |
| | | |
| | | //生成电子缴款码 |
| | | @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"; |
| | |
| | | * 缴款书 |
| | | */ |
| | | @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"; |
| | |
| | | * 获取执法id |
| | | */ |
| | | @PostMapping("getZhifaId") |
| | | @Operation(summary = "更新大厅缴款码" , description = "更新大厅缴款码" ) |
| | | public Object getZhifaId(){ |
| | | QueryWrapper<NowPayOrder> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | * 缴款书 |
| | | */ |
| | | @PostMapping("zhifa") |
| | | @Operation(summary = "执法缴费(新)" , description = "执法缴费(新)" ) |
| | | public Object zhifa(Long id){ |
| | | System.out.println(id+"开始缴费"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | String logs = sdf.format(new Date())+"开始扫码缴费------》\n"; |
| | | logs += "罚单表id为:"+id+",\n"; |
| | |
| | | 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())){ |
| | |
| | | addOrderRecord2(ticket); |
| | | return payurl+eticketnum; |
| | | }else { |
| | | System.out.println("支付申请缴款码返回为:"+entity); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |