Merge branch 'gyj' into test
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.ysk.cashier.cons.domain.*;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
|
||||
@@ -140,7 +141,6 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
tbConsInfoFlowRepository.save(flow);
|
||||
|
||||
|
||||
|
||||
}
|
||||
return tbConsInfoMapper.toDto(new TbConsInfo());
|
||||
}
|
||||
@@ -290,8 +290,6 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
||||
|
||||
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class TbOrderInfoController {
|
||||
|
||||
@PostMapping("/date")
|
||||
@ApiOperation("查询订单")
|
||||
@AnonymousPostMapping
|
||||
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbOrderInfoService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ public class TbOrderInfoQueryCriteria{
|
||||
@Query(type = Query.Type.BETWEEN)
|
||||
private List<Long> createdAt;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
|
||||
@Query
|
||||
private String tableName;
|
||||
@@ -79,4 +81,18 @@ public class TbOrderInfoQueryCriteria{
|
||||
public void setProductName(String productName) {
|
||||
if(StringUtils.isNotBlank(productName)) this.productName = productName;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
if (page == null) {
|
||||
return 0;
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
if (pageSize == null) {
|
||||
return 10;
|
||||
}
|
||||
return pageSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,4 +66,7 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
|
||||
@Query(value = "select b.* from tb_product_sku as a left join tb_product as b on a.product_id=b.id where a.id=:skuId", nativeQuery = true)
|
||||
TbProduct selectBySkuId(@Param("skuId") Integer skuId);
|
||||
|
||||
@Query(value = "select * from tb_product as a where a.id=:skuId", nativeQuery = true)
|
||||
TbProduct selectById(@Param("skuId") Integer skuId);
|
||||
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
predicate = criteriaBuilder.and(predicate, criteriaBuilder.notEqual(root.get("orderType"), "return"));
|
||||
}
|
||||
|
||||
if (criteria.getUserId() != null && criteria.getUserId() != 0) {
|
||||
predicate = criteriaBuilder.and(predicate, criteriaBuilder.equal(root.get("userId"), criteria.getUserId()));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(criteria.getProductName())) {
|
||||
Date startTime, endTime;
|
||||
DateTime offsetMonth = cn.hutool.core.date.DateUtil.offsetMonth(new Date(), 3);
|
||||
@@ -120,11 +124,6 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
|
||||
startTime = new Date(startLong);
|
||||
endTime = new Date(endLong);
|
||||
|
||||
// 如果开始时间小于三个月前,不查询
|
||||
// if (startTime.before(offsetMonth)) {
|
||||
// throw new BadRequestException("查询时间范围不能超过三个月");
|
||||
// }
|
||||
} else {
|
||||
startTime = offsetMonth;
|
||||
endTime = new Date();
|
||||
|
||||
Reference in New Issue
Block a user