'提交代码'

dev-discount
199901012 4 years ago
parent 851998a07a
commit 7bc67da23f
  1. 7
      hai-bweb/src/main/java/com/bweb/controller/HighCouponCodeController.java
  2. 5
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java

@ -11,9 +11,11 @@ import com.hai.entity.HighCouponCode;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -29,6 +31,9 @@ import java.util.Map;
* @Description: 卡卷销售码
* @Date: 2021/3/22 19:39
*/
@Controller
@RequestMapping(value = "/couponCode")
@Api(value = "卡卷销售码接口")
public class HighCouponCodeController {
private static Logger log = LoggerFactory.getLogger(HighCouponCodeController.class);
@ -41,12 +46,14 @@ public class HighCouponCodeController {
@ApiOperation(value = "销售码列表")
public ResponseData getCouponCodeList(@RequestParam(name = "couponId", required = true) Long couponId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "salesCode", required = false) String salesCode,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String, Object> map = new HashMap<>();
map.put("couponId", couponId);
map.put("status", status);
map.put("salesCode", salesCode);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponCodeService.getCouponCodeList(map)));

@ -6,6 +6,7 @@ import com.hai.entity.HighCouponCode;
import com.hai.entity.HighCouponCodeExample;
import com.hai.service.HighCouponCodeService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -57,6 +58,10 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "salesCode"))) {
criteria.andSalesCodeLike("%" + MapUtils.getString(map, "salesCode") + "%");
}
example.setOrderByClause("create_time desc");
return highCouponCodeMapper.selectByExample(example);
}

Loading…
Cancel
Save