'修复已知问题'

dev-discount
199901012 4 years ago
parent ada0bcb6f7
commit ea1850a0a2
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  2. 7
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java

@ -201,6 +201,7 @@ public class HighCouponAgentController {
@ResponseBody @ResponseBody
@ApiOperation(value = "根据代理商和卡券 查询分配的销售码") @ApiOperation(value = "根据代理商和卡券 查询分配的销售码")
public ResponseData getCodeListByAgentCoupon(@RequestParam(name = "couponId", required = true) Long couponId, public ResponseData getCodeListByAgentCoupon(@RequestParam(name = "couponId", required = true) Long couponId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, @RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) { HttpServletRequest request) {
@ -216,6 +217,7 @@ public class HighCouponAgentController {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("agentId", userInfoModel.getHighAgent().getId()); map.put("agentId", userInfoModel.getHighAgent().getId());
map.put("couponId", couponId); map.put("couponId", couponId);
map.put("status", status);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
PageInfo<HighCouponAgentCode> pageInfo = new PageInfo<>(highCouponAgentService.getCouponCodeList(map)); PageInfo<HighCouponAgentCode> pageInfo = new PageInfo<>(highCouponAgentService.getCouponCodeList(map));

@ -1,5 +1,6 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
@ -20,6 +21,8 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @Auther: 胡锐 * @Auther: 胡锐
@ -50,6 +53,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
map.put("status", 1); map.put("status", 1);
map.put("salesEndTimeS", new Date().getTime()); map.put("salesEndTimeS", new Date().getTime());
map.put("isAssignAgent", false); map.put("isAssignAgent", false);
List<HighCouponCode> codeList = highCouponCodeService.getCouponCodeList(map); List<HighCouponCode> codeList = highCouponCodeService.getCouponCodeList(map);
if (highCouponAgentRel.getStockCount() > codeList.size()) { if (highCouponAgentRel.getStockCount() > codeList.size()) {
@ -58,8 +62,9 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highCouponAgentRelMapper.insert(highCouponAgentRel); highCouponAgentRelMapper.insert(highCouponAgentRel);
List<HighCouponCode> assignCouponCodeList = codeList.stream().limit(highCouponAgentRel.getStatus()).collect(Collectors.toList());
HighCouponAgentCode highCouponAgentCode; HighCouponAgentCode highCouponAgentCode;
for (HighCouponCode code : codeList) { for (HighCouponCode code : assignCouponCodeList) {
code.setAgentId(highCouponAgentRel.getAgentId()); code.setAgentId(highCouponAgentRel.getAgentId());
code.setIsAssignAgent(true); code.setIsAssignAgent(true);
highCouponCodeService.updateCouponCode(code); highCouponCodeService.updateCouponCode(code);

Loading…
Cancel
Save