diff --git a/.gitignore b/.gitignore index f9a96bb..1205c03 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ build/ ~/ ### mac ### -.DS_Store \ No newline at end of file +.DS_Store + +.flattened-pom.xml \ No newline at end of file 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 4dc3690..753acbd 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 @@ -63,12 +63,15 @@ public R sendCode(String mobile, String deviceId) { @PreAuthorize("@ss.resourceAuth()") public R reservation(String mobile) { IUser user = iUserMapper.selectById(mobile); - if (user == null || StringUtils.isEmpty(user.getItemCode())) { - return R.error("用户不存在或配置不对"); - } else { - imtService.reservation(user); - return R.ok(); + if (user == null) { + return R.error("用户不存在"); } + if (StringUtils.isEmpty(user.getItemCode())) { + return R.error("商品预约code为空"); + } + + imtService.reservation(user); + return R.ok(); } /** diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java b/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java index 1cce449..276c31a 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java @@ -97,7 +97,7 @@ public class IUser extends BaseEntity { private String randomMinute; /** - * 类型 + * 类型(1:预约本市出货量最大的门店,2:预约你的位置附近门店) */ private int shopType; diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java b/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java index 661dbd5..573d1fd 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java @@ -42,11 +42,11 @@ default PageResult selectPage(IUser iUser, Long userId) { default List selectReservationUser() { return selectList(new LambdaQueryWrapperX() -// .gt(IUser::getExpireTime, new Date()) - .ne(IUser::getLat, "") - .ne(IUser::getLng, "") - .ne(IUser::getShopType, "") - .ne(IUser::getItemCode, "") +// .gt(IUser::getExpireTime, new Date()) + .ne(IUser::getLat, "") + .ne(IUser::getLng, "") + .ne(IUser::getItemCode, "") + .isNotNull(IUser::getItemCode) ); @@ -57,12 +57,12 @@ default List selectReservationUser() { */ default List selectReservationUserByMinute(int minute) { return selectList(new LambdaQueryWrapperX() - .eq(IUser::getMinute, minute) -// .gt(IUser::getExpireTime, new Date()) - .ne(IUser::getLat, "") - .ne(IUser::getLng, "") - .ne(IUser::getShopType, "") - .ne(IUser::getItemCode, "") + .eq(IUser::getMinute, minute) +// .gt(IUser::getExpireTime, new Date()) + .ne(IUser::getLat, "") + .ne(IUser::getLng, "") + .ne(IUser::getItemCode, "") + .isNotNull(IUser::getItemCode) ); } 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 1d955c8..eb8f0bf 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 @@ -129,7 +129,13 @@ public void refreshItem() { @Override public IShop selectByIShopId(String iShopId) { - return iShopMapper.selectOne(IShop::getIShopId,iShopId); + List iShopList = iShopMapper.selectList("i_shop_id", iShopId); + if (iShopList != null && iShopList.size() > 0) { + return iShopList.get(0); + } else { + return null; + } +// return iShopMapper.selectOne(IShop::getIShopId, iShopId); } @Override @@ -198,15 +204,18 @@ public String getShopId(int shopType, String itemId, String province, String cit //本市没有则预约本省最近的 shopId = getMinDistanceShopId(list, province, lat, lng); } - } - - if (shopType == 2) { - // 预约本省距离最近的门店 + } else { + //预约本省距离最近的门店 shopId = getMinDistanceShopId(list, province, lat, lng); } - if (StringUtils.isEmpty(shopId)){ +// if (shopType == 2) { +// // 预约本省距离最近的门店 +// shopId = getMinDistanceShopId(list, province, lat, lng); +// } + if (StringUtils.isEmpty(shopId)) { + throw new ServiceException("申购时根据类型获取的门店商品id为空"); } diff --git a/vue_campus_admin/src/views/imt/user/index.vue b/vue_campus_admin/src/views/imt/user/index.vue index 2f740f2..a5ec2a2 100644 --- a/vue_campus_admin/src/views/imt/user/index.vue +++ b/vue_campus_admin/src/views/imt/user/index.vue @@ -651,7 +651,6 @@ export default { address: null, lat: null, lng: null, - shopType: null, jsonResult: null, createTime: null, minute: 5,