|
|
@@ -54,14 +54,13 @@ import org.springblade.los.box.dto.BoxPoolDTO;
|
|
|
import org.springblade.los.box.dto.BoxPoolItemDTO;
|
|
|
import org.springblade.los.box.dto.BoxPoolPortDTO;
|
|
|
import org.springblade.los.box.entity.*;
|
|
|
-import org.springblade.los.box.excel.EmptyContainerAppearance;
|
|
|
-import org.springblade.los.box.excel.EmptyContainerAppearanceAnalysis;
|
|
|
-import org.springblade.los.box.excel.GiveAnEncore;
|
|
|
+import org.springblade.los.box.excel.*;
|
|
|
import org.springblade.los.box.mapper.ArchivesTrajectoryMapper;
|
|
|
import org.springblade.los.box.mapper.PutBoxMapper;
|
|
|
import org.springblade.los.box.mapper.TradingBoxMapper;
|
|
|
import org.springblade.los.box.service.*;
|
|
|
import org.springblade.los.box.vo.PutBoxVO;
|
|
|
+import org.springblade.los.business.files.entity.FilesCenter;
|
|
|
import org.springblade.los.business.sea.entity.Bills;
|
|
|
import org.springblade.los.business.sea.entity.Containers;
|
|
|
import org.springblade.los.business.sea.mapper.BillsMapper;
|
|
|
@@ -244,8 +243,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
putBox.setCreateUserName(AuthUtil.getUserName());
|
|
|
putBox.setTenantId(AuthUtil.getTenantId());
|
|
|
putBox.setWhetherManuallyCreate("0");
|
|
|
- putBox.setBusType("自有箱");
|
|
|
- putBox.setBoxClass("自有箱");
|
|
|
putBox.setVersion(0);
|
|
|
baseMapper.insert(putBox);
|
|
|
} else {
|
|
|
@@ -365,79 +362,50 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
PutBox putBox1 = baseMapper.selectOne(new LambdaQueryWrapper<PutBox>()
|
|
|
.eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PutBox::getIsDeleted, 0)
|
|
|
- .eq(PutBox::getContainerNumber, putBox.getContainerNumber()));
|
|
|
- PutBox detail = new PutBox();
|
|
|
- if (putBox1 != null) {
|
|
|
- detail = putBox1;
|
|
|
- detail.setRemainingNum(detail.getRemainingNum() + putBox.getPutBoxItemsList().size());
|
|
|
- detail.setStorageNum(detail.getStorageNum() + putBox.getPutBoxItemsList().size());
|
|
|
- baseMapper.updateById(detail);
|
|
|
- if (putBoxOld.getStorageNum() < putBox.getPutBoxItemsList().size()) {
|
|
|
- throw new RuntimeException("场地盘存数量不能小于本次操作数量");
|
|
|
- }
|
|
|
- putBoxOld.setStorageNum(putBoxOld.getStorageNum() - putBox.getPutBoxItemsList().size());
|
|
|
- putBoxOld.setRemainingNum(putBoxOld.getRemainingNum() - putBox.getPutBoxItemsList().size());
|
|
|
+ .eq(PutBox::getContainerNumber, putBox.getContainerNumber())
|
|
|
+ .eq(PutBox::getBoxType, putBox.getBoxType())
|
|
|
+ .eq(PutBox::getPolId, putBox.getPolId())
|
|
|
+ .eq(PutBox::getPolStationId, putBox.getPolStationId())
|
|
|
+ .like(ObjectUtils.isNotNull(putBox.getPodId()), PutBox::getPodId, putBox.getPodId())
|
|
|
+ .eq(PutBox::getBoxClass, putBox.getBoxClass())
|
|
|
+ .last("LIMIT 1"));
|
|
|
+ if (putBox1 == null) {
|
|
|
+ throw new RuntimeException("未查到符合条件放箱号,请先创建");
|
|
|
+ }
|
|
|
+ putBox1.setRemainingNum(putBox1.getRemainingNum() + putBox.getPutBoxItemsList().size());
|
|
|
+ putBox1.setStorageNum(putBox1.getStorageNum() + putBox.getPutBoxItemsList().size());
|
|
|
+ putBox1.setVersion(putBox1.getVersion() + 1);
|
|
|
+ String codes = putBox.getPutBoxItemsList().stream().map(PutBoxItems::getBoxCode).collect(Collectors.joining(","));
|
|
|
+ if (ObjectUtils.isNotNull(putBox1.getCode())) {
|
|
|
+ putBox1.setCode(putBox1.getCode() + "," + codes);
|
|
|
} else {
|
|
|
- BeanUtil.copyProperties(putBoxOld, detail);
|
|
|
- detail.setId(null);
|
|
|
- detail.setUpdateUser(0L);
|
|
|
- detail.setUpdateUserName("");
|
|
|
- detail.setUpdateTime(null);
|
|
|
- detail.setCreateUser(AuthUtil.getUserId());
|
|
|
- detail.setCreateUserName(AuthUtil.getUserName());
|
|
|
- detail.setCreateTime(new Date());
|
|
|
- detail.setContainerNumber(putBox.getContainerNumber());
|
|
|
- String businessTypeCode = "FXH";
|
|
|
- String billNoFormat;
|
|
|
- String billNoFormatInternal = "FXH-N";
|
|
|
- if ("自有箱".equals(detail.getBusType())) {
|
|
|
- billNoFormat = "FXH-ZY";
|
|
|
- } else if ("代理箱".equals(detail.getBusType())) {
|
|
|
- billNoFormat = "FXH-DL";
|
|
|
- } else if ("OW(拿),OW(放)".contains(detail.getBusType())) {
|
|
|
- billNoFormat = "FXH-OW";
|
|
|
- } else {
|
|
|
- billNoFormat = "FXH-ZY";
|
|
|
- billNoFormatInternal = "FXH-N";
|
|
|
- }
|
|
|
- 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, businessTypeCode));
|
|
|
- if (businessType == null) {
|
|
|
- throw new RuntimeException("未找到可用业务类型");
|
|
|
- }
|
|
|
- BusinessBillNo businessBillNo1 = new BusinessBillNo();
|
|
|
- businessBillNo1.setBusinessTypeId(businessType.getId());
|
|
|
- businessBillNo1.setCode(billNoFormatInternal);
|
|
|
- R clientBillNo1 = businessBillNoService.getBillNoLos(businessBillNo1);
|
|
|
- if (!clientBillNo1.isSuccess()) {
|
|
|
- throw new RuntimeException("生成订单编号失败");
|
|
|
- }
|
|
|
- detail.setInternalContainerNumber((String) clientBillNo1.getData());
|
|
|
- BusinessBillNo businessBillNo = new BusinessBillNo();
|
|
|
- businessBillNo.setBusinessTypeId(businessType.getId());
|
|
|
- businessBillNo.setCode(billNoFormat);
|
|
|
- R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
|
|
|
- if (!clientBillNo.isSuccess()) {
|
|
|
- throw new RuntimeException("生成订单编号失败");
|
|
|
- }
|
|
|
- detail.setSysNo((String) clientBillNo.getData());
|
|
|
- detail.setTotalNum(putBox.getPutBoxItemsList().size());
|
|
|
- detail.setOccupyNum(0);
|
|
|
- detail.setRemainingNum(putBox.getPutBoxItemsList().size());
|
|
|
- baseMapper.insert(detail);
|
|
|
- putBoxOld.setTotalNum(putBoxOld.getTotalNum() - detail.getTotalNum());
|
|
|
- if (putBoxOld.getTotalNum() - putBoxOld.getOccupyNum() < 0) {
|
|
|
- throw new RuntimeException("场地盘存数量不能小于操作占用数量");
|
|
|
- }
|
|
|
- putBoxOld.setRemainingNum(putBoxOld.getTotalNum() - putBoxOld.getOccupyNum());
|
|
|
+ putBox1.setCode(codes);
|
|
|
+ }
|
|
|
+ baseMapper.updateById(putBox1);
|
|
|
+ if (putBoxOld.getStorageNum() < putBox.getPutBoxItemsList().size()) {
|
|
|
+ throw new RuntimeException("场地盘存数量不能小于本次操作数量");
|
|
|
}
|
|
|
+ if (putBoxOld.getRemainingNum() < putBox.getPutBoxItemsList().size()) {
|
|
|
+ throw new RuntimeException("可用数量不能小于本次操作数量");
|
|
|
+ }
|
|
|
+ putBoxOld.setStorageNum(putBoxOld.getStorageNum() - putBox.getPutBoxItemsList().size());
|
|
|
+ putBoxOld.setRemainingNum(putBoxOld.getRemainingNum() - putBox.getPutBoxItemsList().size());
|
|
|
putBoxOld.setUpdateTime(new Date());
|
|
|
putBoxOld.setUpdateUserName(AuthUtil.getUserName());
|
|
|
putBoxOld.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ putBoxOld.setVersion(putBoxOld.getVersion() + 1);
|
|
|
+ if (ObjectUtils.isNotNull(putBoxOld.getCode())) {
|
|
|
+ String[] arr = putBoxOld.getCode().split(",");
|
|
|
+ List<String> codeList = new ArrayList<>();
|
|
|
+ for (String item : arr) {
|
|
|
+ if (!codes.contains(item)) {
|
|
|
+ codeList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!codeList.isEmpty()) {
|
|
|
+ putBoxOld.setCode(String.join(",", codeList));
|
|
|
+ }
|
|
|
+ }
|
|
|
baseMapper.updateById(putBoxOld);
|
|
|
List<PutBoxItems> putBoxItemsList = putBox.getPutBoxItemsList();
|
|
|
List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
|
|
|
@@ -446,25 +414,25 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
.in(Archives::getCode, putBoxItemsList.stream().map(PutBoxItems::getBoxCode).distinct().collect(Collectors.toList())));
|
|
|
List<Archives> archives = new ArrayList<>();
|
|
|
for (PutBoxItems item : putBoxItemsList) {
|
|
|
- item.setPid(detail.getId());
|
|
|
+ item.setPid(putBox1.getId());
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- item.setContainerNumber(detail.getContainerNumber());
|
|
|
+ item.setContainerNumber(putBox1.getContainerNumber());
|
|
|
if (!archivesList.isEmpty()) {
|
|
|
Archives archives1 = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
if (archives1 != null) {
|
|
|
- archives1.setAddressId(detail.getPolId());
|
|
|
- archives1.setAddressCname(detail.getPolCname());
|
|
|
- archives1.setAddressEname(detail.getPolEname());
|
|
|
- archives1.setAddressCode(detail.getPolCode());
|
|
|
- archives1.setStationId(detail.getPolStationId());
|
|
|
- archives1.setStationCname(detail.getPolStationCname());
|
|
|
- archives1.setStationEname(detail.getPolStationEname());
|
|
|
- archives1.setStationCode(detail.getPolStationCode());
|
|
|
+ archives1.setAddressId(putBox1.getPolId());
|
|
|
+ archives1.setAddressCname(putBox1.getPolCname());
|
|
|
+ archives1.setAddressEname(putBox1.getPolEname());
|
|
|
+ archives1.setAddressCode(putBox1.getPolCode());
|
|
|
+ archives1.setStationId(putBox1.getPolStationId());
|
|
|
+ archives1.setStationCname(putBox1.getPolStationCname());
|
|
|
+ archives1.setStationEname(putBox1.getPolStationEname());
|
|
|
+ archives1.setStationCode(putBox1.getPolStationCode());
|
|
|
archives1.setNewDate(new Date());
|
|
|
- archives1.setContainerNumber(detail.getContainerNumber());
|
|
|
- archives1.setContainerNumberType(detail.getBoxClass());
|
|
|
+ archives1.setContainerNumber(putBox1.getContainerNumber());
|
|
|
+ archives1.setContainerNumberType(putBox1.getBoxClass());
|
|
|
archives.add(archives1);
|
|
|
} else {
|
|
|
throw new RuntimeException("箱号:" + item.getBoxCode() + "不在箱档案中");
|
|
|
@@ -472,14 +440,14 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
//记录箱轨迹信息
|
|
|
ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
|
|
|
- archivesTrajectory.setPortId(detail.getPolId());
|
|
|
- archivesTrajectory.setPortCname(detail.getPolCname());
|
|
|
- archivesTrajectory.setPortEname(detail.getPolEname());
|
|
|
- archivesTrajectory.setPortCode(detail.getPolCode());
|
|
|
- archivesTrajectory.setStationId(detail.getPolStationId());
|
|
|
- archivesTrajectory.setStationCname(detail.getPolStationCname());
|
|
|
- archivesTrajectory.setStationEname(detail.getPolStationEname());
|
|
|
- archivesTrajectory.setStationCode(detail.getPolStationCode());
|
|
|
+ archivesTrajectory.setPortId(putBox1.getPolId());
|
|
|
+ archivesTrajectory.setPortCname(putBox1.getPolCname());
|
|
|
+ archivesTrajectory.setPortEname(putBox1.getPolEname());
|
|
|
+ archivesTrajectory.setPortCode(putBox1.getPolCode());
|
|
|
+ archivesTrajectory.setStationId(putBox1.getPolStationId());
|
|
|
+ archivesTrajectory.setStationCname(putBox1.getPolStationCname());
|
|
|
+ archivesTrajectory.setStationEname(putBox1.getPolStationEname());
|
|
|
+ archivesTrajectory.setStationCode(putBox1.getPolStationCode());
|
|
|
archivesTrajectory.setNewDate(new Date());
|
|
|
archivesTrajectory.setContainerNumber(item.getContainerNumber());
|
|
|
archivesTrajectory.setBoxType(item.getBoxType());
|
|
|
@@ -492,14 +460,14 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
archivesTrajectory.setStatus("更改放箱号");
|
|
|
archivesTrajectory.setCorpId(item.getBoxEastId());
|
|
|
archivesTrajectory.setCorpName(item.getBoxEastName());
|
|
|
- archivesTrajectory.setBillType(detail.getBoxClass());
|
|
|
+ archivesTrajectory.setBillType(putBox1.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(detail.getId());
|
|
|
+ archivesTrajectory.setSrcId(putBox1.getId());
|
|
|
archivesTrajectory.setEtd(item.getEtd());
|
|
|
archivesTrajectory.setPolCyId(item.getPolCyId());
|
|
|
archivesTrajectory.setPolCyCode(item.getPolCyCode());
|
|
|
@@ -4815,10 +4783,20 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
throw new RuntimeException("放箱号:" + item.getContainerNumber() + "已导入箱号,撤销失败!");
|
|
|
}
|
|
|
}
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setIsDeleted(1);
|
|
|
}
|
|
|
- this.removeByIds(longList);
|
|
|
+ this.updateBatchById(putBoxList);
|
|
|
if (!boxItemsList.isEmpty()) {
|
|
|
- putBoxItemsService.removeByIds(boxItemsList.stream().map(PutBoxItems::getId).collect(Collectors.toList()));
|
|
|
+ for (PutBoxItems item : boxItemsList) {
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setIsDeleted(1);
|
|
|
+ }
|
|
|
+ putBoxItemsService.updateBatchById(boxItemsList);
|
|
|
}
|
|
|
return R.success("删除成功");
|
|
|
}
|
|
|
@@ -4887,9 +4865,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BoxPoolPortDTO> listPortExport(BoxPoolDTO boxPoolDTO) {
|
|
|
+ public List<PortExcel> listPortExport(BoxPoolDTO boxPoolDTO) {
|
|
|
boxPoolDTO.setTenantId(AuthUtil.getTenantId());
|
|
|
List<BoxPoolPortDTO> boxPoolPortDTOList = baseMapper.listPortExport(boxPoolDTO);
|
|
|
+ List<PortExcel> portExcelList = new ArrayList<>();
|
|
|
if (!boxPoolPortDTOList.isEmpty()) {
|
|
|
for (BoxPoolPortDTO item : boxPoolPortDTOList) {
|
|
|
List<Map<String, Long>> mapList = baseMapper.selectBoxNumber(item.getPortId(), boxPoolDTO.getWhetherLoseEfficacy(),
|
|
|
@@ -4914,25 +4893,31 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
otherBad = otherBad + map.get("otherBad");
|
|
|
}
|
|
|
}
|
|
|
- item.setGP20Good(gP20Good);
|
|
|
- item.setGP40Good(gP40Good);
|
|
|
- item.setHG40Good(hG40Good);
|
|
|
- item.setOtherGood(otherGood);
|
|
|
- item.setGP20Bad(gP20Bad);
|
|
|
- item.setGP40Bad(gP40Bad);
|
|
|
- item.setHG40Bad(hG40Bad);
|
|
|
- item.setOtherBad(otherBad);
|
|
|
- item.setTotal(gP20Good + gP40Good + hG40Good + otherGood + gP20Bad + gP40Bad + hG40Bad + otherBad);
|
|
|
-// item.setRemainingTotal(item.getTotal());
|
|
|
- }
|
|
|
- }
|
|
|
- return boxPoolPortDTOList;
|
|
|
+ PortExcel portExcel = new PortExcel();
|
|
|
+ portExcel.setPortName(item.getPortName());
|
|
|
+ portExcel.setStationName(item.getStationName());
|
|
|
+ portExcel.setBusType(item.getBusType());
|
|
|
+ portExcel.setTotal(gP20Good + gP40Good + hG40Good + otherGood + gP20Bad + gP40Bad + hG40Bad + otherBad);
|
|
|
+ portExcel.setRemainingTotal(item.getRemainingTotal());
|
|
|
+ portExcel.setTwentyGpGood(gP20Good + "");
|
|
|
+ portExcel.setFortyGPGood(gP40Good + "");
|
|
|
+ portExcel.setFortyHCGood(hG40Good + "");
|
|
|
+ portExcel.setOtherGood(otherGood + "");
|
|
|
+ portExcel.setTwentyGpBad(gP20Bad + "");
|
|
|
+ portExcel.setFortyGPBad(gP40Bad + "");
|
|
|
+ portExcel.setFortyHCBad(hG40Bad + "");
|
|
|
+ portExcel.setOtherBad(otherBad + "");
|
|
|
+ portExcelList.add(portExcel);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return portExcelList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BoxPoolContainerNumberDTO> listContainerNumberExport(BoxPoolDTO boxPoolDTO) {
|
|
|
+ public List<ContainerNumberExcel> listContainerNumberExport(BoxPoolDTO boxPoolDTO) {
|
|
|
boxPoolDTO.setTenantId(AuthUtil.getTenantId());
|
|
|
List<BoxPoolContainerNumberDTO> putBoxList = baseMapper.listContainerNumberExport(boxPoolDTO);
|
|
|
+ List<ContainerNumberExcel> containerNumberExcels = new ArrayList<>();
|
|
|
if (!putBoxList.isEmpty()) {
|
|
|
List<Long> ids = putBoxList.stream().map(BoxPoolContainerNumberDTO::getId).collect(Collectors.toList());
|
|
|
List<PutBoxItems> boxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
|
|
|
@@ -4941,20 +4926,29 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
.eq(PutBoxItems::getStatus, "待使用")
|
|
|
.in(PutBoxItems::getPid, ids));
|
|
|
for (BoxPoolContainerNumberDTO item : putBoxList) {
|
|
|
- item.setTotal(0L);
|
|
|
+ ContainerNumberExcel excel = new ContainerNumberExcel();
|
|
|
+ excel.setTotal(0L);
|
|
|
if (!boxItemsList.isEmpty()) {
|
|
|
List<PutBoxItems> itemsList = boxItemsList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
|
|
|
if (!itemsList.isEmpty()) {
|
|
|
- item.setGood(itemsList.stream().filter(e -> "好箱".equals(e.getBoxStatus()) && item.getBoxType().equals(e.getBoxType())).count());
|
|
|
- item.setBad(itemsList.stream().filter(e -> "坏箱".equals(e.getBoxStatus()) && item.getBoxType().equals(e.getBoxType())).count());
|
|
|
- item.setTotal(item.getGood() + item.getBad());
|
|
|
+ excel.setGood(itemsList.stream().filter(e -> "好箱".equals(e.getBoxStatus()) && item.getBoxType().equals(e.getBoxType())).count());
|
|
|
+ excel.setBad(itemsList.stream().filter(e -> "坏箱".equals(e.getBoxStatus()) && item.getBoxType().equals(e.getBoxType())).count());
|
|
|
+ excel.setTotal(excel.getGood() + excel.getBad());
|
|
|
}
|
|
|
}
|
|
|
- item.setOccupyNum(item.getOccupyNum());
|
|
|
- item.setRemainingTotal(item.getRemainingNum());
|
|
|
- }
|
|
|
- }
|
|
|
- return putBoxList;
|
|
|
+ excel.setContainerNumber(item.getContainerNumber());
|
|
|
+ excel.setBusType(item.getBusType());
|
|
|
+ excel.setPolName(item.getPolName());
|
|
|
+ excel.setPolStationName(item.getPolStationName());
|
|
|
+ excel.setPodName(item.getPodName());
|
|
|
+ excel.setPodStationName(item.getPodStationName());
|
|
|
+ excel.setBoxType(item.getBoxType());
|
|
|
+ excel.setOccupyNum(item.getOccupyNum());
|
|
|
+ excel.setRemainingTotal(item.getRemainingNum());
|
|
|
+ containerNumberExcels.add(excel);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return containerNumberExcels;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -4984,6 +4978,51 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<PortItemExcel> listPortExportItems(BoxPoolDTO boxPoolDTO) {
|
|
|
+ boxPoolDTO.setTenantId(AuthUtil.getTenantId());
|
|
|
+ List<BoxPoolPortDTO> boxPoolPortDTOList = baseMapper.listPortExport(boxPoolDTO);
|
|
|
+ List<PortItemExcel> putBoxItemsList = new ArrayList<>();
|
|
|
+ if (!boxPoolPortDTOList.isEmpty()) {
|
|
|
+ for (BoxPoolPortDTO item : boxPoolPortDTOList) {
|
|
|
+ List<PortItemExcel> portItemExcels = putBoxItemsService.selectPutBoxItemsList(item.getPortId(), boxPoolDTO.getWhetherLoseEfficacy(),
|
|
|
+ AuthUtil.getTenantId(), item.getBusType(), item.getStationId());
|
|
|
+ if (!portItemExcels.isEmpty()) {
|
|
|
+ putBoxItemsList.addAll(portItemExcels);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return putBoxItemsList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<PortItemExcel> listContainerNumberExportItems(BoxPoolDTO boxPoolDTO) {
|
|
|
+ boxPoolDTO.setTenantId(AuthUtil.getTenantId());
|
|
|
+ List<BoxPoolContainerNumberDTO> putBoxList = baseMapper.listContainerNumberExport(boxPoolDTO);
|
|
|
+ List<PortItemExcel> portItemExcelList = new ArrayList<>();
|
|
|
+ if (!putBoxList.isEmpty()) {
|
|
|
+ List<Long> ids = putBoxList.stream().map(BoxPoolContainerNumberDTO::getId).collect(Collectors.toList());
|
|
|
+ List<PutBoxItems> boxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
|
|
|
+ .eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PutBoxItems::getIsDeleted, 0)
|
|
|
+ .eq(PutBoxItems::getStatus, "待使用")
|
|
|
+ .in(PutBoxItems::getPid, ids));
|
|
|
+ for (PutBoxItems item : boxItemsList) {
|
|
|
+ BoxPoolContainerNumberDTO dto = putBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ PortItemExcel excel = new PortItemExcel();
|
|
|
+ BeanUtil.copyProperties(item, excel);
|
|
|
+ if (dto != null) {
|
|
|
+ excel.setContainerNumber(dto.getContainerNumber());
|
|
|
+ excel.setBusType(dto.getBusType());
|
|
|
+ excel.setPortName(dto.getPolName());
|
|
|
+ excel.setStationName(dto.getPolStationName());
|
|
|
+ }
|
|
|
+ portItemExcelList.add(excel);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return portItemExcelList;
|
|
|
+ }
|
|
|
+
|
|
|
private void countOverdueFeeV1(Bills billsHYJK, List<TradingBox> tradingBoxList,
|
|
|
List<TradingBoxItem> tradingBoxItemOldList, List<PutBoxItems> putBoxItemsOldList,
|
|
|
List<PutBox> putBoxList) {
|