From 67e71fd697a5aed0b3dba67ec285618d5be269bc Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 22 Apr 2024 09:41:23 +0800 Subject: [PATCH] Merge branch 'new-dev' into 2.0-dev # Conflicts: # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java --- .../controller/Etc/EtcCustomerController.java | 3 +- .../main/java/com/cweb/config/AuthConfig.java | 1 + .../controller/Etc/EtcCustomerController.java | 59 ++++++++++++++++--- .../java/com/hai/schedule/EtcSchedule.java | 4 +- .../main/java/com/hai/config/EtcService.java | 3 +- .../main/java/com/hai/entity/HighCoupon.java | 3 +- .../impl/OrderCreateHandleServiceImpl.java | 6 +- .../impl/OrderPaySuccessServiceImpl.java | 5 +- .../impl/OutRechargeOrderServiceImpl.java | 2 +- 9 files changed, 67 insertions(+), 19 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java b/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java index f5c6675d..b16d724b 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java @@ -247,7 +247,7 @@ public class EtcCustomerController { @ResponseBody @ApiOperation(value = "查询车辆列表") public ResponseData getEtcCarMsgList( - @RequestParam(value = "vehPlateNo", required = false) String vehPlateNo, HttpServletRequest request + @RequestParam(value = "vehPlateNo", required = false) String vehPlateNo,@RequestParam(value = "custId", required = false) String custId , HttpServletRequest request ) { try { @@ -258,6 +258,7 @@ public class EtcCustomerController { map.put("userId", userInfoModel.getSecUser().getId()); map.put("vehPlateNo", vehPlateNo); + map.put("custId", custId); List list = etcCarMsgService.getEtcCarList(map); diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index 9df59cb2..2ca79c68 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -149,6 +149,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/highThirdParty/*") .excludePathPatterns("/group/*") .excludePathPatterns("/couponCodeOther/*") + .excludePathPatterns("/etcCustomer/getEquity") ; } diff --git a/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java b/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java index e4825adc..f90cbf29 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java @@ -8,16 +8,13 @@ import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.EtcService; -import com.hai.entity.EtcCarMsg; -import com.hai.entity.EtcContractOrder; -import com.hai.entity.EtcCustMsg; -import com.hai.entity.SecDictionary; +import com.hai.entity.*; import com.hai.etc.EtcCarMsgService; import com.hai.etc.EtcCustMsgService; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; -import com.hai.service.CommonService; +import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -44,6 +41,15 @@ public class EtcCustomerController { @Resource private EtcCarMsgService etcCarMsgService; + @Resource + private SecConfigService secConfigService; + + @Resource + private HighDiscountPackageService highDiscountPackageService; + + @Resource + private HighDiscountPackageDetailsService highDiscountPackageDetailsService; + @RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车辆列表") @@ -241,12 +247,16 @@ public class EtcCustomerController { @RequestParam(value = "type", required = true) Integer type) { try { - EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); + if (contractOrder == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单不存在!"); + } + if (type == 1) { - JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId()); + JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId() , contractOrder.getVehId()); if (object.getString("errCode").equals("0")) { + return ResponseMsgUtil.success(object.getJSONObject("result")); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); @@ -310,6 +320,8 @@ public class EtcCustomerController { public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) { try { + System.out.println(object); + if (object.getString("custId") == null || object.getString("cardNo") == null || object.getInteger("bankCardType") == null || @@ -339,7 +351,40 @@ public class EtcCustomerController { } } + @RequestMapping(value = "/getEquity", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "获取权益") + public ResponseData getEquity() { + try { + // 查询赠送优惠券 + SecConfig secConfig = secConfigService.findByCodeType("GIVE_DISCOUNT_PACKAGE"); + + // 获取卡券数量 + String[] discountPackageId = secConfig.getCodeValue().split(","); + + List list = new ArrayList<>(); + + for (String id : discountPackageId) { + JSONObject jsonObject = new JSONObject(); + HighDiscountPackage discountPackage = highDiscountPackageService.findDiscountPackageById(Integer.valueOf(id)); + if (discountPackage != null) { + jsonObject.put("packageDetail", discountPackage); + // 查询包内的优惠券 + List detailsList = highDiscountPackageDetailsService.getDetailByPackage(Integer.valueOf(id)); + jsonObject.put("discountList", detailsList); + list.add(jsonObject); + } + + } + + return ResponseMsgUtil.success(list); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java index f0be1ad2..914101a2 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java @@ -44,7 +44,7 @@ public class EtcSchedule { * @Date 14:18 2022/5/31 * @Param [] */ - @Scheduled(cron = "0 0/10 * * * ?") //每10分钟执行一次 + @Scheduled(cron = "0 0/2 * * * ?") //每10分钟执行一次 public void getEtcCarList() { try { @@ -70,7 +70,7 @@ public class EtcSchedule { } - @Scheduled(cron = "0 0/60 * * * ?") //每60分钟执行一次 + @Scheduled(cron = "0 0/10 * * * ?") //每60分钟执行一次 public void etcCarMsg() { try { diff --git a/hai-service/src/main/java/com/hai/config/EtcService.java b/hai-service/src/main/java/com/hai/config/EtcService.java index 09b08ab5..a688fe26 100644 --- a/hai-service/src/main/java/com/hai/config/EtcService.java +++ b/hai-service/src/main/java/com/hai/config/EtcService.java @@ -258,7 +258,7 @@ public class EtcService { * @Param cardVarietyId * @return com.alibaba.fastjson.JSONObject */ - public static JSONObject checkNeedSignWechatWithhold(Integer productId , Integer cardVarietyId) throws Exception { + public static JSONObject checkNeedSignWechatWithhold(Integer productId , Integer cardVarietyId , String vehId) throws Exception { // 组装数据 JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); @@ -266,6 +266,7 @@ public class EtcService { JSONObject jsonObject = new JSONObject(); jsonObject.put("productId" , productId); jsonObject.put("cardVarietyId" , cardVarietyId); + jsonObject.put("vehId" , vehId); map.put("body" , jsonObject.toJSONString()); String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); diff --git a/hai-service/src/main/java/com/hai/entity/HighCoupon.java b/hai-service/src/main/java/com/hai/entity/HighCoupon.java index bd926526..4045042f 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCoupon.java +++ b/hai-service/src/main/java/com/hai/entity/HighCoupon.java @@ -143,7 +143,8 @@ public class HighCoupon extends HighCouponModel implements Serializable { private Integer displayArea; /** - * 卡券来源:1.中石化 2.消费券 3.其他 4:贵州中石化 5: 预发码 6:停车券 + * 卡券来源:1.中石化 2.消费券 3.其他 4:贵州中石化 5: 预发码 6:停车券 7 :四川中石油 8:贵州中石油 9:ETC中石油 10:中油优途中石油 + * */ private Integer couponSource; 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 71f748fe..2ce44cdb 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 @@ -1335,12 +1335,14 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { } @Override - public HighChildOrder etcUser(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { + public HighChildOrder etcUser(HighOrder order, CreateOrderChildModel createOrderChildModel) { + HighChildOrder childOrder = new HighChildOrder(); childOrder.setOrderNo(order.getOrderNo()); childOrder.setMemId(order.getMemId()); childOrder.setMemName(order.getMemName()); childOrder.setMemPhone(order.getMemPhone()); + childOrder.setSkuId(createOrderChildModel.getSkuId()); childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); childOrder.setGoodsType(OrderChildGoodsType.TYPE20.getNumber()); childOrder.setGoodsId(createOrderChildModel.getGoodsId()); @@ -1356,7 +1358,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); childOrder.setPraiseStatus(0); childOrder.setCreateTime(new Date()); - return childOrder; + } } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index 5b1ec023..9a94110d 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -816,11 +816,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { carMsg.setPayStatus(2); etcCarMsgService.updateEtcCar(carMsg); - // 查询赠送优惠券 - SecConfig secConfig = secConfigService.findByCodeType("GIVE_DISCOUNT_PACKAGE"); - // 赠送优惠券 - highDiscountPackageService.giveAway(Long.parseLong(secConfig.getCodeValue()) , order.getMemPhone() , 2 , order.getMemId().toString()); + highDiscountPackageService.giveAway(order.getHighChildOrderList().get(0).getSkuId() , order.getMemPhone() , 2 , order.getMemId().toString()); } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index 81ae82a9..42e24d03 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -791,7 +791,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { object.put("orderNo" , childOrder.getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByJn(object); - childOrder.setExt3("畅停查询"+ jsonObject); + childOrder.setExt3("简牛查询"+ jsonObject); if (jsonObject.getJSONObject("data") != null) { JSONObject objectData= jsonObject.getJSONObject("data"); // // 10充值中 20充值完成 -10 充值失败