Browse Source

opt:测试环境不查询库存信息

test-20240527
龚宝雄 7 months ago
parent
commit
d0324fb3ce
  1. 8
      nlsso-server/pom.xml
  2. 49
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java

8
nlsso-server/pom.xml

@ -71,6 +71,7 @@
<version>0.2</version>
</dependency>
<!-- 控制台高亮-->
<!-- https://onew.me/logback/2018/09/17/logback_win.html-->
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
@ -107,13 +108,6 @@
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>4.1.3</version>
</dependency>
<!-- https://onew.me/logback/2018/09/17/logback_win.html-->
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>1.17.1</version>
</dependency>
<!--工具包-->
<dependency>
<groupId>cn.hutool</groupId>

49
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java

@ -56,22 +56,22 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid())
);
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords();
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
easOutInBillDetailList.forEach(bill -> {
//查询库存信息
List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
.filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
&& Objects.equals(inventory.getCkbm(), bill.getCkbm())
&& Objects.equals(inventory.getWlbm(), bill.getWlbm())
&& Objects.equals(inventory.getPc(), bill.getPc())
&& Objects.equals(inventory.getTrackno(), bill.getTrackno())
&& Objects.equals(inventory.getKwbm(), bill.getKwbm()))
.collect(Collectors.toList());
//将库存数量赋值给单据
if (CollectionUtils.isNotEmpty(matchedInventory)) {
bill.setKcsl(matchedInventory.get(0).getKcsl());
}
});
//List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
// easOutInBillDetailList.forEach(bill -> {
// //查询库存信息
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
// && Objects.equals(inventory.getPc(), bill.getPc())
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
// .collect(Collectors.toList());
// //将库存数量赋值给单据
// if (CollectionUtils.isNotEmpty(matchedInventory)) {
// bill.setKcsl(matchedInventory.get(0).getKcsl());
// }
// });
result.setRecords(easOutInBillDetailList);
return CommonPage.getPage(result);
}
@ -149,11 +149,10 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
@Override
public void update(List<EasOutInBillDetailVO> entityList) {
if (CollectionUtils.isNotEmpty(entityList)) {
List<EasOutInBillDetailVO> entityLists= entityList.stream().filter(r->StringUtils.isNotEmpty(r.getKwbm())).collect(Collectors.toList());
List<String> ids =entityLists.stream().map(EasOutInBillDetailVO::getCode).collect(Collectors.toList());
if(ids.size()==entityList.size()&&ids.size()>1)
{
entityList.forEach(r->{
List<EasOutInBillDetailVO> entityLists = entityList.stream().filter(r -> StringUtils.isNotEmpty(r.getKwbm())).collect(Collectors.toList());
List<String> ids = entityLists.stream().map(EasOutInBillDetailVO::getCode).collect(Collectors.toList());
if (ids.size() == entityList.size() && ids.size() > 1) {
entityList.forEach(r -> {
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("flid", r.getFlid());
updateWrapper.set("czsl", r.getSl());
@ -165,16 +164,14 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
easOutInBillDetailMapper.update(null, updateWrapper);
});
}else
{
} else {
boolean isValid = entityList.stream()
.filter(r -> StringUtils.isNotEmpty(r.getKwbm()))
.map(EasOutInBillDetailVO::getSysl)
.reduce(BigDecimal.ZERO, BigDecimal::add)
.compareTo(BigDecimal.ZERO) == 0;
if(isValid)
{
if (isValid) {
throw new BadRequestException("请检查库位和数量信息");
}
BigDecimal amount = entityList.stream()
@ -198,8 +195,6 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
}
}
}

Loading…
Cancel
Save