|
|
@ -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 { |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(regionId); |
|
|
|
|
|
|
|
if (bsCompany != null) { |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
|
|
|
map.put("companyId", bsCompany.getRegionId()); |
|
|
|
if (userInfoModel.getBsCompany() == null) { |
|
|
|
map.put("merchantId", merchantId); |
|
|
|
log.error("HighCouponController -> getCouponList() error!","权限不足"); |
|
|
|
map.put("couponName", couponName); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
map.put("couponType", couponType); |
|
|
|
|
|
|
|
map.put("status", 2); |
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("regionId", regionId); |
|
|
|
|
|
|
|
map.put("merchantId", merchantId); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>()); |
|
|
|
map.put("couponName", couponName); |
|
|
|
|
|
|
|
map.put("couponType", couponType); |
|
|
|
|
|
|
|
map.put("status", 2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); |
|
|
|
|
|
|
|
} 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); |
|
|
|