修改bug
This commit is contained in:
parent
395021ef87
commit
d941ea49d3
|
@ -667,6 +667,10 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
divide1 = divide1.multiply(cy100);
|
divide1 = divide1.multiply(cy100);
|
||||||
earnings = divide1.intValue()+"%";
|
earnings = divide1.intValue()+"%";
|
||||||
System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1);
|
System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1);
|
||||||
|
}else if(orderType == 4){//业绩
|
||||||
|
ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime);
|
||||||
|
int yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime);
|
||||||
|
earnings = yeji+"";
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("data",new PageUtils(ordersIPage));
|
map.put("data",new PageUtils(ordersIPage));
|
||||||
|
|
|
@ -144,5 +144,11 @@ public class AppGoodsController {
|
||||||
return service.findAttrValue(goodsId);
|
return service.findAttrValue(goodsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/wlcglist")
|
||||||
|
@ApiOperation("物料采购")
|
||||||
|
public Result wlcglist(Integer page, Integer size,
|
||||||
|
@ApiParam("排序字段 综合createAt 销量sales 佣金比例commissionPrice 超低价price")@RequestParam(required = false) String sort) {
|
||||||
|
return service.wlcglist(page, size, sort);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,4 +79,6 @@ public interface GoodsService {
|
||||||
|
|
||||||
|
|
||||||
Result selectListByType(String title, String type, Integer status, Integer isJiFenGoods);
|
Result selectListByType(String title, String type, Integer status, Integer isJiFenGoods);
|
||||||
|
|
||||||
|
Result wlcglist(Integer page, Integer size, String sort);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.sqx.modules.shopping.controller.SkuUtil;
|
||||||
import com.sqx.modules.shopping.dao.*;
|
import com.sqx.modules.shopping.dao.*;
|
||||||
import com.sqx.modules.shopping.entity.*;
|
import com.sqx.modules.shopping.entity.*;
|
||||||
import com.sqx.modules.shopping.service.GoodsService;
|
import com.sqx.modules.shopping.service.GoodsService;
|
||||||
|
import com.sqx.modules.shopping.service.GoodsTypeService;
|
||||||
import com.sqx.modules.shopping.service.SelfGoodsAttrService;
|
import com.sqx.modules.shopping.service.SelfGoodsAttrService;
|
||||||
import com.sqx.modules.shopping.utils.DateUtil;
|
import com.sqx.modules.shopping.utils.DateUtil;
|
||||||
import com.sqx.modules.shopping.utils.Result;
|
import com.sqx.modules.shopping.utils.Result;
|
||||||
|
@ -48,6 +49,9 @@ public class SelfGoodsServiceImpl implements GoodsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SelfGoodsBrandJpaRepository selfGoodsBrandJpaRepository;
|
private SelfGoodsBrandJpaRepository selfGoodsBrandJpaRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GoodsTypeService goodsTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后台管理商品列表、创建时间排序
|
* 后台管理商品列表、创建时间排序
|
||||||
* @param page 页数
|
* @param page 页数
|
||||||
|
@ -176,6 +180,47 @@ public class SelfGoodsServiceImpl implements GoodsService {
|
||||||
}
|
}
|
||||||
return ResultUtil.success(all);
|
return ResultUtil.success(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result wlcglist(Integer page, Integer size, String sort) {
|
||||||
|
//只查询类型是物料包的商品
|
||||||
|
String pTypeId = "56";
|
||||||
|
List<GoodsType> goodsTypeList;
|
||||||
|
if(StringUtils.isNotBlank(pTypeId)){
|
||||||
|
Specification<GoodsType> goodsTypeQc = (root, criteriaQuery, criteriaBuilder) -> {
|
||||||
|
List<Predicate> predicateList = new ArrayList<>();
|
||||||
|
predicateList.add(criteriaBuilder.or(criteriaBuilder.equal(root.get("parentId"), pTypeId),criteriaBuilder.equal(root.get("id"), pTypeId)));
|
||||||
|
return criteriaBuilder.and(predicateList.toArray(new Predicate[0]));
|
||||||
|
};
|
||||||
|
goodsTypeList = goodsJpaTypeRepository.findAll(goodsTypeQc);
|
||||||
|
} else {
|
||||||
|
goodsTypeList = null;
|
||||||
|
}
|
||||||
|
//按照时间排序
|
||||||
|
Pageable pageable;
|
||||||
|
if(size == -1){
|
||||||
|
pageable = PageRequest.of(page, Integer.MAX_VALUE, Sort.by(new Sort.Order(Sort.Direction.DESC, "createAt")));
|
||||||
|
} else {
|
||||||
|
pageable = PageRequest.of(page, size, Sort.by(new Sort.Order(Sort.Direction.DESC, "createAt")));
|
||||||
|
}
|
||||||
|
//构造自定义查询条件
|
||||||
|
Specification<SelfGoods> queryCondition = (root, criteriaQuery, criteriaBuilder) -> {
|
||||||
|
List<Predicate> predicateList = new ArrayList<>();
|
||||||
|
if(StringUtils.isNotBlank(pTypeId)) {
|
||||||
|
//goodsTypeList
|
||||||
|
CriteriaBuilder.In<Object> in = criteriaBuilder.in(root.get("typeId"));
|
||||||
|
if(goodsTypeList != null && !goodsTypeList.isEmpty()) {
|
||||||
|
goodsTypeList.forEach(x -> in.value(x.getId()));
|
||||||
|
}
|
||||||
|
predicateList.add(in);
|
||||||
|
}
|
||||||
|
return criteriaBuilder.and(predicateList.toArray(new Predicate[0]));
|
||||||
|
};
|
||||||
|
//处理数据:商品分类
|
||||||
|
Page<SelfGoods> all = jpaRepository.findAll(queryCondition, pageable);
|
||||||
|
return ResultUtil.success(all);
|
||||||
|
}
|
||||||
|
|
||||||
//虚拟商品列表
|
//虚拟商品列表
|
||||||
@Override
|
@Override
|
||||||
public Result goodsVirtualList(Integer page, Integer size, String title, String type, Integer status, Integer isExpress, Integer isJiFenGoods) {
|
public Result goodsVirtualList(Integer page, Integer size, String title, String type, Integer status, Integer isExpress, Integer isJiFenGoods) {
|
||||||
|
|
Loading…
Reference in New Issue