فهرست منبع

1.RT&FD统计增加箱型检索条件
2.合约模块增加字段
3.海运进口-批量修改POD场站逻辑修改
4.用箱计划统计调试及修改
5.客户托书提交生成海运出口未生成费用明细问题修改
6.批量修改POD列表增加检索条件
7.客户托书列表收发通人列表不显示数据
8.客户托书获取报价接口增加检索条件

纪新园 8 ماه پیش
والد
کامیت
08395ae996
16فایلهای تغییر یافته به همراه725 افزوده شده و 97 حذف شده
  1. 8 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/fees/entity/LosBFeesTemplate.java
  2. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/UseBoxPlan.java
  3. 2 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfitDtoList.java
  4. 7 5
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  5. 2 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java
  6. 549 58
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  7. 3 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/RouteCostServiceImpl.java
  8. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/UseBoxPlanServiceImpl.java
  9. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/controller/MktSlotController.java
  10. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  11. 26 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BookingCabinController.java
  12. 3 5
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java
  13. 18 5
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.xml
  14. 32 16
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  15. 48 0
      blade-service/blade-los/src/main/java/org/springblade/los/excel/PodStationR.java
  16. 14 3
      blade-service/blade-los/src/main/java/org/springblade/los/excel/UpdatePodStationExcel.java

