diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java b/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java index f95f3e18..125141b2 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java @@ -120,6 +120,10 @@ public R add(@RequestBody IUser iUser) { if (iShop == null) { throw new ServiceException("门店商品id不存在"); } + iUser.setLng(iShop.getLng()); + iUser.setLat(iShop.getLat()); + iUser.setProvinceName(iShop.getProvinceName()); + iUser.setCityName(iShop.getCityName()); return R.ok(iUserService.insertIUser(iUser)); } @@ -134,6 +138,10 @@ public R edit(@RequestBody IUser iUser) { if (iShop == null) { throw new ServiceException("门店商品id不存在"); } + iUser.setLng(iShop.getLng()); + iUser.setLat(iShop.getLat()); + iUser.setProvinceName(iShop.getProvinceName()); + iUser.setCityName(iShop.getCityName()); return R.ok(iUserService.updateIUser(iUser)); } diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IShopServiceImpl.java b/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IShopServiceImpl.java index 4b9a0a5a..1d955c8b 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IShopServiceImpl.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IShopServiceImpl.java @@ -144,11 +144,13 @@ public List getShopsByProvince(String province, String itemId) { try { res = JSONObject.parseObject(urlRes); } catch (JSONException jsonException) { + logger.info(url); throw new ServiceException("查询所在省市的投放产品和数量error," + province + "-" + itemId); } // JSONObject res = JSONObject.parseObject(HttpUtil.get(url)); if (!res.containsKey("code") || !res.getString("code").equals("2000")) { + logger.info(url); logger.error("查询所在省市的投放产品和数量error," + province + "-" + itemId); throw new ServiceException("查询所在省市的投放产品和数量error," + province + "-" + itemId); }