dev-discount
胡锐 4 years ago
commit ada0bcb6f7
  1. 21
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  2. 1
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  3. 6
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java

@ -60,12 +60,31 @@ public class HighCouponAgentController {
@Resource @Resource
private HighCouponService highCouponService; private HighCouponService highCouponService;
@RequestMapping(value = "/getAgentCount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据销售码查询详情")
public ResponseData getAgentCount(HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
map.put("", "");
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("HighCouponAgentController --> getCodeById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/assignCouponAgent", method = RequestMethod.POST) @RequestMapping(value = "/assignCouponAgent", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "分配卡券给代理商") @ApiOperation(value = "分配卡券给代理商")
public ResponseData assignCouponAgent(@RequestBody HighCouponAgentRel highCouponAgentRel, HttpServletRequest request) { public ResponseData assignCouponAgent(@RequestBody HighCouponAgentRel highCouponAgentRel, HttpServletRequest request) {
try { try {
//发布人员
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) { if (userInfoModel.getBsCompany() == null) {

@ -48,6 +48,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("couponId", highCouponAgentRel.getCouponId()); map.put("couponId", highCouponAgentRel.getCouponId());
map.put("status", 1); map.put("status", 1);
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);

@ -183,7 +183,7 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Override @Override
public Integer getStockCountByCoupon(Long couponId) { public Integer getStockCountByCoupon(Long couponId) {
HighCouponCodeExample example = new HighCouponCodeExample(); HighCouponCodeExample example = new HighCouponCodeExample();
example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeGreaterThan(new Date()); example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeGreaterThan(new Date()).andIsAssignAgentEqualTo(false);
return highCouponCodeMapper.selectByExample(example).size(); return highCouponCodeMapper.selectByExample(example).size();
} }
@ -211,6 +211,10 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
criteria.andSalesCodeLike("%" + MapUtils.getString(map, "salesCode") + "%"); criteria.andSalesCodeLike("%" + MapUtils.getString(map, "salesCode") + "%");
} }
if (MapUtils.getLong(map, "salesEndTimeS") != null) {
criteria.andSalesEndTimeGreaterThan(new Date(MapUtils.getLong(map, "salesEndTimeS")));
}
if (MapUtils.getBoolean(map, "isAssignAgent") != null) { if (MapUtils.getBoolean(map, "isAssignAgent") != null) {
criteria.andIsAssignAgentEqualTo(MapUtils.getBoolean(map, "isAssignAgent")); criteria.andIsAssignAgentEqualTo(MapUtils.getBoolean(map, "isAssignAgent"));
} }

Loading…
Cancel
Save