Просмотр исходного кода

1.主单信息修改分单信息也需要更新,判断逻辑修改
2.海运进出口列表批量请核接口权限判断修改
3.成本,运价费用批量导入接口逻辑修改
4.提取报价列表接口检索条件修改
5.报价中心增加字段,类型和航行天数
6.箱管启用接口,箱池动态-导入接口修改计算箱数逻辑
7.报价中心报表打印接口调试及修改

纪新园 8 месяцев назад
Родитель
Сommit
930f770d66
22 измененных файлов с 472 добавлено и 123 удалено
  1. 16 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBox.java
  2. 11 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java
  3. 6 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/AgentBoxItemExcel.java
  4. 6 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/BoxFeeItemExcel.java
  5. 6 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/RentalBoxItemExcel.java
  6. 8 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/TradingBoxItemExcel.java
  7. 9 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlot.java
  8. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotItem.java
  9. 10 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotQuotation.java
  10. 26 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  11. 3 2
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java
  12. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxController.java
  13. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java
  14. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ArchivesServiceImpl.java
  15. 60 15
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  16. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxItemServiceImpl.java
  17. 21 6
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  18. 5 8
      blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/controller/MktSlotController.java
  19. 19 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/service/impl/MktSlotServiceImpl.java
  20. 195 20
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  21. 24 30
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml
  22. 34 32
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

+ 16 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBox.java

