Browse Source

1.海运进出口列表状态检索条件增加
2.预定舱提交增加状态判断
3.增加海运出口主单同步分单数据接口
4.增加预定舱-预定订舱发送消息接口
5.箱池动态-导入接口修改箱数逻辑
6.超期箱使费增加港口并修改计算规则
7.修改租户复制接口逻辑
8.批量修改单据类型接口从经汉迁移代码
9.增加ow批量修改POD堆场信息接口
10.费用请核-审核人根据单据所属公司走
11.提取商务中心费用币别改为取成本中心币别
12. 物流下拉查询部门数据增加租户条件

纪新园 7 months ago
parent
commit
9bd20cb30c
23 changed files with 513 additions and 169 deletions
  1. 21 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFees.java
  2. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotItem.java
  3. 25 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/mktSlot/entity/MktSlotQuotation.java
  4. 6 7
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  5. 3 1
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsMapper.xml
  6. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java
  7. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesServiceImpl.java
  8. 5 2
      blade-service/blade-los/src/main/java/org/springblade/los/billno/mapper/BusinessBillNoMapper.xml
  9. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java
  10. 6 3
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  11. 56 44
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  12. 28 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  13. 5 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/mktSlot/service/impl/MktSlotServiceImpl.java
  14. 43 9
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  15. 8 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BookingCabinController.java
  16. 6 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java
  17. 190 30
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  18. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/SeaContainerNumberItemServiceImpl.java
  19. 3 1
      blade-service/blade-los/src/main/java/org/springblade/los/check/mapper/AuditPathsActsMapper.xml
  20. 3 1
      blade-service/blade-los/src/main/java/org/springblade/los/check/mapper/AuditPathsMapper.xml
  21. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java
  22. 2 0
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
  23. 90 64
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java

+ 21 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFees.java

