From 88cd1327927786660b9e7594ff3ec5ed9bc05c83 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 15 Sep 2023 11:06:21 +0800 Subject: [PATCH] 1 --- .../bweb/controller/HighTestController.java | 2 +- .../cweb/controller/Blx/BlxCarController.java | 7 + .../cweb/controller/HighCouponController.java | 8 +- .../cweb/controller/HighGasController.java | 2 +- .../main/java/com/web/config/SysConfig.java | 3 + .../web/controller/OrderPayController.java | 51 +++++- .../notify/HuiPayNotifyController.java | 81 +++++++++ .../src/main/resources/dev/config.properties | 1 + .../com/hai/schedule/HighGasSchedule.java | 7 +- .../java/com/hai/dao/ApiBlxOrderMapper.java | 58 ++++--- .../com/hai/dao/ApiBlxOrderSqlProvider.java | 38 +++-- .../java/com/hai/dao/HighOrderMapper.java | 100 +++++------ .../com/hai/dao/HighOrderSqlProvider.java | 14 ++ .../com/hai/dao/HighUserCouponMapper.java | 15 +- .../hai/dao/HighUserCouponSqlProvider.java | 14 ++ .../main/java/com/hai/entity/ApiBlxOrder.java | 40 +++-- .../com/hai/entity/ApiBlxOrderExample.java | 158 ++++++++++++++---- .../main/java/com/hai/entity/HighCoupon.java | 2 +- .../main/java/com/hai/entity/HighOrder.java | 19 ++- .../java/com/hai/entity/HighOrderExample.java | 60 +++++++ .../java/com/hai/entity/HighUserCoupon.java | 18 +- .../com/hai/entity/HighUserCouponExample.java | 60 +++++++ .../main/java/com/hai/model/UserModel.java | 6 - .../com/hai/openApi/config/BlxConfig.java | 10 +- .../service/impl/ApiBlxCouponServiceImpl.java | 4 +- .../order/model/CreateOrderChildModel.java | 27 ++- .../impl/OrderCreateHandleServiceImpl.java | 69 +++++++- .../impl/OrderPaySuccessServiceImpl.java | 24 +-- .../service/impl/OrderRefundServiceImpl.java | 31 +++- .../order/service/impl/OrderServiceImpl.java | 14 +- .../hai/pay/channel/huipay/TradeService.java | 7 + .../pay/channel/huipay/config/HuiConfig.java | 117 +++++++++++++ .../channel/huipay/utils/SignatureUtil.java | 99 +++++++++++ .../impl/HighCouponCodeServiceImpl.java | 20 +-- .../HighGasDiscountOilPriceServiceImpl.java | 2 - .../service/impl/HighUserCardServiceImpl.java | 12 +- .../impl/HighUserCouponServiceImpl.java | 17 +- .../resources/dev/commonConfig.properties | 17 +- .../business/StarbucksController.java | 6 +- 39 files changed, 1019 insertions(+), 221 deletions(-) create mode 100644 hai-order/src/main/java/com/web/controller/notify/HuiPayNotifyController.java create mode 100644 hai-service/src/main/java/com/hai/pay/channel/huipay/TradeService.java create mode 100644 hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java create mode 100644 hai-service/src/main/java/com/hai/pay/channel/huipay/utils/SignatureUtil.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 116b19de..e178542f 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.entity.*; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.bouncycastle.LICENSE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private BlxConfig blxConfig; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101527"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); if (!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } // 响应参数 JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, "工会卡充值退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2 FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) String receiverCount, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.TuanYouConfig; import com.hai.entity.*; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.order.service.OrderService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.bouncycastle.LICENSE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HuiConfig huiConfig; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101527"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); if (!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } // 响应参数 JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, OrderProductType.getDataByType(order.getProductType()).getName() + "退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); if (order.getProductType().equals(4)) { HighUser user = highUserService.findByUserId(order.getMemId()); // 获取应退款积分 int integralNum = order.getTotalPrice().multiply(new BigDecimal(100)).intValue(); if ( integralNum> user.getGold()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } String remark = "订单" + order.getOrderNo() + "退还积分:" + integralNum; // 积分退款 highUserService.goldHandle(user.getId(), integralNum,2, 3, order.getId() , remark , order.getOrderNo()); } return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2 FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) String receiverCount, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/preorder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发起支付") public ResponseData preorder() { try { JSONObject object = new JSONObject(); object.put("outTradeNo" , "HUI" + OrderUtil.generateOrderNo()); object.put("transType" , "JSAPI"); object.put("payMode" , "WECHAT"); object.put("totalAmount" , "0.01"); object.put("profitSharing" , 0); object.put("subject" , "测试"); object.put("userId" , "oUGn_4unIjp90MY-oEXluY4laDrQ"); return ResponseMsgUtil.success(huiConfig.preorder(object)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoListByPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油门店") public ResponseData queryGasInfoListByPage() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setSourceType(2); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(2); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("完成"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/Blx/BlxCarController.java b/hai-cweb/src/main/java/com/cweb/controller/Blx/BlxCarController.java index 8389a4e9..f28b8fe1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/Blx/BlxCarController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/Blx/BlxCarController.java @@ -3,6 +3,7 @@ package com.cweb.controller.Blx; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.JSONPObject; import com.hai.blx.service.BlxCarService; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; @@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -211,6 +213,11 @@ public class BlxCarController { JSONArray jsonArray = data.getJSONObject("data").getJSONArray("ordlist"); jsonArray.addAll(data04.getJSONObject("data").getJSONArray("ordlist")); + for (Object object : jsonArray) { + JSONObject jsonpObject = (JSONObject) object; + jsonpObject.put("currentamt" , jsonpObject.getBigDecimal("currentamt").divide(new BigDecimal(100))); + } + return ResponseMsgUtil.success(jsonArray); } catch (Exception e) { diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java index 6239eb89..5c2d67e8 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java @@ -72,7 +72,7 @@ public class HighCouponController { private HighMerchantStoreService highMerchantStoreService; @Resource - private CommonService commonService; + private HighUserCardService highUserCardService; @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @@ -133,6 +133,7 @@ public class HighCouponController { @ResponseBody @ApiOperation(value = "获取用户卡卷列表") public ResponseData getUserCouponList(@RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "sourceType", required = false) Integer sourceType, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -145,6 +146,11 @@ public class HighCouponController { Map map = new HashMap<>(); map.put("userId", userInfoModel.getHighUser().getId()); map.put("status", status); + map.put("sourceType", sourceType); + + if (sourceType != null && sourceType == 6) { + highUserCardService.getBlxCouponBalance(userInfoModel.getHighUser().getPhone()); + } PageHelper.startPage(pageNum, pageSize); return ResponseMsgUtil.success(new PageInfo<>(highUserCouponService.getUserCouponList(map))); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 86103a26..8c5433f5 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -389,7 +389,7 @@ public class HighGasController { return ResponseMsgUtil.success(param); - } else if (store.getSourceType().equals(store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber()))) { + } else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); diff --git a/hai-order/src/main/java/com/web/config/SysConfig.java b/hai-order/src/main/java/com/web/config/SysConfig.java index 652612a2..0a02a6f6 100644 --- a/hai-order/src/main/java/com/web/config/SysConfig.java +++ b/hai-order/src/main/java/com/web/config/SysConfig.java @@ -21,11 +21,14 @@ public class SysConfig { // 微信支付统一请求地址 private String wxPayUnifiedOrderUrl; + // 微信支付回调地址 private String wxPayNotifyUrl; // 银联支付回调地址 private String unionPayNotifyUrl; + // 惠支付回调地址 + private String huiPayNotify; } diff --git a/hai-order/src/main/java/com/web/controller/OrderPayController.java b/hai-order/src/main/java/com/web/controller/OrderPayController.java index 43bbbfe7..a84b2c46 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -28,6 +28,8 @@ import com.hai.order.service.OrderPayService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderStatus; import com.hai.order.type.PlatformType; +import com.hai.order.utils.OrderUtil; +import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import com.web.config.SysConst; import io.swagger.annotations.Api; @@ -104,6 +106,9 @@ public class OrderPayController { @Resource private SecConfigService secConfigService; + @Resource + private HuiConfig huiConfig; + @RequestMapping(value = "/wechatPay", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "微信支付") @@ -311,16 +316,44 @@ public class OrderPayController { weChatPayReqInfo.setTime_start(DateUtil.date2String(order.getCreateTime(), "yyyyMMddHHmmss")); weChatPayReqInfo.setTime_expire(DateUtil.date2String(DateUtil.addMinute(order.getCreateTime(), 10), "yyyyMMddHHmmss")); - //附加数据,区分订单类型 - Map payMap = new HashMap<>(); - payMap.put("app_id", weChatPayReqInfo.getSub_appid()); - payMap.put("api_key", SysConst.getSysConfig().getWxPayApiKey()); - payMap.put("unified_order_url", SysConst.getSysConfig().getWxPayUnifiedOrderUrl()); - SortedMap sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo, payMap); + SortedMap sortedMap; + + if (!order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) { + //附加数据,区分订单类型 + Map payMap = new HashMap<>(); + payMap.put("app_id", weChatPayReqInfo.getSub_appid()); + payMap.put("api_key", SysConst.getSysConfig().getWxPayApiKey()); + payMap.put("unified_order_url", SysConst.getSysConfig().getWxPayUnifiedOrderUrl()); + + + + sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo, payMap); + + order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id()); + order.setProfitSharingStatus(profitSharing.equals("Y")); + order.setPayChannel(1); + orderService.updateOrderData(order); + + } else { + JSONObject object = new JSONObject(); + object.put("outTradeNo" , order.getOrderNo()); + object.put("transType" , "JSAPI"); + object.put("payMode" , "WECHAT"); + object.put("totalAmount" , order.getPayPrice()); + object.put("profitSharing" , 0); + object.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify()); + object.put("subject" , orderTitle); + object.put("userId" , body.getString("openId")); + + sortedMap = huiConfig.preorder(object); + + order.setAccountMerchantNum(HuiConfig.hlMerNo); + order.setProfitSharingStatus(false); + order.setPayChannel(2); + orderService.updateOrderData(order); + + } - order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id()); - order.setProfitSharingStatus(profitSharing.equals("Y")); - orderService.updateOrderData(order); return ResponseMsgUtil.success(sortedMap); diff --git a/hai-order/src/main/java/com/web/controller/notify/HuiPayNotifyController.java b/hai-order/src/main/java/com/web/controller/notify/HuiPayNotifyController.java new file mode 100644 index 00000000..b3e114f4 --- /dev/null +++ b/hai-order/src/main/java/com/web/controller/notify/HuiPayNotifyController.java @@ -0,0 +1,81 @@ +package com.web.controller.notify; + +import com.alibaba.fastjson.JSONObject; +import com.hai.entity.HighOrder; +import com.hai.order.service.OrderPaySuccessService; +import com.hai.order.service.OrderService; +import com.hai.order.type.OrderPayType; +import com.hai.order.type.OrderStatus; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.math.BigDecimal; + +@Controller +@RequestMapping(value = "/huiPayNotify") +@Api(value = "惠支付业务通知") +public class HuiPayNotifyController { + + private static final Logger log = LoggerFactory.getLogger(HuiPayNotifyController.class); + + @Resource + private OrderService orderService; + + @Resource + private OrderPaySuccessService paySuccessService; + + + @RequestMapping(value = "/huiPayCallback", method = RequestMethod.POST) + @ApiOperation(value = "惠支付回调") + @ResponseBody + public void huiPayCallback(@RequestBody String reqBodyStr, HttpServletResponse response) { + try { + log.info("===============惠支付回调start=================="); + JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); + // 处理业务 + log.info("开始处理业务"); + log.info("惠支付-回调参数: " + dataObject); + + // 查询交易订单 + HighOrder order = orderService.getOrderDetailByNo(dataObject.getString("outTradeNo")); + if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { + // 处理订单业务 + paySuccessService.orderPaySuccessHandle(dataObject.getString("outTradeNo"), + OrderPayType.PAY_TYPE2, + dataObject.getString("accTradeNo"), + dataObject.getBigDecimal("tradeAmount"), + null); + } + log.info("处理业务完成"); + log.info("============回调任务End============="); + + + response.setCharacterEncoding("UTF-8"); + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer= response.getWriter(); + + JSONObject postJson = new JSONObject(); + postJson.put("code" ,"SUCCESS"); + postJson.put("message" ,"执行成功"); + writer.write(postJson.toJSONString()); + writer.flush(); + writer.close(); + + } catch (Exception e) { + log.error("订单处理异常", e); + } finally { + log.info("===============微信支付回调end=================="); + } + } + +} diff --git a/hai-order/src/main/resources/dev/config.properties b/hai-order/src/main/resources/dev/config.properties index e71baf0c..8d6152ce 100644 --- a/hai-order/src/main/resources/dev/config.properties +++ b/hai-order/src/main/resources/dev/config.properties @@ -8,6 +8,7 @@ wxPayUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder wxPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/wechatPay unionPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/unionPay +huiPayNotify=https://hsgcs.dctpay.com/order/huiPayNotify/huiPayCallback #fileUrl=/home/project/hsg/filesystem/ #cmsPath=/home/project/hsg/filesystem/ diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index 9de2bd39..82894bb8 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -37,9 +37,6 @@ public class HighGasSchedule { @Resource private HighGasOilPriceService highGasOilPriceService; - @Resource - private HighGasOilPriceOfficialService gasOilPriceOfficialService; - @Resource private HighGasService gasService; @Scheduled(cron = "0 0 1 * * ?") //每日凌晨1点执行一次 @@ -51,7 +48,7 @@ public class HighGasSchedule { JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); - for (int i = 1; i < resultObjectP.getInteger("totalPageNum").intValue();i++) { + for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); @@ -74,6 +71,7 @@ public class HighGasSchedule { store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); + store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); @@ -123,6 +121,7 @@ public class HighGasSchedule { highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); + highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); diff --git a/hai-service/src/main/java/com/hai/dao/ApiBlxOrderMapper.java b/hai-service/src/main/java/com/hai/dao/ApiBlxOrderMapper.java index 26a3b174..e3ce7292 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiBlxOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/ApiBlxOrderMapper.java @@ -39,28 +39,28 @@ public interface ApiBlxOrderMapper extends ApiBlxOrderMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into api_blx_order (mer_id, order_id, ", + "insert into api_blx_order (mer_id, order_no, ", "mer_order_id, park_order_id, ", "in_time, out_time, ", - "over_time, park_time, ", - "park_name, park_id, ", - "car_seat_id, park_price, ", - "coupon_price, order_type, ", - "order_status, create_time, ", - "update_time, ext_1, ", - "ext_2, ext_3, ext_4, ", - "ext_5, ext_6)", - "values (#{merId,jdbcType=VARCHAR}, #{orderId,jdbcType=BIGINT}, ", + "over_time, car_no, ", + "park_time, park_name, ", + "park_id, car_seat_id, ", + "park_price, coupon_price, ", + "order_type, order_status, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3, ", + "ext_4, ext_5, ext_6)", + "values (#{merId,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", "#{merOrderId,jdbcType=VARCHAR}, #{parkOrderId,jdbcType=VARCHAR}, ", "#{inTime,jdbcType=TIMESTAMP}, #{outTime,jdbcType=TIMESTAMP}, ", - "#{overTime,jdbcType=INTEGER}, #{parkTime,jdbcType=INTEGER}, ", - "#{parkName,jdbcType=VARCHAR}, #{parkId,jdbcType=BIGINT}, ", - "#{carSeatId,jdbcType=BIGINT}, #{parkPrice,jdbcType=DECIMAL}, ", - "#{couponPrice,jdbcType=DECIMAL}, #{orderType,jdbcType=INTEGER}, ", - "#{orderStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ", - "#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" + "#{overTime,jdbcType=INTEGER}, #{carNo,jdbcType=VARCHAR}, ", + "#{parkTime,jdbcType=INTEGER}, #{parkName,jdbcType=VARCHAR}, ", + "#{parkId,jdbcType=BIGINT}, #{carSeatId,jdbcType=VARCHAR}, ", + "#{parkPrice,jdbcType=DECIMAL}, #{couponPrice,jdbcType=DECIMAL}, ", + "#{orderType,jdbcType=INTEGER}, #{orderStatus,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", + "#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(ApiBlxOrder record); @@ -73,16 +73,17 @@ public interface ApiBlxOrderMapper extends ApiBlxOrderMapperExt { @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="mer_id", property="merId", jdbcType=JdbcType.VARCHAR), - @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_order_id", property="merOrderId", jdbcType=JdbcType.VARCHAR), @Result(column="park_order_id", property="parkOrderId", jdbcType=JdbcType.VARCHAR), @Result(column="in_time", property="inTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="out_time", property="outTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="over_time", property="overTime", jdbcType=JdbcType.INTEGER), + @Result(column="car_no", property="carNo", jdbcType=JdbcType.VARCHAR), @Result(column="park_time", property="parkTime", jdbcType=JdbcType.INTEGER), @Result(column="park_name", property="parkName", jdbcType=JdbcType.VARCHAR), @Result(column="park_id", property="parkId", jdbcType=JdbcType.BIGINT), - @Result(column="car_seat_id", property="carSeatId", jdbcType=JdbcType.BIGINT), + @Result(column="car_seat_id", property="carSeatId", jdbcType=JdbcType.VARCHAR), @Result(column="park_price", property="parkPrice", jdbcType=JdbcType.DECIMAL), @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), @Result(column="order_type", property="orderType", jdbcType=JdbcType.INTEGER), @@ -100,25 +101,27 @@ public interface ApiBlxOrderMapper extends ApiBlxOrderMapperExt { @Select({ "select", - "id, mer_id, order_id, mer_order_id, park_order_id, in_time, out_time, over_time, ", - "park_time, park_name, park_id, car_seat_id, park_price, coupon_price, order_type, ", - "order_status, create_time, update_time, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", + "id, mer_id, order_no, mer_order_id, park_order_id, in_time, out_time, over_time, ", + "car_no, park_time, park_name, park_id, car_seat_id, park_price, coupon_price, ", + "order_type, order_status, create_time, update_time, ext_1, ext_2, ext_3, ext_4, ", + "ext_5, ext_6", "from api_blx_order", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="mer_id", property="merId", jdbcType=JdbcType.VARCHAR), - @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="mer_order_id", property="merOrderId", jdbcType=JdbcType.VARCHAR), @Result(column="park_order_id", property="parkOrderId", jdbcType=JdbcType.VARCHAR), @Result(column="in_time", property="inTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="out_time", property="outTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="over_time", property="overTime", jdbcType=JdbcType.INTEGER), + @Result(column="car_no", property="carNo", jdbcType=JdbcType.VARCHAR), @Result(column="park_time", property="parkTime", jdbcType=JdbcType.INTEGER), @Result(column="park_name", property="parkName", jdbcType=JdbcType.VARCHAR), @Result(column="park_id", property="parkId", jdbcType=JdbcType.BIGINT), - @Result(column="car_seat_id", property="carSeatId", jdbcType=JdbcType.BIGINT), + @Result(column="car_seat_id", property="carSeatId", jdbcType=JdbcType.VARCHAR), @Result(column="park_price", property="parkPrice", jdbcType=JdbcType.DECIMAL), @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), @Result(column="order_type", property="orderType", jdbcType=JdbcType.INTEGER), @@ -146,16 +149,17 @@ public interface ApiBlxOrderMapper extends ApiBlxOrderMapperExt { @Update({ "update api_blx_order", "set mer_id = #{merId,jdbcType=VARCHAR},", - "order_id = #{orderId,jdbcType=BIGINT},", + "order_no = #{orderNo,jdbcType=VARCHAR},", "mer_order_id = #{merOrderId,jdbcType=VARCHAR},", "park_order_id = #{parkOrderId,jdbcType=VARCHAR},", "in_time = #{inTime,jdbcType=TIMESTAMP},", "out_time = #{outTime,jdbcType=TIMESTAMP},", "over_time = #{overTime,jdbcType=INTEGER},", + "car_no = #{carNo,jdbcType=VARCHAR},", "park_time = #{parkTime,jdbcType=INTEGER},", "park_name = #{parkName,jdbcType=VARCHAR},", "park_id = #{parkId,jdbcType=BIGINT},", - "car_seat_id = #{carSeatId,jdbcType=BIGINT},", + "car_seat_id = #{carSeatId,jdbcType=VARCHAR},", "park_price = #{parkPrice,jdbcType=DECIMAL},", "coupon_price = #{couponPrice,jdbcType=DECIMAL},", "order_type = #{orderType,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/ApiBlxOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/ApiBlxOrderSqlProvider.java index e4d0a2e4..49e39918 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiBlxOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/ApiBlxOrderSqlProvider.java @@ -32,8 +32,8 @@ public class ApiBlxOrderSqlProvider { sql.VALUES("mer_id", "#{merId,jdbcType=VARCHAR}"); } - if (record.getOrderId() != null) { - sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); + if (record.getOrderNo() != null) { + sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); } if (record.getMerOrderId() != null) { @@ -56,6 +56,10 @@ public class ApiBlxOrderSqlProvider { sql.VALUES("over_time", "#{overTime,jdbcType=INTEGER}"); } + if (record.getCarNo() != null) { + sql.VALUES("car_no", "#{carNo,jdbcType=VARCHAR}"); + } + if (record.getParkTime() != null) { sql.VALUES("park_time", "#{parkTime,jdbcType=INTEGER}"); } @@ -69,7 +73,7 @@ public class ApiBlxOrderSqlProvider { } if (record.getCarSeatId() != null) { - sql.VALUES("car_seat_id", "#{carSeatId,jdbcType=BIGINT}"); + sql.VALUES("car_seat_id", "#{carSeatId,jdbcType=VARCHAR}"); } if (record.getParkPrice() != null) { @@ -131,12 +135,13 @@ public class ApiBlxOrderSqlProvider { sql.SELECT("id"); } sql.SELECT("mer_id"); - sql.SELECT("order_id"); + sql.SELECT("order_no"); sql.SELECT("mer_order_id"); sql.SELECT("park_order_id"); sql.SELECT("in_time"); sql.SELECT("out_time"); sql.SELECT("over_time"); + sql.SELECT("car_no"); sql.SELECT("park_time"); sql.SELECT("park_name"); sql.SELECT("park_id"); @@ -178,8 +183,8 @@ public class ApiBlxOrderSqlProvider { sql.SET("mer_id = #{record.merId,jdbcType=VARCHAR}"); } - if (record.getOrderId() != null) { - sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + if (record.getOrderNo() != null) { + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); } if (record.getMerOrderId() != null) { @@ -202,6 +207,10 @@ public class ApiBlxOrderSqlProvider { sql.SET("over_time = #{record.overTime,jdbcType=INTEGER}"); } + if (record.getCarNo() != null) { + sql.SET("car_no = #{record.carNo,jdbcType=VARCHAR}"); + } + if (record.getParkTime() != null) { sql.SET("park_time = #{record.parkTime,jdbcType=INTEGER}"); } @@ -215,7 +224,7 @@ public class ApiBlxOrderSqlProvider { } if (record.getCarSeatId() != null) { - sql.SET("car_seat_id = #{record.carSeatId,jdbcType=BIGINT}"); + sql.SET("car_seat_id = #{record.carSeatId,jdbcType=VARCHAR}"); } if (record.getParkPrice() != null) { @@ -276,16 +285,17 @@ public class ApiBlxOrderSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("mer_id = #{record.merId,jdbcType=VARCHAR}"); - sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); sql.SET("mer_order_id = #{record.merOrderId,jdbcType=VARCHAR}"); sql.SET("park_order_id = #{record.parkOrderId,jdbcType=VARCHAR}"); sql.SET("in_time = #{record.inTime,jdbcType=TIMESTAMP}"); sql.SET("out_time = #{record.outTime,jdbcType=TIMESTAMP}"); sql.SET("over_time = #{record.overTime,jdbcType=INTEGER}"); + sql.SET("car_no = #{record.carNo,jdbcType=VARCHAR}"); sql.SET("park_time = #{record.parkTime,jdbcType=INTEGER}"); sql.SET("park_name = #{record.parkName,jdbcType=VARCHAR}"); sql.SET("park_id = #{record.parkId,jdbcType=BIGINT}"); - sql.SET("car_seat_id = #{record.carSeatId,jdbcType=BIGINT}"); + sql.SET("car_seat_id = #{record.carSeatId,jdbcType=VARCHAR}"); sql.SET("park_price = #{record.parkPrice,jdbcType=DECIMAL}"); sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}"); sql.SET("order_type = #{record.orderType,jdbcType=INTEGER}"); @@ -312,8 +322,8 @@ public class ApiBlxOrderSqlProvider { sql.SET("mer_id = #{merId,jdbcType=VARCHAR}"); } - if (record.getOrderId() != null) { - sql.SET("order_id = #{orderId,jdbcType=BIGINT}"); + if (record.getOrderNo() != null) { + sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); } if (record.getMerOrderId() != null) { @@ -336,6 +346,10 @@ public class ApiBlxOrderSqlProvider { sql.SET("over_time = #{overTime,jdbcType=INTEGER}"); } + if (record.getCarNo() != null) { + sql.SET("car_no = #{carNo,jdbcType=VARCHAR}"); + } + if (record.getParkTime() != null) { sql.SET("park_time = #{parkTime,jdbcType=INTEGER}"); } @@ -349,7 +363,7 @@ public class ApiBlxOrderSqlProvider { } if (record.getCarSeatId() != null) { - sql.SET("car_seat_id = #{carSeatId,jdbcType=BIGINT}"); + sql.SET("car_seat_id = #{carSeatId,jdbcType=VARCHAR}"); } if (record.getParkPrice() != null) { diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java index f8c17dee..827ff5f7 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java @@ -44,51 +44,51 @@ public interface HighOrderMapper extends HighOrderMapperExt { "mem_discount_id, mem_discount_name, ", "mem_id, mem_name, mem_phone, ", "combine_order_no, order_no, ", - "pay_serial_no, pay_type, ", - "mem_card_id, mem_card_type, ", - "mem_card_no, freight_price, ", - "goods_total_price, total_price, ", - "payable_price, pay_price, ", - "pay_real_price, order_status, ", - "remarks, create_time, ", - "total_deduction_price, deduction_coupon_price, ", - "deduction_product_price, pay_gold, ", - "surplus_refund_price, surplus_refund_integral, ", - "pay_time, finish_time, ", - "cancel_time, cancel_remarks, ", - "refund_time, account_merchant_num, ", - "profit_sharing_status, profit_sharing_record_id, ", - "whether_check, whether_rebate, ", - "exception_status, exception_content, ", - "company_name, promote_code, ", - "sec_user_id, ext_1, ", - "ext_2, ext_3, ext_4, ", - "ext_5, ext_6)", + "pay_serial_no, pay_channel, ", + "pay_type, mem_card_id, ", + "mem_card_type, mem_card_no, ", + "freight_price, goods_total_price, ", + "total_price, payable_price, ", + "pay_price, pay_real_price, ", + "order_status, remarks, ", + "create_time, total_deduction_price, ", + "deduction_coupon_price, deduction_product_price, ", + "pay_gold, surplus_refund_price, ", + "surplus_refund_integral, pay_time, ", + "finish_time, cancel_time, ", + "cancel_remarks, refund_time, ", + "account_merchant_num, profit_sharing_status, ", + "profit_sharing_record_id, whether_check, ", + "whether_rebate, exception_status, ", + "exception_content, company_name, ", + "promote_code, sec_user_id, ", + "ext_1, ext_2, ext_3, ", + "ext_4, ext_5, ext_6)", "values (#{title,jdbcType=VARCHAR}, #{searchTitle,jdbcType=VARCHAR}, ", "#{productType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ", "#{memDiscountId,jdbcType=BIGINT}, #{memDiscountName,jdbcType=VARCHAR}, ", "#{memId,jdbcType=BIGINT}, #{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ", "#{combineOrderNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", - "#{paySerialNo,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ", - "#{memCardId,jdbcType=BIGINT}, #{memCardType,jdbcType=INTEGER}, ", - "#{memCardNo,jdbcType=VARCHAR}, #{freightPrice,jdbcType=DECIMAL}, ", - "#{goodsTotalPrice,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL}, ", - "#{payablePrice,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ", - "#{payRealPrice,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, ", - "#{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{totalDeductionPrice,jdbcType=DECIMAL}, #{deductionCouponPrice,jdbcType=DECIMAL}, ", - "#{deductionProductPrice,jdbcType=DECIMAL}, #{payGold,jdbcType=INTEGER}, ", - "#{surplusRefundPrice,jdbcType=DECIMAL}, #{surplusRefundIntegral,jdbcType=INTEGER}, ", - "#{payTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", - "#{cancelTime,jdbcType=TIMESTAMP}, #{cancelRemarks,jdbcType=VARCHAR}, ", - "#{refundTime,jdbcType=TIMESTAMP}, #{accountMerchantNum,jdbcType=VARCHAR}, ", - "#{profitSharingStatus,jdbcType=BIT}, #{profitSharingRecordId,jdbcType=BIGINT}, ", - "#{whetherCheck,jdbcType=BIT}, #{whetherRebate,jdbcType=BIT}, ", - "#{exceptionStatus,jdbcType=BIT}, #{exceptionContent,jdbcType=VARCHAR}, ", - "#{companyName,jdbcType=VARCHAR}, #{promoteCode,jdbcType=VARCHAR}, ", - "#{secUserId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ", - "#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" + "#{paySerialNo,jdbcType=VARCHAR}, #{payChannel,jdbcType=INTEGER}, ", + "#{payType,jdbcType=INTEGER}, #{memCardId,jdbcType=BIGINT}, ", + "#{memCardType,jdbcType=INTEGER}, #{memCardNo,jdbcType=VARCHAR}, ", + "#{freightPrice,jdbcType=DECIMAL}, #{goodsTotalPrice,jdbcType=DECIMAL}, ", + "#{totalPrice,jdbcType=DECIMAL}, #{payablePrice,jdbcType=DECIMAL}, ", + "#{payPrice,jdbcType=DECIMAL}, #{payRealPrice,jdbcType=DECIMAL}, ", + "#{orderStatus,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{totalDeductionPrice,jdbcType=DECIMAL}, ", + "#{deductionCouponPrice,jdbcType=DECIMAL}, #{deductionProductPrice,jdbcType=DECIMAL}, ", + "#{payGold,jdbcType=INTEGER}, #{surplusRefundPrice,jdbcType=DECIMAL}, ", + "#{surplusRefundIntegral,jdbcType=INTEGER}, #{payTime,jdbcType=TIMESTAMP}, ", + "#{finishTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", + "#{cancelRemarks,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, ", + "#{accountMerchantNum,jdbcType=VARCHAR}, #{profitSharingStatus,jdbcType=BIT}, ", + "#{profitSharingRecordId,jdbcType=BIGINT}, #{whetherCheck,jdbcType=BIT}, ", + "#{whetherRebate,jdbcType=BIT}, #{exceptionStatus,jdbcType=BIT}, ", + "#{exceptionContent,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, ", + "#{promoteCode,jdbcType=VARCHAR}, #{secUserId,jdbcType=BIGINT}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", + "#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighOrder record); @@ -112,6 +112,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { @Result(column="combine_order_no", property="combineOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), @Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT), @Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER), @@ -158,14 +159,15 @@ public interface HighOrderMapper extends HighOrderMapperExt { @Select({ "select", "id, title, search_title, product_type, company_id, mem_discount_id, mem_discount_name, ", - "mem_id, mem_name, mem_phone, combine_order_no, order_no, pay_serial_no, pay_type, ", - "mem_card_id, mem_card_type, mem_card_no, freight_price, goods_total_price, total_price, ", - "payable_price, pay_price, pay_real_price, order_status, remarks, create_time, ", - "total_deduction_price, deduction_coupon_price, deduction_product_price, pay_gold, ", - "surplus_refund_price, surplus_refund_integral, pay_time, finish_time, cancel_time, ", - "cancel_remarks, refund_time, account_merchant_num, profit_sharing_status, profit_sharing_record_id, ", - "whether_check, whether_rebate, exception_status, exception_content, company_name, ", - "promote_code, sec_user_id, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", + "mem_id, mem_name, mem_phone, combine_order_no, order_no, pay_serial_no, pay_channel, ", + "pay_type, mem_card_id, mem_card_type, mem_card_no, freight_price, goods_total_price, ", + "total_price, payable_price, pay_price, pay_real_price, order_status, remarks, ", + "create_time, total_deduction_price, deduction_coupon_price, deduction_product_price, ", + "pay_gold, surplus_refund_price, surplus_refund_integral, pay_time, finish_time, ", + "cancel_time, cancel_remarks, refund_time, account_merchant_num, profit_sharing_status, ", + "profit_sharing_record_id, whether_check, whether_rebate, exception_status, exception_content, ", + "company_name, promote_code, sec_user_id, ext_1, ext_2, ext_3, ext_4, ext_5, ", + "ext_6", "from high_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -183,6 +185,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { @Result(column="combine_order_no", property="combineOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), @Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT), @Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER), @@ -249,6 +252,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { "combine_order_no = #{combineOrderNo,jdbcType=VARCHAR},", "order_no = #{orderNo,jdbcType=VARCHAR},", "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},", + "pay_channel = #{payChannel,jdbcType=INTEGER},", "pay_type = #{payType,jdbcType=INTEGER},", "mem_card_id = #{memCardId,jdbcType=BIGINT},", "mem_card_type = #{memCardType,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java index 5c793bc1..1072ecb9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java @@ -76,6 +76,10 @@ public class HighOrderSqlProvider { sql.VALUES("pay_serial_no", "#{paySerialNo,jdbcType=VARCHAR}"); } + if (record.getPayChannel() != null) { + sql.VALUES("pay_channel", "#{payChannel,jdbcType=INTEGER}"); + } + if (record.getPayType() != null) { sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}"); } @@ -258,6 +262,7 @@ public class HighOrderSqlProvider { sql.SELECT("combine_order_no"); sql.SELECT("order_no"); sql.SELECT("pay_serial_no"); + sql.SELECT("pay_channel"); sql.SELECT("pay_type"); sql.SELECT("mem_card_id"); sql.SELECT("mem_card_type"); @@ -367,6 +372,10 @@ public class HighOrderSqlProvider { sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); } + if (record.getPayChannel() != null) { + sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); + } + if (record.getPayType() != null) { sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); } @@ -548,6 +557,7 @@ public class HighOrderSqlProvider { sql.SET("combine_order_no = #{record.combineOrderNo,jdbcType=VARCHAR}"); sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); + sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); sql.SET("mem_card_id = #{record.memCardId,jdbcType=BIGINT}"); sql.SET("mem_card_type = #{record.memCardType,jdbcType=INTEGER}"); @@ -646,6 +656,10 @@ public class HighOrderSqlProvider { sql.SET("pay_serial_no = #{paySerialNo,jdbcType=VARCHAR}"); } + if (record.getPayChannel() != null) { + sql.SET("pay_channel = #{payChannel,jdbcType=INTEGER}"); + } + if (record.getPayType() != null) { sql.SET("pay_type = #{payType,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighUserCouponMapper.java b/hai-service/src/main/java/com/hai/dao/HighUserCouponMapper.java index 38f592c3..6c5eeed5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighUserCouponMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighUserCouponMapper.java @@ -46,8 +46,9 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { "create_time, consume_time, ", "use_end_time, qr_code_img, ", "`status`, `source`, ", - "source_id, ext_1, ext_2, ", - "ext_3, ext_4)", + "source_id, source_type, ", + "ext_1, ext_2, ext_3, ", + "ext_4)", "values (#{merchantId,jdbcType=BIGINT}, #{couponId,jdbcType=BIGINT}, ", "#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", "#{orderId,jdbcType=BIGINT}, #{childOrderId,jdbcType=BIGINT}, ", @@ -55,8 +56,9 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { "#{createTime,jdbcType=TIMESTAMP}, #{consumeTime,jdbcType=TIMESTAMP}, ", "#{useEndTime,jdbcType=TIMESTAMP}, #{qrCodeImg,jdbcType=VARCHAR}, ", "#{status,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, ", - "#{sourceId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", - "#{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR})" + "#{sourceId,jdbcType=BIGINT}, #{sourceType,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", + "#{ext4,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighUserCoupon record); @@ -83,6 +85,7 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), @@ -94,7 +97,7 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { "select", "id, merchant_id, coupon_id, user_id, user_phone, order_id, child_order_id, coupon_code_id, ", "store_id, create_time, consume_time, use_end_time, qr_code_img, `status`, `source`, ", - "source_id, ext_1, ext_2, ext_3, ext_4", + "source_id, source_type, ext_1, ext_2, ext_3, ext_4", "from high_user_coupon", "where id = #{id,jdbcType=BIGINT}" }) @@ -115,6 +118,7 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), @@ -148,6 +152,7 @@ public interface HighUserCouponMapper extends HighUserCouponMapperExt { "`status` = #{status,jdbcType=INTEGER},", "`source` = #{source,jdbcType=INTEGER},", "source_id = #{sourceId,jdbcType=BIGINT},", + "source_type = #{sourceType,jdbcType=INTEGER},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_3 = #{ext3,jdbcType=VARCHAR},", diff --git a/hai-service/src/main/java/com/hai/dao/HighUserCouponSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighUserCouponSqlProvider.java index 119382d6..cc4e92d0 100644 --- a/hai-service/src/main/java/com/hai/dao/HighUserCouponSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighUserCouponSqlProvider.java @@ -88,6 +88,10 @@ public class HighUserCouponSqlProvider { sql.VALUES("source_id", "#{sourceId,jdbcType=BIGINT}"); } + if (record.getSourceType() != null) { + sql.VALUES("source_type", "#{sourceType,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -129,6 +133,7 @@ public class HighUserCouponSqlProvider { sql.SELECT("`status`"); sql.SELECT("`source`"); sql.SELECT("source_id"); + sql.SELECT("source_type"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -214,6 +219,10 @@ public class HighUserCouponSqlProvider { sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); } + if (record.getSourceType() != null) { + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -254,6 +263,7 @@ public class HighUserCouponSqlProvider { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); @@ -328,6 +338,10 @@ public class HighUserCouponSqlProvider { sql.SET("source_id = #{sourceId,jdbcType=BIGINT}"); } + if (record.getSourceType() != null) { + sql.SET("source_type = #{sourceType,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/ApiBlxOrder.java b/hai-service/src/main/java/com/hai/entity/ApiBlxOrder.java index 3ed6872e..9813cea2 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiBlxOrder.java +++ b/hai-service/src/main/java/com/hai/entity/ApiBlxOrder.java @@ -25,9 +25,9 @@ public class ApiBlxOrder implements Serializable { private String merId; /** - * 订单ID + * 订单号 */ - private Long orderId; + private String orderNo; /** * 商户订单ID @@ -54,6 +54,11 @@ public class ApiBlxOrder implements Serializable { */ private Integer overTime; + /** + * 车牌号 + */ + private String carNo; + /** * 停车时长 */ @@ -72,7 +77,7 @@ public class ApiBlxOrder implements Serializable { /** * 车位ID */ - private Long carSeatId; + private String carSeatId; /** * 停车金额 @@ -152,12 +157,12 @@ public class ApiBlxOrder implements Serializable { this.merId = merId; } - public Long getOrderId() { - return orderId; + public String getOrderNo() { + return orderNo; } - public void setOrderId(Long orderId) { - this.orderId = orderId; + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; } public String getMerOrderId() { @@ -200,6 +205,14 @@ public class ApiBlxOrder implements Serializable { this.overTime = overTime; } + public String getCarNo() { + return carNo; + } + + public void setCarNo(String carNo) { + this.carNo = carNo; + } + public Integer getParkTime() { return parkTime; } @@ -224,11 +237,11 @@ public class ApiBlxOrder implements Serializable { this.parkId = parkId; } - public Long getCarSeatId() { + public String getCarSeatId() { return carSeatId; } - public void setCarSeatId(Long carSeatId) { + public void setCarSeatId(String carSeatId) { this.carSeatId = carSeatId; } @@ -342,12 +355,13 @@ public class ApiBlxOrder implements Serializable { ApiBlxOrder other = (ApiBlxOrder) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) - && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) && (this.getMerOrderId() == null ? other.getMerOrderId() == null : this.getMerOrderId().equals(other.getMerOrderId())) && (this.getParkOrderId() == null ? other.getParkOrderId() == null : this.getParkOrderId().equals(other.getParkOrderId())) && (this.getInTime() == null ? other.getInTime() == null : this.getInTime().equals(other.getInTime())) && (this.getOutTime() == null ? other.getOutTime() == null : this.getOutTime().equals(other.getOutTime())) && (this.getOverTime() == null ? other.getOverTime() == null : this.getOverTime().equals(other.getOverTime())) + && (this.getCarNo() == null ? other.getCarNo() == null : this.getCarNo().equals(other.getCarNo())) && (this.getParkTime() == null ? other.getParkTime() == null : this.getParkTime().equals(other.getParkTime())) && (this.getParkName() == null ? other.getParkName() == null : this.getParkName().equals(other.getParkName())) && (this.getParkId() == null ? other.getParkId() == null : this.getParkId().equals(other.getParkId())) @@ -372,12 +386,13 @@ public class ApiBlxOrder implements Serializable { int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); - result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); + result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); result = prime * result + ((getMerOrderId() == null) ? 0 : getMerOrderId().hashCode()); result = prime * result + ((getParkOrderId() == null) ? 0 : getParkOrderId().hashCode()); result = prime * result + ((getInTime() == null) ? 0 : getInTime().hashCode()); result = prime * result + ((getOutTime() == null) ? 0 : getOutTime().hashCode()); result = prime * result + ((getOverTime() == null) ? 0 : getOverTime().hashCode()); + result = prime * result + ((getCarNo() == null) ? 0 : getCarNo().hashCode()); result = prime * result + ((getParkTime() == null) ? 0 : getParkTime().hashCode()); result = prime * result + ((getParkName() == null) ? 0 : getParkName().hashCode()); result = prime * result + ((getParkId() == null) ? 0 : getParkId().hashCode()); @@ -405,12 +420,13 @@ public class ApiBlxOrder implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", merId=").append(merId); - sb.append(", orderId=").append(orderId); + sb.append(", orderNo=").append(orderNo); sb.append(", merOrderId=").append(merOrderId); sb.append(", parkOrderId=").append(parkOrderId); sb.append(", inTime=").append(inTime); sb.append(", outTime=").append(outTime); sb.append(", overTime=").append(overTime); + sb.append(", carNo=").append(carNo); sb.append(", parkTime=").append(parkTime); sb.append(", parkName=").append(parkName); sb.append(", parkId=").append(parkId); diff --git a/hai-service/src/main/java/com/hai/entity/ApiBlxOrderExample.java b/hai-service/src/main/java/com/hai/entity/ApiBlxOrderExample.java index 2c165fb3..3d362a68 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiBlxOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/ApiBlxOrderExample.java @@ -256,63 +256,73 @@ public class ApiBlxOrderExample { return (Criteria) this; } - public Criteria andOrderIdIsNull() { - addCriterion("order_id is null"); + public Criteria andOrderNoIsNull() { + addCriterion("order_no is null"); return (Criteria) this; } - public Criteria andOrderIdIsNotNull() { - addCriterion("order_id is not null"); + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); return (Criteria) this; } - public Criteria andOrderIdEqualTo(Long value) { - addCriterion("order_id =", value, "orderId"); + public Criteria andOrderNoEqualTo(String value) { + addCriterion("order_no =", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdNotEqualTo(Long value) { - addCriterion("order_id <>", value, "orderId"); + public Criteria andOrderNoNotEqualTo(String value) { + addCriterion("order_no <>", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdGreaterThan(Long value) { - addCriterion("order_id >", value, "orderId"); + public Criteria andOrderNoGreaterThan(String value) { + addCriterion("order_no >", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdGreaterThanOrEqualTo(Long value) { - addCriterion("order_id >=", value, "orderId"); + public Criteria andOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("order_no >=", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdLessThan(Long value) { - addCriterion("order_id <", value, "orderId"); + public Criteria andOrderNoLessThan(String value) { + addCriterion("order_no <", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdLessThanOrEqualTo(Long value) { - addCriterion("order_id <=", value, "orderId"); + public Criteria andOrderNoLessThanOrEqualTo(String value) { + addCriterion("order_no <=", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdIn(List values) { - addCriterion("order_id in", values, "orderId"); + public Criteria andOrderNoLike(String value) { + addCriterion("order_no like", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdNotIn(List values) { - addCriterion("order_id not in", values, "orderId"); + public Criteria andOrderNoNotLike(String value) { + addCriterion("order_no not like", value, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdBetween(Long value1, Long value2) { - addCriterion("order_id between", value1, value2, "orderId"); + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); return (Criteria) this; } - public Criteria andOrderIdNotBetween(Long value1, Long value2) { - addCriterion("order_id not between", value1, value2, "orderId"); + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(String value1, String value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(String value1, String value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); return (Criteria) this; } @@ -636,6 +646,76 @@ public class ApiBlxOrderExample { return (Criteria) this; } + public Criteria andCarNoIsNull() { + addCriterion("car_no is null"); + return (Criteria) this; + } + + public Criteria andCarNoIsNotNull() { + addCriterion("car_no is not null"); + return (Criteria) this; + } + + public Criteria andCarNoEqualTo(String value) { + addCriterion("car_no =", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoNotEqualTo(String value) { + addCriterion("car_no <>", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoGreaterThan(String value) { + addCriterion("car_no >", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoGreaterThanOrEqualTo(String value) { + addCriterion("car_no >=", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoLessThan(String value) { + addCriterion("car_no <", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoLessThanOrEqualTo(String value) { + addCriterion("car_no <=", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoLike(String value) { + addCriterion("car_no like", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoNotLike(String value) { + addCriterion("car_no not like", value, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoIn(List values) { + addCriterion("car_no in", values, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoNotIn(List values) { + addCriterion("car_no not in", values, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoBetween(String value1, String value2) { + addCriterion("car_no between", value1, value2, "carNo"); + return (Criteria) this; + } + + public Criteria andCarNoNotBetween(String value1, String value2) { + addCriterion("car_no not between", value1, value2, "carNo"); + return (Criteria) this; + } + public Criteria andParkTimeIsNull() { addCriterion("park_time is null"); return (Criteria) this; @@ -836,52 +916,62 @@ public class ApiBlxOrderExample { return (Criteria) this; } - public Criteria andCarSeatIdEqualTo(Long value) { + public Criteria andCarSeatIdEqualTo(String value) { addCriterion("car_seat_id =", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdNotEqualTo(Long value) { + public Criteria andCarSeatIdNotEqualTo(String value) { addCriterion("car_seat_id <>", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdGreaterThan(Long value) { + public Criteria andCarSeatIdGreaterThan(String value) { addCriterion("car_seat_id >", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdGreaterThanOrEqualTo(Long value) { + public Criteria andCarSeatIdGreaterThanOrEqualTo(String value) { addCriterion("car_seat_id >=", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdLessThan(Long value) { + public Criteria andCarSeatIdLessThan(String value) { addCriterion("car_seat_id <", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdLessThanOrEqualTo(Long value) { + public Criteria andCarSeatIdLessThanOrEqualTo(String value) { addCriterion("car_seat_id <=", value, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdIn(List values) { + public Criteria andCarSeatIdLike(String value) { + addCriterion("car_seat_id like", value, "carSeatId"); + return (Criteria) this; + } + + public Criteria andCarSeatIdNotLike(String value) { + addCriterion("car_seat_id not like", value, "carSeatId"); + return (Criteria) this; + } + + public Criteria andCarSeatIdIn(List values) { addCriterion("car_seat_id in", values, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdNotIn(List values) { + public Criteria andCarSeatIdNotIn(List values) { addCriterion("car_seat_id not in", values, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdBetween(Long value1, Long value2) { + public Criteria andCarSeatIdBetween(String value1, String value2) { addCriterion("car_seat_id between", value1, value2, "carSeatId"); return (Criteria) this; } - public Criteria andCarSeatIdNotBetween(Long value1, Long value2) { + public Criteria andCarSeatIdNotBetween(String value1, String value2) { addCriterion("car_seat_id not between", value1, value2, "carSeatId"); return (Criteria) this; } diff --git a/hai-service/src/main/java/com/hai/entity/HighCoupon.java b/hai-service/src/main/java/com/hai/entity/HighCoupon.java index 17d60233..bd926526 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCoupon.java +++ b/hai-service/src/main/java/com/hai/entity/HighCoupon.java @@ -143,7 +143,7 @@ public class HighCoupon extends HighCouponModel implements Serializable { private Integer displayArea; /** - * 卡券来源:1.中石化 2.消费券 3.其他 4:贵州中石化 + * 卡券来源:1.中石化 2.消费券 3.其他 4:贵州中石化 5: 预发码 6:停车券 */ private Integer couponSource; diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index 0953bfcd..bfad0ae1 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -44,6 +44,7 @@ public class HighOrder implements Serializable { 10:电影票 11:贵州中石化 12:实物商品 +13:比邻星停车场 */ private Integer productType; @@ -92,6 +93,11 @@ public class HighOrder implements Serializable { */ private String paySerialNo; + /** + * 支付渠道 1:直连 2:惠支付 + */ + private Integer payChannel; + /** * 支付方式: 1:支付宝 2:微信 3:金币 4:汇联通工会卡 5:银联 */ @@ -413,6 +419,14 @@ public class HighOrder implements Serializable { this.paySerialNo = paySerialNo; } + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + public Integer getPayType() { return payType; } @@ -758,6 +772,7 @@ public class HighOrder implements Serializable { && (this.getCombineOrderNo() == null ? other.getCombineOrderNo() == null : this.getCombineOrderNo().equals(other.getCombineOrderNo())) && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) && (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) + && (this.getPayChannel() == null ? other.getPayChannel() == null : this.getPayChannel().equals(other.getPayChannel())) && (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType())) && (this.getMemCardId() == null ? other.getMemCardId() == null : this.getMemCardId().equals(other.getMemCardId())) && (this.getMemCardType() == null ? other.getMemCardType() == null : this.getMemCardType().equals(other.getMemCardType())) @@ -817,6 +832,7 @@ public class HighOrder implements Serializable { result = prime * result + ((getCombineOrderNo() == null) ? 0 : getCombineOrderNo().hashCode()); result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); + result = prime * result + ((getPayChannel() == null) ? 0 : getPayChannel().hashCode()); result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode()); result = prime * result + ((getMemCardId() == null) ? 0 : getMemCardId().hashCode()); result = prime * result + ((getMemCardType() == null) ? 0 : getMemCardType().hashCode()); @@ -879,6 +895,7 @@ public class HighOrder implements Serializable { sb.append(", combineOrderNo=").append(combineOrderNo); sb.append(", orderNo=").append(orderNo); sb.append(", paySerialNo=").append(paySerialNo); + sb.append(", payChannel=").append(payChannel); sb.append(", payType=").append(payType); sb.append(", memCardId=").append(memCardId); sb.append(", memCardType=").append(memCardType); @@ -923,4 +940,4 @@ public class HighOrder implements Serializable { sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java index 9cbd45d9..c187a267 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java @@ -986,6 +986,66 @@ public class HighOrderExample { return (Criteria) this; } + public Criteria andPayChannelIsNull() { + addCriterion("pay_channel is null"); + return (Criteria) this; + } + + public Criteria andPayChannelIsNotNull() { + addCriterion("pay_channel is not null"); + return (Criteria) this; + } + + public Criteria andPayChannelEqualTo(Integer value) { + addCriterion("pay_channel =", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelNotEqualTo(Integer value) { + addCriterion("pay_channel <>", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelGreaterThan(Integer value) { + addCriterion("pay_channel >", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_channel >=", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelLessThan(Integer value) { + addCriterion("pay_channel <", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelLessThanOrEqualTo(Integer value) { + addCriterion("pay_channel <=", value, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelIn(List values) { + addCriterion("pay_channel in", values, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelNotIn(List values) { + addCriterion("pay_channel not in", values, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelBetween(Integer value1, Integer value2) { + addCriterion("pay_channel between", value1, value2, "payChannel"); + return (Criteria) this; + } + + public Criteria andPayChannelNotBetween(Integer value1, Integer value2) { + addCriterion("pay_channel not between", value1, value2, "payChannel"); + return (Criteria) this; + } + public Criteria andPayTypeIsNull() { addCriterion("pay_type is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighUserCoupon.java b/hai-service/src/main/java/com/hai/entity/HighUserCoupon.java index 3b4bb087..ab141e30 100644 --- a/hai-service/src/main/java/com/hai/entity/HighUserCoupon.java +++ b/hai-service/src/main/java/com/hai/entity/HighUserCoupon.java @@ -95,6 +95,11 @@ public class HighUserCoupon implements Serializable { */ private Long sourceId; + /** + * 来源类型 + */ + private Integer sourceType; + private String ext1; private String ext2; @@ -243,6 +248,14 @@ public class HighUserCoupon implements Serializable { this.sourceId = sourceId; } + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + public String getExt1() { return ext1; } @@ -303,6 +316,7 @@ public class HighUserCoupon implements Serializable { && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource())) && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId())) + && (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) @@ -329,6 +343,7 @@ public class HighUserCoupon implements Serializable { result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode()); result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode()); + result = prime * result + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); @@ -358,6 +373,7 @@ public class HighUserCoupon implements Serializable { sb.append(", status=").append(status); sb.append(", source=").append(source); sb.append(", sourceId=").append(sourceId); + sb.append(", sourceType=").append(sourceType); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); @@ -366,4 +382,4 @@ public class HighUserCoupon implements Serializable { sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighUserCouponExample.java b/hai-service/src/main/java/com/hai/entity/HighUserCouponExample.java index ced18b6a..0ba14e33 100644 --- a/hai-service/src/main/java/com/hai/entity/HighUserCouponExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighUserCouponExample.java @@ -1105,6 +1105,66 @@ public class HighUserCouponExample { return (Criteria) this; } + public Criteria andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/model/UserModel.java b/hai-service/src/main/java/com/hai/model/UserModel.java index 9eac5ec3..fd3af7a3 100644 --- a/hai-service/src/main/java/com/hai/model/UserModel.java +++ b/hai-service/src/main/java/com/hai/model/UserModel.java @@ -47,13 +47,7 @@ public class UserModel { // 油卡信息 private Map oilCard; - public Integer getBlxCouponBalance() { - return blxCouponBalance; - } - public void setBlxCouponBalance(Integer blxCouponBalance) { - this.blxCouponBalance = blxCouponBalance; - } public Boolean getIsSetOilCard() { return isSetOilCard; diff --git a/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java b/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java index 35c6324c..ca240d01 100644 --- a/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java +++ b/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java @@ -117,7 +117,7 @@ public class BlxConfig { JSONObject jsonObject = new JSONObject(); jsonObject.put("userMobile" , object.getString("userMobile")); - jsonObject.put("couponStatus" , 1); + jsonObject.put("couponStatus" , object.getInteger("couponStatus")); map.put("data" , jsonObject); Map header = new HashMap<>(); @@ -316,12 +316,14 @@ public class BlxConfig { */ public JSONObject parkOrderPay(JSONObject object) { - Map header = new HashMap<>(); + Map header = new HashMap<>(); header.put("token" , generateJw()); - header.put("orderCode" , object.getString("orderCode")); + Map map = new HashMap<>(); + map.put("orderCode" , object.getString("orderCode")); log.info("============ 比邻星停车券业务-停车场订单支付--捷顺-START ============="); - JSONObject data = HttpsUtils.doPost(CommonSysConst.getSysConfig().getBlxPostUrl() + "/peration/member/parking/api/parkOrderPay" , new HashMap<>() , header); + JSONObject data = HttpsUtils.doGet(CommonSysConst.getSysConfig().getBlxPostUrl() + "/peration/member/parking/api/parkOrderPay" , map, header); log.info("头部参数: " + header); + log.info("请求参数: " + map); log.info("响应参数: " + data); log.info("============ 比邻星停车券业务-停车场订单支付--捷顺-END ============="); return data; diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiBlxCouponServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiBlxCouponServiceImpl.java index b7e11af9..995facb7 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiBlxCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiBlxCouponServiceImpl.java @@ -80,8 +80,8 @@ public class ApiBlxCouponServiceImpl implements ApiBlxCouponService { if (MapUtils.getString(map , "merId") != null) { criteria.andMerIdEqualTo(MapUtils.getString(map , "merId")); } - if (MapUtils.getLong(map , "orderId") != null) { - criteria.andOrderIdEqualTo(MapUtils.getLong(map , "orderId")); + if (MapUtils.getString(map , "orderNo") != null) { + criteria.andOrderNoEqualTo(MapUtils.getString(map , "orderNo")); } if (MapUtils.getString(map , "merOrderId") != null) { criteria.andMerOrderIdEqualTo(MapUtils.getString(map , "merOrderId")); diff --git a/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java b/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java index 751f7c81..fd759710 100644 --- a/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java +++ b/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java @@ -47,6 +47,8 @@ public class CreateOrderChildModel { * 9. 星巴克 * 10. 第三方充值 * 11. 实物商品购买 + * 12. 停车券购买 + * 13. 停车券核销 */ private Integer goodsType; @@ -126,5 +128,28 @@ public class CreateOrderChildModel { private BigDecimal price; /** ======================= 比邻星停车券 end ======================== **/ - + /** ======================= 比邻星停车核销 start ======================== **/ + // 停车场ID + private String parkId; + // 停车场订单ID + private String parkOrderId; + // 停车场名称 + private String parkName; + // 订单类型 10=路边订单,20=室内订单 + private Integer orderType; + // 已支付金额 单位分 + private BigDecimal prePrice; + // 入场时间 + private String inTime; + // 出场时间 + private String outTime; + // 优惠券券码 + private String userCouponCode; + // 停车场时长 + private String parkTime; + // 车位ID + private String carSeatId; + // 车牌号 + private String carNo; + /** ======================= 比邻星停车核销 end ======================== **/ } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 88f471b9..b6671aef 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -17,6 +17,7 @@ import com.hai.goods.service.GoodsSkuService; import com.hai.goods.service.ShoppingCartService; import com.hai.model.GasPayPriceModel; import com.hai.model.OutRechargePriceModel; +import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiBlxCouponService; import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderModel; @@ -34,6 +35,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.lang.reflect.Array; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLDecoder; @@ -54,6 +56,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { @Resource private CommonService commonService; + @Resource + private BlxConfig blxConfig; + + @Resource + private HighUserCardService highUserCardService; + @Resource private ApiBlxCouponService apiBlxCouponService; @@ -1003,7 +1011,56 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { } @Override - public HighChildOrder blxOrder(HighOrder order, CreateOrderChildModel createOrderChildModel) { + public HighChildOrder blxOrder(HighOrder order, CreateOrderChildModel createOrderChildModel){ + + JSONObject object = new JSONObject(); + object.put("userMobile" , order.getMemPhone()); + object.put("userCouponCode" , createOrderChildModel.getUserCouponCode()); + object.put("parkOrderId" , createOrderChildModel.getParkOrderId()); + object.put("orderType" , createOrderChildModel.getOrderType()); + object.put("prePrice" , createOrderChildModel.getPrePrice()); + object.put("parkId" , createOrderChildModel.getParkId()); + object.put("parkName" , createOrderChildModel.getParkName()); + object.put("parkTime" , createOrderChildModel.getParkTime() ); + object.put("carSeatId" , createOrderChildModel.getCarSeatId() ); + object.put("parkTime" , createOrderChildModel.getParkTime() ); + object.put("inTime" , createOrderChildModel.getInTime() ); + object.put("outTime" , createOrderChildModel.getOutTime() == null ? new Date() : createOrderChildModel.getOutTime() ); + object.put("carNo" , createOrderChildModel.getCarNo() ); + + // 调用下单接口 + JSONObject jsonObject = blxConfig.creatOrder(object); + highUserCardService.getBlxCouponBalance(order.getMemPhone()); + // 获取卡券数量 + String[] couponKey = createOrderChildModel.getUserCouponCode().split(","); + + // 组装停车订单 + ApiBlxOrder apiBlxOrder = new ApiBlxOrder(); + apiBlxOrder.setOrderType(createOrderChildModel.getOrderType()); + apiBlxOrder.setCreateTime(new Date()); + + if (jsonObject.getInteger("code") != 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("msg")); + } + + if (jsonObject.getInteger("code") == 1) { + apiBlxOrder.setParkOrderId(jsonObject.getJSONObject("data").getString("orderCode")); + apiBlxOrder.setOverTime(jsonObject.getJSONObject("data").getInteger("overtime")); + } + apiBlxOrder.setCouponPrice(new BigDecimal(couponKey.length)); + apiBlxOrder.setInTime(object.getDate("inTime")); + apiBlxOrder.setUpdateTime(new Date()); + apiBlxOrder.setParkTime(Integer.valueOf(createOrderChildModel.getParkTime())); + apiBlxOrder.setParkName(createOrderChildModel.getParkName()); + apiBlxOrder.setParkPrice(createOrderChildModel.getPrice()); + apiBlxOrder.setOutTime(object.getDate("outTime")); + apiBlxOrder.setMerId(object.getString("merchId")); + apiBlxOrder.setCarNo(createOrderChildModel.getCarNo()); + apiBlxOrder.setCarSeatId(createOrderChildModel.getCarSeatId()); + apiBlxOrder.setOrderNo(order.getOrderNo()); + apiBlxOrder.setOrderStatus(4); + + apiBlxCouponService.insertBlxOrder(apiBlxOrder); // 生成交易子订单 @@ -1015,13 +1072,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); childOrder.setGoodsType(OrderChildGoodsType.TYPE13.getNumber()); childOrder.setGoodsName("停车券核销"); - childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice()); - childOrder.setGoodsActualPrice(createOrderChildModel.getGoodsPrice()); - childOrder.setSaleCount(createOrderChildModel.getSaleCount()); + childOrder.setGoodsPrice(apiBlxOrder.getCouponPrice()); + childOrder.setGoodsActualPrice(apiBlxOrder.getCouponPrice()); + childOrder.setSaleCount(1); childOrder.setGiveawayType(false); childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); - childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); - childOrder.setTotalActualPrice(childOrder.getGoodsActualPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); + childOrder.setTotalPrice(apiBlxOrder.getCouponPrice()); + childOrder.setTotalActualPrice(apiBlxOrder.getCouponPrice()); childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); childOrder.setPraiseStatus(0); childOrder.setCreateTime(new Date()); diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index 9fef60cf..abf4b634 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -223,7 +223,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE5.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) { - mobileRecharge(order); + mobileRechargeHandle(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) { eCouponPackageHandle(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE8.getNumber())) { @@ -233,11 +233,11 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE10.getNumber())) { thirdOrderHandle(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE11.getNumber())) { - goodsRecharge(order , childOrder); + goodsRechargeHandle(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE12.getNumber())) { - blxCoupon(order , childOrder); + blxCouponHandle(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE13.getNumber())) { - blxOrder(order , childOrder); + blxOrderHandle(order); } } } @@ -348,6 +348,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { gasOrder.setChannelOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); + gasOrderService.updateGasOrder(gasOrder); } } else if (gasOrder.getChannelType().equals(MerchantStoreSourceType.type3.getNumber())) { @@ -498,7 +499,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { * @Param [order] * @Return void */ - private void mobileRecharge(HighOrder order) { + private void mobileRechargeHandle(HighOrder order) { OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); if (outRechargeOrder.getPayStatus() == null) { if (order.getProductType().equals(9)) { @@ -516,7 +517,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { * @Param [order] * @Return void */ - private void goodsRecharge(HighOrder order , HighChildOrder highChildOrder) { + private void goodsRechargeHandle(HighOrder order , HighChildOrder highChildOrder) { GoodsOrder goodsOrder = goodsOrderExtService.findGoodsOrder(order.getOrderNo()); goodsOrder.setUpdateTime(new Date()); goodsOrder.setStatus("1"); @@ -524,7 +525,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { presentService.presentUser(order , highChildOrder); } - private void blxCoupon(HighOrder order , HighChildOrder highChildOrder) { + private void blxCouponHandle(HighOrder order , HighChildOrder highChildOrder) { // 派发停车券 ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(highChildOrder.getGoodsSpecName()); @@ -552,10 +553,11 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } } - private void blxOrder(HighOrder order , HighChildOrder highChildOrder) { + private void blxOrderHandle(HighOrder order) { + // 获取下单订单号 Map map = new HashMap<>(); - map.put("orderId" , order.getId()); + map.put("orderNo" , order.getOrderNo()); ApiBlxOrder apiBlxOrder = apiBlxCouponService.findOrderByMap(map); if (apiBlxOrder != null) { @@ -568,8 +570,10 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { if (object.getInteger("code") == 1) { order.setOrderStatus(OrderStatus.STATUS3.getNumber()); order.setFinishTime(new Date()); + for (HighChildOrder childOrder : order.getHighChildOrderList()) { + childOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber()); + } orderService.updateOrderData(order); - } } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java index c3b74d32..31e32b2e 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java @@ -9,10 +9,7 @@ import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.UnionPayConfig; import com.hai.config.WxOrderConfig; import com.hai.dao.HighOrderRefundMapper; -import com.hai.entity.HighChildOrder; -import com.hai.entity.HighOrder; -import com.hai.entity.HighOrderRefund; -import com.hai.entity.HighOrderRefundExample; +import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.openApi.service.ApiOrderService; import com.hai.order.model.RefundPriceModel; @@ -20,6 +17,7 @@ import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.*; import com.hai.order.utils.OrderUtil; +import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.HighFleetOilCardService; import com.hai.service.HighOilCardService; import com.hai.service.HighUserService; @@ -60,6 +58,9 @@ public class OrderRefundServiceImpl implements OrderRefundService { @Resource private ApiOrderService apiOrderService; + @Resource + private HuiConfig huiConfig; + @Override public void update(HighOrderRefund orderRefund) { orderRefundMapper.updateByPrimaryKey(orderRefund); @@ -160,11 +161,23 @@ public class OrderRefundServiceImpl implements OrderRefundService { // 第三方退款 if (orderPayType.getNumber().equals(OrderPayType.PAY_TYPE2.getNumber())) { - // 微信退款 - OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(),order.getPayRealPrice(), order.getAccountMerchantNum(), refundPrice); - if(orderRefundModel.getResult_code().equals("SUCCESS")) { - refundPriceModel.setRefundSuccess(true); - refundPriceModel.setThirdPartyRefundOrderNo(orderRefundModel.getRefund_id()); + + if (order.getPayChannel() == 2) { + JSONObject object = huiConfig.refund(order); + + if (object.getString("return_code").equals("000000")) { + JSONObject jsonObject = object.getJSONObject("return_data"); + refundPriceModel.setRefundSuccess(true); + refundPriceModel.setThirdPartyRefundOrderNo(jsonObject.getString("refundTradeNo")); + } + + } else { + // 微信退款 + OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(),order.getPayRealPrice(), order.getAccountMerchantNum(), refundPrice); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + refundPriceModel.setRefundSuccess(true); + refundPriceModel.setThirdPartyRefundOrderNo(orderRefundModel.getRefund_id()); + } } } else if (orderPayType.getNumber().equals(OrderPayType.PAY_TYPE3.getNumber())) { diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index c6f87749..fc0026f9 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -346,7 +346,7 @@ public class OrderServiceImpl implements OrderService { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE13.getNumber())) { HighChildOrder childOrder = orderCreateHandleService.blxOrder(order , child); childOrderList.add(childOrder); - order.setProductType(OrderProductType.PRODUCT_TYPE13.getNumber()); + order.setProductType(OrderProductType.PRODUCT_TYPE14.getNumber()); order.setSecUserId(childOrder.getId()); if (StringUtils.isBlank(order.getTitle())) { order.setTitle(childOrder.getGoodsName()); @@ -482,6 +482,17 @@ public class OrderServiceImpl implements OrderService { goodsOrderExtService.insertGoodsOrder(goodsOrder); } + if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE14.getNumber())) { + + order.setOrderStatus(OrderStatus.STATUS2.getNumber()); + order.setPayRealPrice(order.getPayPrice()); + order.setPayTime(new Date()); + order.setPayGold(createOrderModel.getPayGold()); + for (HighChildOrder childOrder : order.getHighChildOrderList()) { + childOrder.setChildOrderStatus(OrderChildStatus.STATUS2.getNumber()); + } + } + // 积分抵扣 if (createOrderModel.getPayGold() != null && createOrderModel.getPayGold() > 0) { // 查询用户 @@ -683,6 +694,7 @@ public class OrderServiceImpl implements OrderService { order.setSurplusRefundPrice(new BigDecimal("0")); order.setRefundTime(new Date()); order.setOrderStatus(OrderStatus.STATUS4.getNumber()); + order.setExceptionStatus(false); // 退回金额,原路返回 RefundPriceModel refundPrice = orderRefundService.refundPrice(refundOrderNo diff --git a/hai-service/src/main/java/com/hai/pay/channel/huipay/TradeService.java b/hai-service/src/main/java/com/hai/pay/channel/huipay/TradeService.java new file mode 100644 index 00000000..f27041b7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/pay/channel/huipay/TradeService.java @@ -0,0 +1,7 @@ +package com.hai.pay.channel.huipay; + +public class TradeService { + + + +} diff --git a/hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java b/hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java new file mode 100644 index 00000000..0b8ebebf --- /dev/null +++ b/hai-service/src/main/java/com/hai/pay/channel/huipay/config/HuiConfig.java @@ -0,0 +1,117 @@ +package com.hai.pay.channel.huipay.config; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.pay.WechatPayUtil; +import com.hai.common.utils.HttpsUtils; +import com.hai.config.CommonSysConst; +import com.hai.dao.HighPayRecordMapper; +import com.hai.entity.HighOrder; +import com.hai.entity.HighPayRecord; +import com.hai.order.utils.OrderUtil; +import com.hai.pay.channel.huipay.utils.SignatureUtil; +import com.hai.service.HighOrderService; +import com.hai.service.pay.PayRecordService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.SortedMap; +import java.util.TreeMap; + +@Component +public class HuiConfig { + + @Resource + private PayRecordService payRecordService; + + @Resource + private HighOrderService highOrderService; + + private static Logger log = LoggerFactory.getLogger(HuiConfig.class); + + // 请求地址 + public final static String postUrl = "https://pay.dctpay.com/openApi/v1/"; + + // 渝北区浩联物资经营部 + public final static String hlMerNo = "2023090816465844909"; + + // 渝北区浩联物资经营部 + public final static String hlKey = "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt"; + + public final static String hlSubAppid = "wx8d49e2f83025229d"; + + /** + * @Author Sum1Dream + * @Name preorder + * @Description // 发起支付 + * @Date 16:35 2023/9/13 + * @Param object + * @return java.util.SortedMap + */ + public SortedMap preorder(JSONObject object) throws Exception { + object.put("merchantNo" , hlMerNo); + object.put("subAppid" , hlSubAppid); + object.put("sign" , SignatureUtil.createSign(object , hlKey)); + + JSONObject jsonObject = HttpsUtils.doPost(postUrl + "trade/preorder", object, new HashMap<>()); + // 签名校验 + SortedMap sortedMap = null; + if (jsonObject.getString("return_code").equals("000000")) { + + JSONObject payParam = jsonObject.getJSONObject("return_data").getJSONObject("payParam"); + sortedMap = new TreeMap<>(); + sortedMap.put("appId", payParam.get("app_id")); + sortedMap.put("nonceStr", payParam.get("nonce_str")); + sortedMap.put("timeStamp", payParam.get("time_stamp")); + sortedMap.put("signType", "MD5"); + sortedMap.put("package", payParam.get("package")); + sortedMap.put("sign", payParam.get("pay_sign")); + + // 将支付请求存入支付纪录 + HighPayRecord payRecord = new HighPayRecord(); + payRecord.setBodyInfo(String.valueOf(payParam)); + payRecord.setResType(1); + payRecord.setPayType(2); + payRecord.setPayMoney(object.getBigDecimal("totalAmount")); + payRecordService.addPayRecord(payRecord); + + } else { + log.error("微信支付 -> 组装支付参数:支付信息错误"); + log.error("错误信息:" + jsonObject.getString("return_msg")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,请稍后重新提交订单支付!"); + } + + return sortedMap; + + } + + /** + * @Author Sum1Dream + * @Name refund + * @Description // 发起退款 + * @Date 16:35 2023/9/13 + * @Param orderNo + * @return com.alibaba.fastjson.JSONObject + */ + public JSONObject refund(HighOrder order) throws Exception { + + JSONObject object = new JSONObject(); + object.put("merchantNo" , hlMerNo); + object.put("outTradeNo" , order.getOrderNo()); + object.put("refundTradeNo" , OrderUtil.generateRefundOrderNo()); + object.put("refundAmount" , order.getPayRealPrice()); + object.put("sign" , SignatureUtil.createSign(object , hlKey)); + + return HttpsUtils.doPost(postUrl + "trade/refund", object, new HashMap<>()); + + } + + +} diff --git a/hai-service/src/main/java/com/hai/pay/channel/huipay/utils/SignatureUtil.java b/hai-service/src/main/java/com/hai/pay/channel/huipay/utils/SignatureUtil.java new file mode 100644 index 00000000..9cedb242 --- /dev/null +++ b/hai-service/src/main/java/com/hai/pay/channel/huipay/utils/SignatureUtil.java @@ -0,0 +1,99 @@ +package com.hai.pay.channel.huipay.utils; + +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; + +import javax.xml.bind.annotation.adapters.HexBinaryAdapter; +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * 签名工具类 + */ +public class SignatureUtil { + + /** + * 参数签名 + * @param param 参数 + * @param key 秘钥 + * @return + * @throws Exception + */ + public static String createSign(Object param, String key) throws Exception { + Map map = JSONObject.parseObject(JSONObject.toJSONString(param), Map.class); + return md5Encode(paramSort(map, key).getBytes()); + } + + /** + * 验证签名 + * @param checkSign 需验证的签名字符串 + * @param param 参数 + * @param key 秘钥 + * @return + * @throws Exception + */ + public static Boolean checkSign(String checkSign,Object param, String key) throws Exception { + Map map = JSONObject.parseObject(JSONObject.toJSONString(param), Map.class); + // 去除签名 + map.remove("sign"); + if (checkSign.equals(createSign(map, key))) { + return true; + } + return false; + } + + /** + * 参数排序 + * @param param + * @return + */ + public static String paramSort(final Map param, String key) { + Set keySet = param.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (StringUtils.isBlank(sb.toString())) { + sb.append(k).append("=").append(param.get(k)); + } else { + sb.append("&").append(k).append("=").append(param.get(k)); + } + } + sb.append("&key=").append(key); + return sb.toString(); + } + + /** + * MD5加密 + * @param data + * @return + * @throws Exception + */ + public static String md5Encode(byte[] data) throws Exception { + // 初始化MessageDigest + MessageDigest md = MessageDigest.getInstance("MD5"); + // 执行摘要信息 + byte[] digest = md.digest(data); + // 将摘要信息转换为32位的十六进制字符串 + return new String(new HexBinaryAdapter().marshal(digest)); + } + + public static void main(String[] args) throws Exception { + String paramStr = "{\n" + + " \"merchantNo\": \"2023090816465844909\",\n" + + " \"outTradeNo\": \"ZF1130202305051459532538973458\",\n" + + " \"payMode\": \"WECHAT\",\n" + + " \"totalAmount\": 0.01,\n" + + " \"transType\": \"JSAPI\",\n" + + " \"profitSharing\": 0,\n" + + " \"specialField\": \"测试\"" + + "}"; + String sign = createSign(JSONObject.parseObject(paramStr), "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt"); + System.out.println(sign); + } + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index 552f658d..ef6a7a99 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -49,6 +49,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { @Resource private HighCouponCodeMapperExt highCouponCodeMapperExt; + @Resource + private HighUserCardService highUserCardService; + @Resource private HighCouponCodeOtherService couponCodeOtherService; @@ -502,6 +505,7 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { if (apiBlxCoupon == null || apiBlxCoupon.getCouponStatus() != 1) { throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买"); } + // 计算上送卡券数量 int num = coupon.getSalesPrice().divide(new BigDecimal(apiBlxCoupon.getDenomination())).intValue(); if (num > 0) { @@ -516,19 +520,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { order.setOrderStatus(OrderStatus.STATUS3.getNumber()); order.setFinishTime(new Date()); orderService.updateOrderData(order); - - // 卡卷关联用户 - HighUserCoupon highUserCoupon = new HighUserCoupon(); - highUserCoupon.setMerchantId(coupon.getMerchantId()); - highUserCoupon.setCouponId(coupon.getId()); - highUserCoupon.setOrderId(order.getId()); - highUserCoupon.setChildOrderId(childOrder.getId()); - highUserCoupon.setUserId(order.getMemId()); - highUserCoupon.setUserPhone(order.getMemPhone()); - highUserCoupon.setCreateTime(new Date()); - highUserCoupon.setUseEndTime(apiBlxCoupon.getUseEndTime()); - highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 - highUserCouponService.insertUserCoupon(highUserCoupon); + highUserCardService.getBlxCouponBalance(order.getMemPhone()); + } else { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , object.getString("msg")); } } } else { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java index 073a56cd..5f353f36 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java @@ -146,8 +146,6 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop(); // 油站优惠价 BigDecimal priceVip = gasOilPrice.getPriceVip(); - // 平台优惠 - BigDecimal preferentialMargin = gasOilPrice.getPreferentialMargin(); GasPayPriceModel payPriceModel = new GasPayPriceModel(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java index 8ff3d1b4..03e09859 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java @@ -189,21 +189,28 @@ public class HighUserCardServiceImpl implements HighUserCardService { JSONObject data = new JSONObject(); JSONObject jsonObject = new JSONObject(); jsonObject.put("userMobile" , phone); + jsonObject.put("couponStatus" , 1); HighUser user = highUserService.findByPhone(phone); // 获取比邻星接口查询用户停车券内容 JSONObject object = blxConfig.getUserCouponPage(jsonObject); + jsonObject.put("couponStatus" , 2); + JSONObject object02 = blxConfig.getUserCouponPage(jsonObject); + int num = 0; + int num02 = 0; if (object.getInteger("code") == 1) { num = object.getJSONObject("data").getInteger("total"); + num02 = object02.getJSONObject("data").getInteger("total"); - if (num > 0) { + if (num > 0 || num02 > 2) { // 获取停车券内容 JSONArray blcArray = object.getJSONObject("data").getJSONArray("records"); + blcArray.addAll(object02.getJSONObject("data").getJSONArray("records")); data.put("data" , blcArray); // 更新停车券状态 @@ -234,7 +241,8 @@ public class HighUserCardServiceImpl implements HighUserCardService { highUserCoupon.setCreateTime(new Date()); highUserCoupon.setQrCodeImg(blxData.getString("userCouponCode")); highUserCoupon.setUseEndTime(blxData.getDate("expiresTime")); - highUserCoupon.setSource(3); + highUserCoupon.setSource(1); + highUserCoupon.setSourceType(6); highUserCouponService.insertUserCoupon(highUserCoupon); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java index 8f9adb99..ecd8ce21 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; /** @@ -120,6 +121,9 @@ public class HighUserCouponServiceImpl implements HighUserCouponService { if (MapUtils.getInteger(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } + if (MapUtils.getInteger(map, "sourceType") != null) { + criteria.andSourceTypeEqualTo(MapUtils.getInteger(map, "sourceType")); + } if (MapUtils.getLong(map, "couponCodeId") != null) { criteria.andCouponCodeIdEqualTo(MapUtils.getLong(map, "couponCodeId")); @@ -130,7 +134,18 @@ public class HighUserCouponServiceImpl implements HighUserCouponService { List highUserCoupons = highUserCouponMapper.selectByExample(example); if (highUserCoupons.size() > 0) { for (HighUserCoupon highUserCoupon : highUserCoupons) { - highUserCoupon.setHighCouponModel(highCouponService.getCouponById(highUserCoupon.getCouponId())); + + HighCoupon highCoupon = highCouponService.getCouponById(highUserCoupon.getCouponId()); + + if (highCoupon.getCouponSource().equals(6)) { + highCoupon.setCouponImg("wxApplets/blxOne.jpg"); + highCoupon.setCouponName("1元停车券"); + highCoupon.setSalesPrice(new BigDecimal(1)); + highCoupon.setCouponPrice(new BigDecimal(1)); + highCoupon.setDiscountPrice(new BigDecimal(1)); + } + + highUserCoupon.setHighCouponModel(highCoupon); } } return highUserCoupons; diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 8df47b2b..fe8e9162 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -9,11 +9,16 @@ ChongQingCnpcMerKey=n2j30jxhl3rhuoci ChongQingCnpcCouponSignKey=5ojldakiz343a6yk # TuanYou configuration parameters -tuanYouUrl=https://test05-motorcade-hcs.czb365.com -tuanYouAppKey=231599775566496 -tuanYouAppSecret=cbfab3c550d6142a779c5196c9416342 -tuanYouDieselAccount=c009bidg4400 -tuanYouGasolineAccount=c009bic04400 +#tuanYouUrl=https://test02-motorcade-hcs.czb365.com +#tuanYouAppKey=231599775566496 +#tuanYouAppSecret=cbfab3c550d6142a779c5196c9416342 +#tuanYouDieselAccount=c009bidg4400 +#tuanYouGasolineAccount=c009bic04400 +tuanYouUrl=https://hcs.czb365.com +tuanYouAppKey=210091174083104 +tuanYouAppSecret=f9811df6791d309bf48f4a8db9edaa45 +tuanYouDieselAccount=9hp52qgg4400 +tuanYouGasolineAccount=9hp52qf04400 # JiaHaoYou configuration parameters shellGroupUrl=http://openapi.ngrok.xinyebang.cn/gateway.html @@ -132,4 +137,4 @@ filesystem=https://hsgcs.dctpay.com/filesystem/ #payPostUrl=http://localhost:9601/crest/ # -blxPostUrl=https://gateway.vf.bilinxing.com +blxPostUrl=https://vertical-formats-gateway.blx.bodata.cn:18443 diff --git a/v1/src/main/java/com/v1/controller/business/StarbucksController.java b/v1/src/main/java/com/v1/controller/business/StarbucksController.java index f53a63bf..e8647e36 100644 --- a/v1/src/main/java/com/v1/controller/business/StarbucksController.java +++ b/v1/src/main/java/com/v1/controller/business/StarbucksController.java @@ -113,11 +113,15 @@ public class StarbucksController { JSONObject jsonObject = QianZhuConfig.getStarbucksStore(object.getString("lat") , object.getString("lon")); + if (jsonObject == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未查询到任何内容!"); + } + if (jsonObject.getBoolean("success")) { return ResponseMsgUtil.success(jsonObject.getString("data")); } else { log.error("getRechargeProduct error!", "查询失败!"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , jsonObject.getString("message")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "查询失败"); } } catch (Exception e) {