From affbe9a6d964b724856baed02acd3d7c6c86edd2 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 31 Oct 2022 14:33:12 +0800 Subject: [PATCH] 1 --- .../OutRechargePriceController.java | 4 ++- .../business/OrderThirdPartyController.java | 27 ++++++++++++++----- .../order/service/impl/OrderServiceImpl.java | 4 +-- .../service/BsDistributionUserRelService.java | 2 +- .../java/com/hai/service/HighUserService.java | 2 +- .../hai/service/impl/BsConfigServiceImpl.java | 2 +- .../BsDistributionUserRelServiceImpl.java | 20 +++++++------- .../hai/service/impl/CommonServiceImpl.java | 25 ++++++++--------- .../hai/service/impl/HighUserServiceImpl.java | 2 +- .../impl/OutRechargePriceServiceImpl.java | 5 ++-- 10 files changed, 57 insertions(+), 36 deletions(-) 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 3d259c16..b72a64be 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java @@ -98,7 +98,9 @@ public class OutRechargePriceController { listMap.put("productType", "3"); listMap.put("sourceId", list.getId()); BeanUtils.copyProperties(list, outRechargePriceModel); - outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); + if (bsConfigService.getProductDiscountByMap(listMap) != null) { + outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); + } outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap)); outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap)); outRechargePriceModelList.add(outRechargePriceModel); diff --git a/hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java b/hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java index 546a5ec6..6d285669 100644 --- a/hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java @@ -7,7 +7,6 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; -import com.hai.entity.HighOrder; import com.hai.enum_type.UserObjectTypeEnum; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; @@ -26,7 +25,6 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; import java.util.HashMap; -import java.util.List; import java.util.Map; @Controller @@ -43,10 +41,10 @@ public class OrderThirdPartyController { private OrderService orderService; - @RequestMapping(value = "/getOrderKfcList", method = RequestMethod.GET) + @RequestMapping(value = "/getOrderList", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询肯德基订单列表") - public ResponseData getOrderKfcList(@RequestParam(name = "orderNo", required = false) String orderNo, + @ApiOperation(value = "查询第三方订单列表") + public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "memCardNo", required = false) String memCardNo, @RequestParam(name = "payType", required = false) Integer payType, @@ -56,6 +54,7 @@ public class OrderThirdPartyController { @RequestParam(name = "createTimeE", required = false) Long createTimeE, @RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "productType", required = false) Integer productType, @RequestParam(name = "finishTimeS", required = false) Long finishTimeS, @RequestParam(name = "finishTimeE", required = false) Long finishTimeE, @RequestParam(name = "pageNum", required = true) Integer pageNum, @@ -90,7 +89,7 @@ public class OrderThirdPartyController { map.put("orderNo", orderNo); map.put("memPhone", memPhone); map.put("memCardNo", memCardNo); - map.put("productType", 2); + map.put("productType", productType); map.put("orderStatus", orderStatus); map.put("payType", payType); @@ -103,4 +102,20 @@ public class OrderThirdPartyController { } } + @RequestMapping(value="/getOrderDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询订单详情") + public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { + try { + Map map = new HashMap<>(); + map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo)); + + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("OrderIntegralRechargeController -> getOrderDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } 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 d93cbb43..9184727f 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 @@ -662,8 +662,8 @@ public class OrderServiceImpl implements OrderService { criteria.andMemPhoneLike("%" + MapUtils.getString(param, "memPhone") + "%"); } - if (MapUtils.getInteger(param, "status") != null) { - criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "status")); + if (MapUtils.getInteger(param, "orderStatus") != null) { + criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "orderStatus")); } if (StringUtils.isNotBlank(MapUtils.getString(param, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(param, "createTimeE"))) { criteria.andCreateTimeBetween( diff --git a/hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java b/hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java index f5b12cd5..c3d5d724 100644 --- a/hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java +++ b/hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java @@ -25,7 +25,7 @@ public interface BsDistributionUserRelService { * @Param [java.lang.Long, java.lang.Long] * @return void */ - void insertDistributionRebate(Long userId , Long popularizeUserId , String regionId); + void insertDistributionRebate(Long userId , Long popularizeUserId , String regionId) throws Exception; /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/HighUserService.java b/hai-service/src/main/java/com/hai/service/HighUserService.java index ce2d6886..3ec1f09a 100644 --- a/hai-service/src/main/java/com/hai/service/HighUserService.java +++ b/hai-service/src/main/java/com/hai/service/HighUserService.java @@ -123,7 +123,7 @@ public interface HighUserService { * @param: [highUser] 用户信息 * @return: com.hai.entity.HighUser */ - void insertUser(HighUser highUser , Long popularizeUserId , String regionId); + void insertUser(HighUser highUser , Long popularizeUserId , String regionId) throws Exception; /** * @Author 胡锐 diff --git a/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java index 3f68a290..b62a0b0c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java @@ -37,7 +37,7 @@ public class BsConfigServiceImpl implements BsConfigService { criteria.andSourceIdEqualTo(MapUtils.getLong(map , "sourceId")); } - if (bsProductDiscountMapper.selectByExample(example) == null) { + if (bsProductDiscountMapper.selectByExample(example).size() == 0) { return null; } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java index 09fa920b..7cb14e00 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java @@ -43,7 +43,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe private HighUserMapper highUserMapper; @Override - public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) { + public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) throws Exception { HighUser user = highUserService.findByUserId(userId); HighUser pUser = highUserService.findByUserId(popularizeUserId); @@ -78,10 +78,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe bsDistributionUserRelMapper.insert(distributionUserRel); - new Thread(() -> { + } + + new Thread(() -> { - try { + try { + if (regionId != null) { SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); @@ -93,7 +96,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe freeMap.put("userPhone", user.getPhone()); highDiscountPackageService.freeUserDiscountPackage(freeMap); - if (pUser.getIsAgent() == null) { + if (pUser != null && pUser.getIsAgent() == null) { // 查询推广有礼优惠券包 HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); Map freeMap1 = new HashMap<>(); @@ -102,14 +105,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe freeMap1.put("userPhone", pUser.getPhone()); highDiscountPackageService.freeUserDiscountPackage(freeMap1); } - - } catch (Exception e) { - e.printStackTrace(); } - }).start(); - } + } catch (Exception e) { + e.printStackTrace(); + } + }).start(); } @Override 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 ad6bbe8a..a1a7704b 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 @@ -609,18 +609,19 @@ public class CommonServiceImpl implements CommonService { // 配置展示平台 JSONArray productPlatformArray = object.getJSONArray("productPlatform"); for (Object platform : productPlatformArray) { - productPlatform = new BsProductPlatform(); - SecDictionary dictionary = mappingSysCode("SHOW_PLATFORM", String.valueOf(platform)); - productPlatform.setProductType(object.getInteger("productType")); - productPlatform.setPlatformId(Integer.valueOf(String.valueOf(platform))); - productPlatform.setPlatformName(dictionary.getCodeName()); - productPlatform.setCreateTime(new Date()); - productPlatform.setUpdateTime(new Date()); - productPlatform.setOperatorId(object.getLong("operatorId")); - productPlatform.setOperatorName(object.getString("operatorName")); - productPlatform.setSourceId(object.getLong("sourceId")); - - bsProductPlatformMapper.insert(productPlatform); + if (String.valueOf(platform).length() > 0) { + productPlatform = new BsProductPlatform(); + SecDictionary dictionary = mappingSysCode("SHOW_PLATFORM", String.valueOf(platform)); + productPlatform.setProductType(object.getInteger("productType")); + productPlatform.setPlatformId(Integer.valueOf(String.valueOf(platform))); + productPlatform.setPlatformName(dictionary.getCodeName()); + productPlatform.setCreateTime(new Date()); + productPlatform.setUpdateTime(new Date()); + productPlatform.setOperatorId(object.getLong("operatorId")); + productPlatform.setOperatorName(object.getString("operatorName")); + productPlatform.setSourceId(object.getLong("sourceId")); + bsProductPlatformMapper.insert(productPlatform); + } } } 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 3b676d51..9f47361c 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 @@ -300,7 +300,7 @@ public class HighUserServiceImpl implements HighUserService { @Override @Transactional(propagation= Propagation.REQUIRES_NEW) - public void insertUser(HighUser highUser , Long popularizeUserId , String regionId) { + public void insertUser(HighUser highUser , Long popularizeUserId , String regionId) throws Exception { highUserMapper.insert(highUser); if (highUser.getPhone() != null) { diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java index 48f15607..a2c1c4b8 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java @@ -85,8 +85,9 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService { listMap.put("returnType", 1); listMap.put("sourceId", outRechargePrice.getId()); listMap.put("platformId", platformId); - - outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); + if (bsConfigService.getProductDiscountByMap(listMap) != null) { + outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); + } outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap)); outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap)); return outRechargePriceModel;