| @@ -371,7 +371,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| merchantQ1.setName(merchantName); | |||
| List<Long> merchantIdList = wxMerchantMapper.findIdList(merchantQ1); | |||
| if (null == merchantIdList || merchantIdList.size() <= 0) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"商户名称查询不到商户。"); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| retMerchantIdList.addAll(merchantIdList); | |||
| isConditiondQquery = true; | |||
| @@ -389,7 +390,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| List<Long> shopIds = wxShopMapper.findIdList(shopQ); | |||
| if (null == shopIds || shopIds.size() <= 0 ){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"楼座楼层提交查询不到店铺信息."); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| WxMerchantShop wxMerchantShopQ = new WxMerchantShop(); | |||
| @@ -398,15 +400,17 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| wxMerchantShopQ.setIsDel(0); | |||
| List<Long> buildMerchantIdList = wxMerchantShopMapper.findMerchantIdList(wxMerchantShopQ); | |||
| if (null == buildMerchantIdList || buildMerchantIdList.size() <= 0 ){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"楼座楼层对应店铺无商户绑定记录."); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| retMerchantIdList.retainAll(buildMerchantIdList); | |||
| isConditiondQquery = true; | |||
| } | |||
| if (isConditiondQquery) { | |||
| if (null == retMerchantIdList || retMerchantIdList.size() <= 0 ) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"根据条件交集未查询到商户记录."); | |||
| if (retMerchantIdList.size() <= 0 ) { | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| }else { | |||
| return retMerchantIdList; | |||
| } | |||
| @@ -432,7 +436,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| if (null != basicInfo) { | |||
| wxCouponOrder.setCUserId(basicInfo.getId()); | |||
| }else { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"手机号查询不到会员信息。"); | |||
| wxCouponOrder.setCUserId(-999L); | |||
| return; | |||
| } | |||
| } | |||
| @@ -442,7 +447,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| //查询商户券 | |||
| merchantProductIds = wxCouponMerchantMapper.findMerchantProductIds(wxCouponOrder.getTenantId(), merchantIdListQueryParam); | |||
| if (null == merchantProductIds || merchantProductIds.size() <= 0) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"商户下查询不到券信息。"); | |||
| List<Long> tempCouponIds = new ArrayList<Long>(); | |||
| tempCouponIds.add(-999L); | |||
| wxCouponOrder.setCouponIds(tempCouponIds); | |||
| return; | |||
| } | |||
| } | |||
| @@ -458,7 +466,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| wxCouponQuery.setSourceType(wxCouponOrder.getSourceType()); | |||
| couponIds = wxCouponMapper.findIdList(wxCouponQuery); | |||
| if (null == couponIds || couponIds.size() <= 0) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"根据券条件搜索不到券信息。"); | |||
| List<Long> tempCouponIds = new ArrayList<Long>(); | |||
| tempCouponIds.add(-999L); | |||
| wxCouponOrder.setCouponIds(tempCouponIds); | |||
| return; | |||
| } | |||
| } | |||
| @@ -483,14 +494,20 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| merchantQ2.setName(verifyMerchantName); | |||
| List<Long> merchantIds = wxMerchantMapper.findIdList(merchantQ2); | |||
| if (null == merchantIds || merchantIds.size() <= 0 ){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"核销商户名称查询不到商户记录."); | |||
| List<Long> tempBUserIds = new ArrayList<Long>(); | |||
| tempBUserIds.add(-999L); | |||
| wxCouponOrder.setBUserIdList(tempBUserIds); | |||
| return; | |||
| } | |||
| WxMerchantBUser merchantBUserQ = new WxMerchantBUser(); | |||
| merchantBUserQ.setMerchantIds(merchantIds); | |||
| List<Long> bUserIdList = wxMerchantBUserMapper.findIdList(merchantBUserQ); | |||
| if (null == bUserIdList || bUserIdList.size() <= 0 ){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"核销商户下查询不到员工信息."); | |||
| List<Long> tempBUserIds = new ArrayList<Long>(); | |||
| tempBUserIds.add(-999L); | |||
| wxCouponOrder.setBUserIdList(tempBUserIds); | |||
| return; | |||
| } | |||
| wxCouponOrder.setBUserIdList(bUserIdList); | |||
| } | |||