@@ -109,6 +109,27 @@ public class StorageFees implements Serializable {
 	private String updateUserName;
 	private String updateUserName;
 
 
 	/**
 	/**
+	 * 当前港口
+	 */
+	@ApiModelProperty(value = "当前港口")
+	private String portId;
+	/**
+	 * 当前港口编码
+	 */
+	@ApiModelProperty(value = "当前港口编码")
+	private String portCode;
+	/**
+	 * 当前港口中文
+	 */
+	@ApiModelProperty(value = "当前港口中文")
+	private String portCname;
+	/**
+	 * 当前港口英文
+	 */
+	@ApiModelProperty(value = "当前港口英文")
+	private String portEname;
+
+	/**
 	 * 明细
 	 * 明细
 	 */
 	 */
 
 

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

@@ -334,6 +334,12 @@ public class MktSlotItem implements Serializable {
 	@ApiModelProperty(value = "来源Id")
 	@ApiModelProperty(value = "来源Id")
 	private Long srcId;
 	private Long srcId;
 
 
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
 	@TableField(exist = false)
 	@TableField(exist = false)
 	private List<MktSlotQuotation> mktSlotQuotationList;
 	private List<MktSlotQuotation> mktSlotQuotationList;
 
 

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

@@ -270,6 +270,31 @@ public class MktSlotQuotation implements Serializable {
 	 */
 	 */
 	@ApiModelProperty(value = "类型  转船/直达")
 	@ApiModelProperty(value = "类型  转船/直达")
 	private String flightType;
 	private String flightType;
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+	/**
+	 * 中转港
+	 */
+	@ApiModelProperty(value = "中转港")
+	private Long transitPortId;
+	/**
+	 * 中转港中文
+	 */
+	@ApiModelProperty(value = "中转港中文")
+	private String transitPortCname;
+	/**
+	 * 中转港英文
+	 */
+	@ApiModelProperty(value = "中转港英文")
+	private String transitPortEname;
+	/**
+	 * 中转港代码
+	 */
+	@ApiModelProperty(value = "中转港代码")
+	private String transitPortCode;
 
 
 
 
 }
 }

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

@@ -1033,7 +1033,7 @@ public class Bills implements Serializable {
 	@ApiModelProperty(value = "进项发票开具状态描述(0  未开 3 部分 9 全开)")
 	@ApiModelProperty(value = "进项发票开具状态描述(0  未开 3 部分 9 全开)")
 	private String invoiceCrStatusDescr;
 	private String invoiceCrStatusDescr;
 	/**
 	/**
-	 * 状态(业务参数配置) 0接单1退舱3完成4出号5开船6到港7全部8返空9换单10通关
+	 * 状态(业务参数配置) 0接单1退舱3完成4出号5开船6到港7全部8返空9换单10通关11待处理12待请核
 	 */
 	 */
 	@ApiModelProperty(value = "状态(业务参数配置)")
 	@ApiModelProperty(value = "状态(业务参数配置)")
 	private Integer billStatus;
 	private Integer billStatus;
@@ -1585,6 +1585,11 @@ public class Bills implements Serializable {
 	 */
 	 */
 	@ApiModelProperty(value = "承运人简称")
 	@ApiModelProperty(value = "承运人简称")
 	private String actualShippingCompanyAbbreviation;
 	private String actualShippingCompanyAbbreviation;
+	/**
+	 * 来源id预定舱
+	 */
+	@ApiModelProperty(value = "来源id预定舱")
+	private Long temporaryId;
 
 
 	/**
 	/**
 	 * 到港日期
 	 * 到港日期
@@ -2412,12 +2417,6 @@ public class Bills implements Serializable {
 	private String exrateType;
 	private String exrateType;
 
 
 	/**
 	/**
-	 * 临时来源id
-	 */
-	@TableField(exist = false)
-	private Long temporaryId;
-
-	/**
 	 * 首页统计类型  1=开船提醒
 	 * 首页统计类型  1=开船提醒
 	 *    2=到港提醒
 	 *    2=到港提醒
 	 *    3=截港提醒
 	 *    3=截港提醒

+ 3 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsMapper.xml

@@ -34,7 +34,9 @@
     </select>
     </select>
     <select id="getReports" resultMap="reportsResultMap">
     <select id="getReports" resultMap="reportsResultMap">
         select * from los_b_reports where is_deleted = 0 and  tenant_id = #{data.tenantId}
         select * from los_b_reports where is_deleted = 0 and  tenant_id = #{data.tenantId}
-                                      and branch_id = #{data.branchId}
+        <if test='data.branchId != null and data.branchId!= ""'>
+            and branch_id = #{data.branchId}
+        </if>
     </select>
     </select>
 
 
 </mapper>
 </mapper>

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

@@ -355,7 +355,7 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 					.eq(MktSlotQuotation::getTenantId, AuthUtil.getTenantId())
 					.eq(MktSlotQuotation::getTenantId, AuthUtil.getTenantId())
 					.eq(MktSlotQuotation::getIsDeleted, 0)
 					.eq(MktSlotQuotation::getIsDeleted, 0)
 					.eq(MktSlotQuotation::getPid, mktSlot.getId())
 					.eq(MktSlotQuotation::getPid, mktSlot.getId())
-					.orderByDesc(MktSlotQuotation::getPpid));
+					.orderByDesc(MktSlotQuotation::getSort));
 				mktSlot.setMktSlotQuotationList(mktSlotQuotationList);
 				mktSlot.setMktSlotQuotationList(mktSlotQuotationList);
 				mktSlot.setDept(dept);
 				mktSlot.setDept(dept);
 				map.put(MagicValues.DATA, mktSlot);
 				map.put(MagicValues.DATA, mktSlot);

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesServiceImpl.java

@@ -73,7 +73,9 @@ public class StorageFeesServiceImpl extends ServiceImpl<StorageFeesMapper, Stora
 		}
 		}
 		List<StorageFees> cname = baseMapper.selectList(new LambdaQueryWrapper<StorageFees>()
 		List<StorageFees> cname = baseMapper.selectList(new LambdaQueryWrapper<StorageFees>()
 			.eq(StorageFees::getType, storageFees.getType())
 			.eq(StorageFees::getType, storageFees.getType())
+			.eq(StorageFees::getPortId, storageFees.getPortId())
 			.eq(StorageFees::getTenantId, AuthUtil.getTenantId())
 			.eq(StorageFees::getTenantId, AuthUtil.getTenantId())
+			.eq(StorageFees::getBranchId, branchId)
 			.eq(StorageFees::getIsDeleted, 0));
 			.eq(StorageFees::getIsDeleted, 0));
 		if (storageFees.getId() == null) {
 		if (storageFees.getId() == null) {
 			if (!cname.isEmpty()) {
 			if (!cname.isEmpty()) {

+ 5 - 2
blade-service/blade-los/src/main/java/org/springblade/los/billno/mapper/BusinessBillNoMapper.xml

@@ -35,8 +35,11 @@
     </select>
     </select>
     <select id="getBusinessBillNo" resultMap="businessBillNoResultMap">
     <select id="getBusinessBillNo" resultMap="businessBillNoResultMap">
         select * from los_b_business_bill_no where is_deleted = 0
         select * from los_b_business_bill_no where is_deleted = 0
-                                               and  tenant_id = #{data.tenantId}
-                                               and branch_id = #{data.branchId}
+        and tenant_id = #{data.tenantId}
+        <if test='data.branchId != null and data.branchId!= ""'>
+            and branch_id = #{data.branchId}
+        </if>
+
     </select>
     </select>
 
 
 </mapper>
 </mapper>

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

@@ -438,7 +438,7 @@ public class RouteCostController extends BladeController {
 					mktSlotItem.setImportantInstructions(item.getRemarks());
 					mktSlotItem.setImportantInstructions(item.getRemarks());
 					mktSlotItem.setEffectiveStartDate(item.getEffectiveStartDate());
 					mktSlotItem.setEffectiveStartDate(item.getEffectiveStartDate());
 					mktSlotItem.setEffectiveEndDate(item.getEffectiveEndDate());
 					mktSlotItem.setEffectiveEndDate(item.getEffectiveEndDate());
-					//todo mktSlotItem.setCurCode();
+					mktSlotItem.setCurCode(routeCostItemList.get(0).getCurCode());
 					mktSlotItem.setPolId(item.getPodId());
 					mktSlotItem.setPolId(item.getPodId());
 					mktSlotItem.setPolCode(item.getPodCode());
 					mktSlotItem.setPolCode(item.getPodCode());
 					mktSlotItem.setPolCnName(item.getPodCname());
 					mktSlotItem.setPolCnName(item.getPodCname());

+ 6 - 3
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java

@@ -232,18 +232,21 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 			.eq(LosAuditPathsActs::getIsEnable, 1)
 			.eq(LosAuditPathsActs::getIsEnable, 1)
 			.eq(LosAuditPathsActs::getFidStatus, "status")
 			.eq(LosAuditPathsActs::getFidStatus, "status")
 			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId())
 			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId())
-			.eq(LosAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
+			.eq(LosAuditPathsActs::getSalesCompanyId, expenseApplication.getBranchId())
 			.eq(LosAuditPathsActs::getActId, actId);
 			.eq(LosAuditPathsActs::getActId, actId);
 		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
 		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
 		//获取审批信息
 		//获取审批信息
 		LosAuditPathsActs losAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<LosAuditPathsActs>()
 		LosAuditPathsActs losAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<LosAuditPathsActs>()
 			.eq(LosAuditPathsActs::getActId, actId)
 			.eq(LosAuditPathsActs::getActId, actId)
 			.eq(LosAuditPathsActs::getFidStatus, "status")
 			.eq(LosAuditPathsActs::getFidStatus, "status")
-			.eq(LosAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
+			.eq(LosAuditPathsActs::getSalesCompanyId, expenseApplication.getBranchId())
 			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
 			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
 		Long pathId = losAuditPathsActs.getPathId();
 		Long pathId = losAuditPathsActs.getPathId();
 		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<LosAuditPathsLevels>()
 		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<LosAuditPathsLevels>()
-			.eq(LosAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(LosAuditPathsLevels::getPathId, pathId));
+			.eq(LosAuditPathsLevels::getTenantId, AuthUtil.getTenantId())
+			.eq(LosAuditPathsLevels::getPathId, pathId)
+			.eq(LosAuditPathsLevels::getSalesCompanyId, expenseApplication.getBranchId())
+		);
 		auditProecessDTO.setTimes(1);
 		auditProecessDTO.setTimes(1);
 		auditProecessDTO.setProcessType(processType);
 		auditProecessDTO.setProcessType(processType);
 		// 没开启审批流直接走 通过流程
 		// 没开启审批流直接走 通过流程

+ 56 - 44
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -672,8 +672,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		List<Containers> containersList = new ArrayList<>();
 		List<Containers> containersList = new ArrayList<>();
 		List<Containers> containersListNew = new ArrayList<>();
 		List<Containers> containersListNew = new ArrayList<>();
+		List<Bills> billsList = new ArrayList<>();
 		if (!mblno.isEmpty()) {
 		if (!mblno.isEmpty()) {
-			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+			billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.in(Bills::getMblno, mblno));
 				.in(Bills::getMblno, mblno));
@@ -1039,8 +1040,12 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				if (item.getStorageNum() < 0) {
 				if (item.getStorageNum() < 0) {
 					throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
 					throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
 				}
 				}
-				if ("OW(拿),OW(放)".contains(item.getBusType())) {
-					item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(count + ""));
+				if (!containersList.isEmpty()) {
+					List<String> boxList = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+						.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.toList());
+					long size = containersList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()) &&
+						boxList.contains(e.getCntrNo())).count();
+					item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(size + ""));
 					if (item.getOccupyNum() < 0) {
 					if (item.getOccupyNum() < 0) {
 						throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余操作占用小于本次导入箱数");
 						throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余操作占用小于本次导入箱数");
 					}
 					}
@@ -1202,8 +1207,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		List<Containers> containersList = new ArrayList<>();
 		List<Containers> containersList = new ArrayList<>();
 		List<Containers> containersListNew = new ArrayList<>();
 		List<Containers> containersListNew = new ArrayList<>();
+		List<Bills> billsList = new ArrayList<>();
 		if (!mblno.isEmpty()) {
 		if (!mblno.isEmpty()) {
-			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+			billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.in(Bills::getMblno, mblno));
 				.in(Bills::getMblno, mblno));
@@ -1471,23 +1477,6 @@ 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()) {
 		if (!archivesArrayList.isEmpty()) {
 			archivesService.saveOrUpdateBatch(archivesArrayList);
 			archivesService.saveOrUpdateBatch(archivesArrayList);
 		}
 		}
@@ -1504,7 +1493,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
 			tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
 		}
 		}
 		//计算超期箱使费
 		//计算超期箱使费
-		this.countOverdueFee(tradingBoxList, tradingBoxItemOldList);
+		if (!billsList.isEmpty()){
+			this.countOverdueFee(tradingBoxList, tradingBoxItemOldList);
+		}
 		ArchivesFiles archivesFiles = new ArchivesFiles();
 		ArchivesFiles archivesFiles = new ArchivesFiles();
 		archivesFiles.setCreateUser(AuthUtil.getUserId());
 		archivesFiles.setCreateUser(AuthUtil.getUserId());
 		archivesFiles.setCreateTime(new Date());
 		archivesFiles.setCreateTime(new Date());
@@ -1576,30 +1567,19 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				//对应海运进出口单据所属公司所有币别
 				//对应海运进出口单据所属公司所有币别
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
-				//所属公司具体超期标准
-				StorageFees storageFees;
-				if ("SE".equals(bills.getBusinessType())) {
-					storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
-						"出口超期箱".equals(e.getType())).findFirst().orElse(null);
-				} else if ("SI".equals(bills.getBusinessType())) {
-					storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
-						"进口超期箱".equals(e.getType())).findFirst().orElse(null);
-				} else {
-					storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
-						"退关、无货返空箱".equals(e.getType())).findFirst().orElse(null);
-				}
-				if (storageFees == null) {
-					throw new RuntimeException("请先维护基础资料-超期标准");
-				}
-				StorageFees finalStorageFees = storageFees;
-				//所属公司具体超期标准明细
-				List<StorageFeesItems> storageFeesItems = storageFeesItemsList.stream().filter(e -> e.getPid().equals(finalStorageFees.getId()))
-					.collect(Collectors.toList());
-				if (storageFeesItems.isEmpty()) {
-					throw new RuntimeException("请先维护基础资料-超期标准");
-				}
 				//起运港超期天数
 				//起运港超期天数
 				if (ObjectUtils.isNotNull(item.getPolPickUpDate()) && ObjectUtils.isNotNull(bills.getEtd())) {
 				if (ObjectUtils.isNotNull(item.getPolPickUpDate()) && ObjectUtils.isNotNull(bills.getEtd())) {
+					//所属公司具体超期标准
+					StorageFees storageFees = this.getStorageFees(storageFeesList, bills, "1");
+					if (storageFees == null) {
+						throw new RuntimeException("请先维护基础资料-超期标准");
+					}
+                    //所属公司具体超期标准明细
+					List<StorageFeesItems> storageFeesItems = storageFeesItemsList.stream().filter(e -> e.getPid().equals(storageFees.getId()))
+						.collect(Collectors.toList());
+					if (storageFeesItems.isEmpty()) {
+						throw new RuntimeException("请先维护基础资料-超期标准");
+					}
 					LocalDateTime ldt1 = bills.getEtd().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt1 = bills.getEtd().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt2 = item.getPolPickUpDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt2 = item.getPolPickUpDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					long days = ChronoUnit.DAYS.between(ldt2, ldt1);
 					long days = ChronoUnit.DAYS.between(ldt2, ldt1);
@@ -1619,6 +1599,17 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				//目的港超期天数
 				//目的港超期天数
 				if (ObjectUtils.isNotNull(item.getPodEmptyContainerReturnDate()) &&
 				if (ObjectUtils.isNotNull(item.getPodEmptyContainerReturnDate()) &&
 					ObjectUtils.isNotNull(bills.getEta())) {
 					ObjectUtils.isNotNull(bills.getEta())) {
+					//所属公司具体超期标准
+					StorageFees storageFees = this.getStorageFees(storageFeesList, bills, "2");
+					if (storageFees == null) {
+						throw new RuntimeException("请先维护基础资料-超期标准");
+					}
+                    //所属公司具体超期标准明细
+					List<StorageFeesItems> storageFeesItems = storageFeesItemsList.stream().filter(e -> e.getPid().equals(storageFees.getId()))
+						.collect(Collectors.toList());
+					if (storageFeesItems.isEmpty()) {
+						throw new RuntimeException("请先维护基础资料-超期标准");
+					}
 					LocalDateTime ldt1 = item.getPodEmptyContainerReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt1 = item.getPodEmptyContainerReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt2 = bills.getEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					LocalDateTime ldt2 = bills.getEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 					long days = ChronoUnit.DAYS.between(ldt2, ldt1);
 					long days = ChronoUnit.DAYS.between(ldt2, ldt1);
@@ -1642,6 +1633,27 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		}
 		}
 	}
 	}
 
 
+	private StorageFees getStorageFees(List<StorageFees> storageFeesList, Bills bills, String type) {
+		StorageFees storageFees;
+		String portId;
+		if ("1".equals(type)){
+			portId = bills.getPolId() + "";
+		}else{
+			portId = bills.getPodId() + "";
+		}
+		if ("SE".equals(bills.getBusinessType())) {
+			storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
+				"出口超期箱".equals(e.getType()) && e.getPortId().contains(portId)).findFirst().orElse(null);
+		} else if ("SI".equals(bills.getBusinessType())) {
+			storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
+				"进口超期箱".equals(e.getType()) && e.getPortId().contains(portId)).findFirst().orElse(null);
+		} else {
+			storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
+				"退关、无货返空箱".equals(e.getType()) && e.getPortId().contains(portId)).findFirst().orElse(null);
+		}
+		return storageFees;
+	}
+
 	private FeeCenter addFeeCenter(TradingBox tradingBox, TradingBoxItem item, Bills bills, BFees fees,
 	private FeeCenter addFeeCenter(TradingBox tradingBox, TradingBoxItem item, Bills bills, BFees fees,
 								   List<StorageFeesItems> storageFeesItems, List<BCurExrate> curExrateList,
 								   List<StorageFeesItems> storageFeesItems, List<BCurExrate> curExrateList,
 								   int overdueDays, String exrateType) {
 								   int overdueDays, String exrateType) {

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

@@ -1848,7 +1848,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 
 
 				putBox.setTotalNum(putBox.getTotalNum() + tradingBox.getBoxNumber());
 				putBox.setTotalNum(putBox.getTotalNum() + tradingBox.getBoxNumber());
 				putBox.setRemainingNum(putBox.getTotalNum() - putBox.getOccupyNum());
 				putBox.setRemainingNum(putBox.getTotalNum() - putBox.getOccupyNum());
-				putBox.setStorageNum(putBox.getStorageNum() - tradingBox.getBoxNumber());
+				putBox.setStorageNum(putBox.getStorageNum() + tradingBox.getBoxNumber());
 
 
 				if (ObjectUtils.isNotNull(putBox.getPodId())) {
 				if (ObjectUtils.isNotNull(putBox.getPodId())) {
 					String podId = putBox.getPodId() + "," + detail.getPodId();
 					String podId = putBox.getPodId() + "," + detail.getPodId();
@@ -2748,6 +2748,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			throw new RuntimeException("未查到放箱号箱明细");
 			throw new RuntimeException("未查到放箱号箱明细");
 		}
 		}
 		List<PutBoxItems> putBoxItems = new ArrayList<>();
 		List<PutBoxItems> putBoxItems = new ArrayList<>();
+		List<String> mblno = new ArrayList<>();
 		for (TradingBoxItem item : tradingBox.getTradingBoxItemsList()) {
 		for (TradingBoxItem item : tradingBox.getTradingBoxItemsList()) {
 			item.setPodStationId(tradingBox.getPodStationId());
 			item.setPodStationId(tradingBox.getPodStationId());
 			item.setPodStationCname(tradingBox.getPodStationCname());
 			item.setPodStationCname(tradingBox.getPodStationCname());
@@ -2772,8 +2773,33 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		tradingBoxItemService.updateBatchById(tradingBox.getTradingBoxItemsList());
 		tradingBoxItemService.updateBatchById(tradingBox.getTradingBoxItemsList());
 		if (!putBoxItems.isEmpty()) {
 		if (!putBoxItems.isEmpty()) {
 			putBoxItemsService.updateBatchById(putBoxItems);
 			putBoxItemsService.updateBatchById(putBoxItems);
+			mblno = putBoxItems.stream().map(PutBoxItems::getMblno).distinct().collect(Collectors.toList());
+		}
+		List<Containers> containersListNew = new ArrayList<>();
+		List<Bills> billsList = new ArrayList<>();
+		if (!mblno.isEmpty()) {
+			billsList = billsService.list(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getMblno, mblno));
+			if (!billsList.isEmpty()) {
+				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.in(Containers::getPid, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+				for (Containers containers : containersList) {
+					containers.setPodStationId(tradingBox.getPodStationId());
+					containers.setPodStationCname(tradingBox.getPodStationCname());
+					containers.setPodStationCode(tradingBox.getPodStationCode());
+					containers.setPodStationEname(tradingBox.getPodStationEname());
+					containersListNew.add(containers);
+				}
+				if (!containersListNew.isEmpty()) {
+					containersService.updateBatchById(containersListNew);
+				}
+			}
 		}
 		}
-		return null;
+		return R.data(tradingBox);
 	}
 	}
 
 
 }
 }

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

@@ -306,6 +306,11 @@ public class MktSlotServiceImpl extends ServiceImpl<MktSlotMapper, MktSlot> impl
 				mktSlotQuotation.setNavigateDay(item.getNavigateDay());
 				mktSlotQuotation.setNavigateDay(item.getNavigateDay());
 				mktSlotQuotation.setFlightType(item.getFlightType());
 				mktSlotQuotation.setFlightType(item.getFlightType());
 				mktSlotQuotation.setRemarks(item.getImportantInstructions());
 				mktSlotQuotation.setRemarks(item.getImportantInstructions());
+				mktSlotQuotation.setSort(item.getSort());
+				mktSlotQuotation.setTransitPortId(item.getTransitPortId());
+				mktSlotQuotation.setTransitPortCname(item.getTransitPortCname());
+				mktSlotQuotation.setTransitPortCode(item.getTransitPortCode());
+				mktSlotQuotation.setTransitPortEname(item.getTransitPortEname());
 				mktSlotQuotationList.add(mktSlotQuotation);
 				mktSlotQuotationList.add(mktSlotQuotation);
 			}
 			}
 			item.setUpdateUser(AuthUtil.getUserId());
 			item.setUpdateUser(AuthUtil.getUserId());

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

@@ -129,9 +129,9 @@ public class BillsController extends BladeController {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -176,6 +176,12 @@ public class BillsController extends BladeController {
 				} else if (6 == bills.getBillStatus()) {
 				} else if (6 == bills.getBillStatus()) {
 					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
 					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
 					lambdaQueryWrapper.eq(Bills::getBillStatus, 0);
 					lambdaQueryWrapper.eq(Bills::getBillStatus, 0);
+				} else if (11 == bills.getBillStatus()) {
+					lambdaQueryWrapper.eq(Bills::getTransferOrderStatus, "录入");
+					lambdaQueryWrapper.eq(Bills::getLogisticsStatus, "已提交");
+				} else if (12 == bills.getBillStatus()) {
+					lambdaQueryWrapper.eq(Bills::getStatus, 0);
+					lambdaQueryWrapper.eq(Bills::getTransferOrderStatus, "已转单");
 				}
 				}
 			} else if ("SI".equals(bills.getBusinessType())) {
 			} else if ("SI".equals(bills.getBusinessType())) {
 				if ("1,2,3".contains(bills.getBillStatus() + "")) {
 				if ("1,2,3".contains(bills.getBillStatus() + "")) {
@@ -270,9 +276,9 @@ public class BillsController extends BladeController {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 			/*	if (AuthUtil.getUserRole().contains("业务员")) {
 			/*	if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -622,9 +628,9 @@ public class BillsController extends BladeController {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -667,6 +673,12 @@ public class BillsController extends BladeController {
 				} else if (6 == bills.getBillStatus()) {
 				} else if (6 == bills.getBillStatus()) {
 					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
 					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
 					lambdaQueryWrapper.eq(Bills::getBillStatus, 0);
 					lambdaQueryWrapper.eq(Bills::getBillStatus, 0);
+				} else if (11 == bills.getBillStatus()) {
+					lambdaQueryWrapper.eq(Bills::getTransferOrderStatus, "录入");
+					lambdaQueryWrapper.eq(Bills::getLogisticsStatus, "已提交");
+				} else if (12 == bills.getBillStatus()) {
+					lambdaQueryWrapper.eq(Bills::getStatus, 0);
+					lambdaQueryWrapper.eq(Bills::getTransferOrderStatus, "已转单");
 				}
 				}
 			} else if ("SI".equals(bills.getBusinessType())) {
 			} else if ("SI".equals(bills.getBusinessType())) {
 				if ("1,2,3".contains(bills.getBillStatus() + "")) {
 				if ("1,2,3".contains(bills.getBillStatus() + "")) {
@@ -862,5 +874,27 @@ public class BillsController extends BladeController {
 	public R revokeReturningSecurityMoney(@Valid @RequestBody Bills bills) {
 	public R revokeReturningSecurityMoney(@Valid @RequestBody Bills bills) {
 		return billsService.revokeReturningSecurityMoney(bills);
 		return billsService.revokeReturningSecurityMoney(bills);
 	}
 	}
+
+	/**
+	 * 同步分单数据
+	 */
+	@GetMapping("/synchronizeData")
+	@RepeatSubmit
+	public R synchronizeData(@RequestParam("billId") Long billId) {
+		return billsService.synchronizeData(billId);
+	}
+
+	/**
+	 * 批量修改提单类型
+	 *
+	 * @param ids      单据ids
+	 * @param billType 提单类型
+	 */
+	@GetMapping("/updateBillType")
+	@RepeatSubmit
+	public R updateBillType(@RequestParam("ids") String ids,
+							@RequestParam(value = "billType") String billType) {
+		return billsService.updateBillType(ids, billType);
+	}
 }
 }
 
 

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

@@ -136,5 +136,13 @@ public class BookingCabinController extends BladeController {
 		return billsService.submitBookingCabin(bills);
 		return billsService.submitBookingCabin(bills);
 	}
 	}
 
 
