From 65cb50c39df50badf02ca219e6cb8f6e2c61636f Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 20 Jul 2022 14:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighTestController.java | 2 +- .../OutRechargePriceController.java | 41 ++++++++++-- .../src/main/resources/pre/application.yml | 2 +- .../cweb/controller/HighOrderController.java | 16 +++++ .../controller/HighThirdPartyController.java | 2 +- .../controller/HighUserCardController.java | 28 +++++--- .../src/main/resources/pre/application.yml | 2 +- .../src/main/resources/pre/config.properties | 2 + .../java/com/hai/config/CommonSysConfig.java | 9 +++ .../java/com/hai/config/QianZhuConfig.java | 4 +- .../main/java/com/hai/entity/._HighOrder.java | Bin 4096 -> 0 bytes .../main/java/com/hai/entity/HighOrder.java | 7 +- .../com/hai/enum_type/DiscountUseScope.java | 3 + .../main/java/com/hai/model/UserModel.java | 30 +++++++++ .../hai/service/BsRechargeCodeService.java | 57 ++++++++++++++++ .../com/hai/service/HighOrderService.java | 17 +++++ .../impl/BsRechargeCodeServiceImpl.java | 63 ++++++++++++++++++ .../service/impl/HighOrderServiceImpl.java | 63 ++++++++++++------ .../hai/service/impl/HighUserServiceImpl.java | 2 + .../resources/dev/commonConfig.properties | 1 + .../resources/pre/commonConfig.properties | 25 +++++-- .../prod-9401/commonConfig.properties | 1 + .../resources/prod/commonConfig.properties | 7 +- 23 files changed, 331 insertions(+), 53 deletions(-) delete mode 100644 hai-service/src/main/java/com/hai/entity/._HighOrder.java create mode 100644 hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.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 8c0b341d..0b88b9ea 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.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.*; 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; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @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="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("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"); // // String s = "HFR"; // String s1 = "AGAIN"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // // } // // // return ResponseMsgUtil.success(list); // // } catch (Exception e) { // log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() 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.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.*; 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; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @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="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("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"); // // String s = "HFR1"; // String s1 = "AGAIN1"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java index e1d10a07..ba376347 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java @@ -12,14 +12,13 @@ import com.hai.common.utils.PageUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.RechargeConfig; import com.hai.entity.BsOperationLog; +import com.hai.entity.BsRechargeCode; import com.hai.entity.OutRechargePrice; +import com.hai.entity.SecDictionary; import com.hai.model.OutRechargePriceModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; -import com.hai.service.BsConfigService; -import com.hai.service.BsOperationLogService; -import com.hai.service.CommonService; -import com.hai.service.OutRechargePriceService; +import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -47,12 +46,18 @@ public class OutRechargePriceController { @Resource private OutRechargePriceService outRechargePriceService; + @Resource + private CommonService commonService; + @Resource private BsConfigService bsConfigService; @Resource private BsOperationLogService bsOperationLogService; + @Resource + private BsRechargeCodeService bsRechargeCodeService; + @RequestMapping(value = "/getListOutRechargePrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询充值金额列表") @@ -291,6 +296,34 @@ public class OutRechargePriceController { public ResponseData getProductsList() { try { + return ResponseMsgUtil.success(RechargeConfig.getProductsListByLy()); + + } catch (Exception e) { + log.error("HighOrderController --> unionStagingPay() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getRechargeCodeList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取充值产品编码列表") + public ResponseData getRechargeCodeList(@RequestParam(value = "id", required = true) Long id, + @RequestParam(value = "codeType", required = true) String codeType) { + try { + + List list = commonService.mappingSysNameOl(codeType); + + List objectList = new ArrayList<>(); + + for (SecDictionary dictionary : list) { + JSONObject object = new JSONObject(); + + Map map = new HashMap<>(); + map.put("type" , 1); + map.put("sourceId" , id); + map.put("rechargePlatform" , dictionary.); + BsRechargeCode rechargeCode = bsRechargeCodeService.findByMap() + } return ResponseMsgUtil.success(RechargeConfig.getProductsListByLy()); diff --git a/hai-bweb/src/main/resources/pre/application.yml b/hai-bweb/src/main/resources/pre/application.yml index ccb2ffcf..4be7791f 100644 --- a/hai-bweb/src/main/resources/pre/application.yml +++ b/hai-bweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://139.159.177.244:3306/hsg_prod?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index b05d8989..fbd8b4d1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -506,6 +506,22 @@ public class HighOrderController { } } + @RequestMapping(value = "/orderCheck", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据订单id查看订单") + public ResponseData orderCheck(@RequestParam(name = "orderId", required = true) Long orderId) { + try { + + highOrderService.orderCheck(orderId); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighOrderController --> cancelOrder() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/cancelOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据订单号 取消订单") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java b/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java index 1440f520..b1fe0206 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java @@ -141,7 +141,7 @@ public class HighThirdPartyController { return ResponseMsgUtil.success(starbucksProductsList); } catch (Exception e) { - log.error("HighUserCardController --> oilCardRefund() error!", e); + log.error("HighUserCardController --> getStarbucksProducts() error!", e); return ResponseMsgUtil.exception(e); } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java index 69616e69..3ece39e1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java @@ -29,9 +29,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; +import java.util.*; @Controller @RequestMapping(value = "/highUserCard") @@ -325,20 +323,28 @@ public class HighUserCardController { HttpServletRequest request) { try { // 用户 -// SessionObject sessionObject = userCenter.getSessionObject(request); -// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); -// -// HighUserCard card = highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), cardNo); -// if (card == null) { -// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); -// } 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(HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data"))); + String s = "HFR"; + String s1 = "AGAIN"; + + List list = new ArrayList<>(); + + + for (Object data : array) { + JSONObject dataObject = (JSONObject) data; + if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { + list.add(dataObject); + } + + } + + return ResponseMsgUtil.success(list); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); diff --git a/hai-cweb/src/main/resources/pre/application.yml b/hai-cweb/src/main/resources/pre/application.yml index e19026fd..b33ccd34 100644 --- a/hai-cweb/src/main/resources/pre/application.yml +++ b/hai-cweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://139.159.177.244:3306/hsg_prod?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-cweb/src/main/resources/pre/config.properties b/hai-cweb/src/main/resources/pre/config.properties index 4e9a74e1..a3f3848e 100644 --- a/hai-cweb/src/main/resources/pre/config.properties +++ b/hai-cweb/src/main/resources/pre/config.properties @@ -18,6 +18,8 @@ wxGzSubMchId=1619676214 HDAppId = 1614670195 notifyUrl=https://hsgcs.dctpay.com/crest/wechatpay/notify +imgUrl=https://hsgcs.dctpay.com/filesystem/ + fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 7d234741..f5865753 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -25,6 +25,7 @@ public class CommonSysConfig { private String shellPlatMerchantKey; private String qinzhuUrl; + private String qinzhuUrlToken; private String qinzhuHtmlUrl; private String qianzhuH5url; private String qinzhuMobileUrl; // 话费充值地址 @@ -197,6 +198,14 @@ public class CommonSysConfig { return qinzhuUrl; } + public String getQinzhuUrlToken() { + return qinzhuUrlToken; + } + + public void setQinzhuUrlToken(String qinzhuUrlToken) { + this.qinzhuUrlToken = qinzhuUrlToken; + } + public void setQinzhuUrl(String qinzhuUrl) { this.qinzhuUrl = qinzhuUrl; } diff --git a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java index fa3fd733..0b109b54 100644 --- a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java +++ b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java @@ -133,7 +133,7 @@ public class QianZhuConfig { map.put("traceId", WxUtils.makeNonStr()); map.put("timestamp", new Date().getTime()); map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost("https://live.qianzhu8.com/gateway", JSON.toJSONString(map)); + return HttpsUtils.doPost("", JSON.toJSONString(map)); } /** @@ -415,7 +415,7 @@ public class QianZhuConfig { map.put("traceId", WxUtils.makeNonStr()); map.put("timestamp", new Date().getTime()); map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost("https://live-test.qianzhu8.com/gateway", JSON.toJSONString(map)); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getQinzhuUrlToken(), JSON.toJSONString(map)); } /** diff --git a/hai-service/src/main/java/com/hai/entity/._HighOrder.java b/hai-service/src/main/java/com/hai/entity/._HighOrder.java deleted file mode 100644 index 835c0bfff55d0c0f2067d1f45f173b497f89d0ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vx~Y}f z3(>)_0H|C5O$#HC4;7b6&d=3LEGWoH)yqjNE-5WeO-V^CNmULA2I;Byyp{x_#llaj zg6L5&8UmvsFd71*Aut*OqaiRF0;3@?8UmvsFd71*Aut*OxIzHb*#u!QkPFGkELJE= zEzU13N={Ws%P-1S$jmEA%`3^w&r8h7sZ_{GO)F7I%1O-22KI%ax`s4`>VLRbWEkZB G{|5kL!Yfk% 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 1495d07f..9485c7f7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -3,6 +3,7 @@ package com.hai.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; +import java.util.List; /** * high_order @@ -222,8 +223,7 @@ public class HighOrder implements Serializable { private String ext3; -<<<<<<< HEAD -======= + private List highChildOrderList; private HighDiscount highDiscount; @@ -264,7 +264,6 @@ public class HighOrder implements Serializable { isTyAgent = tyAgent; } ->>>>>>> 2d52dbc7b84e73f0aec222be0e523218c95d9908 private static final long serialVersionUID = 1L; public Long getId() { @@ -782,4 +781,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/enum_type/DiscountUseScope.java b/hai-service/src/main/java/com/hai/enum_type/DiscountUseScope.java index cb50b211..ff85e3ff 100644 --- a/hai-service/src/main/java/com/hai/enum_type/DiscountUseScope.java +++ b/hai-service/src/main/java/com/hai/enum_type/DiscountUseScope.java @@ -11,6 +11,9 @@ public enum DiscountUseScope { type1(1 , "全场"), type2(2 , "卡券"), type3(3 , "话费"), + type4(4 , "肯德基"), + type5(5 , "星巴克"), + type6(6 , "会员充值"), ; private Integer type; 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 3f85b06d..13a41a3e 100644 --- a/hai-service/src/main/java/com/hai/model/UserModel.java +++ b/hai-service/src/main/java/com/hai/model/UserModel.java @@ -20,6 +20,12 @@ public class UserModel { // 待支付数量 private Integer unpaid; + // 待支付数量 + private Long whetherCheckNum; + + // 支付数量 + private Integer orderPayNum; + // 充值订单待支付数量 private Integer rechargeOrderNum; @@ -125,4 +131,28 @@ public class UserModel { public void setRechargeOrderNum(Integer rechargeOrderNum) { this.rechargeOrderNum = rechargeOrderNum; } + + public Integer getOrderPayNum() { + return orderPayNum; + } + + public void setOrderPayNum(Integer orderPayNum) { + this.orderPayNum = orderPayNum; + } + + public Boolean getSetOilCard() { + return isSetOilCard; + } + + public void setSetOilCard(Boolean setOilCard) { + isSetOilCard = setOilCard; + } + + public Long getWhetherCheckNum() { + return whetherCheckNum; + } + + public void setWhetherCheckNum(Long whetherCheckNum) { + this.whetherCheckNum = whetherCheckNum; + } } diff --git a/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java b/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java new file mode 100644 index 00000000..a42ebea9 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java @@ -0,0 +1,57 @@ +package com.hai.service; + +import com.hai.entity.BsRechargeCode; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName BsRechargeCodeService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 充值编码接口 + * @createTime 10:38 2022/7/20 + **/ +public interface BsRechargeCodeService { + + /** + * @Author Sum1Dream + * @name insertRechargeCode.java + * @Description // 新增充值编码 + * @Date 10:39 2022/7/20 + * @Param [com.hai.entity.BsRechargeCode] + * @return void + */ + void insertRechargeCode(BsRechargeCode rechargeCode); + + /** + * @Author Sum1Dream + * @name updateRechargeCode.java + * @Description // 修改充值编码 + * @Date 10:39 2022/7/20 + * @Param [com.hai.entity.BsRechargeCode] + * @return void + */ + void updateRechargeCode(BsRechargeCode rechargeCode); + + /** + * @Author Sum1Dream + * @name getListRechargeCode.java + * @Description //TODO + * @Date 10:40 2022/7/20 + * @Param [java.util.Map] + * @return java.util.List + */ + List getListRechargeCode(Map map); + + /** + * @Author Sum1Dream + * @name findByMap.java + * @Description // 查询详情 + * @Date 13:58 2022/7/20 + * @Param [java.util.Map] + * @return com.hai.entity.BsRechargeCode + */ + BsRechargeCode findByMap(Map map); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 1cf7775a..7e6863a3 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -223,6 +223,23 @@ public interface HighOrderService { **/ Integer countOrderByUserId(Long memId , Integer status); + /** + * @Author 袁野 + * @Description 根据用户查询订单统计 + * @Date 2021/3/27 15:50 + **/ + Long whetherCheck(Long memId , Integer status); + + /** + * @Author Sum1Dream + * @name orderCheck.java + * @Description // 订单查看 + * @Date 14:46 2022/7/19 + * @Param [java.lang.Long] + * @return void + */ + void orderCheck(Long orderId); + /** * @Author 袁野 * @Description 未使用优惠券数量 diff --git a/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java new file mode 100644 index 00000000..2e0f656c --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java @@ -0,0 +1,63 @@ +package com.hai.service.impl; + +import com.hai.dao.BsRechargeCodeMapper; +import com.hai.entity.BsRechargeCode; +import com.hai.entity.BsRechargeCodeExample; +import com.hai.service.BsRechargeCodeService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service("bsRechargeCodeService") +public class BsRechargeCodeServiceImpl implements BsRechargeCodeService { + + + @Resource + private BsRechargeCodeMapper rechargeCodeMapper; + + @Override + public void insertRechargeCode(BsRechargeCode rechargeCode) { + rechargeCodeMapper.insert(rechargeCode); + } + + @Override + public void updateRechargeCode(BsRechargeCode rechargeCode) { + rechargeCodeMapper.updateByPrimaryKey(rechargeCode); + } + + @Override + public List getListRechargeCode(Map map) { + + BsRechargeCodeExample example = new BsRechargeCodeExample(); + BsRechargeCodeExample.Criteria criteria = example.createCriteria(); + + return rechargeCodeMapper.selectByExample(example); + } + + @Override + public BsRechargeCode findByMap(Map map) { + BsRechargeCodeExample example = new BsRechargeCodeExample(); + BsRechargeCodeExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + if (MapUtils.getString(map, "sourceId") != null) { + criteria.andSourceIdEqualTo(MapUtils.getString(map, "SourceId")); + } + if (MapUtils.getInteger(map, "rechargePlatform") != null) { + criteria.andRechargePlatformEqualTo(MapUtils.getInteger(map, "rechargePlatform")); + } + + List list = rechargeCodeMapper.selectByExample(example); + + if (list.size() > 0) { + list.get(0); + } + + return null; + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 73c74c52..137144e7 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -2059,8 +2059,10 @@ public class HighOrderServiceImpl implements HighOrderService { if (highDiscountUserRel == null || highDiscountUserRel.getStatus() != 1) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误"); } - if (!highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType()) - && !highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type3.getType())) { + if (!highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type4.getType()) + && !highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type5.getType()) + && !highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type6.getType()) + ) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用此优惠券"); } } @@ -2089,10 +2091,23 @@ public class HighOrderServiceImpl implements HighOrderService { // 卡卷类型 1:满减 2:抵扣 3:折扣 if (highDiscountUserRel.getHighDiscount().getDiscountType() == 3) { // 满减额度 - discountPrice = orderPayPrice.multiply(highDiscountUserRel.getHighDiscount().getDiscountPrice()); + discountPrice = orderPayPrice.subtract(orderPayPrice.multiply(highDiscountUserRel.getHighDiscount().getDiscountPrice())).setScale(2, RoundingMode.HALF_UP); } } + // 使用优惠券 + if (highOrder.getMemDiscountId() != null) { + orderPayPrice = marketPrice; + HighDiscountUserRel discountUserRel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId()); + discountUserRel.setUseTime(new Date()); // 使用时间 + discountUserRel.setStatus(2); //状态 0:已过期 1:未使用 2:已使用 + highDiscountUserRelService.updateDiscountUserRel(discountUserRel); + + HighDiscountAgentCode code = highDiscountAgentCodeService.getCodeById(discountUserRel.getDiscountAgentCodeId()); + code.setStatus(3); + highDiscountAgentCodeService.updateCode(code); + } + // 使用积分 // 判断积分数量是否大于0 if (object.getLong("integralNum") != null) { @@ -2130,26 +2145,11 @@ public class HighOrderServiceImpl implements HighOrderService { } } - highOrder.setPayPrice(orderPayPrice); highOrder.setDeductionPrice(discountPrice); highOrder.setPayGold(object.getInteger("integralNum")); - // 使用优惠券 - if (highOrder.getMemDiscountId() != null) { - highOrder.setTotalPrice(marketPrice); - highOrder.setPayPrice(marketPrice.subtract(discountPrice)); - HighDiscountUserRel discountUserRel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId()); - discountUserRel.setUseTime(new Date()); // 使用时间 - discountUserRel.setStatus(2); //状态 0:已过期 1:未使用 2:已使用 - highDiscountUserRelService.updateDiscountUserRel(discountUserRel); - - HighDiscountAgentCode code = highDiscountAgentCodeService.getCodeById(discountUserRel.getDiscountAgentCodeId()); - code.setStatus(3); - highDiscountAgentCodeService.updateCode(code); - } else { - highOrder.setTotalPrice(orderPayPrice); - highOrder.setPayPrice(orderPayPrice.subtract(discountPrice)); - } + highOrder.setTotalPrice(orderPayPrice); + highOrder.setPayPrice(orderPayPrice.subtract(discountPrice)); if (integralPrice.compareTo(new BigDecimal(0)) > 0) { highOrder.setPayPrice(highOrder.getPayPrice().subtract(integralPrice)); @@ -2534,4 +2534,27 @@ public class HighOrderServiceImpl implements HighOrderService { updateOrder(order); } } + + @Override + public Long whetherCheck(Long memId, Integer status) { + + HighOrderExample example = new HighOrderExample(); + HighOrderExample.Criteria criteria = example.createCriteria(); + + criteria.andMemIdEqualTo(memId).andOrderStatusEqualTo(status).andWhetherCheckEqualTo(false); + + return highOrderMapper.countByExample(example); + } + + @Override + public void orderCheck(Long orderId) { + HighOrder highOrder = highOrderMapper.selectByPrimaryKey(orderId); + + highOrder.setWhetherCheck(true); + + if (highOrder.getOrderStatus() == 3) { + highOrderMapper.updateByPrimaryKey(highOrder); + } + + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index 142dd10a..db25a422 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -101,6 +101,8 @@ public class HighUserServiceImpl implements HighUserService { } user.setUnusedCouponNum(highUserCouponService.getCouponList(userId, 1).size()); //未使用卡卷数量 user.setUnpaid(highOrderService.countOrderByUserId(userId , 1)); + user.setOrderPayNum(highOrderService.countOrderByUserId(userId , 2)); + user.setWhetherCheckNum(highOrderService.whetherCheck(userId , 3)); user.setRechargeOrderNum(outRechargeOrderService.rechargeOrderNum(userId)); user.setUnusedDiscount(highOrderService.countUnusedDiscountByUserId(userId , 1)); user.setIsSetPayPwd(highUserPayPasswordService.isSetPayPwd(userId)); diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index fd17311c..8971db74 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -14,6 +14,7 @@ shellPlatMerchantKey=123 # ???? qinzhuUrl=https://live-test.qianzhu8.com +qinzhuUrlToken=https://live-test.qianzhu8.com/gateway qinzhuHtmlUrl=https://m-test.qianzhu8.com qianzhuH5url=https://nf-test.qianzhu8.com/gateway qinzhuPlatformId=10376 diff --git a/hai-service/src/main/resources/pre/commonConfig.properties b/hai-service/src/main/resources/pre/commonConfig.properties index 57ecd02b..36c74f1d 100644 --- a/hai-service/src/main/resources/pre/commonConfig.properties +++ b/hai-service/src/main/resources/pre/commonConfig.properties @@ -11,11 +11,17 @@ tuanYouGasolineAccount=9hp52qf04400 # tuanYouGasolineAccount=c2qitc984400 qinzhuUrl=https://live.qianzhu8.com +qinzhuUrlToken=https://live.qianzhu8.com/gateway qinzhuHtmlUrl=https://qz.dctpay.com +qianzhuH5url=https://nf.qianzhu8.com/gateway qinzhuPlatformId=10458 qinzhuSecret=nnl3gg4ss0pka11t qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify +thirdAppKey=211395334 +thirdAppSecret=VxNTJua4FkmRVgIm8HgCSg== +thirdPostUrl=http://mbsmemberclient.scyshy.com/ + huiliantongUrl=https://gzapi.deepermobile.com.cn huiliantongAppNo=guizhouhuilt huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D @@ -49,16 +55,25 @@ TelApiSecret=d11ee9b41e014a039f030e53ae6f5295 TelMemberId=d13091df65d64aafbf0f35d2093157b7 // Mobile -JjNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallbackByJj +JjNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallbackByJj JjAppKey = p429mlj3cvn5hb07 JjUrl = https://jj.dmjvip.com/index.php/third/mobile/ JjAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij #LY -LyNotifyUrl = httpscs://hsg.dctpay.com/crest/czOrder/rechargeCallbackByLy -LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU -LyMemberId=18665 -LyPostUrl=https://cz.31994.cn/yrapi.php/ +LyNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallbackByLy +#LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU +##LyMemberId=18665 +##LyPostUrl=https://cz.31994.cn/yrapi.php/ +LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK +LyMemberId=11236 +LyPostUrl=http://cz.zt10010.com/yrapi.php/ + + +#CY +CyApiKey=cyMYLABWa2H2u +CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT +CyPostUrl=http://120.24.83.85:8999/ unionAppId=ced46392acfe42be863fdfdd3e61164a unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa diff --git a/hai-service/src/main/resources/prod-9401/commonConfig.properties b/hai-service/src/main/resources/prod-9401/commonConfig.properties index 1abcad26..66af0b15 100644 --- a/hai-service/src/main/resources/prod-9401/commonConfig.properties +++ b/hai-service/src/main/resources/prod-9401/commonConfig.properties @@ -11,6 +11,7 @@ tuanYouGasolineAccount=9hp52qf04400 # tuanYouGasolineAccount=c2qitc984400 qinzhuUrl=https://live.qianzhu8.com +qinzhuUrlToken=https://live.qianzhu8.com/gateway qinzhuHtmlUrl=https://qz.dctpay.com qianzhuH5url=https://nf.qianzhu8.com/gateway qinzhuPlatformId=10458 diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 3b22aa8d..36c74f1d 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -11,15 +11,16 @@ tuanYouGasolineAccount=9hp52qf04400 # tuanYouGasolineAccount=c2qitc984400 qinzhuUrl=https://live.qianzhu8.com +qinzhuUrlToken=https://live.qianzhu8.com/gateway qinzhuHtmlUrl=https://qz.dctpay.com qianzhuH5url=https://nf.qianzhu8.com/gateway qinzhuPlatformId=10458 qinzhuSecret=nnl3gg4ss0pka11t qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify -thirdAppKey=211394653 -thirdAppSecret=cyQpQKMaGUG186iEZRt1uQ== -thirdPostUrl=http://mbsmemberwebapi.test.onfishes.com/ +thirdAppKey=211395334 +thirdAppSecret=VxNTJua4FkmRVgIm8HgCSg== +thirdPostUrl=http://mbsmemberclient.scyshy.com/ huiliantongUrl=https://gzapi.deepermobile.com.cn huiliantongAppNo=guizhouhuilt