From d60d1ab65fb74dbe4c8ed577df376ec7eb21c479 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 2 Jan 2025 14:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B1=87=E8=81=94=E9=80=9Adi?= =?UTF-8?q?stributorId=20=20=E5=8E=9F=E5=8F=82=E6=95=B0aNId4A3X=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BAorjuOND7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discount/DiscountController.java | 38 +++++++++++++++++++ .../com/order/controller/OrderController.java | 32 ++++++++-------- .../java/com/hfkj/dao/GoodsMsgMapperExt.java | 14 +++++-- .../java/com/hfkj/jd/Impl/JdServiceImpl.java | 1 - 4 files changed, 64 insertions(+), 21 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java b/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java index 4d284f2..b607f09 100644 --- a/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java +++ b/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java @@ -138,6 +138,44 @@ public class DiscountController { } } + @RequestMapping(value = "/userDiscountNum", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取券数量") + public ResponseData userDiscountNum() { + try { + + // 用户session + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + + Map map = new HashMap<>(); + + map.put("status" , 1); + map.put("phone" , userSession.getUser().getPhone()); + JSONObject object = HaiOilService.queryListByPhone(map); + int num = 0; + if (object.getString("return_code").equals("000000")) { + JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList"); + num += array.size(); + } + + + map.put("userId", userSession.getUser().getId()); + map.put("status", 1); + + List list = discountUserRelService.getList(map); + + num += list.size(); + + return ResponseMsgUtil.success(num); + + + + } catch (Exception e) { + log.error("GoodsDetailController --> getListUser() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/getGoodsDiscount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取商品可用优惠券") diff --git a/order/src/main/java/com/order/controller/OrderController.java b/order/src/main/java/com/order/controller/OrderController.java index 197aeca..89f13ce 100644 --- a/order/src/main/java/com/order/controller/OrderController.java +++ b/order/src/main/java/com/order/controller/OrderController.java @@ -364,22 +364,22 @@ public class OrderController { GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId")); if (userAddress.getProvinceId() == null) { - VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress()); - - if (response != null && response.getOpenRpcResult().getSuccess()) { - userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId()); - userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName()); - userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId()); - userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName()); - userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId()); - userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName()); - userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId()); - userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName()); - userAddress.setUpdateTime(new Date()); - deliveryAddressService.update(userAddress); - } else { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage()); - } +// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress()); +// +// if (response != null && response.getOpenRpcResult().getSuccess()) { +// userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId()); +// userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName()); +// userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId()); +// userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName()); +// userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId()); +// userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName()); +// userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId()); +// userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName()); +// userAddress.setUpdateTime(new Date()); +// deliveryAddressService.update(userAddress); +// } else { +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage()); +// } } List skuInfoList = new ArrayList<>(); diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java b/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java index 6113411..f6b05c9 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java @@ -60,11 +60,11 @@ public interface GoodsMsgMapperExt { // List getGoodsListCrest(@Param("param") Map param); @Select("") List getGoodsListCrest(@Param("param") Map param); diff --git a/service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java b/service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java index e0963da..2d6b557 100644 --- a/service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java +++ b/service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java @@ -95,7 +95,6 @@ public class JdServiceImpl implements JdService { if (token == null) { // 请求回调 会在回调存入参数 JdPostService.getAccessToken(); - getToken(); } return token.toString(); }