@@ -183,9 +183,24 @@ public class PutBox implements Serializable {
 	/**
 	 * 场地盘存
 	 */
-	@ApiModelProperty(value = "场地盘存")
+	@ApiModelProperty(value = "总箱数")
 	private Integer totalNum;
 	/**
+	 * 已提箱
+	 */
+	@ApiModelProperty(value = "已提箱")
+	private Integer suitcaseNum;
+	/**
+	 * 未提箱
+	 */
+	@ApiModelProperty(value = "未提箱")
+	private Integer notSuitcaseNum;
+	/**
+	 * 盘场地存
+	 */
+	@ApiModelProperty(value = "盘场地存")
+	private Integer storageNum;
+	/**
 	 * 操作占用
 	 */
 	@ApiModelProperty(value = "操作占用")

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

@@ -558,6 +558,17 @@ public class TradingBox implements Serializable {
 	private Date printingPersonDate;
 
 	/**
+	 * 已提箱
+	 */
+	@ApiModelProperty(value = "已提箱")
+	private Integer suitcaseNum;
+	/**
+	 * 未提箱
+	 */
+	@ApiModelProperty(value = "未提箱")
+	private Integer notSuitcaseNum;
+
+	/**
 	 * 临时数据
 	 */
 	@TableField(exist = false)

+ 6 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/AgentBoxItemExcel.java

@@ -24,6 +24,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 @ColumnWidth(25)
@@ -82,7 +83,11 @@ public class AgentBoxItemExcel implements Serializable {
 	 */
 	@ExcelProperty(value = "限制船公司")
 	private String restrictingShippingCompaniesName;
-
+	/**
+	 * 造箱日期
+	 */
+	@ExcelProperty(value = "造箱日期")
+	private Date boxMakingDate;
 	/**
 	 * 备注
 	 */

+ 6 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/BoxFeeItemExcel.java

@@ -24,6 +24,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 @ColumnWidth(25)
@@ -88,7 +89,11 @@ public class BoxFeeItemExcel implements Serializable {
 	 */
 	@ExcelProperty(value = "限制船公司")
 	private String restrictingShippingCompaniesName;
-
+	/**
+	 * 造箱日期
+	 */
+	@ExcelProperty(value = "造箱日期")
+	private Date boxMakingDate;
 	/**
 	 * 备注
 	 */

+ 6 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/RentalBoxItemExcel.java

@@ -24,6 +24,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 @ColumnWidth(25)
@@ -77,7 +78,11 @@ public class RentalBoxItemExcel implements Serializable {
 	 */
 	@ExcelProperty(value = "限制船公司")
 	private String restrictingShippingCompaniesName;
-
+	/**
+	 * 造箱日期
+	 */
+	@ExcelProperty(value = "造箱日期")
+	private Date boxMakingDate;
 	/**
 	 * 备注
 	 */

+ 8 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/TradingBoxItemExcel.java

@@ -25,6 +25,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 @ColumnWidth(25)
@@ -78,7 +79,11 @@ public class TradingBoxItemExcel implements Serializable {
 	 */
 	@ExcelProperty(value = "限制船公司")
 	private String restrictingShippingCompaniesName;
-
+	/**
+	 * 造箱日期
+	 */
+	@ExcelProperty(value = "造箱日期")
+	private Date boxMakingDate;
 	/**
 	 * 备注
 	 */
@@ -89,4 +94,6 @@ public class TradingBoxItemExcel implements Serializable {
 
 
 
+
+
 }

+ 9 - 2
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlot.java

@@ -19,10 +19,12 @@ package org.springblade.los.business.mktSlot.entity;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 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.springblade.system.entity.Dept;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -210,19 +212,24 @@ public class MktSlot implements Serializable {
 	@TableField(exist = false)
 	private List<MktSlotItem> mktSlotItemList;
 	@TableField(exist = false)
-	List<MktSlotQuotation> mktSlotQuotationList;
+	private List<MktSlotQuotation> mktSlotQuotationList;
 
 	/**
 	 * 船公司
 	 */
 	@TableField(exist = false)
-	private Long shippingCompanyId;
+	private Long actualShippingCompanyId;
 
 	/**
 	 * 报表表头信息
 	 */
 	@TableField(exist = false)
 	private Dept dept;
+	/**
+	 * etd
+	 */
+	@TableField(exist = false)
+	private String etd;
 
 
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotItem.java

@@ -258,6 +258,11 @@ public class MktSlotItem implements Serializable {
 	@ApiModelProperty(value = "航线代码")
 	private String lineCode;
 	/**
+	 * 航行天数
+	 */
+	@ApiModelProperty(value = "航行天数")
+	private Integer navigateDay;
+	/**
 	 * 类型  转船/直达
 	 */
 	@ApiModelProperty(value = "类型  转船/直达")

+ 10 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotQuotation.java

@@ -260,6 +260,16 @@ public class MktSlotQuotation implements Serializable {
 	 */
 	@ApiModelProperty(value = "箱属")
 	private String boxBelongsTo;
+	/**
+	 * 航行天数
+	 */
+	@ApiModelProperty(value = "航行天数")
+	private Integer navigateDay;
+	/**
+	 * 类型  转船/直达
+	 */
+	@ApiModelProperty(value = "类型  转船/直达")
+	private String flightType;
 
 
 }

+ 26 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -1561,6 +1561,32 @@ public class Bills implements Serializable {
 	private String receivingAndShipping;
 
 	/**
+	 * 承运人
+	 */
+	@ApiModelProperty(value = "承运人")
+	private Long actualShippingCompanyId;
+	/**
+	 * 承运人中文
+	 */
+	@ApiModelProperty(value = "承运人中文")
+	private String actualShippingCompanyCname;
+	/**
+	 * 承运人英文
+	 */
+	@ApiModelProperty(value = "承运人英文")
+	private String actualShippingCompanyEname;
+	/**
+	 * 承运人代码
+	 */
+	@ApiModelProperty(value = "承运人代码")
+	private String actualShippingCompanyCode;
+	/**
+	 * 承运人简称
+	 */
+	@ApiModelProperty(value = "承运人简称")
+	private String actualShippingCompanyAbbreviation;
+
+	/**
 	 * 到港日期
 	 */
 	@TableField(exist = false)

+ 3 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java

@@ -343,7 +343,7 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		} else if (MagicValues.QUOTATION_CENTER.equals(reportCode) && MagicValues.QUOTATION_CENTER.equals(groupCode) && MagicValues.BJZX.equals(type)) {
+		} else if (MagicValues.BJZX.equals(reportCode) && MagicValues.BJZX.equals(groupCode) && MagicValues.BJZX.equals(type)) {
 			MktSlot mktSlot = mktSlotService.getById(billId);
 			if (mktSlot != null) {
 				List<MktSlotItem> mktSlotItemList = mktSlotItemService.list(new LambdaQueryWrapper<MktSlotItem>()
@@ -354,7 +354,8 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 				List<MktSlotQuotation> mktSlotQuotationList = mktSlotQuotationService.list(new LambdaQueryWrapper<MktSlotQuotation>()
 					.eq(MktSlotQuotation::getTenantId, AuthUtil.getTenantId())
 					.eq(MktSlotQuotation::getIsDeleted, 0)
-					.eq(MktSlotQuotation::getPid, mktSlot.getId()));
+					.eq(MktSlotQuotation::getPid, mktSlot.getId())
+					.orderByDesc(MktSlotQuotation::getPpid));
 				mktSlot.setMktSlotQuotationList(mktSlotQuotationList);
 				mktSlot.setDept(dept);
 				map.put(MagicValues.DATA, mktSlot);

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxController.java

@@ -190,6 +190,7 @@ public class PutBoxController extends BladeController {
 		lambdaQueryWrapper.eq(PutBox::getTenantId, AuthUtil.getTenantId())
 			.eq(PutBox::getIsDeleted, 0)
 			.eq(PutBox::getBoxType, putBox.getBoxType())
+			.ne(PutBox::getBusType,"OW(放)")
 			.apply("remaining_num > 0")
 			.like(ObjectUtils.isNotNull(putBox.getPodId()), PutBox::getPodId, putBox.getPodId())
 			.like(ObjectUtils.isNotNull(putBox.getPolId()), PutBox::getPolId, putBox.getPolId())

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java

@@ -451,6 +451,7 @@ public class RouteCostController extends BladeController {
 					mktSlotItem.setLineCnName(item.getAirlineCname());
 					mktSlotItem.setLineEnName(item.getAirlineEname());
 					mktSlotItem.setLineCode(item.getAirlineCode());
+					mktSlotItem.setNavigateDay(item.getNavigateDay());
 					mktSlotItem.setFlightType(item.getFlightType());
 					mktSlotItem.setTransitPortId(item.getTransitPortId());
 					mktSlotItem.setTransitPortCname(item.getTransitPortCname());

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

@@ -96,8 +96,8 @@ public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> i
 			baseMapper.updateById(archives);
 		}
 		//箱图片数据
-		List<ArchivesFiles> archivesFilesList = archives.getFilesList();
-		if (archivesFilesList.size() > 0) {
+		if (ObjectUtils.isNotNull(archives.getFilesList()) && !archives.getFilesList().isEmpty()) {
+			List<ArchivesFiles> archivesFilesList = archives.getFilesList();
 			for (ArchivesFiles archivesFiles : archivesFilesList) {
 				if (null == archivesFiles.getId()) {
 					archivesFiles.setPid(archives.getId());

+ 60 - 15
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -827,8 +827,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()))
 						.findFirst().orElse(null);
 					if (putBoxItem != null) {
-						throw new RemoteException("箱号:" + item.getBoxCode() + "在放箱号:" + item.getContainerNumber() + "单据中已存在,不能重复导入");
-					/*	putBoxItem.setPid(putBox.getId());
+						putBoxItem.setPid(putBox.getId());
 						putBoxItem.setMblno(item.getMblno());
 						putBoxItem.setBoxDynamics("空箱出场");
 						putBoxItem.setPolCyId(corps.getId());
@@ -836,7 +835,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						putBoxItem.setPolCyCname(corps.getCnName());
 						putBoxItem.setPolCyEname(corps.getEnName());
 						putBoxItem.setStatus("使用中");
-						putBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());*/
+						putBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 					} else {
 						putBoxItem = new PutBoxItems();
 						putBoxItem.setBoxClass(putBox.getBusType());
@@ -875,8 +874,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBoxItem.setPolCyEname(corps.getEnName());
 					putBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 				}
-				putBoxItem.setBoxEastId(Long.parseLong(putBox.getBoxEastId()));
-				putBoxItem.setBoxEastName(putBox.getBoxEastName());
+				if (ObjectUtils.isNotNull(putBox.getBoxEastId()) && !"null".equals(putBox.getBoxEastId())) {
+					putBoxItem.setBoxEastId(Long.parseLong(putBox.getBoxEastId()));
+					putBoxItem.setBoxEastName(putBox.getBoxEastName());
+				}
 				putBoxItems.add(putBoxItem);
 				if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 					if (!tradingBoxList.isEmpty()) {
@@ -895,8 +896,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 								tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
 									.findFirst().orElse(null);
 								if (tradingBoxItem != null) {
-									throw new RemoteException("箱号:" + item.getBoxCode() + "在放箱号:" + item.getContainerNumber() + "单据中已存在,不能重复导入");
-									/*tradingBoxItem.setPid(tradingBox.getId());
+									tradingBoxItem.setPid(tradingBox.getId());
 									tradingBoxItem.setMblno(item.getMblno());
 									tradingBoxItem.setBoxDynamics("空箱出场");
 									tradingBoxItem.setPortId(ports.getId());
@@ -916,7 +916,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									} else {
 										tradingBoxItem.setPolStationEmptyContainerExitDate(new Date());
 									}
-									tradingBoxItem.setStatus("待使用");*/
+									tradingBoxItem.setStatus("待使用");
 								} else {
 									tradingBoxItem = new TradingBoxItem();
 									tradingBoxItem.setBoxBelongsTo("SOC");
@@ -1035,8 +1035,16 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
 				}
 				long count = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())).count();
-				item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
-				item.setRemainingNum(item.getTotalNum() - item.getOccupyNum());
+				item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
+				if (item.getStorageNum() < 0) {
+					throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
+				}
+				if ("OW(拿),OW(放)".contains(item.getBusType())) {
+					item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(count + ""));
+					if (item.getOccupyNum() < 0) {
+						throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余操作占用小于本次导入箱数");
+					}
+				}
 				if (!tradingBoxes.isEmpty()) {
 					TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
 					if (tradingBox != null) {
@@ -1053,7 +1061,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 							tradingBox.setCode(excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
 								.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
 						}
-						tradingBox.setActualBoxNumber(tradingBox.getActualBoxNumber() + Integer.parseInt(count + ""));
+						tradingBox.setActualBoxNumber(tradingBox.getActualBoxNumber() - Integer.parseInt(count + ""));
 						tradingBox.setRemainingBoxNumber(tradingBox.getBoxNumber() - tradingBox.getActualBoxNumber());
 						tradingBoxMapper.updateById(tradingBox);
 					}
@@ -1463,6 +1471,23 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				}
 			}
 		}
+		if (!putBoxList.isEmpty()) {
+			for (PutBox item : putBoxList) {
+				long count = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())).count();
+				item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
+				if (item.getStorageNum() < 0) {
+					throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
+				}
+				if ("OW(放),自由箱".contains(item.getBusType())) {
+					item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
+					item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
+					if (item.getTotalNum() < 0) {
+						throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余总箱数小于本次导入箱数");
+					}
+				}
+			}
+			this.saveOrUpdateBatch(putBoxList);
+		}
 		if (!archivesArrayList.isEmpty()) {
 			archivesService.saveOrUpdateBatch(archivesArrayList);
 		}
@@ -1899,11 +1924,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBox1.setTotalNum(1);
 					putBox1.setOccupyNum(0);
 					putBox1.setRemainingNum(1);
+					putBox1.setStorageNum(1);
 					putBoxNewList.add(putBox1);
 				} else {
 					putBox1.setTotalNum(putBox1.getTotalNum() + 1);
 					putBox1.setOccupyNum(0);
 					putBox1.setRemainingNum(putBox1.getRemainingNum() + 1);
+					putBox1.setStorageNum(putBox1.getStorageNum() + 1);
 				}
 			} else {
 				putBox = new PutBox();
@@ -1948,11 +1975,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				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);
 		}
 		return putBoxNewList;
@@ -2507,7 +2536,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						.findFirst().orElse(null);
 					if (putBoxItem != null) {
 						throw new RemoteException("箱号:" + item.getBoxCode() + "在放箱号:" + item.getContainerNumber() + "单据中已存在,不能重复导入");
-					/*	putBoxItem.setPid(putBox.getId());
+						/*putBoxItem.setPid(putBox.getId());
 						putBoxItem.setMblno(item.getMblno());
 						putBoxItem.setBoxDynamics("空箱提箱进场");
 						putBoxItem.setPolCyId(corps.getId());
@@ -2554,8 +2583,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBoxItem.setPolCyEname(corps.getEnName());
 					putBoxItem.setPolPickUpDate(item.getBoxStatusDate());
 				}
-				putBoxItem.setBoxEastId(Long.parseLong(putBox.getBoxEastId()));
-				putBoxItem.setBoxEastName(putBox.getBoxEastName());
+				if (ObjectUtils.isNotNull(putBox.getBoxEastId()) && !"null".equals(putBox.getBoxEastId())) {
+					putBoxItem.setBoxEastId(Long.parseLong(putBox.getBoxEastId()));
+					putBoxItem.setBoxEastName(putBox.getBoxEastName());
+				}
 				putBoxItems.add(putBoxItem);
 				if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 					if (!tradingBoxList.isEmpty()) {
@@ -2706,6 +2737,15 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					item.setCode(excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
 						.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
 				}
+				long count = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())).count();
+				if ("OW(拿),OW(放)".contains(item.getBusType())) {
+					item.setSuitcaseNum(item.getSuitcaseNum() + Integer.parseInt(count + ""));
+					item.setNotSuitcaseNum(item.getTotalNum() - item.getSuitcaseNum());
+					item.setStorageNum(item.getStorageNum() + Integer.parseInt(count + ""));
+				} else {
+					item.setStorageNum(item.getStorageNum() + Integer.parseInt(count + ""));
+					item.setRemainingNum(item.getRemainingNum() + Integer.parseInt(count + ""));
+				}
 				if (!tradingBoxes.isEmpty()) {
 					TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
 					if (tradingBox != null) {
@@ -2722,6 +2762,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 							tradingBox.setCode(excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
 								.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
 						}
+						if ("OW(拿),OW(放)".contains(item.getBusType())) {
+							tradingBox.setSuitcaseNum(tradingBox.getSuitcaseNum() + Integer.parseInt(count + ""));
+							tradingBox.setNotSuitcaseNum(tradingBox.getBoxNumber() - item.getSuitcaseNum());
+						}
 						tradingBoxMapper.updateById(tradingBox);
 					}
 				}
@@ -2797,7 +2841,8 @@ 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) {
+	public R batchUpdatePodStation(String ids, Long podStationId, String podStationCode, String
+		podStationCname, String podStationEname) {
 		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
 			.eq(Containers::getTenantId, AuthUtil.getTenantId())
 			.eq(Containers::getIsDeleted, 0)

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxItemServiceImpl.java

@@ -428,6 +428,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				tradingBoxItem.setCreateTime(new Date());
 				tradingBoxItem.setPid(tradingBox.getId());
 				tradingBoxItem.setRemarks(item.getRemarks());
+				tradingBoxItem.setBoxMakingDate(item.getBoxMakingDate());
 				tradingBoxItemList.add(tradingBoxItem);
 			}
 		} else if ("2".equals(type)) {
@@ -539,6 +540,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				tradingBoxItem.setCreateTime(new Date());
 				tradingBoxItem.setPid(tradingBox.getId());
 				tradingBoxItem.setRemarks(item.getRemarks());
+				tradingBoxItem.setBoxMakingDate(item.getBoxMakingDate());
 				tradingBoxItemList.add(tradingBoxItem);
 			}
 		} else if ("3".equals(type)) {
@@ -651,6 +653,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				tradingBoxItem.setCreateTime(new Date());
 				tradingBoxItem.setPid(tradingBox.getId());
 				tradingBoxItem.setRemarks(item.getRemarks());
+				tradingBoxItem.setBoxMakingDate(item.getBoxMakingDate());
 				tradingBoxItemList.add(tradingBoxItem);
 			}
 		} else if ("4".contains(type)) {
@@ -766,6 +769,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				tradingBoxItem.setCreateTime(new Date());
 				tradingBoxItem.setPid(tradingBox.getId());
 				tradingBoxItem.setRemarks(item.getRemarks());
+				tradingBoxItem.setBoxMakingDate(item.getBoxMakingDate());
 				tradingBoxItemList.add(tradingBoxItem);
 			}
 		}

+ 21 - 6
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -247,6 +247,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		String text;
 		if ("OW-N,OW-F".contains(tradingBox.getType())) {
 			text = "放箱号已存在,请勿重复添加";
+			tradingBox.setNotSuitcaseNum(tradingBox.getBoxNumber());
 		} else {
 			text = "合同号已存在,请勿重复添加";
 		}
@@ -1508,7 +1509,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				.apply("find_in_set(bus_type,'OW(拿),OW(放)')")
 			);
 			if (putBox != null) {
-				if (!putBox.getBoxEastId().contains(tradingBox.getPurchaseCompanyId() + "")) {
+				throw new RuntimeException("OW类型放箱号:" + detail.getContainerNumber() + "已存在");
+				/*if (!putBox.getBoxEastId().contains(tradingBox.getPurchaseCompanyId() + "")) {
 					putBox.setBoxEastId(putBox.getBoxEastId() + "," + tradingBox.getPurchaseCompanyId());
 					putBox.setBoxEastName(putBox.getBoxEastName() + "," + tradingBox.getPurchaseCompanyName());
 				}
@@ -1516,8 +1518,9 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setUpdateTime(new Date());
 				putBox.setUpdateUserName(AuthUtil.getUserName());
 				putBox.setTotalNum(putBox.getTotalNum() + tradingBox.getBoxNumber());
-				putBox.setRemainingNum(putBox.getTotalNum() - putBox.getOccupyNum());
-				putBoxService.updateById(putBox);
+				putBox.setRemainingNum(putBox.getTotalNum());
+				putBox.setNotSuitcaseNum(putBox.getTotalNum()-putBox.getSuitcaseNum());
+				putBoxService.updateById(putBox);*/
 			} else {
 				putBox = new PutBox();
 				putBox.setCreateUser(AuthUtil.getUserId());
@@ -1566,8 +1569,11 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setPodEname(detail.getPodEname());
 				putBox.setPodCode(detail.getPodCode());
 				putBox.setBoxCondition(tradingBox.getBoxCondition());
+
 				putBox.setTotalNum(tradingBox.getBoxNumber());
-				putBox.setRemainingNum(tradingBox.getBoxNumber());
+				putBox.setRemainingNum(putBox.getTotalNum());
+				putBox.setNotSuitcaseNum(putBox.getTotalNum());
+
 				putBox.setEffectiveEndDate(tradingBox.getExpiryDate());
 				putBox.setEffectiveStartDate(tradingBox.getEffectiveDate());
 				putBox.setBoxType(tradingBox.getBoxTypeQuantityOne());
@@ -1635,6 +1641,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 						archives1.setStationCname(detail.getPolStationCname());
 						archives1.setStationEname(detail.getPolStationEname());
 						archives1.setContractNo(tradingBox.getContractNo());
+						archives1.setRemarks(item.getRemarks());
+						archives1.setBoxMakingDate(item.getBoxMakingDate());
 						if ("BUY".equals(tradingBox.getType())) {
 							archives1.setContainerNumberType("自有箱");
 						} else if ("SELL".equals(tradingBox.getType())) {
@@ -1680,6 +1688,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 						archives1.setStationCode(detail.getPolStationCode());
 						archives1.setStationCname(detail.getPolStationCname());
 						archives1.setStationEname(detail.getPolStationEname());
+						archives1.setRemarks(item.getRemarks());
+						archives1.setBoxMakingDate(item.getBoxMakingDate());
 						if ("BUY".equals(tradingBox.getType())) {
 							archives1.setPurchaseDate(tradingBox.getPurchaseDate());
 							archives1.setBoxSource("买箱");
@@ -1737,6 +1747,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 					archives1.setStationCode(detail.getPolStationCode());
 					archives1.setStationCname(detail.getPolStationCname());
 					archives1.setStationEname(detail.getPolStationEname());
+					archives1.setRemarks(item.getRemarks());
+					archives1.setBoxMakingDate(item.getBoxMakingDate());
 					if ("BUY".equals(tradingBox.getType())) {
 						archives1.setPurchaseDate(tradingBox.getPurchaseDate());
 						archives1.setBoxSource("买箱");
@@ -1833,8 +1845,11 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setUpdateUser(AuthUtil.getUserId());
 				putBox.setUpdateTime(new Date());
 				putBox.setUpdateUserName(AuthUtil.getUserName());
-				putBox.setTotalNum(putBox.getTotalNum() + itemList.size());
-				putBox.setRemainingNum(putBox.getRemainingNum() + itemList.size());
+
+				putBox.setTotalNum(putBox.getTotalNum() + tradingBox.getBoxNumber());
+				putBox.setRemainingNum(putBox.getTotalNum() - putBox.getOccupyNum());
+				putBox.setStorageNum(putBox.getStorageNum() - tradingBox.getBoxNumber());
+
 				if (ObjectUtils.isNotNull(putBox.getPodId())) {
 					String podId = putBox.getPodId() + "," + detail.getPodId();
 					List<String> podIdList = Arrays.asList(podId.trim().split(","));

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

@@ -30,10 +30,7 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.los.box.entity.RouteCost;
-import org.springblade.los.box.entity.RouteCostItem;
 import org.springblade.los.business.mktSlot.entity.MktSlot;
-import org.springblade.los.business.mktSlot.entity.MktSlotItem;
 import org.springblade.los.business.mktSlot.entity.MktSlotQuotation;
 import org.springblade.los.business.mktSlot.service.IMktSlotQuotationService;
 import org.springblade.los.business.mktSlot.service.IMktSlotService;
@@ -41,7 +38,6 @@ import org.springblade.los.business.mktSlot.vo.MktSlotVO;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -199,9 +195,7 @@ public class MktSlotController extends BladeController {
 		LambdaQueryWrapper<MktSlot> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(MktSlot::getTenantId, AuthUtil.getTenantId())
 			.eq(MktSlot::getIsDeleted, 0)
-			.eq(MktSlot::getBillStatus, "已提交")
-			.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);
 		if (!list.isEmpty()) {
@@ -209,7 +203,10 @@ public class MktSlotController extends BladeController {
 			mktSlotQuotationList = mktSlotQuotationService.list(new LambdaQueryWrapper<MktSlotQuotation>()
 				.eq(MktSlotQuotation::getTenantId, AuthUtil.getTenantId())
 				.eq(MktSlotQuotation::getIsDeleted, 0)
-				.eq(MktSlotQuotation::getShippingCompanyId, mktSlot.getShippingCompanyId())
+				.eq(ObjectUtils.isNotNull(mktSlot.getPolId()), MktSlotQuotation::getPolId, mktSlot.getPolId())
+				.eq(ObjectUtils.isNotNull(mktSlot.getPodId()), MktSlotQuotation::getPodId, mktSlot.getPodId())
+				.eq(MktSlotQuotation::getActualShippingCompanyId, mktSlot.getActualShippingCompanyId())
+				.eq(MktSlotQuotation::getEtd, mktSlot.getEtd())
 				.in(MktSlotQuotation::getPid, pid)
 			);
 		}

+ 19 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/service/impl/MktSlotServiceImpl.java

@@ -43,7 +43,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
-import java.time.*;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -170,7 +173,11 @@ public class MktSlotServiceImpl extends ServiceImpl<MktSlotMapper, MktSlot> impl
 			this.updateById(mktSlot);
 		}
 		if (ObjectUtils.isNotNull(mktSlot.getMktSlotItemList()) && !mktSlot.getMktSlotItemList().isEmpty()) {
+			List<MktSlotQuotation> mktSlotQuotationList = new ArrayList<>();
 			for (MktSlotItem item : mktSlot.getMktSlotItemList()) {
+				if (ObjectUtils.isNotNull(item.getMktSlotQuotationList()) && !item.getMktSlotQuotationList().isEmpty()){
+					mktSlotQuotationList.addAll(item.getMktSlotQuotationList());
+				}
 				if (item.getId() == null) {
 					item.setCreateTime(new Date());
 					item.setCreateUser(AuthUtil.getUserId());
@@ -185,6 +192,14 @@ public class MktSlotServiceImpl extends ServiceImpl<MktSlotMapper, MktSlot> impl
 				item.setPid(mktSlot.getId());
 			}
 			mktSlotItemService.saveOrUpdateBatch(mktSlot.getMktSlotItemList());
+			if (!mktSlotQuotationList.isEmpty()){
+				for (MktSlotQuotation item : mktSlotQuotationList){
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+				mktSlotQuotationService.updateBatchById(mktSlotQuotationList);
+			}
 		}
 		return R.data(mktSlot);
 	}
@@ -288,6 +303,9 @@ public class MktSlotServiceImpl extends ServiceImpl<MktSlotMapper, MktSlot> impl
 				mktSlotQuotation.setActualShippingCompanyEname(item.getActualShippingCompanyEname());
 				mktSlotQuotation.setActualShippingCompanyCode(item.getActualShippingCompanyCode());
 				mktSlotQuotation.setActualShippingCompanyAbbreviation(item.getActualShippingCompanyAbbreviation());
+				mktSlotQuotation.setNavigateDay(item.getNavigateDay());
+				mktSlotQuotation.setFlightType(item.getFlightType());
+				mktSlotQuotation.setRemarks(item.getImportantInstructions());
 				mktSlotQuotationList.add(mktSlotQuotation);
 			}
 			item.setUpdateUser(AuthUtil.getUserId());

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

@@ -801,36 +801,48 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			boolean statusAtd = false;
 			boolean statusAta = false;
 			if ("SE".equals(bills.getBusinessType())) {
+				if (ObjectUtils.isNull(details.getEtd()) && ObjectUtils.isNotNull(bills.getEtd())){
+					statusEtd = true;
+				}
 				if (ObjectUtils.isNotNull(details.getEtd()) && !details.getEtd().equals(bills.getEtd())) {
 					statusEtd = true;
 				}
+				if (ObjectUtils.isNull(details.getActualEtd()) && ObjectUtils.isNotNull(bills.getActualEtd())){
+					statusEtd = true;
+				}
 				if (ObjectUtils.isNotNull(details.getActualEtd()) && !details.getActualEtd().equals(bills.getActualEtd())) {
 					statusAtd = true;
 				}
 			} else if ("SI".equals(bills.getBusinessType())) {
+				if (ObjectUtils.isNull(details.getEta()) && ObjectUtils.isNotNull(bills.getEta())){
+					statusEtd = true;
+				}
 				if (ObjectUtils.isNotNull(details.getEta()) && !details.getEta().equals(bills.getEta())) {
 					statusEta = true;
 				}
+				if (ObjectUtils.isNull(details.getActualEta()) && ObjectUtils.isNotNull(bills.getActualEta())){
+					statusEtd = true;
+				}
 				if (ObjectUtils.isNotNull(details.getActualEta()) && !details.getActualEta().equals(bills.getActualEta())) {
 					statusAta = true;
 				}
 			}
-			boolean statusVessel = ObjectUtils.isNotNull(details.getVesselId()) && !details.getVesselId().equals(bills.getVesselId());
-			boolean statusVoyageNo = ObjectUtils.isNotNull(details.getVoyageNo()) && !details.getVoyageNo().equals(bills.getVoyageNo());
-			boolean statusMblno = ObjectUtils.isNotNull(details.getMblno()) && !details.getMblno().equals(bills.getMblno());
-			boolean statusPolId = ObjectUtils.isNotNull(details.getPolId()) && !details.getPolId().equals(bills.getPolId());
-			boolean statusPodId = ObjectUtils.isNotNull(details.getPodId()) && !details.getPodId().equals(bills.getPodId());
-			boolean statusCyTrailerTime = ObjectUtils.isNotNull(details.getCyTrailerTime()) && !details.getCyTrailerTime().equals(bills.getCyTrailerTime());
-			boolean statusCyReturnTime = ObjectUtils.isNotNull(details.getCyReturnTime()) && !details.getCyReturnTime().equals(bills.getCyReturnTime());
-			boolean bookingDate = ObjectUtils.isNotNull(details.getBookingDate()) && !details.getBookingDate().equals(bills.getBookingDate());
-			boolean statusLineId = ObjectUtils.isNotNull(details.getLineId()) && !details.getLineId().equals(bills.getLineId());
-			boolean statusForwarding = ObjectUtils.isNotNull(details.getForwarding()) && !details.getForwarding().equals(bills.getForwarding());
-			boolean statusBookingAgentId = ObjectUtils.isNotNull(details.getBookingAgentId()) && !details.getBookingAgentId().equals(bills.getBookingAgentId());
-			boolean shippingAgencyId = ObjectUtils.isNotNull(details.getShippingAgencyId()) && !details.getShippingAgencyId().equals(bills.getShippingAgencyId());
-			boolean carrierId = ObjectUtils.isNotNull(details.getCarrierId()) && !details.getCarrierId().equals(bills.getCarrierId());
-			boolean foreignAgencyId = ObjectUtils.isNotNull(details.getForeignAgencyId()) && !details.getForeignAgencyId().equals(bills.getForeignAgencyId());
-			boolean issueDate = ObjectUtils.isNotNull(details.getIssueDate()) && !details.getIssueDate().equals(bills.getIssueDate());
-			boolean boxBelongsTo = ObjectUtils.isNotNull(details.getBoxBelongsTo()) && !details.getBoxBelongsTo().equals(bills.getBoxBelongsTo());
+			boolean statusVessel = ObjectUtils.isNotNull(bills.getVesselId()) && !bills.getVesselId().equals(details.getVesselId());
+			boolean statusVoyageNo = ObjectUtils.isNotNull(bills.getVoyageNo()) && !bills.getVoyageNo().equals(details.getVoyageNo());
+			boolean statusMblno = ObjectUtils.isNotNull(bills.getMblno()) && !bills.getMblno().equals(details.getMblno());
+			boolean statusPolId = ObjectUtils.isNotNull(bills.getPolId()) && !bills.getPolId().equals(details.getPolId());
+			boolean statusPodId = ObjectUtils.isNotNull(bills.getPodId()) && !bills.getPodId().equals(details.getPodId());
+			boolean statusCyTrailerTime = ObjectUtils.isNotNull(bills.getCyTrailerTime()) && !bills.getCyTrailerTime().equals(details.getCyTrailerTime());
+			boolean statusCyReturnTime = ObjectUtils.isNotNull(bills.getCyReturnTime()) && !bills.getCyReturnTime().equals(details.getCyReturnTime());
+			boolean bookingDate = ObjectUtils.isNotNull(bills.getBookingDate()) && !bills.getBookingDate().equals(details.getBookingDate());
+			boolean statusLineId = ObjectUtils.isNotNull(bills.getLineId()) && !bills.getLineId().equals(details.getLineId());
+			boolean statusForwarding = ObjectUtils.isNotNull(bills.getForwarding()) && !bills.getForwarding().equals(details.getForwarding());
+			boolean statusBookingAgentId = ObjectUtils.isNotNull(bills.getBookingAgentId()) && !bills.getBookingAgentId().equals(details.getBookingAgentId());
+			boolean shippingAgencyId = ObjectUtils.isNotNull(bills.getShippingAgencyId()) && !bills.getShippingAgencyId().equals(details.getShippingAgencyId());
+			boolean carrierId = ObjectUtils.isNotNull(bills.getCarrierId()) && !bills.getCarrierId().equals(details.getCarrierId());
+			boolean foreignAgencyId = ObjectUtils.isNotNull(bills.getForeignAgencyId()) && !bills.getForeignAgencyId().equals(details.getForeignAgencyId());
+			boolean issueDate = ObjectUtils.isNotNull(bills.getIssueDate()) && !bills.getIssueDate().equals(details.getIssueDate());
+			boolean boxBelongsTo = ObjectUtils.isNotNull(bills.getBoxBelongsTo()) && !bills.getBoxBelongsTo().equals(details.getBoxBelongsTo());
 			if (statusEtd || statusEta || statusAtd || statusAta || statusVessel || statusVoyageNo || statusMblno || statusPolId
 				|| statusPodId || statusCyTrailerTime || statusCyReturnTime || statusLineId || statusForwarding || statusBookingAgentId
 				|| shippingAgencyId || bookingDate || carrierId || foreignAgencyId || issueDate || boxBelongsTo) {
@@ -2631,6 +2643,23 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setShippingStaffId(bills.getShippingStaffId());
 		detail.setShippingStaffName(bills.getShippingStaffName());
 		baseMapper.updateById(detail);
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					item.setLogisticsStatus("已提交");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setShippingStaffId(bills.getShippingStaffId());
+					item.setShippingStaffName(bills.getShippingStaffName());
+				}
+				this.updateBatchById(billsList);
+			}
+		}
 		LocalDateTime now = LocalDateTime.now();
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 		String formatted = now.format(formatter);
@@ -2707,6 +2736,23 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setShippingStaffId(null);
 		detail.setShippingStaffName("");
 		baseMapper.updateById(detail);
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					item.setLogisticsStatus("录入");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setShippingStaffId(null);
+					item.setShippingStaffName("");
+				}
+				this.updateBatchById(billsList);
+			}
+		}
 		return R.data(detail);
 	}
 
@@ -2858,6 +2904,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 			if (!details.isEmpty()) {
+				for (Bills item : details){
+					item.setTransferOrderStatus("已转单");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setPodCompanyId(bills.getPodCompanyId());
+					item.setPodCompanyName(bills.getPodCompanyName());
+					item.setPodStaffId(bills.getPodStaffId());
+					item.setPodStaffName(bills.getPodStaffName());
+				}
+				this.updateBatchById(details);
 				List<Bills> billsList = new ArrayList<>();
 				for (Bills item : details) {
 					item.setOperatorId(bills.getPodStaffId());
@@ -3191,6 +3248,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R revokeTransferOrder(Bills bills) {
 		if (bills.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -3214,7 +3272,20 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		this.removeItemList(billsJk.getId());
 		baseMapper.deleteById(billsJk.getId());
 		//主单应加上分单费用
-		if ("MM".equals(billsJk.getBillType())) {
+		if ("MM".equals(detail.getBillType())) {
+			List<Bills> details1 = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, detail.getId()));
+			if (!details1.isEmpty()) {
+				for (Bills item : details1) {
+					item.setTransferOrderStatus("录入");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+				}
+				this.updateBatchById(details1);
+			}
 			List<Bills> details = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
@@ -3272,13 +3343,43 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setUpdateUserName(AuthUtil.getUserName());
 		detail.setUpdateTime(new Date());
 		baseMapper.updateById(detail);
-		Bills bills1 = baseMapper.selectById(bills.getSrcBusId());
+		Bills bills1 = baseMapper.selectById(detail.getSrcBusId());
 		if (bills1 != null) {
 			bills1.setReceiveStatus("已接收");
 			bills1.setUpdateUser(AuthUtil.getUserId());
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateTime(new Date());
 			baseMapper.updateById(bills1);
+			if ("MM".equals(bills1.getBillType())){
+				List<Bills> billsList1 = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getMasterId, bills1.getId()));
+				if (!billsList1.isEmpty()){
+					for (Bills item : billsList1){
+						item.setReceiveStatus("已接收");
+						item.setUpdateUser(AuthUtil.getUserId());
+						item.setUpdateUserName(AuthUtil.getUserName());
+						item.setUpdateTime(new Date());
+					}
+					this.updateBatchById(billsList1);
+				}
+			}
+		}
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					item.setReceiveStatus("已接收");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+				}
+				this.updateBatchById(billsList);
+			}
 		}
 		return R.data(detail);
 	}
@@ -3305,6 +3406,36 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateTime(new Date());
 			baseMapper.updateById(bills1);
+			if ("MM".equals(bills1.getBillType())){
+				List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getMasterId, bills1.getId()));
+				if (!billsList.isEmpty()){
+					for (Bills item : billsList){
+						item.setReceiveStatus("录入");
+						item.setUpdateUser(AuthUtil.getUserId());
+						item.setUpdateUserName(AuthUtil.getUserName());
+						item.setUpdateTime(new Date());
+					}
+					this.updateBatchById(billsList);
+				}
+			}
+		}
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					item.setReceiveStatus("录入");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+				}
+				this.updateBatchById(billsList);
+			}
 		}
 		return R.data(detail);
 	}