+	/**
+	 * 预定订舱(发送消息)
+	 */
+	@PostMapping("/sendMessageBooking")
+	public R sendMessageBooking(@Valid @RequestBody Bills bills) {
+		return billsService.sendMessageBooking(bills);
+	}
+
 }
 }
 
 

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java

@@ -181,4 +181,10 @@ public interface IBillsService extends IService<Bills> {
 	R submitBookingCabin(Bills bills);
 	R submitBookingCabin(Bills bills);
 
 
 	R submitBooking(Bills bills)throws Exception;
 	R submitBooking(Bills bills)throws Exception;
+
+	R synchronizeData(Long billId);
+
+	R sendMessageBooking(Bills bills);
+
+	R updateBillType(String ids, String billType);
 }
 }

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

@@ -31,7 +31,6 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.core.tool.utils.StringUtil;
-import org.springblade.los.Util.BoxNumUtils;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.Util.StringTools;
 import org.springblade.los.Util.StringTools;
 import org.springblade.los.Util.ZrUtil;
 import org.springblade.los.Util.ZrUtil;
@@ -542,6 +541,18 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		BigDecimal measurement = bills.getMeasurement();
 		BigDecimal measurement = bills.getMeasurement();
 		//主单应加上分单费用
 		//主单应加上分单费用
 		if ("MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
 		if ("MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
+			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);
+			}
 			bills.setMasterBillNo(bills.getBillNo());
 			bills.setMasterBillNo(bills.getBillNo());
 			//主单信息同步分单
 			//主单信息同步分单
 			List<Bills> details = this.synchronous(bills);
 			List<Bills> details = this.synchronous(bills);
