修复已知问题

dev-discount
胡锐 3 years ago
parent bcde92c9e2
commit ec3af40f1d
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighCouponAgentController.java
  3. 10
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java

@ -292,6 +292,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 = "type", required = true) Integer type,
@RequestParam(name = "status", required = false) String status, @RequestParam(name = "status", required = false) String status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE, @RequestParam(name = "createTimeE", required = false) Long createTimeE,
@ -309,6 +310,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("type", type);
map.put("couponId", couponId); map.put("couponId", couponId);
map.put("status", status); map.put("status", status);
map.put("createTimeS", createTimeS); map.put("createTimeS", createTimeS);

@ -60,7 +60,7 @@ public class HighCouponAgentController {
log.error("HighCouponAgentController -> queryConvertCode() error!","无效的兑换码"); log.error("HighCouponAgentController -> queryConvertCode() error!","无效的兑换码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码");
} }
if (convertCode.getStatus() != 1) { if (convertCode.getStatus() == 3) {
log.error("HighCouponAgentController -> queryConvertCode() error!","兑换码已被使用"); log.error("HighCouponAgentController -> queryConvertCode() error!","兑换码已被使用");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用");
} }

@ -99,6 +99,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highCouponCodeService.updateCouponCode(code); highCouponCodeService.updateCouponCode(code);
highCouponAgentCode = new HighCouponAgentCode(); highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId()); highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId()); highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(code.getCouponId()); highCouponAgentCode.setCouponId(code.getCouponId());
@ -118,6 +119,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
HighCouponAgentCode highCouponAgentCode; HighCouponAgentCode highCouponAgentCode;
for (int i = 0; i < stockCount; i++) { for (int i = 0; i < stockCount; i++) {
highCouponAgentCode = new HighCouponAgentCode(); highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId()); highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId()); highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(highCoupon.getId()); highCouponAgentCode.setCouponId(highCoupon.getId());
@ -127,7 +129,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highCouponAgentCode.setCreateTime(new Date()); highCouponAgentCode.setCreateTime(new Date());
highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId()); highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId());
highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName()); highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(highCouponAgentCode); highCouponAgentCodeMapper.insert(highCouponAgentCode);
} }
} }
} }
@ -179,6 +181,10 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
criteria.andCouponAgentIdEqualTo(MapUtils.getLong(map, "couponAgentId")); criteria.andCouponAgentIdEqualTo(MapUtils.getLong(map, "couponAgentId"));
} }
if (MapUtils.getInteger(map, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
}
if (MapUtils.getLong(map, "couponId") != null) { if (MapUtils.getLong(map, "couponId") != null) {
criteria.andCouponIdEqualTo(MapUtils.getLong(map, "couponId")); criteria.andCouponIdEqualTo(MapUtils.getLong(map, "couponId"));
} }
@ -373,7 +379,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
if (convertCode == null) { if (convertCode == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码");
} }
if (convertCode.getStatus() != 1) { if (convertCode.getStatus() == 3) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用");
} }
// 查询未销售的卡券 // 查询未销售的卡券

Loading…
Cancel
Save