dev-discount
袁野 4 years ago
parent 272dd3d0b1
commit f447e624f2
  1. BIN
      .gradle/6.7/executionHistory/executionHistory.lock
  2. BIN
      .gradle/6.7/fileChanges/last-build.bin
  3. BIN
      .gradle/6.7/fileHashes/fileHashes.lock
  4. 0
      .gradle/6.7/gc.properties
  5. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  6. 2
      .gradle/buildOutputCleanup/cache.properties
  7. BIN
      .gradle/checksums/checksums.lock
  8. 0
      .gradle/configuration-cache/gc.properties
  9. 0
      .gradle/vcs-1/gc.properties
  10. 31
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  11. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java

@ -0,0 +1,2 @@
#Tue Mar 09 11:14:27 CST 2021
gradle.version=6.7

Binary file not shown.

@ -7,14 +7,9 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.model.HighCouponModel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponCodeService;
import com.hai.service.HighCouponService;
import com.hai.service.HighOrderService;
@ -28,8 +23,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -74,20 +67,32 @@ public class HighOrderController {
}
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET)
@RequestMapping(value = "/getOrderCouponList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户订单")
@ApiOperation(value = "获取卡券订单列表")
public ResponseData getUserOrderList(@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "couponId", required = false) Integer couponId,
@RequestParam(name = "salesCode", required = false) Integer salesCode,
HttpServletRequest request) {
try {
Map<String,Object> map = new HashMap<>();
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getBsCompany() == null) {
log.error("HighCouponController -> getCouponList() error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
// map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("couponId", couponId);
map.put("salesCode", salesCode);
map.put("status", status);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map)));
return ResponseMsgUtil.success(new PageInfo<>(highCouponCodeService.getCouponCodeList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);

@ -110,7 +110,7 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Override
public Integer getStockCountByCoupon(Long couponId) {
HighCouponCodeExample example = new HighCouponCodeExample();
example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeLessThan(new Date());
example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeGreaterThan(new Date());
return highCouponCodeMapper.selectByExample(example).size();
}

Loading…
Cancel
Save