|
|
|
@ -9,11 +9,14 @@ import com.hai.common.security.SessionObject; |
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.MemberValidateUtil; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.entity.HighCoupon; |
|
|
|
|
import com.hai.entity.HighMerchant; |
|
|
|
|
import com.hai.entity.HighMerchantStore; |
|
|
|
|
import com.hai.model.HighCouponModel; |
|
|
|
|
import com.hai.model.HighMerchantStoreModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
|
import com.hai.service.HighCouponService; |
|
|
|
|
import com.hai.service.HighMerchantService; |
|
|
|
|
import com.hai.service.HighMerchantStoreService; |
|
|
|
|
import com.hai.service.SecUserService; |
|
|
|
@ -47,6 +50,9 @@ public class HighMerchantStoreController { |
|
|
|
|
@Autowired |
|
|
|
|
private UserCenter userCenter; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighCouponService highCouponService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighMerchantStoreService highMerchantStoreService; |
|
|
|
|
|
|
|
|
@ -70,34 +76,22 @@ public class HighMerchantStoreController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getStoreListByCompany",method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value="/getStoreListByCoupon",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "根据公司 查询商户门店列表") |
|
|
|
|
public ResponseData getStoreListByCompany(@RequestParam(name = "merchantId", required = false) Long merchantId, |
|
|
|
|
@RequestParam(name = "telephone", required = false) String telephone, |
|
|
|
|
@RequestParam(name = "storeName", required = false) String storeName, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
@ApiOperation(value = "根据卡卷查询门店列表") |
|
|
|
|
public ResponseData getStoreListByCoupon(@RequestParam(name = "couponId", required = true) Long couponId) { |
|
|
|
|
try { |
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
|
|
|
|
if (userInfoModel.getBsCompany() == null) { |
|
|
|
|
log.error("HighMerchantStoreController -> getStoreListByCompany() error!","权限不足"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("companyId", userInfoModel.getBsCompany().getId()); |
|
|
|
|
map.put("merchantId", merchantId); |
|
|
|
|
map.put("telephone", telephone); |
|
|
|
|
map.put("storeName", storeName); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highMerchantStoreService.getMerchantStoreList(map))); |
|
|
|
|
HighCouponModel coupon = highCouponService.getCouponById(couponId); |
|
|
|
|
if (coupon == null) { |
|
|
|
|
ResponseMsgUtil.success(null); |
|
|
|
|
} |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("merchantId", coupon.getMerchantId()); |
|
|
|
|
return ResponseMsgUtil.success(highMerchantStoreService.getMerchantStoreList(map)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighMerchantStoreController -> getStoreListByCompany() error!",e); |
|
|
|
|
log.error("HighMerchantStoreController -> getStoreListByCoupon() error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|