|
|
|
@ -87,6 +87,8 @@ public class HighCouponAgentController { |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询今天 代理商已销售的卡券") |
|
|
|
|
public ResponseData getAgentSalesCodeList(HttpServletRequest request, |
|
|
|
|
@RequestParam(name = "consumeTimeS", required = false) Long consumeTimeS, |
|
|
|
|
@RequestParam(name = "consumeTimeE", required = false) Long consumeTimeE, |
|
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
|
try { |
|
|
|
@ -97,21 +99,29 @@ public class HighCouponAgentController { |
|
|
|
|
log.error("HighCouponAgentController -> assignCouponAgent() error!","该主角色没有权限"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
// 计算使用有效期
|
|
|
|
|
Calendar consumeTimeS = Calendar.getInstance(); |
|
|
|
|
consumeTimeS.setTime(new Date()); |
|
|
|
|
consumeTimeS.set(Calendar.HOUR_OF_DAY, 00); |
|
|
|
|
consumeTimeS.set(Calendar.MINUTE, 00); |
|
|
|
|
consumeTimeS.set(Calendar.SECOND, 00); |
|
|
|
|
// 如果为空查当前时间
|
|
|
|
|
Calendar timeS = Calendar.getInstance(); |
|
|
|
|
if (consumeTimeS != null) { |
|
|
|
|
timeS.setTime(new Date(consumeTimeS)); |
|
|
|
|
} else { |
|
|
|
|
timeS.setTime(new Date()); |
|
|
|
|
} |
|
|
|
|
timeS.set(Calendar.HOUR_OF_DAY, 00); |
|
|
|
|
timeS.set(Calendar.MINUTE, 00); |
|
|
|
|
timeS.set(Calendar.SECOND, 00); |
|
|
|
|
|
|
|
|
|
Calendar consumeTimeE = Calendar.getInstance(); |
|
|
|
|
consumeTimeE.setTime(new Date()); |
|
|
|
|
consumeTimeE.set(Calendar.HOUR_OF_DAY, 23); |
|
|
|
|
consumeTimeE.set(Calendar.MINUTE, 59); |
|
|
|
|
consumeTimeE.set(Calendar.SECOND, 59); |
|
|
|
|
Calendar timeE = Calendar.getInstance(); |
|
|
|
|
if (consumeTimeE != null) { |
|
|
|
|
timeE.setTime(new Date(consumeTimeE)); |
|
|
|
|
} else { |
|
|
|
|
timeE.setTime(new Date()); |
|
|
|
|
} |
|
|
|
|
timeE.set(Calendar.HOUR_OF_DAY, 23); |
|
|
|
|
timeE.set(Calendar.MINUTE, 59); |
|
|
|
|
timeE.set(Calendar.SECOND, 59); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getAgentSalesCodeList(userInfoModel.getHighAgent().getId(), DateUtil.date2String(consumeTimeS.getTime(), "yyyy-MM-dd HH:mm:ss"), DateUtil.date2String(consumeTimeE.getTime(), "yyyy-MM-dd HH:mm:ss")))); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getAgentSalesCodeList(userInfoModel.getHighAgent().getId(), DateUtil.date2String(timeS.getTime(), "yyyy-MM-dd HH:mm:ss"), DateUtil.date2String(timeE.getTime(), "yyyy-MM-dd HH:mm:ss")))); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("HighCouponAgentController --> getAgentSalesCodeList() error!", e); |
|
|
|
|