|
|
@@ -647,11 +647,11 @@ public class KwpGoodsService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void batchDelete(List<Long> ids) {
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.in(KwpGoods::getId, ids).in(KwpGoods::getStatus, 0, 2)
|
|
|
+ wrapper.in(KwpGoods::getId, ids).eq(KwpGoods::getStatus, 0)
|
|
|
.eq(KwpGoods::getEntId, LoginUserHolder.getEntId()).eq(KwpGoods::getDelFlag, Global.NO);
|
|
|
List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
|
|
|
if (!Objects.equals(ids.size(), list.size())) {
|
|
|
- throw new BusinessException("删除操作仅针对“已下架”“草稿”状态的单据");
|
|
|
+ throw new BusinessException("删除操作仅针对“草稿”状态的单据");
|
|
|
}
|
|
|
LambdaUpdateWrapper<KwpGoods> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
updateWrapper.set(KwpGoods::getDelFlag, Global.YES).in(KwpGoods::getId, ids);
|
|
|
@@ -750,10 +750,16 @@ public class KwpGoodsService {
|
|
|
public List<GoodsDropList> dropList(GoodsDropListReq params) {
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
if (Objects.equals(params.getOrderType(), 2)) {
|
|
|
- if (Objects.isNull(params.getSupplyEntId())) {
|
|
|
+ Long supplyEntId = params.getSupplyEntId();
|
|
|
+ if (Objects.isNull(supplyEntId)) {
|
|
|
throw new BusinessException("供应单位不能为空!");
|
|
|
}
|
|
|
- wrapper.eq(KwpGoods::getSupplyEntId, params.getSupplyEntId());
|
|
|
+ Map<Long, EntCacheResDto> map = remoteSystemService.queryEntTreeByIds(List.of(supplyEntId));
|
|
|
+ EntCacheResDto ent = map.get(supplyEntId);
|
|
|
+ if (Objects.isNull(ent) || Objects.isNull(ent.getId())) {
|
|
|
+ throw new BusinessException("供应单位一级企业为空!");
|
|
|
+ }
|
|
|
+ wrapper.eq(KwpGoods::getSupplyEntId, ent.getId());
|
|
|
}
|
|
|
wrapper.like(StringUtils.isNotBlank(params.getName()), KwpGoods::getName, params.getName())
|
|
|
.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode())
|