| | |
| | | package com.boying.controller.phone; |
| | | |
| | | import cn.hutool.http.Header; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.boying.common.R; |
| | | import com.boying.common.ReturnData; |
| | | import com.boying.common.SystemConfigProperties; |
| | | import com.boying.entity.*; |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | | import java.io.FileWriter; |
| | |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.Files; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @RequiredArgsConstructor |
| | | public class YCPayController { |
| | | private final OutParkService outParkService; |
| | | private final PayLogService payLogService; |
| | | private final ParkService parkService; |
| | | private final OrderRecordService orderRecordService; |
| | | private final TicketService ticketService; |
| | | private final TicketBlackService ticketBlackService; |
| | | |
| | | private final SystemConfigProperties systemConfigProperties; |
| | | private final WhiteListService whiteListService; |
| | | private final EnterParkService enterParkService; |
| | | private final WXService wxService; |
| | | private final OutParkLogService outParkLogService; |
| | | |
| | | /** |
| | | * 查询订单接口 |
| | |
| | | if(StringUtils.isBlank(outPark.getPayCode())){ |
| | | String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费------》\n"; |
| | | writeTxt(logs); |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId()); |
| | | if(byCarNo.size()>0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | if(enterPark != null && enterPark.getIsPay() == 1){ |
| | | if(outPark.getPrice()==enterPark.getPrice()){ |
| | | return R.failed("已缴费"); |
| | | }else { |
| | | outPark.setPrice(outPark.getPrice()-enterPark.getPrice()); |
| | | outParkService.updateById(outPark); |
| | | } |
| | | } |
| | | } |
| | | addOrderRecord(outPark); |
| | | return R.ok("跳转邮储支付","https://openpayment.psbc.com/h5/static/router.html?rurl=router&router=psbc&appid=CUP14094502391¶ms={\"payMode\":\"B\",\"payItemNo\":\"41304508000500\",\"userNo\":"+id+"}"); |
| | | }else { |
| | | return R.failed("出错"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否缴费 |
| | | */ |
| | | @PostMapping("parkXT") |
| | | 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("本次停车无需支付费用"); |
| | | } |
| | | |
| | | //判断是否在白名单 |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(WhiteList::getCarNo,outPark.getCarNo()); |
| | | List<WhiteList> all = whiteListService.list(wrapper); |
| | | for(WhiteList w : all){ |
| | | if(w.getType()==0){ |
| | | updateOutPark(outPark.getId(),"03"); |
| | | return R.failed("本次停车无需支付费用!"); |
| | | }else{ |
| | | if(StringUtils.isNotBlank(w.getParkIds())){ |
| | | if(w.getParkIds().contains(outPark.getParkId()+"")){ |
| | | if(w.getEndTime()!=null){ |
| | | if(System.currentTimeMillis()<w.getEndTime().getTime()){ |
| | | updateOutPark(outPark.getId(),"03"); |
| | | return R.failed("本次停车无需支付费用!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 0){ |
| | | String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费2------》\n"; |
| | | writeTxt(logs); |
| | | OutParkLog byOutPark = outParkLogService.getByOutPark(outPark.getCarNo(), outPark.getId()); |
| | | byOutPark.setPayStartTime(LocalDateTime.now()); |
| | | outParkLogService.saveOrUpdate(byOutPark); |
| | | return R.ok(null,"跳转邢台银行支付"); |
| | | }else if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 1){ |
| | | return R.failed("已缴费"); |
| | | } |
| | | |
| | | if(StringUtils.isBlank(outPark.getPayCode())){ |
| | | String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费------》\n"; |
| | | writeTxt(logs); |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId()); |
| | | if(byCarNo.size()>0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | if(enterPark != null && enterPark.getIsPay() == 1){ |
| | | if(outPark.getPrice()==enterPark.getPrice()){ |
| | | return R.failed("已缴费"); |
| | | }else { |
| | | outPark.setPrice(outPark.getPrice()-enterPark.getPrice()); |
| | | outParkService.updateById(outPark); |
| | | OutParkLog byOutPark = outParkLogService.getByOutPark(outPark.getCarNo(), outPark.getId()); |
| | | byOutPark.setPayStartTime(LocalDateTime.now()); |
| | | outParkLogService.saveOrUpdate(byOutPark); |
| | | } |
| | | } |
| | | } |
| | | addOrderRecord(outPark); |
| | | return R.ok(null,"跳转邢台银行支付"); |
| | | }else { |
| | | return R.failed("出错"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 阿里缴费 |
| | | */ |
| | | @PostMapping("payByAli") |
| | | public Object payByAli(Long id){ |
| | | OutPark outPark = outParkService.getById(id); |
| | | String xtyhpay = systemConfigProperties.getXTYHPAY(); |
| | | LocalDateTime date3 = LocalDateTime.now(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String format = sdf.format(new Date()); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("encoding","UTF-8"); |
| | | map.put("signMethod","01"); |
| | | map.put("sdkAppId",systemConfigProperties.getXTYHMERID()); |
| | | map.put("txnType","1007"); |
| | | map.put("txnSubType","100702"); |
| | | map.put("txnAccType","03"); |
| | | map.put("aesWay","01"); |
| | | 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()+"泊车缴费"); |
| | | map.put("txnAmt",Math.round(outPark.getPrice() * 100)+""); |
| | | map.put("txnCcyType","156"); |
| | | if(outPark.getPayTime() != null){ |
| | | LocalDateTime date4 = outPark.getPayTime(); |
| | | Duration duration = Duration.between(date3, date4); |
| | | long l = duration.toMinutes(); |
| | | if(l<3){ |
| | | map.put("preTxnSsn",outPark.getCode2()); |
| | | } |
| | | } |
| | | |
| | | Map<String, String> stringStringMap = wxService.addSign(map); |
| | | map.put("certId",stringStringMap.get("certId")); |
| | | map.put("signAture",stringStringMap.get("signAture")); |
| | | Gson gson =new Gson(); |
| | | String str = gson.toJson(map); |
| | | System.out.println("请求报文:"+str); |
| | | writeTxt2(outPark.getId()+"ALipay请求: "+str); |
| | | |
| | | String body = HttpRequest.post(xtyhpay) |
| | | .header(Header.CONTENT_TYPE, "application/json") |
| | | .body(str) |
| | | .timeout(15000) |
| | | .execute() |
| | | .body(); |
| | | System.out.println(outPark.getId()+"响应报文:"+body); |
| | | |
| | | writeTxt2(outPark.getId()+"ALipay响应: "+body); |
| | | JSONObject map1 = JSON.parseObject(body); |
| | | String respCode = (String)map1.get("respCode"); |
| | | if(respCode.equals("0000")){ |
| | | String respTxnSsn = (String)map1.get("respTxnSsn"); |
| | | String respData = (String)map1.get("respData"); |
| | | String respTxnTime = (String)map1.get("respTxnTime"); |
| | | Map map2 = gson.fromJson(respData, Map.class); |
| | | String qrCode = (String)map2.get("qrCode"); |
| | | PayLog payLog = new PayLog(); |
| | | payLog.setOutParkId(outPark.getId()); |
| | | payLog.setCode2(respTxnSsn); |
| | | payLog.setQrCode(qrCode); |
| | | payLog.setPayTime(LocalDateTime.now()); |
| | | payLog.setTxnOrderId(outPark.getId()+""+format); |
| | | payLog.setTxnOrderTime(format); |
| | | payLog.setRespTxnTime(respTxnTime); |
| | | payLogService.save(payLog); |
| | | return R.ok(null,qrCode); |
| | | } |
| | | String respMsg = (String)map1.get("respMsg"); |
| | | return R.failed(respCode+":"+respMsg); |
| | | } |
| | | |
| | | /** |
| | | * 获取微信openid |
| | | */ |
| | | @PostMapping("getOpenId") |
| | | public Object park(Long id,String code){ |
| | | OutPark outPark = outParkService.getById(id); |
| | | String openIdByCode = wxService.getOpenIdByCode(code); |
| | | writeTxt2(outPark.getId()+"获取openid为:"+openIdByCode); |
| | | return payByWX(id,openIdByCode); |
| | | } |
| | | |
| | | /** |
| | | * 微信缴费 |
| | | */ |
| | | @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"); |
| | | String format = sdf.format(new Date()); |
| | | LocalDateTime date3 = LocalDateTime.now(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("encoding","UTF-8"); |
| | | map.put("signMethod","01"); |
| | | map.put("sdkAppId",systemConfigProperties.getXTYHMERID()); |
| | | map.put("txnType","1006"); |
| | | map.put("txnSubType","100603"); |
| | | map.put("txnAccType","02"); |
| | | map.put("secMerAppId",systemConfigProperties.getXTYHAPPID()); |
| | | map.put("txnSubOpenid",openId); |
| | | map.put("txnProductId",outPark.getId()+""); |
| | | map.put("aesWay","01"); |
| | | 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()+"泊车缴费"); |
| | | map.put("txnAmt",Math.round(outPark.getPrice() * 100)+""); |
| | | map.put("txnCcyType","156"); |
| | | if(outPark.getPayTime() != null){ |
| | | LocalDateTime date4 = outPark.getPayTime(); |
| | | Duration duration = Duration.between(date3, date4); |
| | | long l = duration.toMinutes(); |
| | | if(l<3){ |
| | | map.put("preTxnSsn",outPark.getCode2()); |
| | | } |
| | | } |
| | | Map<String, String> stringStringMap = wxService.addSign(map); |
| | | map.put("certId",stringStringMap.get("certId")); |
| | | map.put("signAture",stringStringMap.get("signAture")); |
| | | Gson gson =new Gson(); |
| | | String str = gson.toJson(map); |
| | | System.out.println("请求报文:"+str); |
| | | writeTxt2(outPark.getId()+"WXpay请求: "+str); |
| | | |
| | | String body = HttpRequest.post(xtyhpay) |
| | | .header(Header.CONTENT_TYPE, "application/json") |
| | | .body(str) |
| | | .timeout(15000) |
| | | .execute() |
| | | .body(); |
| | | System.out.println(outPark.getId()+"响应报文:"+body); |
| | | |
| | | writeTxt2(outPark.getId()+"WXpay响应: "+body); |
| | | JSONObject map1 = JSON.parseObject(body); |
| | | String respCode = (String)map1.get("respCode"); |
| | | if(respCode.equals("0000")){ |
| | | String respTxnSsn = (String)map1.get("respTxnSsn"); |
| | | String respTxnTime = (String)map1.get("respTxnTime"); |
| | | String respData = (String)map1.get("respData"); |
| | | Map map2 = gson.fromJson(respData, Map.class); |
| | | String appId = (String)map2.get("appId"); |
| | | String timeStamp = (String)map2.get("timeStamp"); |
| | | String nonceStr = (String)map2.get("nonceStr"); |
| | | String signType = (String)map2.get("signType"); |
| | | String package1 = (String)map2.get("package"); |
| | | String paySign = (String)map2.get("paySign"); |
| | | Map<String,String> resultMap = new HashMap<>(); |
| | | resultMap.put("appId",appId); |
| | | resultMap.put("timeStamp",timeStamp); |
| | | resultMap.put("nonceStr",nonceStr); |
| | | resultMap.put("signType",signType); |
| | | resultMap.put("package",package1); |
| | | resultMap.put("paySign",paySign); |
| | | PayLog payLog = new PayLog(); |
| | | payLog.setOutParkId(outPark.getId()); |
| | | payLog.setCode2(respTxnSsn); |
| | | payLog.setPayTime(LocalDateTime.now()); |
| | | payLog.setTxnOrderId(outPark.getId()+""+format); |
| | | payLog.setTxnOrderTime(format); |
| | | payLog.setRespTxnTime(respTxnTime); |
| | | payLogService.save(payLog); |
| | | return R.ok(resultMap,null); |
| | | } |
| | | String respMsg = (String)map1.get("respMsg"); |
| | | return R.failed(respCode+":"+respMsg); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 支付回调接口 |
| | |
| | | updateOrderRecord(queryId,"03"); |
| | | String logs = sdf.format(new Date())+" 车牌号为:"+byId.getCarNo()+",缴费成功------》\n"; |
| | | writeTxt(logs); |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(byId.getCarNo(),byId.getParkId()); |
| | | if(byCarNo.size()>0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | enterPark.setIsPay(1); |
| | | enterParkService.updateById(enterPark); |
| | | } |
| | | return R.ok(null,"回调成功"); |
| | | }else { |
| | | String logs = sdf.format(new Date())+" 出场id为:"+queryId+",缴费失败------》\n"; |
| | |
| | | } |
| | | return R.ok(byId,"回调成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 邢台银行支付回调接口 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/getResult") |
| | | public Object getResult(HttpServletRequest request){ |
| | | System.out.println("getResult收到访问"); |
| | | String respCode = request.getParameter("respCode"); |
| | | String respTxnSsn = request.getParameter("respTxnSsn"); |
| | | // String respCode = map.get("respCode"); |
| | | // String respTxnSsn = map.get("respTxnSsn"); |
| | | System.out.println(respCode+":"+respTxnSsn); |
| | | if(respCode != null){ |
| | | if(respCode.equals("0000")){ |
| | | //交易成功,根据流水号查询出场记录 |
| | | PayLog payLog = payLogService.findByPayCode(respTxnSsn); |
| | | if(payLog == null){ |
| | | return R.failed("未查询到流水记录"); |
| | | }else { |
| | | OutPark byPayCode = outParkService.getById(payLog.getOutParkId()); |
| | | writeTxt2(byPayCode.getId()+"收到回执\n"); |
| | | if(byPayCode == null){ |
| | | return R.failed("未查询到订单"); |
| | | }else { |
| | | if(byPayCode.getStatus() == 1){ |
| | | return R.ok(null,"订单已支付"); |
| | | }else { |
| | | OutParkLog byOutPark = outParkLogService.getByOutPark(byPayCode.getCarNo(), byPayCode.getId()); |
| | | byOutPark.setPayEndTime(LocalDateTime.now()); |
| | | outParkLogService.saveOrUpdate(byOutPark); |
| | | updateOrderRecord((long)byPayCode.getId(),"03"); |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(byPayCode.getCarNo(),byPayCode.getParkId()); |
| | | if(byCarNo.size()>0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | enterPark.setIsPay(1); |
| | | enterParkService.updateById(enterPark); |
| | | } |
| | | return R.ok(null,"回调成功"); |
| | | } |
| | | } |
| | | } |
| | | }else if(respCode.equals("0002") || respCode.equals("0003") || respCode.equals("0003") || respCode.equals("0012")){ |
| | | //交易成功,超时,未明,稍后发起查询 |
| | | }else if(respCode.equals("0011")){ |
| | | //交易 |
| | | } |
| | | }else { |
| | | return R.failed("未接收到入参"); |
| | | } |
| | | return R.failed(null,"请求失败"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 对账接口 |
| | |
| | | return R.failed(null,"文件不存在"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 邢台银行对账接口 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping ("/checkbillXTYH") |
| | | public Object checkbillXTYH(String date){ |
| | | String xtyhpay = systemConfigProperties.getXTYHPAY(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("encoding","UTF-8"); |
| | | map.put("signMethod","01"); |
| | | map.put("txnType","4001"); |
| | | map.put("txnSubType","400102"); |
| | | map.put("billType","00"); |
| | | map.put("billDate",date); |
| | | map.put("merId","8202309110000001"); |
| | | |
| | | Map<String, String> stringStringMap = wxService.addSign(map); |
| | | map.put("certId",stringStringMap.get("certId")); |
| | | map.put("signAture",stringStringMap.get("signAture")); |
| | | Gson gson =new Gson(); |
| | | String str = gson.toJson(map); |
| | | System.out.println("请求报文:"+str); |
| | | writeTxt2(date+"对账请求: "+str); |
| | | |
| | | String body = HttpRequest.post(xtyhpay) |
| | | .header(Header.CONTENT_TYPE, "application/json") |
| | | .body(str) |
| | | .timeout(15000) |
| | | .execute() |
| | | .body(); |
| | | |
| | | writeTxt2(date+"对账响应: "+body); |
| | | JSONObject map1 = JSON.parseObject(body); |
| | | String respCode = (String)map1.get("respCode"); |
| | | if(respCode.equals("0000")){ |
| | | String billDownloadUrl = (String)map1.get("billDownloadUrl"); |
| | | String respData = (String)map1.get("respData"); |
| | | return R.ok(null,billDownloadUrl); |
| | | } |
| | | String respMsg = (String)map1.get("respMsg"); |
| | | return R.failed(respCode+":"+respMsg); |
| | | } |
| | | |
| | | /** |
| | | * 交易状态查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping ("/searchPayStatus") |
| | | public Object searchPayStatus(String txnOrderId,String txnOrderTime){ |
| | | OutPark outPark = outParkService.findByOrderId(txnOrderId); |
| | | if(outPark == null){ |
| | | return R.failed("未找到该订单"); |
| | | } |
| | | String xtyhpay = systemConfigProperties.getXTYHPAY(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("encoding","UTF-8"); |
| | | map.put("signMethod","01"); |
| | | map.put("sdkAppId","8202309110000001"); |
| | | map.put("txnType","1009"); |
| | | map.put("txnSubType","100900"); |
| | | map.put("merId","8202309110000001"); |
| | | map.put("origTxnOrderId",txnOrderId); |
| | | map.put("origTxnOrderTime",txnOrderTime); |
| | | |
| | | Map<String, String> stringStringMap = wxService.addSign(map); |
| | | map.put("certId",stringStringMap.get("certId")); |
| | | map.put("signAture",stringStringMap.get("signAture")); |
| | | Gson gson =new Gson(); |
| | | String str = gson.toJson(map); |
| | | System.out.println("请求报文:"+str); |
| | | writeTxt2(txnOrderId+"状态查询请求: "+str); |
| | | |
| | | String body = HttpRequest.post(xtyhpay) |
| | | .header(Header.CONTENT_TYPE, "application/json") |
| | | .body(str) |
| | | .timeout(15000) |
| | | .execute() |
| | | .body(); |
| | | System.out.println(txnOrderId+"状态查询响应报文:"+body); |
| | | |
| | | writeTxt2(txnOrderId+"状态查询响应: "+body); |
| | | JSONObject map1 = JSON.parseObject(body); |
| | | String respCode = (String)map1.get("respCode"); |
| | | if(respCode.equals("0000")){ |
| | | result((long)outPark.getId(),0,0); |
| | | return R.ok(null,"查询成功"); |
| | | } |
| | | String respMsg = (String)map1.get("respMsg"); |
| | | return R.failed(respCode+":"+respMsg); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //更新出场 |
| | | public void updateOutPark(Integer outParkId, String status){ |
| | | OutPark outPark = outParkService.getById(outParkId); |
| | | if(outPark!=null){ |
| | | if(outPark!=null && outPark.getEnterTime() !=null){ |
| | | if(status.equals("03")){ |
| | | outPark.setStatus(1); |
| | | outParkService.saveOrUpdate(outPark); |
| | |
| | | String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",创建订单------》\n"; |
| | | writeTxt(logs); |
| | | outPark.setPayCode(outPark.getId()+""); |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId()); |
| | | outParkService.updateById(outPark); |
| | | Park park = parkService.getById(outPark.getParkId()); |
| | | OrderRecord orderRecord = new OrderRecord(); |
| | | if(byCarNo.size() >0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | if(enterPark != null && enterPark.getImgId() != null){ |
| | | orderRecord.setImgInId(enterPark.getImgId()); |
| | | } |
| | | } |
| | | orderRecord.setAddress(park.getName()); |
| | | orderRecord.setCarNo(outPark.getCarNo()); |
| | | orderRecord.setCode(outPark.getCode()); |
| | |
| | | orderRecord.setPayCode(outPark.getPayCode()); |
| | | if(outPark.getImgId() != null){ |
| | | orderRecord.setImgOutId(outPark.getImgId()); |
| | | } |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId()); |
| | | if(byCarNo.size() >0){ |
| | | EnterPark enterPark = byCarNo.get(0); |
| | | if(enterPark != null && enterPark.getImgId() != null){ |
| | | orderRecord.setImgInId(enterPark.getImgId()); |
| | | } |
| | | } |
| | | orderRecordService.saveOrUpdate(orderRecord); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private void writeTxt2( String txt) |
| | | { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | try |
| | | { |
| | | FileWriter f = new FileWriter(systemConfigProperties.getLogPath()+"邢台银行支付日志"+sdf.format(new Date())+".txt",true); |
| | | BufferedWriter bw=new BufferedWriter(f); |
| | | bw.write(txt); |
| | | bw.newLine(); |
| | | bw.close(); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | System.out.println("打印错误"); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Path path = Paths.get("E:\\ycCheckBill\\Bank_PSBC_20350421.txt"); |
| | | try { |