@@ -3332,6 +3463,26 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setUpdateTime(new Date());
 		detail.setChangeOrderDate(new Date());
 		baseMapper.updateById(detail);
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					if ("录入".equals(item.getChangeOrdersStatus())) {
+						item.setChangeOrdersStatus("可换单");
+					} else {
+						item.setChangeOrdersStatus("已换单");
+					}
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setChangeOrderDate(new Date());
+				}
+				this.updateBatchById(billsList);
+			}
+		}
 		return R.data(detail);
 	}
 
@@ -3358,6 +3509,26 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setUpdateTime(new Date());
 		detail.setChangeOrderDate(null);
 		baseMapper.updateById(detail);
+		if ("MM".equals(detail.getBillType())){
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!billsList.isEmpty()){
+				for (Bills item : billsList){
+					if ("可换单".equals(item.getChangeOrdersStatus())) {
+						item.setChangeOrdersStatus("录入");
+					} else {
+						item.setChangeOrdersStatus("可换单");
+					}
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setChangeOrderDate(null);
+				}
+				this.updateBatchById(billsList);
+			}
+		}
 		return R.data(detail);
 	}
 
@@ -3414,11 +3585,15 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public R checkBillsBatch(String billsIds, String url, String pageStatus, String pageLabel) {
-		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+		LambdaQueryWrapper<Bills> lambdaQueryWrapper = new LambdaQueryWrapper<Bills>()
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getIsDeleted, 0)
 			.eq(Bills::getBranchId, AuthUtil.getDeptId())
