|
|
@ -311,6 +311,34 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { |
|
|
|
return returnMap; |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Map<String, Object> getConvertCodeCountByAgent(Long agentId) { |
|
|
|
|
|
|
|
Map<String,Object> listMap = new HashMap<>(); |
|
|
|
|
|
|
|
listMap.put("agentId", agentId); |
|
|
|
|
|
|
|
List<HighCouponAgentRel> list = getCouponAgentList(listMap).stream().sorted(Comparator.comparing(HighCouponAgentRel::getSalesPrice)).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> returnMap = new HashMap<>(); |
|
|
|
|
|
|
|
returnMap.put("list", list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 待销售
|
|
|
|
|
|
|
|
returnMap.put("noSalesNum", highCouponAgentRelMapper.getAgentCodeCount(agentId, "1", 2)); |
|
|
|
|
|
|
|
returnMap.put("noSalesPrice", highCouponAgentRelMapper.getAgentCodePrice(agentId, "1", 2)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 已销售
|
|
|
|
|
|
|
|
returnMap.put("salesNum", highCouponAgentRelMapper.getAgentCodeCount(agentId, "2", 2)); |
|
|
|
|
|
|
|
returnMap.put("salesPrice", highCouponAgentRelMapper.getAgentCodePrice(agentId, "2", 2)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 待使用
|
|
|
|
|
|
|
|
returnMap.put("noUsedNum", highCouponAgentRelMapper.getAgentCodeCount(agentId, "2", 2)); |
|
|
|
|
|
|
|
returnMap.put("noUsedPrice", highCouponAgentRelMapper.getAgentCodePrice(agentId, "2", 2)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 已使用
|
|
|
|
|
|
|
|
returnMap.put("usedNum", highCouponAgentRelMapper.getAgentCodeCount(agentId, "3", 2)); |
|
|
|
|
|
|
|
returnMap.put("usedPrice", highCouponAgentRelMapper.getAgentCodePrice(agentId, "3", 2)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return returnMap; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<HighCouponAgentRecord> getRecordList(Map<String, Object> map) { |
|
|
|
public List<HighCouponAgentRecord> getRecordList(Map<String, Object> map) { |
|
|
|
HighCouponAgentRecordExample example = new HighCouponAgentRecordExample(); |
|
|
|
HighCouponAgentRecordExample example = new HighCouponAgentRecordExample(); |
|
|
@ -373,7 +401,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW,isolation= Isolation.SERIALIZABLE) |
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW,isolation= Isolation.SERIALIZABLE) |
|
|
|
public String useConvertCode(String code) { |
|
|
|
public Map<String, Object> useConvertCode(String code) { |
|
|
|
// 查询兑换码
|
|
|
|
// 查询兑换码
|
|
|
|
HighCouponAgentCode convertCode = getConvertCode(code); |
|
|
|
HighCouponAgentCode convertCode = getConvertCode(code); |
|
|
|
if (convertCode == null) { |
|
|
|
if (convertCode == null) { |
|
|
@ -395,9 +423,14 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { |
|
|
|
convertCode.setCouponCodeId(couponCode.getId()); |
|
|
|
convertCode.setCouponCodeId(couponCode.getId()); |
|
|
|
convertCode.setCouponCode(couponCode.getSalesCode()); |
|
|
|
convertCode.setCouponCode(couponCode.getSalesCode()); |
|
|
|
convertCode.setQrCode(couponCode.getExt1()); |
|
|
|
convertCode.setQrCode(couponCode.getExt1()); |
|
|
|
convertCode.setStatus(2); |
|
|
|
convertCode.setStatus(3); |
|
|
|
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode); |
|
|
|
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode); |
|
|
|
|
|
|
|
|
|
|
|
return "/couponCode/"+couponCode.getExt1(); |
|
|
|
// 查询卡券销售码
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put("couponInfo", highCouponService.getCouponById(convertCode.getCouponId())); |
|
|
|
|
|
|
|
map.put("couponCode", highCouponCodeService.getCouponCodeById(convertCode.getCouponCodeId())); |
|
|
|
|
|
|
|
map.put("couponAgentCode", convertCode); |
|
|
|
|
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|