From 9b531f43040a14897076bdef491fe9e6cd67f6a1 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 21 Oct 2022 09:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BA=E5=9F=9F=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cweb/controller/BsMsgController.java | 26 ++++++++++++++++--- .../controller/HighThirdPartyController.java | 5 ++-- .../com/hai/config/ThirdProductConfig.java | 14 +++++++--- .../java/com/hai/dao/BsMsgUserMapperExt.java | 2 ++ .../order/model/CreateOrderChildModel.java | 4 +++ .../service/OrderCreateHandleService.java | 3 +++ .../order/service/impl/OrderServiceImpl.java | 1 + .../service/impl/ApiProductServiceImpl.java | 3 +++ .../hai/service/impl/BsMsgServiceImpl.java | 3 ++- .../service/impl/HighOrderServiceImpl.java | 2 +- 10 files changed, 52 insertions(+), 11 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java b/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java index 02d2bdb4..f225b8f3 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/BsMsgController.java @@ -102,21 +102,39 @@ public class BsMsgController { @RequestMapping(value = "/queryMsgByList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询站内信列表") - public ResponseData queryMsgByList(@RequestParam(value = "companyId", required = false) Long companyId, HttpServletRequest request) { + public ResponseData queryMsgByList( + @RequestParam(value = "companyId", required = false) Long companyId, + @RequestParam(value = "type", required = false) Long type, + HttpServletRequest request) { try { // 用户 SessionObject sessionObject = userCenter.getSessionObject(request); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + Map mapUser = new HashMap<>(); + + mapUser.put("companyId" , companyId); + mapUser.put("type" , type); + mapUser.put("userId" , userInfoModel.getHighUser().getId()); + mapUser.put("msgType" , 1); + + // 查询个人站内信 + List userMsg = bsMsgService.queryMsgByList(mapUser); + + // 查询全局站内信 Map map = new HashMap<>(); map.put("companyId" , companyId); - map.put("userId" , userInfoModel.getHighUser().getId()); + map.put("type" , type); + map.put("msgType" , 2); + + // 查询个人站内信 + List msgList = bsMsgService.queryMsgByList(map); - bsMsgService.queryMsgByList(map); + msgList.addAll(userMsg); - return ResponseMsgUtil.success(bsMsgService.queryMsgByList(map)); + return ResponseMsgUtil.success(msgList); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); 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 ded7f07c..e2939002 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java @@ -302,6 +302,7 @@ public class HighThirdPartyController { @ApiOperation(value = "查询第三方产品详情") public ResponseData getThirdPartyByDetail(@RequestParam(name = "platformId", required = true) Integer platformId, @RequestParam(name = "productType", required = true) Integer productType, + @RequestParam(name = "productId", required = false) Long productId, @RequestParam(name = "regionId", required = true) String regionId) { try { @@ -314,7 +315,7 @@ public class HighThirdPartyController { BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); - return ResponseMsgUtil.success(thirdProductConfig.getThirdPartyByDetail(platformId , productType , bsCompany.getId())); + return ResponseMsgUtil.success(thirdProductConfig.getThirdPartyByDetail(platformId , productType , bsCompany.getId() , productId)); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); @@ -407,7 +408,7 @@ public class HighThirdPartyController { } } else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) { // 查询详单订单的实际 - JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(1, 1, order.getCompanyId()); + JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(1, 1, order.getCompanyId() , null); object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo()); if (object.getBoolean("success")) { diff --git a/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java b/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java index abaeb82f..62b53c39 100644 --- a/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java +++ b/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java @@ -1,6 +1,9 @@ package com.hai.config; import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; import com.hai.entity.BsProductConfig; import com.hai.entity.BsProductDiscount; import com.hai.service.ApiProductService; @@ -43,11 +46,12 @@ public class ThirdProductConfig { } // 产品折扣比例 - public BsProductConfig getProductConfig(Integer productType , Long companyId) { + public BsProductConfig getProductConfig(Integer productType , Long companyId , Long productId) { Map listMap = new HashMap<>(); listMap.put("productType", productType); listMap.put("companyId", companyId); + listMap.put("productId", productId); List productConfigs = apiProductService.getProductConfig(listMap); @@ -57,8 +61,12 @@ public class ThirdProductConfig { return null; } - public JSONObject getThirdPartyByDetail(Integer platformId , Integer productType , Long companyId) { - BsProductConfig productConfig = getProductConfig(productType, companyId); + public JSONObject getThirdPartyByDetail(Integer platformId , Integer productType , Long companyId , Long productId) { + BsProductConfig productConfig = getProductConfig(productType, companyId , productId); + + if (productConfig == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未配置当前内容"); + } JSONObject object = new JSONObject(); diff --git a/hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java b/hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java index ec44e9d0..9a27a561 100644 --- a/hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java @@ -21,6 +21,8 @@ public interface BsMsgUserMapperExt { "where status = 2 " + "and company_id = #{param.companyId} " + " and user_id = #{param.userId} ", + " and type = #{param.type} ", + " and msg_type = #{param.msgType} ", " and where_check = #{param.whereCheck} ", "order by create_time desc; " + " "}) 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 15d1ab9a..4d3f97c7 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 @@ -68,6 +68,10 @@ public class CreateOrderChildModel { // 代理商价格 private Boolean isTyAgent; /** ======================= 油站所需参数 ======================== **/ + /** ======================= 肯德基,星巴克,会员充值所需参数 ======================== **/ + // 下单电话 + private String customerMobile; + /** ======================= 肯德基,星巴克,会员充值所需参数 ======================== **/ } 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 c44110ce..7b7710fe 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 @@ -55,4 +55,7 @@ public interface OrderCreateHandleService { */ ResponseData hltUnionCardRecharge(CreateOrderChildModel createOrderChild); + +// List thirdProduct() + } 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 046c66bf..3bf4a31a 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 @@ -183,6 +183,7 @@ public class OrderServiceImpl implements OrderService { // 肯德基 } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE4.getNumber())) { order.setProductType(OrderProductType.PRODUCT_TYPE2.getNumber()); + // 创建肯德基订单业务 // 电影票 } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE5.getNumber())) { diff --git a/hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java index 06c1a994..ad8ce70c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java @@ -340,6 +340,9 @@ public class ApiProductServiceImpl implements ApiProductService { if (MapUtils.getString(map, "productName") != null) { criteria.andProductNameEqualTo(MapUtils.getString(map, "productName")); } + if (MapUtils.getLong(map, "productId") != null) { + criteria.andProductIdEqualTo(MapUtils.getLong(map, "productId")); + } return productConfigMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java index 51530985..4a9fd11f 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java @@ -11,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.beans.Transient; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.jar.JarEntry; @@ -94,7 +95,7 @@ public class BsMsgServiceImpl implements BsMsgService { // 查询用户相关站内信内容 List list = findMsgUserById(user.getId() , msgId); BsMsgUser bsMsgUser = new BsMsgUser(); - // 判读是否有呢日 + // 判读是否有数据 if (list.size()>0) { bsMsgUser = list.get(0); // 判断当前内容是否已经查看过了 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 2fdf6eaf..a14fb8a6 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 @@ -2464,7 +2464,7 @@ public class HighOrderServiceImpl implements HighOrderService { BigDecimal marketPrice = new BigDecimal(0); // 查询详单订单的实际 - JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(object.getInteger("platformId"), object.getInteger("productType"), object.getLong("companyId")); + JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(object.getInteger("platformId"), object.getInteger("productType"), object.getLong("companyId") , object.getLong("productId")); highOrder.setProductType(object.getInteger("productType"));