-			.apply("find_in_set(id,'" + billsIds + "')"));
+			.apply("find_in_set(id,'" + billsIds + "')");
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
+		}
+		List<Bills> billsList = baseMapper.selectList(lambdaQueryWrapper);
 		if (billsList.isEmpty()) {
 			throw new RuntimeException("未查到单据信息");
 		}

+ 24 - 30
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml

@@ -243,18 +243,17 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.src_id
+            GROUP BY acc.src_id, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
-        GROUP BY acc.branch_id
     </select>
     <select id="feeSummaryExportList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
         SELECT
@@ -325,18 +324,17 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.src_id
+            GROUP BY acc.src_id, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
-        GROUP BY acc.branch_id
     </select>
     <select id="feeSummaryDetailList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
         SELECT
@@ -427,19 +425,18 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         ORDER BY acc.corp_id
-        GROUP BY acc.branch_id
     </select>
     <select id="feeSummaryDetailExportList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
         SELECT
@@ -530,19 +527,18 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         ORDER BY acc.corp_id
-        GROUP BY acc.branch_id
     </select>
     <select id="feeSummaryDetailNotList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
         SELECT
@@ -633,19 +629,18 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         ORDER BY acc.corp_id
-        GROUP BY acc.branch_id
     </select>
     <select id="feeSummaryDetailExportNotList"
             resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