+ 8 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/fees/entity/LosBFeesTemplate.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.los.basic.fees.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -172,38 +173,45 @@ public class LosBFeesTemplate implements Serializable {
 	 * 船公司
 	 */
 	@ApiModelProperty(value = "船公司")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String shippingCompanyId;
 	/**
 	 * 船公司中文
 	 */
 	@ApiModelProperty(value = "船公司中文")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String shippingCompanyCname;
 	/**
 	 * 船公司代码
 	 */
 	@ApiModelProperty(value = "船公司代码")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String shippingCompanyCode;
 
 	/**
 	 * 港口地址
 	 */
 	@ApiModelProperty(value = "港口地址")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Long addressId;
 	/**
 	 * 港口地址中文
 	 */
 	@ApiModelProperty(value = "港口地址中文")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String addressCname;
 	/**
 	 * 港口地址代码
 	 */
 	@ApiModelProperty(value = "港口地址代码")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String addressCode;
 
 	/**
 	 * 运输条款
 	 */
 	@ApiModelProperty(value = "运输条款")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String transportationTerms;
 
 	/**

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/UseBoxPlan.java

@@ -18,9 +18,11 @@ package org.springblade.los.box.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -109,11 +111,15 @@ public class UseBoxPlan implements Serializable {
 	 * 开始日期
 	 */
 	@ApiModelProperty(value = "开始日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date startDate;
 	/**
 	 * 结束日期
 	 */
 	@ApiModelProperty(value = "结束日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date endDate;
 
 	/**

+ 2 - 2
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfitDtoList.java

@@ -83,13 +83,13 @@ public class FinanceProfitDtoList {
 	 * 起运港
 	 */
 	@ExcelProperty(value = "起运港")
-	private String pod;
+	private String pol;
 
 	/**
 	 * 目的港
 	 */
 	@ExcelProperty(value = "目的港")
-	private String pol;
+	private String pod;
 
 	/**
 	 * 中文船名

+ 7 - 5
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -797,11 +797,13 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							}
 							for (Bills item : billsList) {
 								this.dictionaryConversion(item);
-								List<FeeCenter> feeD = feeCenterListMh.stream().filter(e -> MagicValues.D.equals(e.getDc())).collect(Collectors.toList());
+								List<FeeCenter> feeD = feeCenterListMh.stream().filter(e -> MagicValues.D.equals(e.getDc()) &&
+									e.getPid().equals(item.getId())).collect(Collectors.toList());
 								item.setFeeCenterListD(feeD);
-								List<FeeCenter> feeC = feeCenterListMh.stream().filter(e -> MagicValues.C.equals(e.getDc())).collect(Collectors.toList());
+								List<FeeCenter> feeC = feeCenterListMh.stream().filter(e -> MagicValues.C.equals(e.getDc()) &&
+									e.getPid().equals(item.getId())).collect(Collectors.toList());
 								item.setFeeCenterListC(feeC);
-								List<FeeCenter> feeCenterList = feeCenterListMh.stream()
+								List<FeeCenter> feeCenterList = feeCenterListMh.stream().filter(e -> e.getPid().equals(item.getId()))
 									.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 										Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode() + f.getDc()))), ArrayList::new));
 								List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
@@ -1192,12 +1194,12 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							feeCenterReports1.setHblno(feeCentersD.get(i).getHblno());
 							feeCenterReports1.setPid(feeCentersD.get(i).getPid());
 							int finalI = i;
-							FeeCenterReports feeCenterC = feeCenterReportsC.stream()
-								.filter(e -> e.getFeeCnName().equals(feeCentersD.get(finalI).getFeeCnName()) && !"1".equals(e.getMark())).findFirst().orElse(null);
 							feeCenterReports1.setBillCorpCnName(feeCentersD.get(i).getBillCorpCnName());
 							feeCenterReports1.setAmountD(feeCentersD.get(i).getAmountD());
 							feeCenterReports1.setAmountLocD(feeCentersD.get(i).getAmountLocD());
 							feeCenterReports1.setAmountUsdD(feeCentersD.get(i).getAmountUsdD());
+							FeeCenterReports feeCenterC = feeCenterReportsC.stream()
+								.filter(e -> e.getFeeCnName().equals(feeCentersD.get(finalI).getFeeCnName()) && !"1".equals(e.getMark())).findFirst().orElse(null);
 							if (feeCenterC != null) {
 								feeCenterC.setMark("1");
 								feeCenterReports1.setCorpCnName(feeCenterC.getCorpCnName());

+ 2 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java

@@ -31,6 +31,7 @@ import org.springblade.los.box.excel.EmptyContainerAppearance;
 import org.springblade.los.box.excel.EmptyContainerAppearanceAnalysis;
 import org.springblade.los.box.vo.PutBoxVO;
 import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.excel.PodStationR;
 import org.springblade.los.excel.RouteCostProfitExcel;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -80,7 +81,7 @@ public interface IPutBoxService extends IService<PutBox> {
 
 	R emptyContainerEntry(List<EmptyContainerAppearanceAnalysis> analysisList)throws IOException;
 
-	R batchUpdatePodStation(String ids, Long podStationId, String podStationCode, String podStationCname, String podStationEname);
+	R batchUpdatePodStation(PodStationR podStationR);
 
 	R emptyContainerEntryAnalysis(MultipartFile file)throws IOException;
 

+ 549 - 58
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -27,7 +27,6 @@ import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.core.tool.utils.Func;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
@@ -63,7 +62,9 @@ import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.los.business.sea.service.IContainersService;
+import org.springblade.los.excel.PodStationR;
 import org.springblade.los.excel.RouteCostProfitExcel;
+import org.springblade.los.excel.UpdatePodStationExcel;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.resource.feign.IOssClient;
@@ -1635,9 +1636,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				//对应海运进出口单据所属公司所有币别
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
 				Date polPickUpDate;
-				if ("OW-N".equals(tradingBox.getType())){
+				if ("OW-N".equals(tradingBox.getType())) {
 					polPickUpDate = item.getPolPickUpDate();
-				}else{
+				} else {
 					polPickUpDate = item.getPolStationEmptyContainerExitDate();
 				}
 				//起运港超期天数
@@ -2899,72 +2900,562 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public R batchUpdatePodStation(String ids, Long podStationId, String podStationCode, String
-		podStationCname, String podStationEname) {
-		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+	public R batchUpdatePodStation(PodStationR podStationR) {
+		if (ObjectUtils.isNull(podStationR.getPodStationId()) || ObjectUtils.isNull(podStationR.getList()) ||
+			podStationR.getList().isEmpty()) {
+			throw new RuntimeException("缺少必要请求参数");
+		}
+		List<Long> containersIds = podStationR.getList().stream().map(UpdatePodStationExcel::getContainersId).collect(Collectors.toList());
+		List<Long> billsIds = podStationR.getList().stream().map(UpdatePodStationExcel::getId).distinct().collect(Collectors.toList());
+		List<Containers> containersHYJKList = containersService.list(new LambdaQueryWrapper<Containers>()
 			.eq(Containers::getTenantId, AuthUtil.getTenantId())
 			.eq(Containers::getIsDeleted, 0)
-			.in(Containers::getId, Func.toLongList(ids)));
-		if (containersList.isEmpty()) {
+			.in(Containers::getId, containersIds));
+		if (containersHYJKList.isEmpty()) {
 			throw new RuntimeException("未查到配箱信息");
 		}
-		List<String> containerNumber = containersList.stream().map(Containers::getContainerNumber).filter(Objects::nonNull)
-			.distinct().collect(Collectors.toList());
-		List<String> boxCode = containersList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
-			.distinct().collect(Collectors.toList());
-		for (Containers item : containersList) {
-			item.setPodStationId(podStationId);
-			item.setPodStationCname(podStationCname);
-			item.setPodStationEname(podStationEname);
-			item.setPodStationCode(podStationCode);
-			item.setUpdateTime(new Date());
-			item.setUpdateUser(AuthUtil.getUserId());
-			item.setUpdateUserName(AuthUtil.getUserName());
-		}
-		containersService.updateBatchById(containersList);
-		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
-			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
-			.eq(PutBox::getIsDeleted, 0)
-			.in(PutBox::getContainerNumber, containerNumber));
-		if (!putBoxList.isEmpty()) {
+		if ("HYJK".equals(podStationR.getBusinessType())) {
+			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::getTenantId, AuthUtil.getTenantId())
 				.eq(PutBoxItems::getIsDeleted, 0)
-				.in(PutBoxItems::getBoxCode, boxCode)
-				.in(PutBoxItems::getPid, putBoxList.stream().map(PutBox::getId).collect(Collectors.toList()))
-			);
-			for (PutBoxItems item : putBoxItemsList) {
-				item.setPodStationId(podStationId);
-				item.setPodStationCname(podStationCname);
-				item.setPodStationEname(podStationEname);
-				item.setPodStationCode(podStationCode);
-				item.setUpdateTime(new Date());
-				item.setUpdateUser(AuthUtil.getUserId());
-				item.setUpdateUserName(AuthUtil.getUserName());
+				.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));
 			}
-			putBoxItemsService.updateBatchById(putBoxItemsList);
-		}
-		List<TradingBox> tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
-			.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
-			.eq(TradingBox::getIsDeleted, 0)
-			.in(TradingBox::getContainerNumber, containerNumber));
-		if (!tradingBoxList.isEmpty()) {
-			List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
-				.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
-				.eq(TradingBoxItem::getIsDeleted, 0)
-				.in(TradingBoxItem::getCode, boxCode)
-				.in(TradingBoxItem::getPid, tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList()))
-			);
-			for (TradingBoxItem item : tradingBoxItemList) {
-				item.setPodStationId(podStationId);
-				item.setPodStationCname(podStationCname);
-				item.setPodStationEname(podStationEname);
-				item.setPodStationCode(podStationCode);
+			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> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getId, billsIds));
+			if (billsHYJKList.isEmpty()) {
+				throw new RuntimeException("未查到海运进口单据");
+			}
+			List<Long> idHYJKList = new ArrayList<>();
+			List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getMasterId, billsIds));
+			if (!billsHYJKListFD.isEmpty()) {
+				idHYJKList.addAll(billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList()));
+			}
+			List<Containers> containersHYJKListFD = 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 : billsHYJKList){
+				//目的港生成新放箱号单据
+				List<PutBox> putBoxNewList = new ArrayList<>();
+				//目的港生成新放箱号单据明细数据
+				List<PutBoxItems> putBoxItemsNewList = new ArrayList<>();
+				//原起运港放箱号单据明细数据
+				List<PutBoxItems> putBoxItemsOldList = new ArrayList<>();
+				//原起运港OW单据明细数据
+				List<TradingBoxItem> tradingBoxItemOldList = new ArrayList<>();
+				//自有箱-箱档案数据更新
+				List<Archives> archivesArrayList = 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) {
+					item.setPodStationId(podStationR.getPodStationId());
+					item.setPodStationCname(podStationR.getPodStationCname());
+					item.setPodStationEname(podStationR.getPodStationEname());
+					item.setPodStationCode(podStationR.getPodStationCode());
+					item.setUpdateTime(new Date());
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					containersListNew.add(item);
+					//进口分单配箱信息处理
+					if (!containersHYJKListFD.isEmpty()) {
+						Containers containers = containersHYJKListFD.stream().filter(e -> e.getCntrNo().equals(item.getCntrNo()))
+							.findFirst().orElse(null);
+						if (containers != null) {
+							containers.setPodStationId(podStationR.getPodStationId());
+							containers.setPodStationCname(podStationR.getPodStationCname());
+							containers.setPodStationEname(podStationR.getPodStationEname());
+							containers.setPodStationCode(podStationR.getPodStationCode());
+							containers.setUpdateTime(new Date());
+							containers.setUpdateUser(AuthUtil.getUserId());
+							containers.setUpdateUserName(AuthUtil.getUserName());
+							containersListNew.add(containers);
+						}
+					}
+					//箱档案信息处理
+					Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getCntrNo())).findFirst().orElse(null);
+					if (archives == null) {
+						throw new RuntimeException("未查到箱号:" + item.getCntrNo() + "箱档案数据");
+					}
+					archives.setUpdateTime(new Date());
+					archives.setUpdateUser(AuthUtil.getUserId());
+					archives.setUpdateUserName(AuthUtil.getUserName());
+					archives.setStatus("待使用");
+					archives.setNewDate(podStationR.getReturnEmptyTime());
+					archives.setBoxDynamics("空箱进场");
+					archives.setAddressId(billsHYJK.getPodId());
+					archives.setAddressCode(billsHYJK.getPodCode());
+					archives.setAddressCname(billsHYJK.getPodCnName());
+					archives.setAddressEname(billsHYJK.getPodEnName());
+					archives.setStationId(podStationR.getPodStationId());
+					archives.setStationCode(podStationR.getPodStationCname());
+					archives.setStationCname(podStationR.getPodStationEname());
+					archives.setStationEname(podStationR.getPodStationCode());
+					archivesArrayList.add(archives);
+					//原放箱号数据处理
+					PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw()))
+						.findFirst().orElse(null);
+					if (putBox1 != null) {
+						if ("OW(放),自有箱,代理箱".contains(putBox1.getBoxClass())) {
+							//放箱号明细数据处理
+							PutBoxItems putBoxItem;
+							if (!putBoxItemsList.isEmpty()) {
+								putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCntrNo()))
+									.findFirst().orElse(null);
+								if (putBoxItem != null) {
+									putBoxItem.setPid(putBox1.getId());
+									putBoxItem.setPodStationId(podStationR.getPodStationId());
+									putBoxItem.setPodStationCode(podStationR.getPodStationCname());
+									putBoxItem.setPodStationCname(podStationR.getPodStationEname());
+									putBoxItem.setPodStationEname(podStationR.getPodStationCode());
+									putBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
+									putBoxItem.setStatus("待使用");
+									putBoxItem.setBoxDynamics("空箱进场");
+									putBoxItemsOldList.add(putBoxItem);
+								} else {
+									throw new RuntimeException("未查到原放箱号:" + archives.getContainerNumber() + "中箱号为:" + item.getCntrNo() + "数据");
+								}
+							} else {
+								throw new RuntimeException("未查到原放箱号:" + archives.getContainerNumber() + "中箱号为:" + item.getCntrNo() + "数据");
+							}
+							if ("OW(放)".equals(putBox1.getBoxClass())) {
+								if (!tradingBoxList.isEmpty()) {
+									TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox1.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.setPodStationId(podStationR.getPodStationId());
+												tradingBoxItem.setPodStationCode(podStationR.getPodStationCname());
+												tradingBoxItem.setPodStationCname(podStationR.getPodStationEname());
+												tradingBoxItem.setPodStationEname(podStationR.getPodStationCode());
+												tradingBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
+												tradingBoxItem.setBoxDynamics("空箱进场");
+												tradingBoxItem.setStatus("待使用");
+												tradingBoxItem.setPortId(billsHYJK.getPodId());
+												tradingBoxItem.setPortCode(billsHYJK.getPodCode());
+												tradingBoxItem.setPortCname(billsHYJK.getPodCnName());
+												tradingBoxItem.setPortEname(billsHYJK.getPodEnName());
+												tradingBoxItem.setStationId(podStationR.getPodStationId());
+												tradingBoxItem.setStationCode(podStationR.getPodStationCname());
+												tradingBoxItem.setStationCname(podStationR.getPodStationEname());
+												tradingBoxItem.setStationEname(podStationR.getPodStationCode());
+												tradingBoxItemOldList.add(tradingBoxItem);
+											} else {
+												throw new RuntimeException("未查到原OW单据-放箱号:" + archives.getContainerNumber() + "中箱号是:" + item.getCntrNo() + "数据");
+											}
+										} else {
+											throw new RuntimeException("未查到原OW单据-放箱号:" + archives.getContainerNumber() + "中箱号是:" + item.getCntrNo() + "数据");
+										}
+									} else {
+										throw new RuntimeException("未查到原OW单据-放箱号为:" + archives.getContainerNumber());
+									}
+								} else {
+									throw new RuntimeException("未查到原OW单据-放箱号为:" + archives.getContainerNumberOw());
+								}
+							}
+							//pod放箱号处理
+							PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
+								&& e.getPolId().equals(archives.getAddressId()) && e.getPolStationId().equals(archives.getStationId())
+								&& e.getBusType().equals(archives.getContainerNumberType())).findFirst().orElse(null);
+							if (putBox == null) {
+								if (!putBoxNewList.isEmpty()) {
+									PutBox putBox2 = putBoxNewList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
+										&& e.getPolId().equals(archives.getAddressId()) && e.getPolStationId().equals(archives.getStationId())).findFirst().orElse(null);
+									if (putBox2 == null) {
+										putBox2 = new PutBox();
+										putBox2.setCreateUser(AuthUtil.getUserId());
+										putBox2.setCreateTime(new Date());
+										putBox2.setCreateUserName(AuthUtil.getUserName());
+										putBox2.setBusType("自有箱");
+										putBox2.setBoxBelongsTo("SOC");
+										putBox2.setBoxEastId(archives.getBoxEastId() + "");
+										putBox2.setBoxEastName(archives.getBoxEastName());
+										String code = "FXH-ZY";
+										BusinessBillNo businessBillNo = new BusinessBillNo();
+										businessBillNo.setBusinessTypeId(businessType.getId());
+										businessBillNo.setCode(code);
+										R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+										if (!clientBillNo.isSuccess()) {
+											throw new RuntimeException("生成订单编号失败");
+										}
+										putBox2.setSysNo((String) clientBillNo.getData());
+										putBox2.setContainerNumber(archives.getContainerNumber());
+										putBox2.setSrcContainerNumber(archives.getContainerNumberOw());
+										putBox2.setSrcType(archives.getContainerNumberTypeOw());
+										BusinessBillNo businessBillNo1 = new BusinessBillNo();
+										businessBillNo1.setBusinessTypeId(businessType.getId());
+										businessBillNo1.setCode("FXH-N");
+										R clientBillNo1 = businessBillNoService.getBillNoLos(businessBillNo1);
+										if (!clientBillNo1.isSuccess()) {
+											throw new RuntimeException("生成订单编号失败");
+										}
+										putBox2.setInternalContainerNumber((String) clientBillNo1.getData());
+										putBox2.setPolId(billsHYJK.getPodId());
+										putBox2.setPolCode(billsHYJK.getPodCode());
+										putBox2.setPolCname(billsHYJK.getPodCnName());
+										putBox2.setPolEname(billsHYJK.getPodEnName());
+										putBox2.setPolStationId(podStationR.getPodStationId());
+										putBox2.setPolStationCode(podStationR.getPodStationCname());
+										putBox2.setPolStationCname(podStationR.getPodStationEname());
+										putBox2.setPolStationEname(podStationR.getPodStationCode());
+										putBox2.setBoxType(archives.getTypeName());
+										putBox2.setBoxClass("自有箱");
+										putBox2.setTotalNum(1);
+										putBox2.setOccupyNum(0);
+										putBox2.setRemainingNum(1);
+										putBox2.setStorageNum(1);
+										putBoxNewList.add(putBox2);
+									} else {
+										putBox2.setTotalNum(putBox1.getTotalNum() + 1);
+										putBox2.setOccupyNum(0);
+										putBox2.setRemainingNum(putBox1.getRemainingNum() + 1);
+										putBox2.setStorageNum(putBox1.getStorageNum() + 1);
+									}
+								} else {
+									putBox = new PutBox();
+									putBox.setCreateUser(AuthUtil.getUserId());
+									putBox.setCreateTime(new Date());
+									putBox.setCreateUserName(AuthUtil.getUserName());
+									putBox.setBusType("自有箱");
+									putBox.setBoxClass("自有箱");
+									String code = "FXH-ZY";
+									BusinessBillNo businessBillNo = new BusinessBillNo();
+									businessBillNo.setBusinessTypeId(businessType.getId());
+									businessBillNo.setCode(code);
+									R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+									if (!clientBillNo.isSuccess()) {
+										throw new RuntimeException("生成订单编号失败");
+									}
+									putBox.setSysNo((String) clientBillNo.getData());
+									putBox.setContainerNumber(archives.getContainerNumber());
+									putBox.setBoxBelongsTo("SOC");
+									putBox.setBoxEastId(archives.getBoxEastId() + "");
+									putBox.setBoxEastName(archives.getBoxEastName());
+									putBox.setSrcContainerNumber(archives.getContainerNumberOw());
+									putBox.setSrcType(archives.getContainerNumberTypeOw());
+									BusinessBillNo businessBillNo1 = new BusinessBillNo();
+									businessBillNo1.setBusinessTypeId(businessType.getId());
+									businessBillNo1.setCode("FXH-N");
+									R clientBillNo1 = businessBillNoService.getBillNoLos(businessBillNo1);
+									if (!clientBillNo1.isSuccess()) {
+										throw new RuntimeException("生成订单编号失败");
+									}
+									putBox.setInternalContainerNumber((String) clientBillNo1.getData());
+									putBox.setPolId(billsHYJK.getPodId());
+									putBox.setPolCode(billsHYJK.getPodCode());
+									putBox.setPolCname(billsHYJK.getPodCnName());
+									putBox.setPolEname(billsHYJK.getPodEnName());
+									putBox.setPolStationId(podStationR.getPodStationId());
+									putBox.setPolStationCode(podStationR.getPodStationCname());
+									putBox.setPolStationCname(podStationR.getPodStationEname());
+									putBox.setPolStationEname(podStationR.getPodStationCode());
+									putBox.setBoxType(archives.getTypeName());
+									putBox.setBoxClass("自有箱");
+									putBox.setTotalNum(1);
+									putBox.setOccupyNum(0);
+									putBox.setRemainingNum(1);
+									putBox.setStorageNum(1);
+									putBoxNewList.add(putBox);
+								}
+							} else {
+								putBox.setTotalNum(putBox.getTotalNum() + 1);
+								putBox.setRemainingNum(putBox.getTotalNum() + 1 - putBox.getOccupyNum());
+								putBox.setStorageNum(putBox.getStorageNum() + 1 - putBox.getOccupyNum());
+								putBoxNewList.add(putBox);
+							}
+						} else if ("OW(拿)".equals(putBox1.getBoxClass())) {
+							//放箱号明细数据处理
+							PutBoxItems putBoxItem;
+							if (!putBoxItemsList.isEmpty()) {
+								putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCntrNo()))
+									.findFirst().orElse(null);
+								if (putBoxItem != null) {
+									putBoxItem.setPid(putBox1.getId());
+									putBoxItem.setPodStationId(podStationR.getPodStationId());
+									putBoxItem.setPodStationCode(podStationR.getPodStationCname());
+									putBoxItem.setPodStationCname(podStationR.getPodStationEname());
+									putBoxItem.setPodStationEname(podStationR.getPodStationCode());
+									putBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
+									putBoxItem.setStatus("待使用");
+									putBoxItem.setBoxDynamics("空箱进场");
+									putBoxItemsOldList.add(putBoxItem);
+								} else {
+									throw new RuntimeException("未查到原放箱号:" + archives.getContainerNumber() + "中箱号为:" + item.getCntrNo() + "数据");
+								}
+							} else {
+								throw new RuntimeException("未查到原放箱号:" + archives.getContainerNumber() + "中箱号为:" + item.getCntrNo() + "数据");
+							}
+							if (!tradingBoxList.isEmpty()) {
+								TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox1.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.setPodStationId(podStationR.getPodStationId());
+											tradingBoxItem.setPodStationCode(podStationR.getPodStationCname());
+											tradingBoxItem.setPodStationCname(podStationR.getPodStationEname());
+											tradingBoxItem.setPodStationEname(podStationR.getPodStationCode());
+											tradingBoxItem.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
+											tradingBoxItem.setBoxDynamics("空箱进场");
+											tradingBoxItem.setStatus("待使用");
+											tradingBoxItem.setPortId(billsHYJK.getPodId());
+											tradingBoxItem.setPortCode(billsHYJK.getPodCode());
+											tradingBoxItem.setPortCname(billsHYJK.getPodCnName());
+											tradingBoxItem.setPortEname(billsHYJK.getPodEnName());
+											tradingBoxItem.setStationId(podStationR.getPodStationId());
+											tradingBoxItem.setStationCode(podStationR.getPodStationCname());
+											tradingBoxItem.setStationCname(podStationR.getPodStationEname());
+											tradingBoxItem.setStationEname(podStationR.getPodStationCode());
+											tradingBoxItemOldList.add(tradingBoxItem);
+										} else {
+											throw new RuntimeException("未查到原OW单据-放箱号:" + archives.getContainerNumber() + "中箱号是:" + item.getCntrNo() + "数据");
+										}
+									} else {
+										throw new RuntimeException("未查到原OW单据-放箱号:" + archives.getContainerNumber() + "中箱号是:" + item.getCntrNo() + "数据");
+									}
+								} else {
+									throw new RuntimeException("未查到原OW单据-放箱号为:" + archives.getContainerNumber());
+								}
+							} else {
+								throw new RuntimeException("未查到原OW单据-放箱号为:" + archives.getContainerNumberOw());
+							}
+							archivesDateleList.add(archives.getId());
+						} else {
+							throw new RuntimeException("放箱号:" + archives.getContainerNumberOw() + "单据类型错误,请联系管理员");
+						}
+					}
+				}
+				if (!containersListNew.isEmpty()) {
+					containersService.updateBatchById(containersListNew);
+				}
+				if (!putBoxItemsOldList.isEmpty()) {
+					putBoxItemsService.updateBatchById(putBoxItemsOldList);
+				}
+				if (!tradingBoxItemOldList.isEmpty()) {
+					tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
+				}
+				if (!archivesArrayList.isEmpty()) {
+					archivesService.updateBatchById(archivesArrayList);
+				}
+				if (!archivesDateleList.isEmpty()) {
+					archivesService.removeByIds(archivesDateleList);
+				}
+				if (!putBoxNewList.isEmpty()) {
+					this.saveOrUpdateBatch(putBoxNewList);
+				}
+				for (Containers item : containersList) {
+					//箱档案信息处理
+					Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getCntrNo())).findFirst().orElse(null);
+					if (archives == null) {
+						throw new RuntimeException("未查到箱号:" + item.getCntrNo() + "箱档案数据");
+					}
+					//放箱号数据处理
+					PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw()))
+						.findFirst().orElse(null);
+					if (putBox1 != null) {
+						if ("OW(放),自有箱,代理箱".contains(putBox1.getBoxClass())) {
+							//POD放箱号数据明细处理
+							PutBox putBox = putBoxNewList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
+									&& e.getPolId().equals(archives.getAddressId()) && e.getPolStationId().equals(archives.getStationId()))
+								.findFirst().orElse(null);
+							if (putBox != null) {
+								//POD放箱号明细数据处理
+								PutBoxItems putBoxItem;
+								if (!putBoxItemsList.isEmpty()) {
+									putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCntrNo()) &&
+											putBox.getId().equals(e.getPid()))
+										.findFirst().orElse(null);
+									if (putBoxItem != null) {
+										putBoxItem.setMblno(item.getMblno());
+										putBoxItem.setBoxDynamics("空箱进场");
+										putBoxItem.setStatus("待使用");
+										putBoxItem.setPolCyId(billsHYJK.getPodId());
+										putBoxItem.setPolCyCode(billsHYJK.getPodCode());
+										putBoxItem.setPolCyCname(billsHYJK.getPodCnName());
+										putBoxItem.setPolCyEname(billsHYJK.getPodEnName());
+										putBoxItem.setEtd(null);
+										putBoxItem.setPolFreeBoxUseDays(0);
+										putBoxItem.setPolPreAppearanceDate(null);
+										putBoxItem.setPolStationEmptyContainerExitDate(null);
+										putBoxItem.setPolReturnDate(null);
+										putBoxItem.setPolOverdueBoxUseDays(0);
+										putBoxItem.setPolPickUpDate(null);
+										putBoxItem.setEta(null);
+										putBoxItem.setPodEmptyContainerReturnDate(null);
+										putBoxItem.setPodStationId(null);
+										putBoxItem.setPodStationCode(null);
+										putBoxItem.setPodStationCname(null);
+										putBoxItem.setPodStationEname(null);
+										putBoxItem.setPodFreeBoxUseDays(null);
+										putBoxItem.setPodBoxUseDays(null);
+									} else {
+										putBoxItem = new PutBoxItems();
+										putBoxItem.setBoxClass(putBox.getBusType());
+										putBoxItem.setBoxBelongsTo("SOC");
+										putBoxItem.setBoxCondition("新");
+										putBoxItem.setBoxStatus("好");
+										putBoxItem.setPid(putBox.getId());
+										putBoxItem.setContainerNumber(archives.getContainerNumber());
+										putBoxItem.setBoxCode(item.getCntrNo());
+										putBoxItem.setBoxType(item.getCntrTypeCode());
+										putBoxItem.setMblno(item.getMblno());
+										putBoxItem.setBoxDynamics("空箱进场");
+										putBoxItem.setStatus("待使用");
+										putBoxItem.setPolCyId(billsHYJK.getPodId());
+										putBoxItem.setPolCyCode(billsHYJK.getPodCode());
+										putBoxItem.setPolCyCname(billsHYJK.getPodCnName());
+										putBoxItem.setPolCyEname(billsHYJK.getPodEnName());
+									}
+								} else {
+									putBoxItem = new PutBoxItems();
+									putBoxItem.setBoxClass(putBox.getBusType());
+									putBoxItem.setBoxBelongsTo("SOC");
+									putBoxItem.setBoxCondition("新");
+									putBoxItem.setBoxStatus("好");
+									putBoxItem.setPid(putBox.getId());
+									putBoxItem.setContainerNumber(archives.getContainerNumber());
+									putBoxItem.setBoxCode(item.getCntrNo());
+									putBoxItem.setBoxType(item.getCntrTypeCode());
+									putBoxItem.setMblno(item.getMblno());
+									putBoxItem.setBoxDynamics("空箱进场");
+									putBoxItem.setStatus("待使用");
+									putBoxItem.setPolCyId(billsHYJK.getPodId());
+									putBoxItem.setPolCyCode(billsHYJK.getPodCode());
+									putBoxItem.setPolCyCname(billsHYJK.getPodCnName());
+									putBoxItem.setPolCyEname(billsHYJK.getPodEnName());
+								}
+								putBoxItemsNewList.add(putBoxItem);
+							} else {
+								throw new RuntimeException("未查到pod放箱号单据信息");
+							}
+						}
+					}
+				}
+				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.setBoxDynamics("空箱进场");
+							archivesTrajectory.setStatus(item.getBoxDynamics());
+							archivesTrajectory.setBillType(putBox.getBusType());
+							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());
+							archivesTrajectoryMapper.insert(archivesTrajectory);
+						}
+					}
+				}
+				//计算超期箱使费
+				this.countOverdueFeeV1(billsHYJK, tradingBoxList, tradingBoxItemOldList);
+			}
+		} else {
+			for (Containers item : containersHYJKList) {
+				item.setPodStationId(podStationR.getPodStationId());
+				item.setPodStationCname(podStationR.getPodStationCname());
+				item.setPodStationEname(podStationR.getPodStationEname());
+				item.setPodStationCode(podStationR.getPodStationCode());
 				item.setUpdateTime(new Date());
 				item.setUpdateUser(AuthUtil.getUserId());
 				item.setUpdateUserName(AuthUtil.getUserName());
 			}
-			tradingBoxItemService.updateBatchById(tradingBoxItemList);
+			containersService.updateBatchById(containersHYJKList);
 		}
 		return R.data("操作成功");
 	}

+ 3 - 2
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/RouteCostServiceImpl.java

@@ -805,10 +805,10 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 		//POL-POD&L单据
 		String effectiveStartDate = "";
 		String effectiveEndDate = "";
-		if (ObjectUtils.isNotNull(profitExcel.getEffectiveStartDate())){
+		if (ObjectUtils.isNotNull(profitExcel.getEffectiveStartDate())) {
 			effectiveStartDate = formatter.format(profitExcel.getEffectiveStartDate());
 		}
-		if (ObjectUtils.isNotNull(profitExcel.getEffectiveEndDate())){
+		if (ObjectUtils.isNotNull(profitExcel.getEffectiveEndDate())) {
 			effectiveEndDate = formatter.format(profitExcel.getEffectiveEndDate());
 		}
 		List<RouteCost> routeCostList = baseMapper.selectList(new LambdaQueryWrapper<RouteCost>()
@@ -844,6 +844,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 		List<RouteCostItem> routeCostItemList = routeCostItemService.list(new LambdaQueryWrapper<RouteCostItem>()
 			.eq(RouteCostItem::getTenantId, AuthUtil.getTenantId())
 			.eq(RouteCostItem::getIsDeleted, 0)
+			.eq(ObjectUtils.isNotNull(profitExcel.getBoxType()), RouteCostItem::getBoxType, profitExcel.getBoxType())
 			.in(RouteCostItem::getPid, idList));
 		//循环POL-POD&L单据
 		for (RouteCost itemPol : routeCostList) {

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/UseBoxPlanServiceImpl.java

@@ -166,6 +166,7 @@ public class UseBoxPlanServiceImpl extends ServiceImpl<UseBoxPlanMapper, UseBoxP
 		}
 		UseBoxPlan detail = baseMapper.selectById(useBoxPlan.getId());
 		detail.setStatus(1);
+		baseMapper.updateById(detail);
 		R<String> res = sysClient.getRoleIds(AuthUtil.getTenantId(), "OW,箱管");
 		if (res.isSuccess() && ObjectUtils.isNotNull()) {
 			LocalDateTime now = LocalDateTime.now();

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/controller/MktSlotController.java

@@ -195,6 +195,9 @@ public class MktSlotController extends BladeController {
 		LambdaQueryWrapper<MktSlot> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(MktSlot::getTenantId, AuthUtil.getTenantId())
 			.eq(MktSlot::getIsDeleted, 0)
+			.eq(MktSlot::getBranchId, AuthUtil.getDeptId())
+			.eq(ObjectUtils.isNotNull(mktSlot.getPolId()), MktSlot::getPolId, mktSlot.getPolId())
+			.eq(ObjectUtils.isNotNull(mktSlot.getPodId()), MktSlot::getPodId, mktSlot.getPodId())
 			.eq(MktSlot::getBillStatus, "已提交");
 		lambdaQueryWrapper.orderByAsc(MktSlot::getPodId);
 		List<MktSlot> list = mktSlotService.list(lambdaQueryWrapper);

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -92,6 +92,9 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getTransferOrderStatus()), Bills::getTransferOrderStatus, bills.getTransferOrderStatus())
 			.eq(ObjectUtils.isNotNull(bills.getLogisticsStatus()), Bills::getLogisticsStatus, bills.getLogisticsStatus())
 			.like(ObjectUtils.isNotNull(bills.getBillNo()), Bills::getBillNo, bills.getBillNo())
+			.like(ObjectUtils.isNotNull(bills.getTemporaryNo()), Bills::getTemporaryNo, bills.getTemporaryNo())
+			.apply(ObjectUtils.isNotNull(bills.getTemporaryNo()), "temporary_no like'%" + bills.getTemporaryNo()
+				+ "%' and temporary_no is not null")
 			.like(ObjectUtils.isNotNull(bills.getMblno()), Bills::getMblno, bills.getMblno())
 			.like(ObjectUtils.isNotNull(bills.getHblno()), Bills::getHblno, bills.getHblno())
 			.like(ObjectUtils.isNotNull(bills.getCorpSource()), Bills::getCorpSource, bills.getCorpSource())

+ 26 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BookingCabinController.java

@@ -30,10 +30,14 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.SeaBillsDetail;
 import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.ISeaBillsDetailService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 业务-预定舱 控制器
@@ -49,6 +53,8 @@ public class BookingCabinController extends BladeController {
 
 	private final IBillsService billsService;
 
+	private final ISeaBillsDetailService seaBillsDetailService;
+
 	/**
 	 * 详情
 	 */
@@ -128,6 +134,26 @@ public class BookingCabinController extends BladeController {
 			}
 		}
 		IPage<Bills> pages = billsService.page(Condition.getPage(query), lambdaQueryWrapper);
+		if (!pages.getRecords().isEmpty()) {
+			List<Long> ids = pages.getRecords().stream().map(Bills::getId).collect(Collectors.toList());
+			List<SeaBillsDetail> seaBillsDetailList = seaBillsDetailService.list(new LambdaQueryWrapper<SeaBillsDetail>()
+				.eq(SeaBillsDetail::getTenantId, AuthUtil.getTenantId())
+				.in(SeaBillsDetail::getPid, ids));
+			for (Bills item : pages.getRecords()) {
+				if (!seaBillsDetailList.isEmpty()) {
+					SeaBillsDetail seaBillsDetail = seaBillsDetailList.stream().filter(e -> e.getPid().equals(item.getId())).findFirst().orElse(null);
+					if (seaBillsDetail != null) {
+						item.setHconsigneeCnName(seaBillsDetail.getHconsigneeCnName());
+						item.setHconsigneeDetails(seaBillsDetail.getHconsigneeDetails());
+						item.setMconsigneeCntyCode(seaBillsDetail.getMconsigneeCntyCode());
+						item.setMconsigneeDetails(seaBillsDetail.getMconsigneeDetails());
+						item.setHshipperCnName(seaBillsDetail.getHshipperCnName());
+						item.setHshipperDetails(seaBillsDetail.getHshipperDetails());
+						item.setHnotifyDetails(seaBillsDetail.getHnotifyDetails());
+					}
+				}
+			}
+		}
 		return R.data(pages);
 	}
 

+ 3 - 5
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java

@@ -11,6 +11,7 @@ import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.service.IPutBoxService;
 import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
+import org.springblade.los.excel.PodStationR;
 import org.springblade.los.excel.UpdatePodStationExcel;
 import org.springblade.los.statisticAnalysis.FeeSummaryRD;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -59,11 +60,8 @@ public class UpdatePodStationController {
 	 */
 	@GetMapping("/batchUpdatePodStation")
 	@RepeatSubmit
-	public R batchUpdatePodStation(@RequestParam("ids") String ids,@RequestParam("podStationId") Long podStationId,
-								   @RequestParam("podStationCode") String podStationCode,
-								   @RequestParam("podStationCname") String podStationCname,
-								   @RequestParam("podStationEname") String podStationEname) {
-		return putBoxService.batchUpdatePodStation(ids,podStationId,podStationCode,podStationCname,podStationEname);
+	public R batchUpdatePodStation(PodStationR podStationR) {
+		return putBoxService.batchUpdatePodStation(podStationR);
 	}
 
 

+ 18 - 5
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.xml

@@ -92,7 +92,10 @@
         sc.cntr_type_code as cntrTypeCode,
         sc.pod_station_cname as podStationName,
         sc.id as containersId,
-        se.id as id
+        se.id as id,
+        se.eta as eta,
+        se.etd as etd,
+        se.business_type as businessType
         FROM
         los_sea_containers sc
         LEFT JOIN los_sea_bills se ON sc.pid = se.id
@@ -102,9 +105,16 @@
         AND se.tenant_id = #{data.tenantId}
         AND sc.is_deleted = '0'
         AND se.is_deleted = '0'
+        and se.bill_type = 'MH'
+        <if test="data.businessType != null and data.businessType != ''">
+            and se.business_type = #{data.businessType}
+        </if>
         <if test="data.branchId != null and data.branchId != ''">
             and se.branch_id = #{data.branchId}
         </if>
+        <if test="data.cntrNo != null and data.cntrNo != ''">
+            and sc.cntr_no = #{data.cntrNo}
+        </if>
         <if test="data.mblno != null and data.mblno != ''">
             and se.mblno like concat('%', #{data.mblno}, '%')
         </if>
@@ -126,9 +136,6 @@
         <if test="data.podName != null and data.podName != ''">
             and se.pod_cn_name like concat('%', #{data.podName}, '%')
         </if>
-        <if test="data.billType != null and data.billType != ''">
-            and se.bill_type = #{data.billType}
-        </if>
         <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
             and se.actual_etd &gt;= #{data.actualEtdList[0]}
         </if>
@@ -158,7 +165,10 @@
         sc.cntr_type_code as cntrTypeCode,
         sc.pod_station_cname as podStationName,
         sc.id as containersId,
-        se.id as id
+        se.id as id,
+        se.eta as eta,
+        se.etd as etd,
+        se.business_type as businessType
         FROM
         los_sea_containers sc
         LEFT JOIN los_sea_bills se ON sc.pid = se.id
@@ -174,6 +184,9 @@
         <if test="data.mblno != null and data.mblno != ''">
             and se.mblno like concat('%', #{data.mblno}, '%')
         </if>
+        <if test="data.cntrNo != null and data.cntrNo != ''">
+            and sc.cntr_no = #{data.cntrNo}
+        </if>
         <if test="data.hblno != null and data.hblno != ''">
             and se.hblno like concat('%', #{data.hblno}, '%')
         </if>

+ 32 - 16
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -267,18 +267,35 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setUpdateUser(AuthUtil.getUserId());
 			bills.setUpdateTime(new Date());
 			bills.setUpdateUserName(AuthUtil.getUserName());
-			if (ObjectUtils.isNotNull(bills.getMblno()) && ObjectUtils.isNotNull(bills.getTemporaryId())) {
-				Bills bills1 = new Bills();
-				bills1.setMblno(bills.getMblno());
-				bills1.setVesselId(bills.getVesselId());
-				bills1.setVesselCnName(bills.getVesselCnName());
-				bills1.setVesselEnName(bills.getVesselEnName());
-				bills1.setVoyageNo(bills.getVoyageNo());
-				bills1.setReturnDate(bills.getReturnDate());
-				bills1.setReturnEmptyDate(bills.getReturnEmptyDate());
-				bills1.setId(bills.getTemporaryId());
-				this.updateById(bills1);
+			if (ObjectUtils.isNotNull(bills.getTemporaryId())){
+				Bills bills1 = baseMapper.selectById(bills.getTemporaryId());
+				if ("MM".equals(bills.getBillType())){
+					if (ObjectUtils.isNotNull(bills.getMblno())) {
+						bills1.setMblno(bills.getMblno());
+						bills1.setHblno(bills.getHblno());
+						bills1.setVesselId(bills.getVesselId());
+						bills1.setVesselCnName(bills.getVesselCnName());
+						bills1.setVesselEnName(bills.getVesselEnName());
+						bills1.setVoyageNo(bills.getVoyageNo());
+						bills1.setCyReturnTime(bills.getCyReturnTime());
+						bills1.setCyTrailerTime(bills.getCyTrailerTime());
+						this.updateById(bills1);
+					}
+				}else if ("MH".equals(bills.getBillType())){
+					if (ObjectUtils.isNotNull(bills.getHblno())) {
+						bills1.setMblno(bills.getMblno());
+						bills1.setHblno(bills.getHblno());
+						bills1.setVesselId(bills.getVesselId());
+						bills1.setVesselCnName(bills.getVesselCnName());
+						bills1.setVesselEnName(bills.getVesselEnName());
+						bills1.setVoyageNo(bills.getVoyageNo());
+						bills1.setCyReturnTime(bills.getCyReturnTime());
+						bills1.setCyTrailerTime(bills.getCyTrailerTime());
+						this.updateById(bills1);
+					}
+				}
 			}
+
 		}
 		Integer V20 = 0;
 		Integer V40 = 0;
@@ -4280,29 +4297,28 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				String deptName = copyBills.getBranchName();
 				String branchId = copyBills.getBranchId();
 				List<FeeCenter> feeCenters = new ArrayList<>();
-				Date date = bills.getEtd();
+				Date date = copyBills.getEtd();
 				String exrateType = currencyUtils.standardCurrency(branchId);
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 				int count = 1;
 				for (PreContainers item : preContainersList) {
-					FeeCenter feeCenter = this.addFeeCenterQuotation(bills, "D", count, fees,  item,
+					FeeCenter feeCenter = this.addFeeCenterQuotation(copyBills, "D", count, fees,  item,
 						curExrateList, exrateType, "1");
 					if (feeCenter != null) {
 						feeCenter.setUnitNo(item.getCntrTypeCode());
 						feeCenter.setBranchId(branchId);
 						feeCenter.setBranchName(deptName);
 						feeCenters.add(feeCenter);
-						count++;
 					}
-					FeeCenter feeCenterD = this.addFeeCenterQuotation(bills, "C", count, feesD,  item,
+					FeeCenter feeCenterD = this.addFeeCenterQuotation(copyBills, "C", count, feesD,  item,
 						curExrateList, exrateType, "2");
 					if (feeCenterD != null) {
 						feeCenterD.setUnitNo(item.getCntrTypeCode());
 						feeCenterD.setBranchId(branchId);
 						feeCenterD.setBranchName(deptName);
 						feeCenters.add(feeCenterD);
-						count++;
 					}
+					count++;
 				}
 				if (!feeCenters.isEmpty()) {
 					feeCenterService.saveBatch(feeCenters);

+ 48 - 0
blade-service/blade-los/src/main/java/org/springblade/los/excel/PodStationR.java

@@ -0,0 +1,48 @@
+package org.springblade.los.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/5/20
+ */
+@Data
+public class PodStationR {
+
+	/**
+	 * 场站
+	 */
+	private Long podStationId;
+	/**
+	 * 场站
+	 */
+	private String podStationCode;
+	/**
+	 * 场站
+	 */
+	private String podStationCname;
+	/**
+	 * 场站
+	 */
+	private String podStationEname;
+
+	private List<UpdatePodStationExcel> list;
+
+	/**
+	 * 单据类型
+	 */
+	private String businessType;
+
+	/**
+	 * pod场站返空时间
+	 */
+	private Date returnEmptyTime;
+
+
+}

+ 14 - 3
blade-service/blade-los/src/main/java/org/springblade/los/excel/UpdatePodStationExcel.java

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -29,6 +30,16 @@ public class UpdatePodStationExcel {
 	@ExcelProperty(value = "hblno")
 	private String hblno;
 	/**
+	 * ETD
+	 */
+	@ExcelProperty(value = "ETD")
+	private Date etd;
+	/**
+	 * ETA
+	 */
+	@ExcelProperty(value = "ETA")
+	private Date eta;
+	/**
 	 * 船名
 	 */
 	@ExcelProperty(value = "船名")
@@ -87,7 +98,7 @@ public class UpdatePodStationExcel {
 	 * 单据类型
 	 */
 	@ExcelIgnore
-	private String billType;
+	private String businessType;
 
 	/**
 	 * 实际开船日期
@@ -103,12 +114,12 @@ public class UpdatePodStationExcel {
 	 * 主表id
 	 */
 	@ExcelIgnore
-	private String id;
+	private Long id;
 	/**
 	 * 配箱id
 	 */
 	@ExcelIgnore
-	private String containersId;
+	private Long containersId;
 
 
 	/**