|
|
@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.security.SessionObject; |
|
|
|
import com.hai.common.security.SessionObject; |
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
|
|
|
import com.hai.entity.BsCompany; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
import com.hai.service.*; |
|
|
|
import com.hai.service.*; |
|
|
@ -47,6 +48,9 @@ public class HighCouponController { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighCouponHandselService highCouponHandselService; |
|
|
|
private HighCouponHandselService highCouponHandselService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private BsCompanyService bsCompanyService; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighCouponCodeService highCouponCodeService; |
|
|
|
private HighCouponCodeService highCouponCodeService; |
|
|
|
|
|
|
|
|
|
|
@ -56,30 +60,28 @@ public class HighCouponController { |
|
|
|
@RequestMapping(value="/getCouponList",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/getCouponList",method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "卡卷列表") |
|
|
|
@ApiOperation(value = "卡卷列表") |
|
|
|
public ResponseData getCouponList(@RequestParam(name = "regionId", required = true) Long regionId, |
|
|
|
public ResponseData getCouponList(@RequestParam(name = "regionId", required = true) String regionId, |
|
|
|
@RequestParam(name = "merchantId", required = false) Long merchantId, |
|
|
|
@RequestParam(name = "merchantId", required = false) Long merchantId, |
|
|
|
@RequestParam(name = "couponName", required = false) String couponName, |
|
|
|
@RequestParam(name = "couponName", required = false) String couponName, |
|
|
|
@RequestParam(name = "couponType", required = false) Integer couponType, |
|
|
|
@RequestParam(name = "couponType", required = false) Integer couponType, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(regionId); |
|
|
|
|
|
|
|
if (bsCompany != null) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put("companyId", bsCompany.getRegionId()); |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
|
|
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
if (userInfoModel.getBsCompany() == null) { |
|
|
|
|
|
|
|
log.error("HighCouponController -> getCouponList() error!","权限不足"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
map.put("regionId", regionId); |
|
|
|
|
|
|
|
map.put("merchantId", merchantId); |
|
|
|
map.put("merchantId", merchantId); |
|
|
|
map.put("couponName", couponName); |
|
|
|
map.put("couponName", couponName); |
|
|
|
map.put("couponType", couponType); |
|
|
|
map.put("couponType", couponType); |
|
|
|
map.put("status", 2); |
|
|
|
map.put("status", 2); |
|
|
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighCouponController -> getCouponList() error!",e); |
|
|
|
log.error("HighCouponController -> getCouponList() error!",e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|