|
|
@@ -30,6 +30,8 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.los.Util.CurrencyUtils;
|
|
|
+import org.springblade.los.Util.GlobalOperationLogUtils;
|
|
|
+import org.springblade.los.Util.OperatorType;
|
|
|
import org.springblade.los.basic.business.entity.BusinessType;
|
|
|
import org.springblade.los.basic.business.service.IBusinessTypeService;
|
|
|
import org.springblade.los.basic.cntr.entity.BCntrTypes;
|
|
|
@@ -139,7 +141,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
|
|
|
private final ICostProfitCalculationService costProfitCalculationService;
|
|
|
|
|
|
- private final PutBoxMapper putBoxMapper;
|
|
|
+ private final GlobalOperationLogUtils logUtils;
|
|
|
|
|
|
@Override
|
|
|
public IPage<PutBoxVO> selectPutBoxPage(IPage<PutBoxVO> page, PutBoxVO putBox) {
|
|
|
@@ -3198,419 +3200,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
throw new RuntimeException("箱号:" + item.getCntrNo() + "已返场");
|
|
|
}
|
|
|
}
|
|
|
- /*if ("1".equals(podStationR.getType())) {
|
|
|
- List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (boxNum.isEmpty()) {
|
|
|
- throw new RuntimeException("所选配箱信息箱号不能为空");
|
|
|
- }
|
|
|
- //箱档案数据
|
|
|
- List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
|
|
|
- .eq(Archives::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(Archives::getIsDeleted, 0)
|
|
|
- .in(Archives::getCode, boxNum)
|
|
|
- .eq(Archives::getStatus, "使用中"));
|
|
|
- if (archivesList.isEmpty()) {
|
|
|
- throw new RuntimeException("未查到对应箱档案信息");
|
|
|
- }
|
|
|
- if (boxNum.size() > archivesList.size()) {
|
|
|
- List<String> boxCode = archivesList.stream().map(Archives::getCode).collect(Collectors.toList());
|
|
|
- throw new RuntimeException("箱号:" + boxNum.stream().filter(e -> !boxCode.contains(e))
|
|
|
- .collect(Collectors.joining(",")) + "未查到对应箱档案信息");
|
|
|
- }
|
|
|
- List<String> containerNumberList = archivesList.stream().map(Archives::getContainerNumber)
|
|
|
- .distinct().collect(Collectors.toList());
|
|
|
- List<String> containerNumberOwList = archivesList.stream().map(Archives::getContainerNumberOw)
|
|
|
- .distinct().collect(Collectors.toList());
|
|
|
- if (!containerNumberOwList.isEmpty()) {
|
|
|
- containerNumberList.addAll(containerNumberOwList);
|
|
|
- }
|
|
|
- List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
|
|
|
- .eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PutBox::getIsDeleted, 0)
|
|
|
- .and(i -> i.in(PutBox::getContainerNumber, containerNumberList).or()
|
|
|
- .in(PutBox::getSrcContainerNumber, containerNumberList)));
|
|
|
- if (putBoxList.isEmpty()) {
|
|
|
- throw new RuntimeException("未查到放箱号单据");
|
|
|
- }
|
|
|
- List<Long> putBoxIdList = putBoxList.stream().map(PutBox::getId).collect(Collectors.toList());
|
|
|
- List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
|
|
|
- .eq(PutBoxItems::getIsDeleted, 0)
|
|
|
- .eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
|
|
|
- .in(PutBoxItems::getPid, putBoxIdList));
|
|
|
- List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
|
|
|
- List<TradingBox> tradingBoxList = new ArrayList<>();
|
|
|
- if (!srcIdList.isEmpty()) {
|
|
|
- tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
|
|
|
- .eq(TradingBox::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(TradingBox::getIsDeleted, 0)
|
|
|
- .in(TradingBox::getId, srcIdList));
|
|
|
- }
|
|
|
- List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
|
|
|
- if (!tradingBoxList.isEmpty()) {
|
|
|
- List<Long> tradingBoxIdList = tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList());
|
|
|
- tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
|
|
|
- .eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
- .eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
- .in(TradingBoxItem::getPid, tradingBoxIdList));
|
|
|
- }
|
|
|
- BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
|
|
|
- .select(BusinessType::getId)
|
|
|
- .eq(BusinessType::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(BusinessType::getIsDeleted, 0)
|
|
|
- .eq(BusinessType::getStatus, 0)
|
|
|
- .eq(BusinessType::getCode, "FXH"));
|
|
|
- if (businessType == null) {
|
|
|
- throw new RuntimeException("未找到可用业务类型");
|
|
|
- }
|
|
|
- List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
- .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(Bills::getIsDeleted, 0)
|
|
|
- .eq(Bills::getBusinessType, "SI")
|
|
|
- .in(Bills::getId, billsIds));
|
|
|
- if (billsHYJKListFD.isEmpty()) {
|
|
|
- throw new RuntimeException("未查到海运进口单据");
|
|
|
- }
|
|
|
- List<Long> idHYJKList = new ArrayList<>();
|
|
|
- List<Bills> billsHYJKListZD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
- .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(Bills::getIsDeleted, 0)
|
|
|
- .in(Bills::getMasterId, billsHYJKListFD.stream().map(Bills::getMasterId).collect(Collectors.toList())));
|
|
|
- if (!billsHYJKListZD.isEmpty()) {
|
|
|
- idHYJKList.addAll(billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList()));
|
|
|
- }
|
|
|
- List<Containers> containersHYJKListZD = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
- .eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(Containers::getIsDeleted, 0)
|
|
|
- .in(Containers::getPid, idHYJKList)
|
|
|
- .in(Containers::getCntrNo, boxNum));
|
|
|
- List<Containers> containersListNew = new ArrayList<>();
|
|
|
- for (Bills billsHYJK : billsHYJKListFD) {
|
|
|
- //自有箱-箱档案数据更新
|
|
|
- List<Archives> archivesArrayList = new ArrayList<>();
|
|
|
- //新放箱号单据
|
|
|
- List<PutBox> putBoxNewList = new ArrayList<>();
|
|
|
- //新放箱号单据明细数据
|
|
|
- List<PutBoxItems> putBoxItemsNewList = new ArrayList<>();
|
|
|
- //原放箱号单据明细数据
|
|
|
- List<PutBoxItems> putBoxItemsOldList = new ArrayList<>();
|
|
|
- //原OW单据明细数据
|
|
|
- List<TradingBoxItem> tradingBoxItemOldList = new ArrayList<>();
|
|
|
- //OW(拿)-箱档案数据删除
|
|
|
- List<Long> archivesDateleList = new ArrayList<>();
|
|
|
- List<Containers> containersList = containersHYJKList.stream().filter(e -> e.getPid().equals(billsHYJK.getId()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- for (Containers item : containersList) {
|
|
|
- if (ObjectUtils.isNull(item.getHblno())) {
|
|
|
- throw new RuntimeException("分单号不能为空");
|
|
|
- }
|
|
|
- //箱档案信息处理
|
|
|
- Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getCntrNo())).findFirst().orElse(null);
|
|
|
- if (archives == null) {
|
|
|
- throw new RuntimeException("未查到箱号:" + item.getCntrNo() + "箱档案数据");
|
|
|
- }
|
|
|
- String containerNumberType = "";
|
|
|
- //原放箱号数据处理
|
|
|
- PutBox putBoxOld = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw())
|
|
|
- && e.getPolId().equals(archives.getAddressId()) && e.getPolStationId().equals(archives.getStationId())
|
|
|
- && e.getBoxType().equals(archives.getTypeName())).findFirst().orElse(null);
|
|
|
- if (putBoxOld != null) {
|
|
|
- containerNumberType = putBoxOld.getBoxClass();
|
|
|
- PutBoxItems putBoxItem;
|
|
|
- if (!putBoxItemsList.isEmpty()) {
|
|
|
- putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCntrNo())
|
|
|
- && e.getPid().equals(putBoxOld.getId())).findFirst().orElse(null);
|
|
|
- if (putBoxItem != null) {
|
|
|
- putBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setPodStationId(podStationR.getPodStationId());
|
|
|
- putBoxItem.setPodStationCode(podStationR.getPodStationCode());
|
|
|
- putBoxItem.setPodStationCname(podStationR.getPodStationCname());
|
|
|
- putBoxItem.setPodStationEname(podStationR.getPodStationEname());
|
|
|
- putBoxItem.setStatus("已还箱");
|
|
|
- putBoxItem.setBoxDynamics("已返场");
|
|
|
- putBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
- putBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- putBoxItem.setUpdateTime(new Date());
|
|
|
- putBoxItem.setPodFreeBoxUseDays(billsHYJK.getPodFreeBoxUseDays());
|
|
|
- putBoxItem.setEta(billsHYJK.getEta());
|
|
|
- putBoxItem.setActualEta(billsHYJK.getActualEta());
|
|
|
- putBoxItemsOldList.add(putBoxItem);
|
|
|
- }
|
|
|
- }
|
|
|
- if (!tradingBoxList.isEmpty()) {
|
|
|
- TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBoxOld.getSrcId()))
|
|
|
- .findFirst().orElse(null);
|
|
|
- if (tradingBox != null) {
|
|
|
- TradingBoxItem tradingBoxItem;
|
|
|
- if (!tradingBoxItemList.isEmpty()) {
|
|
|
- tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getCntrNo()))
|
|
|
- .findFirst().orElse(null);
|
|
|
- if (tradingBoxItem != null) {
|
|
|
- tradingBoxItem.setPid(tradingBox.getId());
|
|
|
- tradingBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
|
|
|
- tradingBoxItem.setPodStationId(podStationR.getPodStationId());
|
|
|
- tradingBoxItem.setPodStationCode(podStationR.getPodStationCode());
|
|
|
- tradingBoxItem.setPodStationCname(podStationR.getPodStationCname());
|
|
|
- tradingBoxItem.setPodStationEname(podStationR.getPodStationEname());
|
|
|
- tradingBoxItem.setBoxDynamics("已返场");
|
|
|
- tradingBoxItem.setStatus("已还箱");
|
|
|
- tradingBoxItem.setStationId(podStationR.getPodStationId());
|
|
|
- tradingBoxItem.setStationCode(podStationR.getPodStationCode());
|
|
|
- tradingBoxItem.setStationCname(podStationR.getPodStationCname());
|
|
|
- tradingBoxItem.setStationEname(podStationR.getPodStationEname());
|
|
|
- tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
- tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- tradingBoxItem.setUpdateTime(new Date());
|
|
|
- tradingBoxItem.setPortId(billsHYJK.getPodId());
|
|
|
- tradingBoxItem.setPortCode(billsHYJK.getPodCode());
|
|
|
- tradingBoxItem.setPortCname(billsHYJK.getPodCnName());
|
|
|
- tradingBoxItem.setPortEname(billsHYJK.getPodEnName());
|
|
|
- tradingBoxItem.setPodFreeBoxUseDays(billsHYJK.getPodFreeBoxUseDays());
|
|
|
- tradingBoxItem.setEta(billsHYJK.getEta());
|
|
|
- tradingBoxItem.setActualEta(billsHYJK.getActualEta());
|
|
|
- tradingBoxItemOldList.add(tradingBoxItem);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if ("OW(拿)".contains(putBoxOld.getBoxClass())) {
|
|
|
- archivesDateleList.add(archives.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- archives.setUpdateTime(new Date());
|
|
|
- archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
- archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- archives.setStatus("待使用");
|
|
|
- archives.setNewDate(podStationR.getReturnEmptyTime());
|
|
|
- archives.setBoxDynamics("空箱提箱进场");
|
|
|
- archives.setWhetherTransfer("0");
|
|
|
- archives.setAddressId(billsHYJK.getPodId());
|
|
|
- archives.setAddressCode(billsHYJK.getPodCode());
|
|
|
- archives.setAddressCname(billsHYJK.getPodCnName());
|
|
|
- archives.setAddressEname(billsHYJK.getPodEnName());
|
|
|
- archives.setStationId(podStationR.getPodStationId());
|
|
|
- archives.setStationCode(podStationR.getPodStationCode());
|
|
|
- archives.setStationCname(podStationR.getPodStationCname());
|
|
|
- archives.setStationEname(podStationR.getPodStationEname());
|
|
|
- archives.setContainerNumberOw("");
|
|
|
- archives.setContainerNumberTypeOw("");
|
|
|
- archivesArrayList.add(archives);
|
|
|
- if (!containerNumberType.equals("OW(拿)")) {
|
|
|
- //新放箱号数据处理
|
|
|
- PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
|
|
|
- && e.getPolId().equals(archives.getAddressId()) && e.getPolStationId().equals(archives.getStationId())
|
|
|
- && e.getBoxType().equals(archives.getTypeName())).findFirst().orElse(null);
|
|
|
- if (putBox != null) {
|
|
|
- //放箱号明细数据处理
|
|
|
- PutBoxItems putBoxItem;
|
|
|
- if (!putBoxItemsList.isEmpty()) {
|
|
|
- putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(archives.getCode())
|
|
|
- && putBox.getId().equals(e.getPid())).findFirst().orElse(null);
|
|
|
- if (putBoxItem != null) {
|
|
|
- putBoxItem.setBoxDynamics("空箱提箱进场");
|
|
|
- putBoxItem.setStatus("待使用");
|
|
|
- putBoxItem.setPolCyId(podStationR.getPodStationId());
|
|
|
- putBoxItem.setPolCyCode(podStationR.getPodStationCode());
|
|
|
- putBoxItem.setPolCyCname(podStationR.getPodStationCname());
|
|
|
- putBoxItem.setPolCyEname(podStationR.getPodStationEname());
|
|
|
- putBoxItem.setPolPickUpDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setPolPreAppearanceDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
- putBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- putBoxItem.setUpdateTime(new Date());
|
|
|
-
|
|
|
- putBoxItem.setPodEmptyContainerReturnDate(null);
|
|
|
- putBoxItem.setPodStationId(null);
|
|
|
- putBoxItem.setPodStationCode(null);
|
|
|
- putBoxItem.setPodStationCname(null);
|
|
|
- putBoxItem.setPodStationEname(null);
|
|
|
- putBoxItem.setEta(null);
|
|
|
- putBoxItem.setCorpId(0L);
|
|
|
- putBoxItem.setCorpName("");
|
|
|
- putBoxItem.setMblno("");
|
|
|
- putBoxItem.setHblno("");
|
|
|
- putBoxItem.setShipNameId(0L);
|
|
|
- putBoxItem.setShipCname("");
|
|
|
- putBoxItem.setShipEname("");
|
|
|
- putBoxItem.setShipCode("");
|
|
|
- putBoxItem.setVoyage("");
|
|
|
- putBoxItem.setPodCyAddress("");
|
|
|
- putBoxItem.setPodCyContact("");
|
|
|
- putBoxItem.setPodCyEmail("");
|
|
|
- putBoxItem.setPodCyTel("");
|
|
|
- putBoxItem.setEtd(null);
|
|
|
- putBoxItem.setPolFreeBoxUseDays(0);
|
|
|
- putBoxItem.setPolStationEmptyContainerExitDate(null);
|
|
|
- putBoxItem.setPolReturnDate(null);
|
|
|
- putBoxItem.setPolOverdueBoxUseDays(0);
|
|
|
- putBoxItem.setPodFreeBoxUseDays(0);
|
|
|
- putBoxItem.setPodBoxUseDays(0);
|
|
|
- putBoxItem.setAgentName("");
|
|
|
- putBoxItem.setActualEtd(null);
|
|
|
- putBoxItem.setActualEta(null);
|
|
|
- } else {
|
|
|
- putBoxItem = new PutBoxItems();
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
- putBoxItem.setBoxBelongsTo("SOC");
|
|
|
- putBoxItem.setBoxCondition("新");
|
|
|
- putBoxItem.setBoxStatus("好");
|
|
|
- putBoxItem.setStatus("待使用");
|
|
|
- putBoxItem.setPid(putBox.getId());
|
|
|
- putBoxItem.setContainerNumber(archives.getContainerNumber());
|
|
|
- putBoxItem.setBoxCode(archives.getCode());
|
|
|
- putBoxItem.setBoxType(archives.getTypeName());
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
- putBoxItem.setBoxDynamics("空箱提箱进场");
|
|
|
- putBoxItem.setPolCyId(podStationR.getPodStationId());
|
|
|
- putBoxItem.setPolCyCode(podStationR.getPodStationCode());
|
|
|
- putBoxItem.setPolCyCname(podStationR.getPodStationCname());
|
|
|
- putBoxItem.setPolCyEname(podStationR.getPodStationEname());
|
|
|
- putBoxItem.setPolPickUpDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setPolPreAppearanceDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
- putBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
- putBoxItem.setCreateTime(new Date());
|
|
|
- }
|
|
|
- } else {
|
|
|
- putBoxItem = new PutBoxItems();
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
- putBoxItem.setBoxBelongsTo("SOC");
|
|
|
- putBoxItem.setBoxCondition("新");
|
|
|
- putBoxItem.setBoxStatus("好");
|
|
|
- putBoxItem.setStatus("待使用");
|
|
|
- putBoxItem.setPid(putBox.getId());
|
|
|
- putBoxItem.setContainerNumber(archives.getContainerNumber());
|
|
|
- putBoxItem.setBoxCode(archives.getCode());
|
|
|
- putBoxItem.setBoxType(archives.getTypeName());
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
- putBoxItem.setBoxDynamics("空箱提箱进场");
|
|
|
- putBoxItem.setPolCyId(podStationR.getPodStationId());
|
|
|
- putBoxItem.setPolCyCode(podStationR.getPodStationCode());
|
|
|
- putBoxItem.setPolCyCname(podStationR.getPodStationCname());
|
|
|
- putBoxItem.setPolCyEname(podStationR.getPodStationEname());
|
|
|
- putBoxItem.setPolPickUpDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setPolPreAppearanceDate(podStationR.getReturnEmptyTime());
|
|
|
- putBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
- putBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
- putBoxItem.setCreateTime(new Date());
|
|
|
- }
|
|
|
- putBoxItemsNewList.add(putBoxItem);
|
|
|
- if (putBoxNewList.isEmpty()) {
|
|
|
- putBoxNewList.add(putBox);
|
|
|
- } else {
|
|
|
- PutBox putBox2 = putBoxNewList.stream().filter(e -> e.getContainerNumber().equals(putBox.getContainerNumber())
|
|
|
- && e.getPolId().equals(putBox.getPolId()) && e.getPolStationId().equals(putBox.getPolStationId())
|
|
|
- && e.getBoxType().equals(putBox.getBoxType())).findFirst().orElse(null);
|
|
|
- if (putBox2 == null) {
|
|
|
- putBoxNewList.add(putBox2);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- throw new RuntimeException("放箱号:" + archives.getContainerNumberOw() + "未查到");
|
|
|
- }
|
|
|
- }
|
|
|
- item.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
|
|
|
- item.setPodStationId(podStationR.getPodStationId());
|
|
|
- item.setPodStationCname(podStationR.getPodStationCname());
|
|
|
- item.setPodStationEname(podStationR.getPodStationEname());
|
|
|
- item.setPodStationCode(podStationR.getPodStationCode());
|
|
|
- item.setWhetherFee("1");
|
|
|
- item.setUpdateTime(new Date());
|
|
|
- item.setUpdateUser(AuthUtil.getUserId());
|
|
|
- item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- containersListNew.add(item);
|
|
|
- }
|
|
|
- if (!archivesArrayList.isEmpty()) {
|
|
|
- archivesService.updateBatchById(archivesArrayList);
|
|
|
- }
|
|
|
- if (!putBoxNewList.isEmpty()) {
|
|
|
- for (PutBox item : putBoxNewList) {
|
|
|
- if (!putBoxItemsNewList.isEmpty()) {
|
|
|
- long count = putBoxItemsNewList.stream().filter(e -> e.getPid().equals(item.getId())).count();
|
|
|
- item.setTotalNum((ObjectUtils.isNull(item.getTotalNum()) ? 0 : item.getTotalNum())
|
|
|
- + Integer.parseInt(count + ""));
|
|
|
- item.setRemainingNum((ObjectUtils.isNull(item.getRemainingNum()) ? 0 : item.getRemainingNum()) + Integer.parseInt(count + ""));
|
|
|
- item.setStorageNum((ObjectUtils.isNull(item.getStorageNum()) ? 0 : item.getStorageNum()) + Integer.parseInt(count + ""));
|
|
|
- item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
- putBoxMapper.updateById(item);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (!putBoxItemsNewList.isEmpty()) {
|
|
|
- putBoxItemsService.saveOrUpdateBatch(putBoxItemsNewList);
|
|
|
- for (PutBoxItems item : putBoxItemsNewList) {
|
|
|
- PutBox putBox = putBoxNewList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
- if (putBox != null) {
|
|
|
- //记录箱轨迹信息
|
|
|
- ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
|
|
|
- archivesTrajectory.setPortId(putBox.getPolId());
|
|
|
- archivesTrajectory.setPortCode(putBox.getPolCode());
|
|
|
- archivesTrajectory.setPortCname(putBox.getPolCname());
|
|
|
- archivesTrajectory.setPortEname(putBox.getPolEname());
|
|
|
- archivesTrajectory.setStationId(putBox.getPolStationId());
|
|
|
- archivesTrajectory.setStationCode(putBox.getPolStationCode());
|
|
|
- archivesTrajectory.setStationCname(putBox.getPolStationCname());
|
|
|
- archivesTrajectory.setStationEname(putBox.getPolStationEname());
|
|
|
- archivesTrajectory.setContainerNumber(item.getContainerNumber());
|
|
|
- archivesTrajectory.setBoxType(item.getBoxType());
|
|
|
- archivesTrajectory.setBoxCategory(item.getBoxClass());
|
|
|
- archivesTrajectory.setBoxEastId(item.getBoxEastId());
|
|
|
- archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
- archivesTrajectory.setMblno(item.getMblno());
|
|
|
- archivesTrajectory.setHblno(item.getHblno());
|
|
|
- archivesTrajectory.setBoxDynamics("客户还箱");
|
|
|
- archivesTrajectory.setStatus(item.getBoxDynamics());
|
|
|
- archivesTrajectory.setBillType(putBox.getBoxClass());
|
|
|
- archivesTrajectory.setCode(item.getBoxCode());
|
|
|
- archivesTrajectory.setNewDate(new Date());
|
|
|
- archivesTrajectory.setCreateTime(new Date());
|
|
|
- archivesTrajectory.setCreateUser(AuthUtil.getUserId());
|
|
|
- archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
|
|
|
- archivesTrajectory.setTenantId(AuthUtil.getTenantId());
|
|
|
- archivesTrajectory.setSrcId(putBox.getId());
|
|
|
- archivesTrajectory.setEtd(item.getEtd());
|
|
|
- archivesTrajectory.setPolCyId(item.getPolCyId());
|
|
|
- archivesTrajectory.setPolCyCode(item.getPolCyCode());
|
|
|
- archivesTrajectory.setPolCyCname(item.getPolCyCname());
|
|
|
- archivesTrajectory.setPolCyEname(item.getPolCyEname());
|
|
|
- archivesTrajectory.setPolFreeBoxUseDays(item.getPolFreeBoxUseDays());
|
|
|
- archivesTrajectory.setPolPreAppearanceDate(item.getPolPreAppearanceDate());
|
|
|
- archivesTrajectory.setPolStationEmptyContainerExitDate(item.getPolStationEmptyContainerExitDate());
|
|
|
- archivesTrajectory.setPolReturnDate(item.getPolReturnDate());
|
|
|
- archivesTrajectory.setPolOverdueBoxUseDays(item.getPolOverdueBoxUseDays());
|
|
|
- archivesTrajectory.setEta(item.getEta());
|
|
|
- archivesTrajectory.setPodEmptyContainerReturnDate(item.getPodEmptyContainerReturnDate());
|
|
|
- archivesTrajectory.setPodStationId(item.getPodStationId());
|
|
|
- archivesTrajectory.setPodStationCode(item.getPodStationCode());
|
|
|
- archivesTrajectory.setPodStationCname(item.getPodStationCname());
|
|
|
- archivesTrajectory.setPodStationEname(item.getPodStationEname());
|
|
|
- archivesTrajectory.setPodFreeBoxUseDays(item.getPodFreeBoxUseDays());
|
|
|
- archivesTrajectory.setPodBoxUseDays(item.getPodBoxUseDays());
|
|
|
- archivesTrajectory.setShipNameId(item.getShipNameId());
|
|
|
- archivesTrajectory.setShipCname(item.getShipCname());
|
|
|
- archivesTrajectory.setShipEname(item.getShipEname());
|
|
|
- archivesTrajectory.setShipCode(item.getShipCode());
|
|
|
- archivesTrajectory.setVoyage(item.getVoyage());
|
|
|
- archivesTrajectoryMapper.insert(archivesTrajectory);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (!putBoxItemsOldList.isEmpty()) {
|
|
|
- putBoxItemsService.updateBatchById(putBoxItemsOldList);
|
|
|
- }
|
|
|
- if (!tradingBoxItemOldList.isEmpty()) {
|
|
|
- tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
|
|
|
- }
|
|
|
- if (!containersListNew.isEmpty()) {
|
|
|
- containersService.updateBatchById(containersListNew);
|
|
|
- }
|
|
|
- if (!archivesDateleList.isEmpty()) {
|
|
|
- archivesService.removeByIds(archivesDateleList);
|
|
|
- }
|
|
|
- //计算超期箱使费
|
|
|
- this.countOverdueFeeV1(billsHYJK, tradingBoxList, tradingBoxItemOldList, putBoxItemsOldList, putBoxList);
|
|
|
- }
|
|
|
- } else {*/
|
|
|
for (Containers item : containersHYJKList) {
|
|
|
if (ObjectUtils.isNull(item.getHblno())) {
|
|
|
throw new RuntimeException("分单号不能为空");
|
|
|
@@ -3628,6 +3217,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ logUtils.saveOperationLog(OperatorType.EMPTY_CONTAINER_RETURN, "修改Pod场站", item.getId());
|
|
|
}
|
|
|
containersService.updateBatchById(containersHYJKList);
|
|
|
List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
@@ -3663,6 +3253,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ logUtils.saveOperationLog(OperatorType.EMPTY_CONTAINER_RETURN, "修改Pod场站", item.getId());
|
|
|
}
|
|
|
containersService.updateBatchById(containersList);
|
|
|
}
|
|
|
@@ -3685,6 +3276,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ logUtils.saveOperationLog(OperatorType.POD_ENCORE, "修改POD场站", item.getId());
|
|
|
}
|
|
|
containersService.updateBatchById(containersHYJKList);
|
|
|
List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
@@ -3719,6 +3311,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ logUtils.saveOperationLog(OperatorType.POD_ENCORE, "修改POD场站", item.getId());
|
|
|
}
|
|
|
containersService.updateBatchById(containersList);
|
|
|
}
|