|
|
@@ -167,6 +167,20 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
;
|
|
|
putBoxList = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
}
|
|
|
+ List<PutBox> putBoxs = new ArrayList<>();
|
|
|
+ if (ObjectUtils.isNotNull(putBox.getContainerNumber())) {
|
|
|
+ LambdaQueryWrapper<PutBox> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PutBox::getIsDeleted, 0)
|
|
|
+ .eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PutBox::getBoxClass, putBox.getBoxClass())
|
|
|
+ .eq(PutBox::getBoxType, putBox.getBoxType())
|
|
|
+ .eq(PutBox::getPolId, putBox.getPolId())
|
|
|
+ .eq(PutBox::getPolStationId, putBox.getPolStationId())
|
|
|
+ .eq(PutBox::getPodId, putBox.getPodId())
|
|
|
+ .eq(PutBox::getContainerNumber, putBox.getContainerNumber())
|
|
|
+ ;
|
|
|
+ putBoxs = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
+ }
|
|
|
String businessTypeCode = "FXH";
|
|
|
String billNoFormat;
|
|
|
String billNoFormatInternal = "FXH-N";
|
|
|
@@ -207,6 +221,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
&& e.getPolStationId().equals(putBox.getPolStationId()))) {
|
|
|
throw new RuntimeException("放箱号已存在,请勿重复添加");
|
|
|
}
|
|
|
+ if (!putBoxs.isEmpty()) {
|
|
|
+ throw new RuntimeException("存在重复单据");
|
|
|
+ }
|
|
|
BusinessBillNo businessBillNo = new BusinessBillNo();
|
|
|
businessBillNo.setBusinessTypeId(businessType.getId());
|
|
|
businessBillNo.setCode(billNoFormat);
|
|
|
@@ -228,6 +245,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
&& e.getPolStationId().equals(putBox.getPolStationId()))) {
|
|
|
throw new RuntimeException("放箱号已存在,请勿重复添加");
|
|
|
}
|
|
|
+ if (putBoxs.stream().anyMatch(e -> !e.getId().equals(putBox.getId()))) {
|
|
|
+ throw new RuntimeException("存在重复单据");
|
|
|
+ }
|
|
|
putBox.setUpdateTime(new Date());
|
|
|
putBox.setUpdateUser(AuthUtil.getUserId());
|
|
|
putBox.setUpdateUserName(AuthUtil.getUserName());
|
|
|
@@ -5311,6 +5331,47 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
return R.success("删除成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public R batchUpdatePod(String ids, String podId, String podCname, String podEname, String podCode) {
|
|
|
+ if (ObjectUtils.isNull(ids) || ObjectUtils.isNull(podId)) {
|
|
|
+ throw new RuntimeException("缺少必要参数");
|
|
|
+ }
|
|
|
+ List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
|
|
|
+ .eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PutBox::getIsDeleted, 0)
|
|
|
+ .apply("find_in_set(id,'" + ids + "')"));
|
|
|
+ if (putBoxList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未查到放箱号单据");
|
|
|
+ }
|
|
|
+ List<String> containerNumber = putBoxList.stream().map(PutBox::getContainerNumber).distinct().collect(Collectors.toList());
|
|
|
+ List<PutBox> putBoxs = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<PutBox> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PutBox::getIsDeleted, 0)
|
|
|
+ .eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .in(PutBox::getContainerNumber, containerNumber)
|
|
|
+ ;
|
|
|
+ putBoxs = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
+ for (PutBox item : putBoxList) {
|
|
|
+ item.setPodId(podId);
|
|
|
+ item.setPodCname(podCname);
|
|
|
+ item.setPodCode(podCode);
|
|
|
+ item.setPodEname(podEname);
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ List<PutBox> putBoxes = putBoxs.stream().filter(e -> e.getPolId().equals(item.getPolId()) &&
|
|
|
+ e.getContainerNumber().equals(item.getContainerNumber()) && e.getBoxClass().equals(item.getBoxClass())
|
|
|
+ && e.getBoxType().equals(item.getBoxClass()) && e.getPolStationId().equals(item.getPolStationId())
|
|
|
+ && e.getPodId().equals(item.getPodId()) && !e.getId().equals(item.getId())).collect(Collectors.toList());
|
|
|
+ if (!putBoxes.isEmpty()) {
|
|
|
+ throw new RuntimeException("放箱号:" + item.getContainerNumber() + "存在重复数据,修改失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.updateBatchById(putBoxList);
|
|
|
+ return R.data("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
private void countOverdueFeeV1(Bills billsHYJK, List<TradingBox> tradingBoxList,
|
|
|
List<TradingBoxItem> tradingBoxItemOldList, List<PutBoxItems> putBoxItemsOldList,
|
|
|
List<PutBox> putBoxList) {
|