@@ -801,26 +812,26 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			boolean statusAtd = false;
 			boolean statusAtd = false;
 			boolean statusAta = false;
 			boolean statusAta = false;
 			if ("SE".equals(bills.getBusinessType())) {
 			if ("SE".equals(bills.getBusinessType())) {
-				if (ObjectUtils.isNull(details.getEtd()) && ObjectUtils.isNotNull(bills.getEtd())){
+				if (ObjectUtils.isNull(details.getEtd()) && ObjectUtils.isNotNull(bills.getEtd())) {
 					statusEtd = true;
 					statusEtd = true;
 				}
 				}
 				if (ObjectUtils.isNotNull(details.getEtd()) && !details.getEtd().equals(bills.getEtd())) {
 				if (ObjectUtils.isNotNull(details.getEtd()) && !details.getEtd().equals(bills.getEtd())) {
 					statusEtd = true;
 					statusEtd = true;
 				}
 				}
-				if (ObjectUtils.isNull(details.getActualEtd()) && ObjectUtils.isNotNull(bills.getActualEtd())){
+				if (ObjectUtils.isNull(details.getActualEtd()) && ObjectUtils.isNotNull(bills.getActualEtd())) {
 					statusEtd = true;
 					statusEtd = true;
 				}
 				}
 				if (ObjectUtils.isNotNull(details.getActualEtd()) && !details.getActualEtd().equals(bills.getActualEtd())) {
 				if (ObjectUtils.isNotNull(details.getActualEtd()) && !details.getActualEtd().equals(bills.getActualEtd())) {
 					statusAtd = true;
 					statusAtd = true;
 				}
 				}
 			} else if ("SI".equals(bills.getBusinessType())) {
 			} else if ("SI".equals(bills.getBusinessType())) {
-				if (ObjectUtils.isNull(details.getEta()) && ObjectUtils.isNotNull(bills.getEta())){
+				if (ObjectUtils.isNull(details.getEta()) && ObjectUtils.isNotNull(bills.getEta())) {
 					statusEtd = true;
 					statusEtd = true;
 				}
 				}
 				if (ObjectUtils.isNotNull(details.getEta()) && !details.getEta().equals(bills.getEta())) {
 				if (ObjectUtils.isNotNull(details.getEta()) && !details.getEta().equals(bills.getEta())) {
 					statusEta = true;
 					statusEta = true;
 				}
 				}
-				if (ObjectUtils.isNull(details.getActualEta()) && ObjectUtils.isNotNull(bills.getActualEta())){
+				if (ObjectUtils.isNull(details.getActualEta()) && ObjectUtils.isNotNull(bills.getActualEta())) {
 					statusEtd = true;
 					statusEtd = true;
 				}
 				}
 				if (ObjectUtils.isNotNull(details.getActualEta()) && !details.getActualEta().equals(bills.getActualEta())) {
 				if (ObjectUtils.isNotNull(details.getActualEta()) && !details.getActualEta().equals(bills.getActualEta())) {
@@ -1300,6 +1311,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			.eq(Containers::getIsDeleted, 0)
 			.eq(Containers::getIsDeleted, 0)
 			.in(Containers::getPid, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
 			.in(Containers::getPid, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
 		if (!containersList.isEmpty()) {
 		if (!containersList.isEmpty()) {
+			for (Containers item : containersList) {
+				item.setMblno(bills.getMblno());
+			}
+			containersService.updateBatchById(containersList);
 			List<Containers> containersListNew = new ArrayList<>();
 			List<Containers> containersListNew = new ArrayList<>();
 			for (Containers item : containersList) {
 			for (Containers item : containersList) {
 				item.setSrcSplitOrderId(item.getPid());
 				item.setSrcSplitOrderId(item.getPid());
@@ -2643,13 +2658,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setShippingStaffId(bills.getShippingStaffId());
 		detail.setShippingStaffId(bills.getShippingStaffId());
 		detail.setShippingStaffName(bills.getShippingStaffName());
 		detail.setShippingStaffName(bills.getShippingStaffName());
 		baseMapper.updateById(detail);
 		baseMapper.updateById(detail);
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					item.setLogisticsStatus("已提交");
 					item.setLogisticsStatus("已提交");
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUserName(AuthUtil.getUserName());
 					item.setUpdateUserName(AuthUtil.getUserName());
@@ -2736,13 +2751,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setShippingStaffId(null);
 		detail.setShippingStaffId(null);
 		detail.setShippingStaffName("");
 		detail.setShippingStaffName("");
 		baseMapper.updateById(detail);
 		baseMapper.updateById(detail);
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					item.setLogisticsStatus("录入");
 					item.setLogisticsStatus("录入");
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUserName(AuthUtil.getUserName());
 					item.setUpdateUserName(AuthUtil.getUserName());
@@ -2904,7 +2919,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
 			if (!details.isEmpty()) {
 			if (!details.isEmpty()) {
-				for (Bills item : details){
+				for (Bills item : details) {
 					item.setTransferOrderStatus("已转单");
 					item.setTransferOrderStatus("已转单");
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUserName(AuthUtil.getUserName());
 					item.setUpdateUserName(AuthUtil.getUserName());
@@ -3350,13 +3365,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateTime(new Date());
 			bills1.setUpdateTime(new Date());
 			baseMapper.updateById(bills1);
 			baseMapper.updateById(bills1);
-			if ("MM".equals(bills1.getBillType())){
+			if ("MM".equals(bills1.getBillType())) {
 				List<Bills> billsList1 = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				List<Bills> billsList1 = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 					.eq(Bills::getTenantId, AuthUtil.getTenantId())
 					.eq(Bills::getTenantId, AuthUtil.getTenantId())
 					.eq(Bills::getIsDeleted, 0)
 					.eq(Bills::getIsDeleted, 0)
 					.eq(Bills::getMasterId, bills1.getId()));
 					.eq(Bills::getMasterId, bills1.getId()));
-				if (!billsList1.isEmpty()){
-					for (Bills item : billsList1){
+				if (!billsList1.isEmpty()) {
+					for (Bills item : billsList1) {
 						item.setReceiveStatus("已接收");
 						item.setReceiveStatus("已接收");
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUserName(AuthUtil.getUserName());
 						item.setUpdateUserName(AuthUtil.getUserName());
@@ -3366,13 +3381,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				}
 				}
 			}
 			}
 		}
 		}
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					item.setReceiveStatus("已接收");
 					item.setReceiveStatus("已接收");
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUserName(AuthUtil.getUserName());
 					item.setUpdateUserName(AuthUtil.getUserName());
@@ -3406,13 +3421,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateUserName(AuthUtil.getUserName());
 			bills1.setUpdateTime(new Date());
 			bills1.setUpdateTime(new Date());
 			baseMapper.updateById(bills1);
 			baseMapper.updateById(bills1);
-			if ("MM".equals(bills1.getBillType())){
+			if ("MM".equals(bills1.getBillType())) {
 				List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 					.eq(Bills::getTenantId, AuthUtil.getTenantId())
 					.eq(Bills::getTenantId, AuthUtil.getTenantId())
 					.eq(Bills::getIsDeleted, 0)
 					.eq(Bills::getIsDeleted, 0)
 					.eq(Bills::getMasterId, bills1.getId()));
 					.eq(Bills::getMasterId, bills1.getId()));
-				if (!billsList.isEmpty()){
-					for (Bills item : billsList){
+				if (!billsList.isEmpty()) {
+					for (Bills item : billsList) {
 						item.setReceiveStatus("录入");
 						item.setReceiveStatus("录入");
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUserName(AuthUtil.getUserName());
 						item.setUpdateUserName(AuthUtil.getUserName());
@@ -3422,13 +3437,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				}
 				}
 			}
 			}
 		}
 		}
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					item.setReceiveStatus("录入");
 					item.setReceiveStatus("录入");
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUser(AuthUtil.getUserId());
 					item.setUpdateUserName(AuthUtil.getUserName());
 					item.setUpdateUserName(AuthUtil.getUserName());
@@ -3463,13 +3478,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setUpdateTime(new Date());
 		detail.setUpdateTime(new Date());
 		detail.setChangeOrderDate(new Date());
 		detail.setChangeOrderDate(new Date());
 		baseMapper.updateById(detail);
 		baseMapper.updateById(detail);
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					if ("录入".equals(item.getChangeOrdersStatus())) {
 					if ("录入".equals(item.getChangeOrdersStatus())) {
 						item.setChangeOrdersStatus("可换单");
 						item.setChangeOrdersStatus("可换单");
 					} else {
 					} else {
@@ -3509,13 +3524,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setUpdateTime(new Date());
 		detail.setUpdateTime(new Date());
 		detail.setChangeOrderDate(null);
 		detail.setChangeOrderDate(null);
 		baseMapper.updateById(detail);
 		baseMapper.updateById(detail);
-		if ("MM".equals(detail.getBillType())){
+		if ("MM".equals(detail.getBillType())) {
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
 				.eq(Bills::getMasterId, bills.getId()));
-			if (!billsList.isEmpty()){
-				for (Bills item : billsList){
+			if (!billsList.isEmpty()) {
+				for (Bills item : billsList) {
 					if ("可换单".equals(item.getChangeOrdersStatus())) {
 					if ("可换单".equals(item.getChangeOrdersStatus())) {
 						item.setChangeOrdersStatus("录入");
 						item.setChangeOrdersStatus("录入");
 					} else {
 					} else {
@@ -4068,6 +4083,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	}
 	}
 
 
 	@Override
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R submitBookingCabin(Bills bills) {
 	public R submitBookingCabin(Bills bills) {
 		if (bills.getId() == null) {
 		if (bills.getId() == null) {
 			throw new SecurityException("缺少必要参数");
 			throw new SecurityException("缺少必要参数");
@@ -4076,6 +4092,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (detail == null) {
 		if (detail == null) {
 			throw new SecurityException("未查到单据信息");
 			throw new SecurityException("未查到单据信息");
 		}
 		}
+		detail.setIssueStatus("1");
+		baseMapper.updateById(detail);
 		SeaBillsDetail seaBillsDetail = seaBillsDetailService.getOne(new LambdaQueryWrapper<SeaBillsDetail>()
 		SeaBillsDetail seaBillsDetail = seaBillsDetailService.getOne(new LambdaQueryWrapper<SeaBillsDetail>()
 			.eq(SeaBillsDetail::getTenantId, AuthUtil.getTenantId())
 			.eq(SeaBillsDetail::getTenantId, AuthUtil.getTenantId())
 			.eq(SeaBillsDetail::getPid, detail.getId()));
 			.eq(SeaBillsDetail::getPid, detail.getId()));
@@ -4153,12 +4171,14 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		copyBills.setInvoiceDrStatusDescr("未开");
 		copyBills.setInvoiceDrStatusDescr("未开");
 		copyBills.setInvoiceCrStatus(0);
 		copyBills.setInvoiceCrStatus(0);
 		copyBills.setInvoiceCrStatusDescr("未开");
 		copyBills.setInvoiceCrStatusDescr("未开");
+		copyBills.setIssueStatus("0");
 		copyBills.setBillStatus(0);
 		copyBills.setBillStatus(0);
 		copyBills.setAccountStatus(0);
 		copyBills.setAccountStatus(0);
 		copyBills.setSplitOrderSum(0);
 		copyBills.setSplitOrderSum(0);
 		copyBills.setCfsQuantity(new BigDecimal("0.00"));
 		copyBills.setCfsQuantity(new BigDecimal("0.00"));
 		copyBills.setCfsGrossWeight(new BigDecimal("0.00"));
 		copyBills.setCfsGrossWeight(new BigDecimal("0.00"));
 		copyBills.setCfsMeasurement(new BigDecimal("0.00"));
 		copyBills.setCfsMeasurement(new BigDecimal("0.00"));
+		copyBills.setBillType("MM");
 		this.save(copyBills);
 		this.save(copyBills);
 		if (seaBillsDetail != null) {
 		if (seaBillsDetail != null) {
 			seaBillsDetail.setId(null);
 			seaBillsDetail.setId(null);
@@ -4187,6 +4207,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	}
 	}
 
 
 	@Override
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R submitBooking(Bills billss) throws Exception {
 	public R submitBooking(Bills billss) throws Exception {
 		Object object = StringTools.handle(billss, "Bills");
 		Object object = StringTools.handle(billss, "Bills");
 		Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
 		Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
@@ -4351,6 +4372,145 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		return R.data(bills);
 		return R.data(bills);
 	}
 	}
 
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R synchronizeData(Long billId) {
+		if (ObjectUtils.isNull(billId)) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Bills bills = baseMapper.selectById(billId);
+		if (bills != null) {
+			if (3 == bills.getBillStatus()) {
+				throw new RuntimeException("主单已完成,操作失败");
+			}
+			if (1 == bills.getBillStatus()) {
+				throw new RuntimeException("主单已退舱,操作失败");
+			}
+			if (bills.getStatus() > 0 && bills.getStatus() < 3) {
+				throw new RuntimeException("主单提交请核,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getMblno())) {
+				throw new RuntimeException("主单提单号不能为空,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getPodId())) {
+				throw new RuntimeException("卸货港不能为空,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getPolId())) {
+				throw new RuntimeException("装货港不能为空,操作失败");
+			}
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, billId));
+			BigDecimal grossWeight = new BigDecimal("0.00");
+			BigDecimal quantity = new BigDecimal("0.00");
+			BigDecimal measurement = new BigDecimal("0.00");
+			int teuTotal = 0;
+			String marks = "";
+			String commodityDescr = "";
+			if (!billsList.isEmpty()) {
+				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.eq(Containers::getPid, billId));
+				if (!containersList.isEmpty()) {
+					containersService.removeByIds(containersList.stream().map(Containers::getId).collect(Collectors.toList()));
+				}
+				teuTotal = teuTotal + billsList.stream().map(Bills::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
+				grossWeight = grossWeight.add(billsList.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				quantity = quantity.add(billsList.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				measurement = measurement.add(billsList.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				marks = billsList.stream().map(Bills::getMarks).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
+				commodityDescr = billsList.stream().map(Bills::getCommodityDescr).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
+				this.itemCopy(bills, billsList);
+			}
+			bills.setTeuTotal(teuTotal);
+			bills.setGrossWeight(grossWeight);
+			bills.setQuantity(quantity);
+			bills.setMeasurement(measurement);
+			bills.setSplitOrderSum(billsList.size());
+			if (ObjectUtils.isNotNull(marks)) {
+				marks = marks.replaceAll("N/M", "");
+				bills.setMarks("N/M" + marks);
+			}
+			if (ObjectUtils.isNotNull(commodityDescr)) {
+				bills.setCommodityDescr(commodityDescr);
+			}
+			baseMapper.updateById(bills);
+		}
+		return R.data("操作成功");
+	}
+
+	@Override
+	public R sendMessageBooking(Bills bills) {
+		//发送消息
+		R<String> res = sysClient.getRoleIds(bills.getBranchId(), "业务员");
+		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())){
+			R<List<User>> userListR = userClient.listUserByRoleId(res.getData(),AuthUtil.getTenantId(),bills.getBranchId());
+			if (userListR.isSuccess() && ObjectUtils.isNotNull(userListR.getData())) {
+				LocalDateTime now = LocalDateTime.now();
+				DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+				String formatted = now.format(formatter);
+				for (User datum : userListR.getData()){
+					Message sendMessage = new Message();
+					sendMessage.setParameter(bills.getId() + "");
+					sendMessage.setUserName(AuthUtil.getUserName());
+					sendMessage.setUserId(null);
+					sendMessage.setToUserId(datum.getId());
+					sendMessage.setToUserName(datum.getName());
+					sendMessage.setMessageType(1);
+					sendMessage.setTenantId(AuthUtil.getTenantId());
+					sendMessage.setCreateUser(null);
+					sendMessage.setCreateTime(new Date());
+					sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
+					sendMessage.setPageLabel("海运进口");
+					sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+					sendMessage.setMessageBody("您有新的预定舱,请及时待处理!单号:" + bills.getBillNo() + "时间:" + formatted);
+					R save = messageClient.save(sendMessage);
+					if (!save.isSuccess()) {
+						throw new SecurityException("发送消息失败");
+					}
+				}
+			}
+		}
+		return R.data("操作成功");
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R updateBillType(String ids, String billType) {
+		if (ObjectUtils.isNull(ids)) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getId, Func.toLongList(ids)));
+		if (billsList.isEmpty()) {
+			throw new SecurityException("未查到单据信息");
+		}
+		List<Long> idList = billsList.stream().map(Bills::getId).collect(Collectors.toList());
+		List<Bills> billsLists = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getMasterId, idList));
+		for (Bills item : billsList) {
+			if ("MH".equals(item.getBillType()) && "DD,MM".contains(billType)) {
+				if (ObjectUtils.isNotNull(item.getMasterBillNo())) {
+					throw new RuntimeException("提单号:" + item.getMblno() + "已填加到主单");
+				}
+			} else if ("MM".equals(item.getBillType()) && "DD,MH".contains(billType)) {
+				List<Bills> bills = billsLists.stream().filter(e -> e.getMasterId().equals(item.getId())).collect(Collectors.toList());
+				if (!bills.isEmpty()) {
+					throw new RuntimeException("提单号:" + item.getMblno() + "中存在分单");
+				}
+			}
+			item.setBillType(billType);
+		}
+		this.updateBatchById(billsList);
+		return R.data("操作成功");
+	}
+
 	/**
 	/**
 	 * 删除海运进出口明细表
 	 * 删除海运进出口明细表
 	 *
 	 *

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/SeaContainerNumberItemServiceImpl.java

@@ -108,7 +108,7 @@ public class SeaContainerNumberItemServiceImpl extends ServiceImpl<SeaContainerN
 				throw new RuntimeException("数据错误,请联系管理员");
 				throw new RuntimeException("数据错误,请联系管理员");
 			}
 			}
 			item.setOccupyNum(item.getOccupyNum() + containerNumberItem.getOccupyNum());
 			item.setOccupyNum(item.getOccupyNum() + containerNumberItem.getOccupyNum());
-			item.setRemainingNum(item.getTotalNum() - item.getOccupyNum());
+			item.setRemainingNum(item.getStorageNum() - item.getOccupyNum());
 		}
 		}
 		putBoxService.updateBatchById(putBoxList);
 		putBoxService.updateBatchById(putBoxList);
 		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()
 		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()
@@ -299,7 +299,7 @@ public class SeaContainerNumberItemServiceImpl extends ServiceImpl<SeaContainerN
 				throw new RuntimeException("数据错误,请联系管理员");
 				throw new RuntimeException("数据错误,请联系管理员");
 			}
 			}
 			item.setOccupyNum(item.getOccupyNum() - containerNumberItem.getOccupyNum());
 			item.setOccupyNum(item.getOccupyNum() - containerNumberItem.getOccupyNum());
-			item.setRemainingNum(item.getTotalNum() - item.getOccupyNum());
+			item.setRemainingNum(item.getStorageNum() - item.getOccupyNum());
 		}
 		}
 		putBoxService.updateBatchById(putBoxList);
 		putBoxService.updateBatchById(putBoxList);
 		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()
 		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()

+ 3 - 1
blade-service/blade-los/src/main/java/org/springblade/los/check/mapper/AuditPathsActsMapper.xml

@@ -31,7 +31,9 @@
     </select>
     </select>
     <select id="getLosAuditPathsActs" resultMap="auditPathsActsResultMap">
     <select id="getLosAuditPathsActs" resultMap="auditPathsActsResultMap">
         select * from los_audit_paths_acts where  tenant_id = #{data.tenantId}
         select * from los_audit_paths_acts where  tenant_id = #{data.tenantId}
-                                             and sales_company_id = #{data.salesCompanyId}
+        <if test='data.salesCompanyId != null and data.salesCompanyId!= ""'>
+            and sales_company_id = #{data.salesCompanyId}
+        </if>
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 3 - 1
blade-service/blade-los/src/main/java/org/springblade/los/check/mapper/AuditPathsMapper.xml

@@ -21,7 +21,9 @@
     </select>
     </select>
     <select id="getLosAuditPaths" resultMap="auditPathsResultMap">
     <select id="getLosAuditPaths" resultMap="auditPathsResultMap">
         select * from los_audit_paths where is_deleted = 0 and  tenant_id = #{data.tenantId}
         select * from los_audit_paths where is_deleted = 0 and  tenant_id = #{data.tenantId}
-         and sales_company_id = #{data.salesCompanyId}
+        <if test='data.salesCompanyId != null and data.salesCompanyId!= ""'>
+            and sales_company_id = #{data.salesCompanyId}
+        </if>
     </select>
     </select>
 
 
 </mapper>
 </mapper>

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

@@ -1755,7 +1755,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		feeCenter.setFeeCnName(fees.getCnName());
 		feeCenter.setFeeCnName(fees.getCnName());
 		feeCenter.setFeeEnName(fees.getEnName());
 		feeCenter.setFeeEnName(fees.getEnName());
 		feeCenter.setUnitNo(fees.getUnitNo());
 		feeCenter.setUnitNo(fees.getUnitNo());
-		feeCenter.setCurCode(fees.getCurNo());
+		feeCenter.setCurCode(mktSlotQuotations.getCurCode());
 		feeCenter.setExrate(currencyUtils.obtainExrate(feeCenter.getDc(), curExrateList, feeCenter.getCurCode(), "1"));
 		feeCenter.setExrate(currencyUtils.obtainExrate(feeCenter.getDc(), curExrateList, feeCenter.getCurCode(), "1"));
 		feeCenter.setQuantity(new BigDecimal(items.getQuantity() + ""));
 		feeCenter.setQuantity(new BigDecimal(items.getQuantity() + ""));
 		if ("1".equals(type)) {
 		if ("1".equals(type)) {

+ 2 - 0
blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java

@@ -254,6 +254,8 @@ public class DeptController extends BladeController {
 									 @RequestParam(value = "isHq",required = false) String isHq,
 									 @RequestParam(value = "isHq",required = false) String isHq,
 									 @RequestParam(value = "fullName",required = false) String fullName) {
 									 @RequestParam(value = "fullName",required = false) String fullName) {
 		List<Dept> deptList = deptService.list(new LambdaQueryWrapper<Dept>()
 		List<Dept> deptList = deptService.list(new LambdaQueryWrapper<Dept>()
+			.eq( Dept::getTenantId, AuthUtil.getTenantId())
+			.eq( Dept::getIsDeleted, 0)
 			.eq(ObjectUtils.isNotNull(id), Dept::getId, id)
 			.eq(ObjectUtils.isNotNull(id), Dept::getId, id)
 			.eq(ObjectUtils.isNotNull(isHq), Dept::getIsHq, isHq)
 			.eq(ObjectUtils.isNotNull(isHq), Dept::getIsHq, isHq)
 			.like(ObjectUtils.isNotNull(polId), Dept::getPolId, polId)
 			.like(ObjectUtils.isNotNull(polId), Dept::getPolId, polId)

+ 90 - 64
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java

@@ -16,6 +16,7 @@
  */
  */
 package org.springblade.system.service.impl;
 package org.springblade.system.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -220,7 +221,9 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 			// 业务字典
 			// 业务字典
 			LinkedList<DictBiz> dictBizs = new LinkedList<>();
 			LinkedList<DictBiz> dictBizs = new LinkedList<>();
 			List<DictBiz> dictBizList = getDictBizsV0(tenantId, tenantIdCopy, dictBizs);
 			List<DictBiz> dictBizList = getDictBizsV0(tenantId, tenantIdCopy, dictBizs);
-			dictBizService.saveBatch(dictBizList);
+			if (!dictBizList.isEmpty()){
+				dictBizService.saveBatch(dictBizList);
+			}
 		} else if (type.contains("2")) {
 		} else if (type.contains("2")) {
 			// 角色
 			// 角色
 			List<Role> roleLinkedList = new ArrayList<>();
 			List<Role> roleLinkedList = new ArrayList<>();
@@ -230,18 +233,19 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 				item.setTenantId(tenantIdCopy);
 				item.setTenantId(tenantIdCopy);
 				roleLinkedList.add(item);
 				roleLinkedList.add(item);
 			}
 			}
-			roleService.saveBatch(roleLinkedList);
+			if (!roleLinkedList.isEmpty()){
+				roleService.saveBatch(roleLinkedList);
+			}
 		} else if (type.contains("3")) {
 		} else if (type.contains("3")) {
 			// 审批流程
 			// 审批流程
 			List<LosAuditPaths> losAuditPaths = new ArrayList<>();
 			List<LosAuditPaths> losAuditPaths = new ArrayList<>();
 			LosAuditPaths losAuditPath = new LosAuditPaths();
 			LosAuditPaths losAuditPath = new LosAuditPaths();
 			losAuditPath.setTenantId(tenantId);
 			losAuditPath.setTenantId(tenantId);
-			losAuditPath.setSalesCompanyId(1703929959275413506L);
 			List<LosAuditPaths> losAuditPathsList = losClient.getLosAuditPaths(losAuditPath);
 			List<LosAuditPaths> losAuditPathsList = losClient.getLosAuditPaths(losAuditPath);
 			for (LosAuditPaths item : losAuditPathsList) {
 			for (LosAuditPaths item : losAuditPathsList) {
-				Long oldParentId = item.getId();
-				Long newParentId = IdWorker.getId();
-				item.setId(newParentId);
+//				Long oldParentId = item.getId();
+//				Long newParentId = IdWorker.getId();
+				item.setId(null);
 				item.setTenantId(tenantIdCopy);
 				item.setTenantId(tenantIdCopy);
 				if (dept != null) {
 				if (dept != null) {
 					item.setSalesCompanyId(dept.getId());
 					item.setSalesCompanyId(dept.getId());
@@ -251,55 +255,11 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 					item.setSalesCompanyName("");
 					item.setSalesCompanyName("");
 				}
 				}
 				losAuditPaths.add(item);
 				losAuditPaths.add(item);
-				recursionLosAuditPathsActs(tenantId, tenantIdCopy, oldParentId, newParentId, dept);
+//				recursionLosAuditPathsActs(tenantId, tenantIdCopy, oldParentId, newParentId, dept);
 			}
 			}
-			losClient.addLosAuditPathsList(losAuditPaths);
-		} else if (type.contains("8")) {
-			LosAuditPaths losAuditPath = new LosAuditPaths();
-			losAuditPath.setTenantId(tenantIdCopy);
-			losAuditPath.setSalesCompanyId(dept.getId());
-			List<LosAuditPaths> losAuditPathsList = losClient.getLosAuditPaths(losAuditPath);
-			// 业务审批配置
-			LosAuditPathsActs losAuditPathsActs = new LosAuditPathsActs();
-			losAuditPathsActs.setTenantId(tenantId);
-			losAuditPathsActs.setSalesCompanyId(1703929959275413506L);
-			List<LosAuditPathsActs> losAuditPathsActsList = new ArrayList<>();
-			List<LosAuditPathsActs> list = losClient.getLosAuditPathsActs(losAuditPathsActs);
-			for (LosAuditPathsActs item : list) {
-				item.setId(null);
-				item.setTenantId(tenantIdCopy);
-				LosAuditPaths losAuditPaths = losAuditPathsList.stream().filter(e -> e.getPathName().equals(item.getActName())).findFirst().orElse(null);
-				if (losAuditPaths != null) {
-					item.setPathId(losAuditPaths.getId());
-				} else {
-					item.setPathId(0L);
-				}
-				item.setSalesCompanyId(dept.getId());
-				item.setSalesCompanyName(dept.getDeptName());
-				losAuditPathsActsList.add(item);
+			if (!losAuditPaths.isEmpty()){
+				losClient.addLosAuditPathsList(losAuditPaths);
 			}
 			}
-			losClient.addLosAuditPathsActsList(losAuditPathsActsList);
-		} else if (type.contains("4")) {
-			// 编号配置
-			List<BusinessBillNo> businessBillNos = new ArrayList<>();
-			BusinessBillNo businessBillNo = new BusinessBillNo();
-			businessBillNo.setTenantId(tenantId);
-			businessBillNo.setBranchId("1703929959275413506");
-			List<BusinessBillNo> businessBillNoList = losClient.getBusinessBillNo(businessBillNo);
-			for (BusinessBillNo item : businessBillNoList) {
-				item.setId(null);
-				item.setTenantId(tenantIdCopy);
-				if (dept != null) {
-					item.setBranchId(dept.getId() + "");
-				} else {
-					item.setBranchId("");
-				}
-				item.setCreateTime(new Date());
-				item.setCreateUser(AuthUtil.getUserId());
-				item.setCreateUserName(AuthUtil.getUserName());
-				businessBillNos.add(item);
-			}
-			losClient.addBusinessBillNoList(businessBillNos);
 		} else if (type.contains("5")) {
 		} else if (type.contains("5")) {
 			// 业务类型
 			// 业务类型
 			List<BusinessType> businessTypes = new ArrayList<>();
 			List<BusinessType> businessTypes = new ArrayList<>();
@@ -314,20 +274,20 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 				item.setCreateUserName(AuthUtil.getUserName());
 				item.setCreateUserName(AuthUtil.getUserName());
 				businessTypes.add(item);
 				businessTypes.add(item);
 			}
 			}
-			losClient.addBusinessTypeList(businessTypes);
+			if (!businessTypes.isEmpty()){
+				losClient.addBusinessTypeList(businessTypes);
+			}
 		} else if (type.contains("6")) {
 		} else if (type.contains("6")) {
 			// 报表
 			// 报表
 			List<Reports> reportsList = new ArrayList<>();
 			List<Reports> reportsList = new ArrayList<>();
 			Reports reports = new Reports();
 			Reports reports = new Reports();
 			reports.setTenantId(tenantId);
 			reports.setTenantId(tenantId);
-			reports.setBranchId("1703929959275413506");
 			List<Reports> losReportsList = losClient.getReports(reports);
 			List<Reports> losReportsList = losClient.getReports(reports);
 			for (Reports item : losReportsList) {
 			for (Reports item : losReportsList) {
-				Long newParentId = IdWorker.getId();
 				item.setCreateTime(new Date());
 				item.setCreateTime(new Date());
 				item.setCreateUser(AuthUtil.getUserId());
 				item.setCreateUser(AuthUtil.getUserId());
 				item.setCreateUserName(AuthUtil.getUserName());
 				item.setCreateUserName(AuthUtil.getUserName());
-				item.setId(newParentId);
+				item.setId(null);
 				item.setTenantId(tenantIdCopy);
 				item.setTenantId(tenantIdCopy);
 				if (dept != null) {
 				if (dept != null) {
 					item.setBranchId(dept.getId() + "");
 					item.setBranchId(dept.getId() + "");
@@ -336,7 +296,9 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 				}
 				}
 				reportsList.add(item);
 				reportsList.add(item);
 			}
 			}
-			losClient.addReportsList(reportsList);
+			if (!reportsList.isEmpty()){
+				losClient.addReportsList(reportsList);
+			}
 		} else if (type.contains("7")) {
 		} else if (type.contains("7")) {
 			// 汇率
 			// 汇率
 			List<BCurrency> reportsList = new ArrayList<>();
 			List<BCurrency> reportsList = new ArrayList<>();
@@ -344,19 +306,29 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 			reports.setTenantId(tenantId);
 			reports.setTenantId(tenantId);
 			List<BCurrency> losReportsList = losClient.getBCurrency(reports);
 			List<BCurrency> losReportsList = losClient.getBCurrency(reports);
 			for (BCurrency item : losReportsList) {
 			for (BCurrency item : losReportsList) {
-				Long newParentId = IdWorker.getId();
 				item.setCreateTime(new Date());
 				item.setCreateTime(new Date());
 				item.setCreateUser(AuthUtil.getUserId());
 				item.setCreateUser(AuthUtil.getUserId());
 				item.setCreateUserName(AuthUtil.getUserName());
 				item.setCreateUserName(AuthUtil.getUserName());
-				item.setId(newParentId);
+				item.setId(null);
 				item.setTenantId(tenantIdCopy);
 				item.setTenantId(tenantIdCopy);
+				if (dept != null) {
+					item.setBranchId(dept.getId() + "");
+					item.setBranchName(dept.getDeptName());
+				} else {
+					item.setBranchId("");
+					item.setBranchName("");
+				}
 				reportsList.add(item);
 				reportsList.add(item);
 			}
 			}
-			losClient.addBCurrencyList(reportsList);
-		}else if (type.contains("9")) {
+			if (!reportsList.isEmpty()){
+				losClient.addBCurrencyList(reportsList);
+			}
+		} else if (type.contains("9")) {
 			// 业务参数
 			// 业务参数
 			List<ParamService> roleLinkedList = new ArrayList<>();
 			List<ParamService> roleLinkedList = new ArrayList<>();
-			List<ParamService> roleList = paramServiceService.selectParamService(tenantId,"1703929959275413506");
+			List<ParamService> roleList = paramServiceService.list(new LambdaQueryWrapper<ParamService>()
+				.eq(ParamService::getTenantId, tenantId)
+				.eq(ParamService::getIsDeleted, 0));
 			for (ParamService item : roleList) {
 			for (ParamService item : roleList) {
 				item.setId(null);
 				item.setId(null);
 				item.setTenantId(tenantIdCopy);
 				item.setTenantId(tenantIdCopy);
@@ -364,7 +336,61 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 				item.setSalesCompanyName(dept.getDeptName());
 				item.setSalesCompanyName(dept.getDeptName());
 				roleLinkedList.add(item);
 				roleLinkedList.add(item);
 			}
 			}
-			paramServiceService.saveBatch(roleLinkedList);
+			if (!roleLinkedList.isEmpty()){
+				paramServiceService.saveBatch(roleLinkedList);
+			}
+		}else if (type.contains("8")) {
+			LosAuditPaths losAuditPath = new LosAuditPaths();
+			losAuditPath.setTenantId(tenantIdCopy);
+			List<LosAuditPaths> losAuditPathsList = losClient.getLosAuditPaths(losAuditPath);
+			// 业务审批配置
+			LosAuditPathsActs losAuditPathsActs = new LosAuditPathsActs();
+			losAuditPathsActs.setTenantId(tenantId);
+			List<LosAuditPathsActs> losAuditPathsActsList = new ArrayList<>();
+			List<LosAuditPathsActs> list = losClient.getLosAuditPathsActs(losAuditPathsActs);
+			for (LosAuditPathsActs item : list) {
+				item.setId(null);
+				item.setTenantId(tenantIdCopy);
+				LosAuditPaths losAuditPaths = losAuditPathsList.stream().filter(e -> e.getPathName().equals(item.getActName())).findFirst().orElse(null);
+				if (losAuditPaths != null) {
+					item.setPathId(losAuditPaths.getId());
+				} else {
+					item.setPathId(0L);
+				}
+				item.setSalesCompanyId(dept.getId());
+				item.setSalesCompanyName(dept.getDeptName());
+				losAuditPathsActsList.add(item);
+			}
+			if (!losAuditPathsActsList.isEmpty()){
+				losClient.addLosAuditPathsActsList(losAuditPathsActsList);
+			}
+		} else if (type.contains("4")) {
+			BusinessType businessType = new BusinessType();
+			businessType.setTenantId(tenantIdCopy);
+			List<BusinessType> businessTypeList = losClient.getBusinessType(businessType);
+			// 编号配置
+			List<BusinessBillNo> businessBillNos = new ArrayList<>();
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setTenantId(tenantId);
+			List<BusinessBillNo> businessBillNoList = losClient.getBusinessBillNo(businessBillNo);
+			for (BusinessBillNo item : businessBillNoList) {
+				businessTypeList.stream().filter(e -> e.getCode().equals(item.getBusinessType()))
+					.findFirst().ifPresent(businessType1 -> item.setBusinessTypeId(businessType1.getId()));
+				item.setId(null);
+				item.setTenantId(tenantIdCopy);
+				if (dept != null) {
+					item.setBranchId(dept.getId() + "");
+				} else {
+					item.setBranchId("");
+				}
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				businessBillNos.add(item);
+			}
+			if (!businessBillNos.isEmpty()){
+				losClient.addBusinessBillNoList(businessBillNos);
+			}
 		}
 		}
 		return R.data("操作成功");
 		return R.data("操作成功");
 	}
 	}