From 5487d5d6beba6d9a4f57a6bef8314c9d50aa90e6 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 8 Aug 2023 15:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighTestController.java | 2 +- .../Goods/ShoppingCartController.java | 2 + .../com/web/controller/OrderController.java | 96 ++++++++++++ .../web/controller/OrderPayController.java | 146 ++++-------------- .../impl/ApiOrderCreateHandleServiceImpl.java | 36 ++++- .../service/impl/ApiOrderServiceImpl.java | 13 +- .../order/model/CreateOrderChildModel.java | 5 + .../com/hai/order/model/CreateOrderModel.java | 5 + .../com/hai/order/model/combine/Amount.java | 24 +++ .../model/combine/CombineOrderModel.java | 49 +++--- .../order/model/combine/CreateCombine.java | 20 +++ .../hai/order/model/combine/SubOrders.java | 54 +++++++ .../service/OrderCreateHandleService.java | 2 + .../impl/OrderCreateHandleServiceImpl.java | 5 + .../order/service/impl/OrderServiceImpl.java | 8 + .../hai/order/type/OrderChildGoodsType.java | 1 + .../hai/service/impl/CommonServiceImpl.java | 7 +- .../business/BlxCouponController.java | 2 +- .../com/v1/controller/orderController.java | 3 +- 19 files changed, 320 insertions(+), 160 deletions(-) create mode 100644 hai-service/src/main/java/com/hai/order/model/combine/Amount.java create mode 100644 hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java create mode 100644 hai-service/src/main/java/com/hai/order/model/combine/SubOrders.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 fb427cb6..8363255a 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.excel.EasyExcel; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.bweb.config.SysConst; 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.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiBlxCouponService; import com.hai.order.model.ExportOrderMobileModel; import com.hai.order.model.OrderThirdPartyModel; 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.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.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.File; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @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 OutRechargeOrderService outRechargeOrderService; @Autowired private OutRechargeChildOrderService childOrderService; @Resource private ApiBlxCouponService apiBlxCouponService; @Resource private BlxConfig blxConfig; @Resource private CommonService commonService; @Resource private OrderService orderService; @Resource private HighOrderService highOrderService; @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 = "/getStationStores", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取油站") public ResponseData getStationStores() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "4B1DF80A2D64376D2807ACA6CFEDE8AA"); mapPost.put("merchId" , "20220896102"); Map map = new HashMap<>(); map.put("apiKey" , "4B1DF80A2D64376D2807ACA6CFEDE8AA"); map.put("merchId" , "20220896102"); 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/refuelOnline/getStationStore" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getRechargeProduct", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取充值产品") public ResponseData getRechargeProduct() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); 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/mobileRecharge/getMobileProduct" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getAllCities", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询可用城市") public ResponseData getAllCities() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); 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/apiMerchants/getAllCities" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克门店") public ResponseData starbucksStore() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("lat" , "29.56900"); mapPost.put("lon" , "106.55843"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("lat" , "29.56900"); map.put("lon" , "106.55843"); 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/starbucks/starbucksStore" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克商品") public ResponseData starbucksProducts() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); 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/starbucks/starbucksProducts" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/kfcStoresList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData kfcStoresList() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); 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/kfc/kfcStoresList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/kfcProductByStoreCode", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据门店编码查询KFC产品") public ResponseData kfcProductByStoreCode(@RequestParam(name = "storeCode", required = true) String storeCode) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("storeCode" , storeCode); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("storeCode" , storeCode); 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/kfc/kfcProductByStoreCode" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getRegional", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询区域信息") public ResponseData getRegional() { try { return ResponseMsgUtil.success(commonService.getRegional("code" , "name" , "childs")); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/memberProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询会员产品") public ResponseData memberProducts() { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); 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/memberRecharge/memberProducts" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() 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("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("notifyUrl" , "test"); mapPost.put("content" , object.toString()); System.out.println(mapPost); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("timetable" , mapPost.get("timetable").toString()); map.put("orderNo" , mapPost.get("orderNo")); map.put("productType" , object.getString("productType")); map.put("content" , object.toString()); 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/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(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 = "/mobileDw", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单下载") public ResponseData mobileDw(@RequestParam(name = "createTimeS", required = false) String createTimeS, @RequestParam(name = "createTimeE", required = false) String createTimeE, @RequestParam(name = "refundTimeS", required = false) String refundTimeS, @RequestParam(name = "refundTimeE", required = false) String refundTimeE ) { try { Map map = new HashMap<>(); map.put("productType" , 9); map.put("createTimeS" , createTimeS); map.put("createTimeE" , createTimeE); map.put("refundTimeS" , refundTimeS); map.put("refundTimeE" , refundTimeE); List order = highOrderService.getOrderListNotChild(map); List list = new ArrayList<>(); ExportOrderMobileModel model; for (HighOrder highOrder : order) { model = new ExportOrderMobileModel(); OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNoNotChild(highOrder.getOrderNo()); if (rechargeOrder != null) { OutRechargeChildOrder childOrder = mobileChildOrderHandle(highOrder,rechargeOrder); model.setRechargeOrderNo(rechargeOrder.getOrderNo()); if (childOrder != null) { model.setChildOrderNo(childOrder.getOrderNo()); if (childOrder.getRechargePlatform() != null) { model.setRechargePlatform(RechargePlatformType.getDataByType(childOrder.getRechargePlatform()).getName()); } model.setRemark(childOrder.getExt1()); } } model.setFinishTime(highOrder.getFinishTime()); model.setOrderStatus(OrderStatus.getDataByType(highOrder.getOrderStatus()).getName()); model.setMemPhone(highOrder.getMemPhone()); model.setCreateTime(highOrder.getCreateTime()); model.setTitle(highOrder.getTitle()); model.setPayablePrice(highOrder.getPayablePrice()); model.setRefundTime(highOrder.getRefundTime()); model.setPayPrice(highOrder.getPayPrice()); model.setOrderNo(highOrder.getOrderNo()); model.setMemCardNo(highOrder.getMemCardNo()); if (highOrder.getPayType() != null) { model.setPayType(OrderPayType.getDataByType(highOrder.getPayType()).getName()); } list.add(model); } String fileUrl = SysConst.getSysConfig().getFileUrl() + "temporary/"; String pathName = System.currentTimeMillis()+".xlsx"; File file = new File(fileUrl); if (!file.exists()) { file.mkdirs(); } EasyExcel.write(fileUrl+pathName) .head(ExportOrderMobileModel.class) .sheet("话费交易订单") .doWrite(list); return ResponseMsgUtil.success(pathName); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } public OutRechargeChildOrder mobileChildOrderHandle(HighOrder highOrder , OutRechargeOrder outRechargeOrder) { // 组装查询子订单数据 Map childOrderMap101 = new HashMap<>(); childOrderMap101.put("parent_order_id", outRechargeOrder.getId()); childOrderMap101.put("status", "101,102"); // 查询充值订单 List childOrders = childOrderService.getListRechargeChildOrder(childOrderMap101); OutRechargeChildOrder childOrder; // 判读是否存在多个充值中的订单 if (childOrders.size() > 0) { childOrder = childOrders.get(0); if (childOrders.size() > 1) { childOrder.setExt1("当前订单存在多个充值订单"); } } else { childOrder = childOrderService.findByOrderId(outRechargeOrder.getId()); if (childOrder != null && highOrder != null && childOrder.getStatus() != null && highOrder.getOrderStatus() != null) { if (highOrder.getOrderStatus() == 2 && childOrder.getStatus() != 102) { childOrder.setExt1("主订单充值中,但是充值订单状态不为充值中"); } if (highOrder.getOrderStatus() == 3 && childOrder.getStatus() != 101) { childOrder.setExt1("主订单充值成功,但是充值订单状态不为充值成功"); } if (highOrder.getOrderStatus() == 4 && !(childOrder.getStatus() == 103 || childOrder.getStatus() == 104)) { childOrder.setExt1("主订单退款,但是充值订单状态不为退款"); } } } return childOrder; } @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 = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData test() { try { Map map = new HashMap<>(); map.put("organizeCode" , "dhy"); JSONObject object = HttpsUtils.doGet("https://vertical-formats-gateway.blx.bodata.cn:18443/admin/api/generateJwt" , map); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "qureyCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData qureyCouponPage() { try { JSONObject object = blxConfig.queryCouponPage(); if (object.getInteger("code") == 1) { JSONArray jsonArray = object.getJSONObject("data").getJSONArray("records"); for (int i = 0; i < jsonArray.size(); i++) { if (jsonArray.getJSONObject(i).getString("couponCode") != null) { ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(jsonArray.getJSONObject(i).getString("couponCode")); if (apiBlxCoupon == null) { apiBlxCoupon = new ApiBlxCoupon(); apiBlxCoupon.setCouponCode(jsonArray.getJSONObject(i).getString("couponCode")); apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus")); apiBlxCoupon.setCreateTime(new Date()); apiBlxCoupon.setCouponName(jsonArray.getJSONObject(i).getString("couponName")); apiBlxCoupon.setDenomination(jsonArray.getJSONObject(i).getInteger("denomination")); apiBlxCoupon.setUpdateTime(new Date()); apiBlxCoupon.setMinPrice(jsonArray.getJSONObject(i).getInteger("minPrice")); apiBlxCoupon.setUseStartTime(jsonArray.getJSONObject(i).getDate("useStartTime")); apiBlxCoupon.setUseEndTime(jsonArray.getJSONObject(i).getDate("useEndTime")); apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus")); apiBlxCoupon.setReceiveDays(jsonArray.getJSONObject(i).getInteger("receiveDays")); apiBlxCoupon.setReceiveLimit(jsonArray.getJSONObject(i).getInteger("receiveLimit")); apiBlxCouponService.insertBlxCoupon(apiBlxCoupon); } else { apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus")); apiBlxCoupon.setCouponName(jsonArray.getJSONObject(i).getString("couponName")); apiBlxCoupon.setDenomination(jsonArray.getJSONObject(i).getInteger("denomination")); apiBlxCoupon.setUpdateTime(new Date()); apiBlxCoupon.setMinPrice(jsonArray.getJSONObject(i).getInteger("minPrice")); apiBlxCoupon.setUseStartTime(jsonArray.getJSONObject(i).getDate("useStartTime")); apiBlxCoupon.setUseEndTime(jsonArray.getJSONObject(i).getDate("useEndTime")); apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus")); apiBlxCoupon.setReceiveDays(jsonArray.getJSONObject(i).getInteger("receiveDays")); apiBlxCoupon.setReceiveLimit(jsonArray.getJSONObject(i).getInteger("receiveLimit")); apiBlxCouponService.editBlxCoupon(apiBlxCoupon); } } } } return ResponseMsgUtil.success(apiBlxCouponService.getBlxCouponList(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() { try { JSONObject jsonObject = new JSONObject(); jsonObject.put("couponCode" , "16881066428954950"); jsonObject.put("receiverPhone" , "18090580471"); jsonObject.put("receiverCount" , "1"); JSONObject object = blxConfig.sendCoupon(jsonObject); return ResponseMsgUtil.success(object); } 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 { JSONObject jsonObject = new JSONObject(); jsonObject.put("userMobile" , phone); JSONObject object = blxConfig.getUserCouponPage(jsonObject); int num = 0; if (object.getInteger("code") == 1) { num = object.getJSONObject("data").getInteger("total"); } return ResponseMsgUtil.success(num); } 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.entity.HighChildOrder; import com.hai.entity.HighOrder; import com.hai.model.ResponseData; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.service.HighOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.HashMap; 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 HighOrderService highOrderService; @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("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); // mapPost.put("merchId" , "20230258302"); // mapPost.put("timetable" , new Date().getTime()); // mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); // mapPost.put("productType" , object.getString("productType")); // mapPost.put("notifyUrl" , "test"); // // mapPost.put("content" , object.toString()); // System.out.println(mapPost); // // Map map = new HashMap<>(); // map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); // map.put("merchId" , "20230258302"); // map.put("timetable" , mapPost.get("timetable").toString()); // map.put("orderNo" , mapPost.get("orderNo")); // map.put("productType" , object.getString("productType")); // map.put("content" , object.toString()); // // 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/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); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java b/hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java index 4031cd03..774d4627 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java @@ -147,6 +147,8 @@ public class ShoppingCartController { shoppingCart.setImg(sku.getShowImg()); shoppingCart.setOriginalPrice(sku.getOriginalPrice()); shoppingCart.setLoseEfficacy(false); + shoppingCart.setOpId(goodsDetail.getOpId()); + shoppingCart.setOpName(goodsDetail.getOpName()); shoppingCart.setWhetherCheck(true); shoppingCart.setPrice(sku.getPrice()); shoppingCart.setCreateTime(new Date()); diff --git a/hai-order/src/main/java/com/web/controller/OrderController.java b/hai-order/src/main/java/com/web/controller/OrderController.java index a67500d8..5b12c8d4 100644 --- a/hai-order/src/main/java/com/web/controller/OrderController.java +++ b/hai-order/src/main/java/com/web/controller/OrderController.java @@ -23,6 +23,7 @@ import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderModel; import com.hai.order.model.ExportOrderMobileModel; import com.hai.order.model.ExportOrderModel; +import com.hai.order.model.combine.CreateCombine; import com.hai.order.service.OrderService; import com.hai.order.type.OrderChildGoodsType; import com.hai.order.type.OrderPayType; @@ -160,6 +161,101 @@ public class OrderController { } } + @RequestMapping(value="/createCombine",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建合单订单") + public ResponseData createCombine(@RequestBody CreateCombine createCombine) { + try { + + + // 用户信息 + HighUserModel userModel = userCenter.getSessionModel(HighUserModel.class); + if (userModel == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.USE_VISIT_ILLEGAL, ""); + } + if (StringUtils.isBlank(userModel.getHighUser().getPhone())) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NO_BIND_PHONE, ""); + } + + String combineOrderNo = OrderUtil.generateOrderNo(); + + List orderModels = createCombine.getCreateOrderModel(); + + for (CreateOrderModel body : orderModels) { + body.setMemId(userModel.getHighUser().getId()); + body.setMemName(userModel.getHighUser().getName()); + body.setMemPhone(userModel.getHighUser().getPhone()); + + if (body.getChildOrderList() == null || body.getChildOrderList().size() == 0) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + for (CreateOrderChildModel childModel : body.getChildOrderList()) { + + childModel.setMemId(body.getMemId()); + childModel.setMemName(body.getMemName()); + childModel.setMemPhone(body.getMemPhone()); + + // 校验子订单参数 + if (childModel.getGoodsType() == null + || OrderChildGoodsType.getDataByType(childModel.getGoodsType()) == null + || childModel.getGoodsId() == null + || childModel.getSaleCount() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber()) + || childModel.getGoodsType().equals(OrderChildGoodsType.TYPE8.getNumber())) { + if (childModel.getGoodsPrice() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写充值金额"); + } + + } else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE3.getNumber())) { + if (childModel.getGoodsPrice() == null || childModel.getGasOilNo() == null || childModel.getGasGunNo() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写加油信息;加油金额、油号、抢号"); + } + } else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) { + if (childModel.getRechargeContent() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入充值内容!"); + } + } else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE4.getNumber()) || childModel.getGoodsType().equals(OrderChildGoodsType.TYPE9.getNumber())|| childModel.getGoodsType().equals(OrderChildGoodsType.TYPE10.getNumber())) { + if (childModel.getCustomerMobile() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入下单手机号!"); + } + } else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE11.getNumber())) { + if (childModel.getSkuId() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请选择规格!"); + } + if (body.getDeliveryAddressId() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请选择收货地址!"); + } + + } + } + + body.setOrderNo(OrderUtil.generateOrderNo()); + body.setCombineOrderNo(combineOrderNo); + orderService.createOrder(body); + } + + return ResponseMsgUtil.success(combineOrderNo); + + } catch (Exception e) { + log.error("OrderController -> create() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/cancel",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "订单取消") 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 698f2f7c..43bbbfe7 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -21,6 +21,7 @@ import com.hai.enum_type.UserCardType; import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; +import com.hai.order.model.combine.CombineOrderModel; import com.hai.order.service.OrderPayBeforeService; import com.hai.order.service.OrderService; import com.hai.order.service.OrderPayService; @@ -32,6 +33,7 @@ import com.web.config.SysConst; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; +import org.bouncycastle.LICENSE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -43,10 +45,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.SortedMap; +import java.util.*; import java.util.concurrent.ThreadLocalRandom; /** @@ -142,9 +141,9 @@ public class OrderPayController { weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxPayMchId()); // 商户号 if (PlatformType.TYPE2.getNumber().equals(body.getInteger("platformType"))) { if (openIdType != null && openIdType.equals(2)) { - weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MP); // 商户号公众号 + weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MP); // 黔印象公众号 } else { - weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 嗨森逛小程序 + weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 黔印象小程序 } } else { if (openIdType != null && openIdType.equals(2)) { @@ -400,119 +399,7 @@ public class OrderPayController { return ResponseMsgUtil.exception(e); } } -/* - @RequestMapping(value="/oilCardPay",method = RequestMethod.POST) - @ResponseBody - @ApiOperation(value = "嗨森逛油卡支付") - public ResponseData oilCardPay(@RequestBody JSONObject body) { - try { - if (body == null - || StringUtils.isBlank(body.getString("orderNo")) - || StringUtils.isBlank(body.getString("cardNo")) - || StringUtils.isBlank(body.getString("password"))) { - log.error("oilCardPay error!", "参数错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } - // 获取当前操作人信息 - HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); - if (userInfoModel == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); - } - String password = body.getString("password"); - - // 查询用户与卡号的关系 - HighUserCard userCard = userCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), body.getString("cardNo")); - if (userCard == null) { - log.error("OrderController --> orderToPay() ERROR", "未绑定卡号"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定卡号"); - } - // 查询用户支付密码 - HighUserPayPassword userPayPassword = userPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()); - if (userPayPassword == null) { - log.error("orderToPay error!", "未设置支付密码"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, ""); - } - if (StringUtils.isBlank(password)) { - log.error("orderToPay error!", "未输入支付密码"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, ""); - } - // 支付密码是否正确 - if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) { - log.error("orderToPay error!", ""); - throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, ""); - } - // 查询订单 - HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo")); - if(!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { - log.error("OrderController --> orderToPay() ERROR", "订单不处于待支付状态"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); - } - - return ResponseMsgUtil.success(orderPayService.oilCardPay(order, userCard)); - - } catch (Exception e) { - log.error("OrderPayController -> oilCardPay() error!",e); - return ResponseMsgUtil.exception(e); - } - }*/ - -/* @RequestMapping(value="/hltCardPay",method = RequestMethod.POST) - @ResponseBody - @ApiOperation(value = "贵州汇联通工会卡支付") - public ResponseData hltCardPay(@RequestBody JSONObject body) { - try { - - if (body == null - || StringUtils.isBlank(body.getString("orderNo")) - || StringUtils.isBlank(body.getString("cardNo")) - || StringUtils.isBlank(body.getString("password"))) { - log.error("oilCardPay error!", "参数错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } - - // 获取当前操作人信息 - HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); - if (userInfoModel == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); - } - String password = body.getString("password"); - - // 查询用户与卡号的关系 - HighUserCard userCard = userCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), body.getString("cardNo")); - if (userCard == null) { - log.error("OrderController --> orderToPay() ERROR", "未绑定卡号"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定卡号"); - } - // 查询用户支付密码 - HighUserPayPassword userPayPassword = userPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()); - if (userPayPassword == null) { - log.error("orderToPay error!", "未设置支付密码"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, ""); - } - if (StringUtils.isBlank(password)) { - log.error("orderToPay error!", "未输入支付密码"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, ""); - } - // 支付密码是否正确 - if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) { - log.error("orderToPay error!", ""); - throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, ""); - } - // 查询订单 - HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo")); - if(!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { - log.error("OrderController --> orderToPay() ERROR", "订单不处于待支付状态"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); - } - - return ResponseMsgUtil.success(orderPayService.hltCardPay(order, userCard)); - - } catch (Exception e) { - log.error("OrderController -> hltCardPay() error!",e); - return ResponseMsgUtil.exception(e); - } - }*/ @RequestMapping(value = "/unionPay", method = RequestMethod.POST) @ResponseBody @@ -548,4 +435,27 @@ public class OrderPayController { } } + @RequestMapping(value = "wechatCombinePay" , method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "微信合单支付") + public ResponseData wechatCombinePay(@RequestBody JSONObject body, HttpServletRequest request) { + + if (body == null + || StringUtils.isBlank(body.getString("combineOrderNo")) + || StringUtils.isBlank(body.getString("openId")) + ) { + log.error("wechatCombinePay error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + Map map = new HashMap<>(); + map.put("combineOrderNo" , body.getString("combineOrderNo")); + + List orders = orderService.getOrderList(map); + + CombineOrderModel combineOrderModel = new CombineOrderModel(); + + return ResponseMsgUtil.success(""); + } + } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java index f667a8a1..ab1e9c92 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java @@ -348,8 +348,6 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ // 获取下单内容 JSONObject dataObject = JSONObject.parseObject(object.getString("content")); - JSONArray dataArray = dataObject.getJSONArray("data"); - // 查询api商户 ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); @@ -360,13 +358,39 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ mapProduct.put("mchId" , object.getString("merchId")); mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE13.getNumber()); - ApiMchProduct apiMchProducts = apiMchProductService.findByMap(mapProduct); + ApiMchProduct mchProduct = apiMchProductService.findByMap(mapProduct); - BigDecimal priceTotal = new BigDecimal(0); - BigDecimal facePrice = new BigDecimal(0); + // 计算成本价格 + BigDecimal price = priceComputeConfig.computationPriceCost(mchProduct.getDiscount() , new BigDecimal(apiBlxCoupon.getDenomination())); + + // 判断金额是否充足 + if (apiMerchants.getAmounts().compareTo(price) < 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.INSUFFICIENT_BALANCE); + } + + // 组装内容 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("name" ,apiBlxCoupon.getCouponName()); + jsonObject.put("couponCode" , apiBlxCoupon.getCouponCode()); + jsonObject.put("receiverPhone" , dataObject.getString("receiverPhone")); + jsonObject.put("receiverCount" , dataObject.getString("receiverCount")); + // 组装api订单 + ApiOrder apiOrder = new ApiOrder(); + apiOrder.setCreateTime(new Date()); + apiOrder.setTitle(apiMerchants.getMerchantName() + "|" + OrderProductType.PRODUCT_TYPE13.getName() + "|扣款" + price); + apiOrder.setFacePrice(new BigDecimal(apiBlxCoupon.getDenomination())); + apiOrder.setCostPrice(price); + apiOrder.setOrderPrice(price.multiply(new BigDecimal(object.getInteger("receiverCount")))); + apiOrder.setMchId(object.getString("merchId")); + apiOrder.setMchName(apiMerchants.getMerchantName()); + apiOrder.setUpdateTime(new Date()); + apiOrder.setProductType(object.getInteger("productType")); + apiOrder.setMchOrderNo(object.getString("orderNo")); + apiOrder.setNotifyUrl(object.getString("notifyUrl")); + apiOrder.setContent(jsonObject.toJSONString()); - return null; + return apiOrder; } } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java index 4dc3a69c..d29bc852 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java @@ -84,7 +84,7 @@ public class ApiOrderServiceImpl implements ApiOrderService { createOrderModel.setOrderNo(OrderUtil.generateOrderNo()); // 判断订单号是否重复 - if (apiOrderList.size() > 0) { + if (!apiOrderList.isEmpty()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_ALREADY_EXISTS); } @@ -109,8 +109,6 @@ public class ApiOrderServiceImpl implements ApiOrderService { orderService.createOrder(createOrderModel); } - - // 处理肯德基订单 if (OrderProductType.PRODUCT_TYPE2.getNumber().equals(object.getInteger("productType"))) { apiOrder = orderCreateHandleService.kfcHandle(object); @@ -206,17 +204,16 @@ public class ApiOrderServiceImpl implements ApiOrderService { // 处理停车券订单 if (OrderProductType.PRODUCT_TYPE13.getNumber().equals(object.getInteger("productType"))) { - apiOrder = orderCreateHandleService.mobileHandle(object); + apiOrder = orderCreateHandleService.blxCouponHandle(object); // 组装子订单内容 CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); createOrderChildModel.setMemName(apiMerchants.getMerchantName()); createOrderChildModel.setMemPhone(apiMerchants.getPhone()); createOrderChildModel.setCompanyId(2L); - createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE6.getNumber()); - createOrderChildModel.setGoodsId(dataObject.getLong("productId")); - createOrderChildModel.setRechargeContent(dataObject.getString("mobile")); - createOrderChildModel.setSaleCount(1); + createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE12.getNumber()); + createOrderChildModel.setCouponCode(dataObject.getString("couponCode")); + createOrderChildModel.setSaleCount(dataObject.getInteger("receiverCount")); createOrderChildModel.setIsTyAgent(false); createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); 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 6b5d285b..e9d74fa7 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 @@ -119,4 +119,9 @@ public class CreateOrderChildModel { private Long shopCartId; /** ======================= 实物商品所需参数 end ======================== **/ + /** ======================= 比邻星停车券 start ======================== **/ + // 停车券编码 + private String couponCode; + /** ======================= 比邻星停车券 end ======================== **/ + } diff --git a/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java b/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java index b7d5ca98..f482505f 100644 --- a/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java +++ b/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java @@ -24,6 +24,11 @@ public class CreateOrderModel { */ private String orderNo; + /** + * 合单订单号 + */ + private String combineOrderNo; + /** * 用户id */ diff --git a/hai-service/src/main/java/com/hai/order/model/combine/Amount.java b/hai-service/src/main/java/com/hai/order/model/combine/Amount.java new file mode 100644 index 00000000..74c5e8ef --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/model/combine/Amount.java @@ -0,0 +1,24 @@ +package com.hai.order.model.combine; + +import lombok.Data; + +/** + * @author sum1dream + */ +@Data +public class Amount { + + /** + * @Author Sum1Dream + * @Description // 标价金额 子单金额,单位为分。 + * @Date 2023/8/7 15:21 + */ + private Integer totalAmount; + + /** + * @Author Sum1Dream + * @Description // 标价币种 人民币:CNY。 + * @Date 2023/8/7 15:21 + */ + private String currency; +} diff --git a/hai-service/src/main/java/com/hai/order/model/combine/CombineOrderModel.java b/hai-service/src/main/java/com/hai/order/model/combine/CombineOrderModel.java index 116b40a5..07edcde3 100644 --- a/hai-service/src/main/java/com/hai/order/model/combine/CombineOrderModel.java +++ b/hai-service/src/main/java/com/hai/order/model/combine/CombineOrderModel.java @@ -1,44 +1,57 @@ package com.hai.order.model.combine; +import com.alibaba.fastjson.JSONObject; import com.hai.order.model.CreateOrderModel; +import lombok.Data; import java.util.List; +/** + * @author sum1dream + */ +@Data public class CombineOrderModel { + /** - * 公司id - */ - private Long companyId; - /** - * 用户id + * @Author Sum1Dream + * @Description // 合单商户appid + * @Date 2023/8/7 15:21 */ - private Long userId; + private String combineAppid; /** - * 用户名称 + * @Author Sum1Dream + * @Description // 合单商户号 + * @Date 2023/8/7 15:21 */ - private String userName; + private String combineMchId; /** - * 用户手机号 + * @Author Sum1Dream + * @Description // 合单商户订单号 + * @Date 2023/8/7 15:21 */ - private String userPhone; + private String combineOutTradeNo; /** - * 用户优惠券关系id + * @Author Sum1Dream + * @Description // 子单信息 + * @Date 2023/8/7 15:21 */ - private Long memDiscountId; + private List subOrders; /** - * 支付积分(金币) + * @Author Sum1Dream + * @Description // 支付者信息 + * @Date 2023/8/7 15:21 */ - private Integer payGold; + private JSONObject combinePayerInfo; /** - * 支付密码 + * @Author Sum1Dream + * @Description // 接收微信支付异步通知回调地址 + * @Date 2023/8/7 15:21 */ - private String payPwd; - - List createOrderModelList; + private String notifyUrl; } diff --git a/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java b/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java new file mode 100644 index 00000000..7c0f3a63 --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java @@ -0,0 +1,20 @@ +package com.hai.order.model.combine; + +import com.hai.order.model.CreateOrderModel; +import lombok.Data; + +import java.util.List; + +/** + * @author sum1dream + */ +@Data +public class CreateCombine { + + /** + * @Author Sum1Dream + * @Description // 合单商户号 + * @Date 2023/8/7 15:21 + */ + private List createOrderModel; +} diff --git a/hai-service/src/main/java/com/hai/order/model/combine/SubOrders.java b/hai-service/src/main/java/com/hai/order/model/combine/SubOrders.java new file mode 100644 index 00000000..04171e34 --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/model/combine/SubOrders.java @@ -0,0 +1,54 @@ +package com.hai.order.model.combine; + +import lombok.Data; + +/** + * @author sum1dream + */ +@Data +public class SubOrders { + + /** + * @Author Sum1Dream + * @Description // 子单商户号 + * @Date 2023/8/7 15:21 + */ + private String mchId; + + /** + * @Author Sum1Dream + * @Description // 附加数据 + * @Date 2023/8/7 15:21 + */ + private String attach; + + /** + * @Author Sum1Dream + * @Description // 订单金额 + * @Date 2023/8/7 15:21 + */ + private Amount amount; + + /** + * @Author Sum1Dream + * @Description // 子单商户订单号 + * @Date 2023/8/7 15:21 + */ + private String outTradeNo; + + /** + * @Author Sum1Dream + * @Description // 子单商户订单号 + * @Date 2023/8/7 15:21 + */ + private String subMchId; + + /** + * @Author Sum1Dream + * @Description // 商品描述 + * @Date 2023/8/7 15:21 + */ + private String description; + + +} diff --git a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java index 11f6f459..fc4fbdef 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java @@ -86,4 +86,6 @@ public interface OrderCreateHandleService { */ HighChildOrder goods(HighOrder order, CreateOrderChildModel createOrderChild) throws Exception; + HighChildOrder blxCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; + } 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 ce407af6..999e10f1 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 @@ -968,4 +968,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { return childOrder; } + + @Override + public HighChildOrder blxCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { + return null; + } } 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 add954c2..a97ff10b 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 @@ -167,6 +167,7 @@ public class OrderServiceImpl implements OrderService { order.setPromoteCode(popularizeUser.getAgentId().toString()); } + order.setCombineOrderNo(createOrderModel.getCombineOrderNo()); order.setOrderNo(createOrderModel.getOrderNo()); order.setMemId(createOrderModel.getMemId()); order.setMemName(createOrderModel.getMemName()); @@ -328,6 +329,9 @@ public class OrderServiceImpl implements OrderService { order.setExt6(order.getExt6() + "," +childOrder.getGoodsImg()); } + // 比邻星停车券 + } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE12.getNumber())) { + HighChildOrder childOrder = orderCreateHandleService.blxCoupon(order , child); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型"); } @@ -815,6 +819,10 @@ public class OrderServiceImpl implements OrderService { criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId")); } + if (StringUtils.isNotBlank(MapUtils.getString(param , "combineOrderNo"))) { + criteria.andCombineOrderNoEqualTo(MapUtils.getString(param , "combineOrderNo")); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "title"))) { criteria.andTitleLike("%" + MapUtils.getString(param, "title") + "%"); } diff --git a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java index 4f572054..91d9af2e 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java @@ -20,6 +20,7 @@ public enum OrderChildGoodsType { TYPE9(9, "星巴克"), TYPE10(10, "第三方充值"), TYPE11(11, "实物商品购买"), + TYPE12(12, "比邻星停车券"), ; private Integer number; diff --git a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java index 29774971..2047a531 100644 --- a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java @@ -846,7 +846,7 @@ public class CommonServiceImpl implements CommonService { } String borderWidth; String padding; - Double alpha; + double alpha; // 1:ios 2:安卓 if (type == 2) { borderWidth = "12"; @@ -874,11 +874,6 @@ public class CommonServiceImpl implements CommonService { storeModel.setSourceType(1); storeModel.setLatitude(payData.getString("latitude")); storeModel.setLongitude(payData.getString("longitude")); -// if (payData.getString("iconPath") == null) { -// storeModel.setLogo(CommonSysConst.getSysConfig().getFilesystem() + "/img/store.png"); -// } else { -// storeModel.setLogo(payData.getString("iconPath")); -// } storeModel.setIconPath(CommonSysConst.getSysConfig().getFilesystem() + "/img/location.png"); storeModel.setLogo(CommonSysConst.getSysConfig().getFilesystem() + "/img/store.png"); storeModel.setRotate(1); diff --git a/v1/src/main/java/com/v1/controller/business/BlxCouponController.java b/v1/src/main/java/com/v1/controller/business/BlxCouponController.java index be727fb2..af692296 100644 --- a/v1/src/main/java/com/v1/controller/business/BlxCouponController.java +++ b/v1/src/main/java/com/v1/controller/business/BlxCouponController.java @@ -32,7 +32,7 @@ import java.util.Map; public class BlxCouponController { - private static Logger log = LoggerFactory.getLogger(MobileRechargeController.class); + private static Logger log = LoggerFactory.getLogger(BlxCouponController.class); @Resource private ApiMerchantsService apiMerchantsService; diff --git a/v1/src/main/java/com/v1/controller/orderController.java b/v1/src/main/java/com/v1/controller/orderController.java index 0e10e85d..229dd1a1 100644 --- a/v1/src/main/java/com/v1/controller/orderController.java +++ b/v1/src/main/java/com/v1/controller/orderController.java @@ -169,8 +169,7 @@ public class orderController { } } if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE13.getNumber())) { - if (dataObject.getJSONArray("data") == null - || StringUtils.isBlank(dataObject.getString("couponCode")) + if ( StringUtils.isBlank(dataObject.getString("couponCode")) || StringUtils.isBlank(dataObject.getString("receiverPhone")) || dataObject.getInteger("receiverCount") == null ) {