@@ -737,19 +732,18 @@
             </if>
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
-            GROUP BY acc.corp_id
+            GROUP BY acc.corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
-            GROUP BY acc.bill_corp_id
+            GROUP BY acc.bill_corp_id, acc.branch_id
         </if>
         <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.mblno
+            GROUP BY acc.mblno, acc.branch_id
         </if>
         ORDER BY acc.corp_id
-        GROUP BY acc.branch_id
     </select>
     <select id="agingAnalysis" resultType="org.springblade.los.statisticAnalysis.AgingAnalysisRD">
         SELECT

+ 34 - 32
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.basic.corps.entity.BCorps;
@@ -279,7 +278,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				feeCenter.setSort(count);
 				feeCenter.setCorpType(templateItems.getCorpType());
 				count++;
-				if (ObjectUtils.isNull(templateItems.getCorpType())){
+				if (ObjectUtils.isNull(templateItems.getCorpType())) {
 					BCorps bCorps = null;
 					if (!corpsList.isEmpty()) {
 						bCorps = corpsList.stream().filter(e -> e.getId().equals(items.getCorpId())).findFirst().orElse(null);
@@ -288,7 +287,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setCorpCnName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(items.getCorpEnName());
 					feeCenter.setShortName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
-				}else{
+				} else {
 					if ("国内直接客户,国外直接客户,国内同行及代理".contains(templateItems.getCorpType())) {
 						feeCenter.setCorpId(bills.getCorpId());
 						feeCenter.setCorpCnName(bills.getShortName());
@@ -1263,7 +1262,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				feeCenter.setSort(count);
 				feeCenter.setCorpType(templateItems.getCorpType());
 				count++;
-				if (ObjectUtils.isNull(templateItems.getCorpType())){
+				if (ObjectUtils.isNull(templateItems.getCorpType())) {
 					BCorps bCorps = null;
 					if (!corpsList.isEmpty()) {
 						bCorps = corpsList.stream().filter(e -> e.getId().equals(items.getCorpId())).findFirst().orElse(null);
@@ -1272,7 +1271,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setCorpCnName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(items.getCorpEnName());
 					feeCenter.setShortName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
-				}else{
+				} else {
 					if ("国内直接客户,国外直接客户,国内同行及代理".contains(templateItems.getCorpType())) {
 						feeCenter.setCorpId(bills.getCorpId());
 						feeCenter.setCorpCnName(bills.getShortName());
@@ -1545,14 +1544,15 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						count++;
 					}
 				} else if ("MH".equals(bills.getBillType())) {
-					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "国内直接客户", items,
+					throw new RuntimeException("只能提取主单,直单单据成本");
+					/*FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "国内直接客户", items,
 						curExrateList, preContainers, exrateType, "4");
 					if (feeCenter != null) {
 						feeCenter.setBranchId(branchId);
 						feeCenter.setBranchName(deptName);
 						list.add(feeCenter);
 						count++;
-					}
+					}*/
 				} else {
 					throw new RuntimeException("单据类型错误,请联系管理员");
 				}
@@ -1574,11 +1574,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public R quotationImportBatch(String billsIds, String quotationId) {
-		List<MktSlotQuotation> mktSlotQuotationList = mktSlotQuotationService.list(new LambdaQueryWrapper<MktSlotQuotation>()
-			.eq(MktSlotQuotation::getTenantId, AuthUtil.getTenantId())
-			.eq(MktSlotQuotation::getIsDeleted, 0)
-			.eq(MktSlotQuotation::getPid, Func.toLongList(quotationId)));
-		if (mktSlotQuotationList.isEmpty()) {
+		MktSlotQuotation mktSlotQuotation = mktSlotQuotationService.getById(quotationId);
+		if (mktSlotQuotation == null) {
 			throw new RuntimeException("未查到成本明细");
 		}
 		List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
@@ -1647,7 +1644,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				preContainers = preContainersList.stream().filter(e -> e.getPid().equals(bills.getId())).collect(Collectors.toList());
 			}
 			if (preContainers.isEmpty()) {
-				continue;
+				throw new RuntimeException("请维护编号:" + bills.getBillNo() + "单据箱型数据");
 			}
 			Date date;
 			if ("SE".equals(bills.getBusinessType())) {
@@ -1663,40 +1660,41 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					date = bills.getEta();
 				}
 			}
-			List<MktSlotQuotation> mktSlotQuotations = mktSlotQuotationList.stream().filter(e -> e.getEtd().equals(date)
-				&& e.getBoxBelongsTo().equals(bills.getBoxBelongsTo())).collect(Collectors.toList());
 			String exrateType = currencyUtils.standardCurrency(branchId);
 			List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 			int count = 1;
 			for (PreContainers item : preContainers) {
 				FeeCenter feeCenter = this.addFeeCenterQuotation(bills, "D", count, fees, "国内直接客户", item,
-					curExrateList, mktSlotQuotations, exrateType, "1");
+					curExrateList, mktSlotQuotation, exrateType, "1");
 				if (feeCenter != null) {
+					feeCenter.setUnitNo(item.getCntrTypeCode());
 					feeCenter.setBranchId(branchId);
 					feeCenter.setBranchName(deptName);
 					list.add(feeCenter);
 					count++;
 				}
 				if ("SOC".equals(bills.getBoxBelongsTo())) {
-					FeeCenter feeCenterD = this.addFeeCenterQuotation(bills, "D", count, feesD, "国内直接客户", item,
-						curExrateList, mktSlotQuotations, exrateType, "2");
+					FeeCenter feeCenterD = this.addFeeCenterQuotation(bills, "C", count, feesD, "国内直接客户", item,
+						curExrateList, mktSlotQuotation, exrateType, "2");
 					if (feeCenterD != null) {
+						feeCenterD.setUnitNo(item.getCntrTypeCode());
 						feeCenterD.setBranchId(branchId);
 						feeCenterD.setBranchName(deptName);
 						list.add(feeCenterD);
 						count++;
 					}
 				} else if ("COC".equals(bills.getBoxBelongsTo())) {
-					FeeCenter feeCenterD = this.addFeeCenterQuotation(bills, "D", count, feesD, "国内直接客户", item,
-						curExrateList, mktSlotQuotations, exrateType, "2");
+					FeeCenter feeCenterD = this.addFeeCenterQuotation(bills, "C", count, feesD, "船公司", item,
+						curExrateList, mktSlotQuotation, exrateType, "3");
 					if (feeCenterD != null) {
+						feeCenterD.setUnitNo(item.getCntrTypeCode());
 						feeCenterD.setBranchId(branchId);
 						feeCenterD.setBranchName(deptName);
 						list.add(feeCenterD);
 						count++;
 					}
 				} else {
-					throw new RuntimeException("单号:" + bills.getBillNo() + "单据类型非分单,请选择分单数据");
+					throw new RuntimeException("单号:" + bills.getBillNo() + "单据箱箱属不符");
 				}
 
 			}
@@ -1715,7 +1713,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 
 	private FeeCenter addFeeCenterQuotation(Bills bills, String dc, int count, BFees fees, String corpType,
 											PreContainers items, List<BCurExrate> curExrateList,
-											List<MktSlotQuotation> mktSlotQuotations, String exrateType, String type) {
+											MktSlotQuotation mktSlotQuotations, String exrateType, String type) {
 		FeeCenter feeCenter = new FeeCenter();
 		feeCenter.setBranchId(bills.getBranchId());
 		feeCenter.setBranchName(bills.getBranchName());
@@ -1766,11 +1764,11 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			feeCenter.setCorpEnName(bills.getCorpEnName());
 			feeCenter.setShortName(bills.getShortName());
 			if ("20GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp20).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp20());
 			} else if ("40GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp40).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp40());
 			} else if ("40HC".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getHc40).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getHc40());
 			} else {
 				return null;
 			}
@@ -1787,11 +1785,11 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			feeCenter.setCorpEnName(bCorps.getEnName());
 			feeCenter.setShortName(bCorps.getShortName());
 			if ("20GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp20Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp20Cost());
 			} else if ("40GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp40Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp40Cost());
 			} else if ("40HC".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getHc40Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getHc40Cost());
 			} else {
 				return null;
 			}
@@ -1801,11 +1799,11 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			feeCenter.setCorpEnName(bills.getCarrierEnName());
 			feeCenter.setShortName(bills.getCarrierShortName());
 			if ("20GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp20Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp20Cost());
 			} else if ("40GP".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getGp40Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getGp40Cost());
 			} else if ("40HC".equals(items.getCntrTypeCode())) {
-				feeCenter.setPrice(mktSlotQuotations.stream().map(MktSlotQuotation::getHc40Cost).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				feeCenter.setPrice(mktSlotQuotations.getHc40Cost());
 			} else {
 				return null;
 			}
@@ -1823,7 +1821,11 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				feeCenter.setAmountLoc(new BigDecimal("0"));
 			}
 		}
-		return feeCenter;
+		if (new BigDecimal("0").compareTo(feeCenter.getAmount()) == 0) {
+			return null;
+		} else {
+			return feeCenter;
+		}
 	}
 
 	private FeeCenter addFeeCenter(Bills bills, String dc, int count, BFees fees, String corpType, RouteCostItem items,