Browse Source

1.费用申请修改,删除审核通过重新计算单据利润金额
2.海运进出口单据删除增加消息提示
3.海运进出口单据退舱,撤销退舱增加消息提示
4.箱池动态增加港口,放箱号导出明细接口
5.箱管,海运进出口,放箱号删除逻辑修改
6.放箱号批量修改放箱号主表箱号合计问题修改
7.箱管费用删除增加费用明细判断
8.进出场同步问题修改
9.客户订舱-提交订舱增加第二管理员消息提醒

纪新园 2 days ago
parent
commit
61258cfd76
18 changed files with 786 additions and 233 deletions
  1. 8 8
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/PortExcel.java
  2. 215 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/PortItemExcel.java
  3. 7 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java
  4. 22 4
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/BoxPoolController.java
  5. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java
  6. 100 77
      blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java
  7. 2 3
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ArchivesMapper.xml
  8. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxItemsMapper.java
  9. 32 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxItemsMapper.xml
  10. 5 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxItemsService.java
  11. 7 5
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java
  12. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxService.java
  13. 8 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxItemsServiceImpl.java
  14. 160 121
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  15. 50 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  16. 146 10
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  17. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java
  18. 15 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

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

@@ -49,48 +49,48 @@ public class PortExcel {
 	 * 20GP-好
 	 */
 	@ExcelProperty(value = "20GP-好")
-	private Long gP20Good;
+	private String twentyGpGood;
 
 	/**
 	 * 40GP-好
 	 */
 	@ExcelProperty(value = "40GP-好")
-	private Long gP40Good;
+	private String fortyGPGood;
 
 	/**
 	 * 40HC-好
 	 */
 	@ExcelProperty(value = "40HC-好")
-	private Long hG40Good;
+	private String fortyHCGood;
 
 	/**
 	 * 其他-好
 	 */
 	@ExcelProperty(value = "其他-好")
-	private Long otherGood;
+	private String otherGood;
 
 	/**
 	 * 20GP-坏
 	 */
 	@ExcelProperty(value = "20GP-坏")
-	private Long gP20Bad;
+	private String twentyGpBad;
 
 	/**
 	 * 40GP-坏
 	 */
 	@ExcelProperty(value = "40GP-坏")
-	private Long gP40Bad;
+	private String fortyGPBad;
 
 	/**
 	 * 40HC-坏
 	 */
 	@ExcelProperty(value = "40HC-坏")
-	private Long hG40Bad;
+	private String fortyHCBad;
 
 	/**
 	 * 其他-坏
 	 */
 	@ExcelProperty(value = "其他-坏")
-	private Long otherBad;
+	private String otherBad;
 
 }

+ 215 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/PortItemExcel.java

@@ -0,0 +1,215 @@
+package org.springblade.los.box.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2025/4/17
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class PortItemExcel {
+
+	/**
+	 * 放箱号
+	 */
+	@ExcelProperty(value = "放箱号")
+	private String containerNumber;
+	/**
+	 * 放箱号类型
+	 */
+	@ExcelProperty(value = "放箱号类型")
+	private String busType;
+	/**
+	 * 港口
+	 */
+	@ExcelProperty(value = "港口")
+	private String portName;
+	/**
+	 * 场站
+	 */
+	@ExcelProperty(value = "场站")
+	private String stationName;
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号")
+	private String boxCode;
+	/**
+	 * 箱型
+	 */
+	@ExcelProperty(value = "箱型")
+	private String boxType;
+	/**
+	 * 箱属
+	 */
+	@ExcelProperty(value = "箱属")
+	private String boxBelongsTo;
+	/**
+	 * 箱况
+	 */
+	@ExcelProperty(value = "箱况")
+	private String boxCondition;
+	/**
+	 * 箱状态 待使用、使用中、作废
+	 */
+	@ExcelProperty(value = "箱状态")
+	private String status;
+	/**
+	 * 箱好坏
+	 */
+	@ExcelProperty(value = "箱好坏")
+	private String boxStatus;
+	/**
+	 * 箱动态
+	 */
+	@ExcelProperty(value = "箱动态")
+	private String boxDynamics;
+	/**
+	 * 客户名称
+	 */
+	@ExcelProperty(value = "客户名称")
+	private String corpName;
+	/**
+	 * 提单号
+	 */
+	@ExcelProperty(value = "提单号")
+	private String mblno;
+	/**
+	 * 分单号
+	 */
+	@ExcelProperty(value = "分单号")
+	private String hblno;
+	/**
+	 * 船名
+	 */
+	@ExcelProperty(value = "船名")
+	private String shipCname;
+	/**
+	 * 航次
+	 */
+	@ExcelProperty(value = "航次")
+	private String voyage;
+	/**
+	 * etd
+	 */
+	@ExcelProperty(value = "etd")
+	private Date etd;
+	/**
+	 * pol 堆场中文
+	 */
+	@ExcelProperty(value = "pol 堆场")
+	private String polCyCname;
+	/**
+	 * pol 免箱使天数
+	 */
+	@ExcelProperty(value = "pol 免箱使天数")
+	private Integer polFreeBoxUseDays;
+	/**
+	 * pol预出场日期
+	 */
+	@ExcelProperty(value = "pol预出场日期")
+	private Date polPreAppearanceDate;
+	/**
+	 * pol场站空箱出场日期
+	 */
+	@ExcelProperty(value = "pol场站空箱出场日期")
+	private Date polStationEmptyContainerExitDate;
+	/**
+	 * eta
+	 */
+	@ExcelProperty(value = "eta")
+	private Date eta;
+	/**
+	 * pod空箱还箱日期
+	 */
+	@ExcelProperty(value = "pod空箱还箱日期")
+	private Date podEmptyContainerReturnDate;
+	/**
+	 * pol提箱日期
+	 */
+	@ExcelProperty(value = "pol提箱日期")
+	private Date polPickUpDate;
+
+	/**
+	 * pod场站中文
+	 */
+	@ExcelProperty(value = "pod场站中文")
+	private String podStationCname;
+	/**
+	 * pod 免箱使天数
+	 */
+	@ExcelProperty(value = "pod 免箱使天数")
+	private Integer podFreeBoxUseDays;
+	/**
+	 * pod箱使天数
+	 */
+	@ExcelProperty(value = "pod箱使天数")
+	private Integer podBoxUseDays;
+	/**
+	 * 目的港场站地址
+	 */
+	@ExcelProperty(value = "目的港场站地址")
+	private String podCyAddress;
+
+	/**
+	 * 目的港场站联系人
+	 */
+	@ExcelProperty(value = "目的港场站联系人")
+	private String podCyContact;
+
+	/**
+	 * 目的港场站邮箱
+	 */
+	@ExcelProperty(value = "目的港场站邮箱")
+	private String podCyEmail;
+
+	/**
+	 * 目的港场站电话
+	 */
+	@ExcelProperty(value = "目的港场站电话")
+	private String podCyTel;
+	/**
+	 * pol还箱日期
+	 */
+	@ExcelProperty(value = "pol还箱日期")
+	private Date polReturnDate;
+	/**
+	 * pol超期箱使天数
+	 */
+	@ExcelProperty(value = "pol超期箱使天数")
+	private Integer polOverdueBoxUseDays;
+	/**
+	 * 实际开船日期
+	 */
+	@ExcelProperty(value = "实际开船日期")
+	private Date actualEtd;
+	/**
+	 * 实际到港日期
+	 */
+	@ExcelProperty(value = "实际到港日期")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date actualEta;
+	/**
+	 * 代理名称
+	 */
+	@ExcelProperty(value = "代理名称")
+	private String agentName;
+	/**
+	 * 备注
+	 */
+	@ExcelProperty(value = "备注")
+	private String remarks;
+
+
+}

+ 7 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java

@@ -83,6 +83,8 @@ public interface IUserClient {
 
 	String GET_USER_LIST_BY_ROLE = API_PREFIX + "/getUserListByRole";
 
+	String SELECT_LIST_BY_ROLE_AND_DEPT = API_PREFIX + "/selectListByRoleAndDept";
+
 	@GetMapping(LIST_USER_BY_ROLE_ID)
 	R<List<User>> listUserByRoleId(@RequestParam("roleId") String roleId, @RequestParam(value = "tenantId", required = false) String tenantId, @RequestParam(value = "salesCompanyId", required = false) String salesCompanyId);
 
@@ -330,4 +332,9 @@ public interface IUserClient {
 
 	@GetMapping(GET_USER_LIST_BY_ROLE)
 	List<User> selectListByRole(@RequestParam(value = "tenantId", required = false) String tenantId);
+
+	@GetMapping(SELECT_LIST_BY_ROLE_AND_DEPT)
+	List<User> selectListByRoleAndDept(@RequestParam(value = "roleName", required = false)String roleName,
+									   @RequestParam(value = "branchId", required = false)String branchId,
+									   @RequestParam(value = "tenantId", required = false)String tenantId);
 }

+ 22 - 4
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/BoxPoolController.java

@@ -67,8 +67,17 @@ public class BoxPoolController extends BladeController {
 	 */
 	@GetMapping("/listPortExport")
 	public void listPortExport(BoxPoolDTO boxPoolDTO,HttpServletResponse response) {
-		List<BoxPoolPortDTO> list = putBoxService.listPortExport(boxPoolDTO);
-		ExcelUtil.export(response, "港口统计", "港口统计", BeanUtil.copy(list, PortExcel.class), PortExcel.class);
+		List<PortExcel> list = putBoxService.listPortExport(boxPoolDTO);
+		ExcelUtil.export(response, "港口统计", "港口统计", list, PortExcel.class);
+	}
+
+	/**
+	 * 箱池动态港口-导出明细
+	 */
+	@GetMapping("/listPortExportItems")
+	public void listPortExportItems(BoxPoolDTO boxPoolDTO,HttpServletResponse response) {
+		List<PortItemExcel> list = putBoxService.listPortExportItems(boxPoolDTO);
+		ExcelUtil.export(response, "港口明细统计", "港口明细统计", list, PortItemExcel.class);
 	}
 
 	/**
@@ -84,8 +93,17 @@ public class BoxPoolController extends BladeController {
 	 */
 	@GetMapping("/listContainerNumberExport")
 	public void listContainerNumberExport(BoxPoolDTO boxPoolDTO,HttpServletResponse response) {
-		List<BoxPoolContainerNumberDTO> list = putBoxService.listContainerNumberExport(boxPoolDTO);
-		ExcelUtil.export(response, "放箱号统计", "放箱号统计", BeanUtil.copy(list, PortExcel.class), PortExcel.class);
+		List<ContainerNumberExcel> list = putBoxService.listContainerNumberExport(boxPoolDTO);
+		ExcelUtil.export(response, "放箱号统计", "放箱号统计", list, ContainerNumberExcel.class);
+	}
+
+	/**
+	 * 箱池动态放箱号-导出明细
+	 */
+	@GetMapping("/listContainerNumberExportItems")
+	public void listContainerNumberExportItems(BoxPoolDTO boxPoolDTO,HttpServletResponse response) {
+		List<PortItemExcel> list = putBoxService.listContainerNumberExportItems(boxPoolDTO);
+		ExcelUtil.export(response, "放箱号明细统计", "放箱号明细统计", list, PortItemExcel.class);
 	}
 
 	/**

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

@@ -208,7 +208,7 @@ public class TradingBoxController extends BladeController {
 	@ApiOperation(value = "删除", notes = "传入ids")
 	@RepeatSubmit
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(tradingBoxService.removeByIds(Func.toLongList(ids)));
+		return tradingBoxService.removeIds(Func.toLongList(ids));
 	}
 
 	/**

+ 100 - 77
blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java

@@ -967,9 +967,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 新箱进场流程
-	 * @param boxDynamicsRecord  进出场记录
-	 * @param itemsListJC  进出场记录箱明细
-	 * @param type  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 *
+	 * @param boxDynamicsRecord 进出场记录
+	 * @param itemsListJC       进出场记录箱明细
+	 * @param type              操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean synchronization(List<BoxDynamicsRecordItems> itemsListJC, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
 		if (itemsListJC.stream().anyMatch(e -> ObjectUtils.isNull(e.getObjective()))) {
@@ -1048,7 +1049,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
 					if (archives != null) {
 						//存储上一步数据
-						BoxNumUtils.storagePreviousStepData(archives,item);
+						BoxNumUtils.storagePreviousStepData(archives, item);
 
 						archives.setContainerNumberOw(item.getContainerNumber());
 						archives.setContainerNumberTypeOw(putBox.getBoxClass());
@@ -1253,7 +1254,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 										} else if ("ZR".equals(tradingBox.getType())) {
 											tradingBoxItem.setBoxCategory("租箱");
 										}
-										putBoxItem.setBoxClass(putBox.getBoxClass());
 										tradingBoxItem.setBoxCondition("新");
 										tradingBoxItem.setBoxStatus(item.getBoxStatus());
 										tradingBoxItem.setContainerNumber(item.getContainerNumber());
@@ -1480,9 +1480,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 撤销新箱进场流程
-	 * @param boxDynamicsRecord  进出场记录
-	 * @param itemsListJC  进出场记录箱明细
-	 * @param type  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 *
+	 * @param boxDynamicsRecord 进出场记录
+	 * @param itemsListJC       进出场记录箱明细
+	 * @param type              操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean revokeSynchronization(List<BoxDynamicsRecordItems> itemsListJC, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
 		if (itemsListJC.stream().anyMatch(e -> ObjectUtils.isNull(e.getObjective()))) {
@@ -1632,16 +1633,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						putBoxItem.setUpdateTime(new Date());
 						putBoxItem.setUpdateUserName(AuthUtil.getUserName());
 						putBoxItem.setUpdateUser(AuthUtil.getUserId());
-						if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(putBoxItem.getStatus())) {
-							putBoxItem.setStatus(item.getSrcBoxStatus());
-							putBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
-							putBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
-						} else {
-							putBoxItem.setBoxDynamics("作废");
-							putBoxItem.setStatus("作废");
-							putBoxItem.setBoxStatus("好箱");
-						}
 						if ("CC".contains(type)) {
+							if (!"使用中".equals(putBoxItem.getStatus())) {
+								throw new RemoteException("箱号:" + putBoxItem.getBoxCode() + "状态不是使用中,撤销出场失败");
+							}
 							putBoxItem.setPodStationId(null);
 							putBoxItem.setPodStationCode(null);
 							putBoxItem.setPodStationCname(null);
@@ -1668,7 +1663,15 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							putBoxItem.setEtd(null);
 							putBoxItem.setActualEtd(null);
 						}
+						if ("JC".equals(type)) {
+							if (!"待使用".equals(putBoxItem.getStatus())) {
+								throw new RemoteException("箱号:" + putBoxItem.getBoxCode() + "状态不是待使用,撤销进场失败");
+							}
+						}
 						if ("HX".equals(type)) {
+							if (!"待使用".equals(putBoxItem.getStatus())) {
+								throw new RemoteException("箱号:" + putBoxItem.getBoxCode() + "状态不是待使用,撤销还箱失败");
+							}
 							putBoxItem.setPodEmptyContainerReturnDate(null);
 							putBoxItem.setPodStationId(null);
 							putBoxItem.setPodStationCode(null);
@@ -1679,6 +1682,15 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							putBoxItem.setActualEta(null);
 							putBoxItem.setPodBoxUseDays(0);
 						}
+						if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(putBoxItem.getStatus())) {
+							putBoxItem.setStatus(item.getSrcBoxStatus());
+							putBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
+							putBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
+						} else {
+							putBoxItem.setBoxDynamics("作废");
+							putBoxItem.setStatus("作废");
+							putBoxItem.setBoxStatus("好箱");
+						}
 						putBoxItems.add(putBoxItem);
 					}
 				} else {
@@ -1884,9 +1896,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 进出场数据同步处理
-	 * @param boxDynamicsRecord  进出场记录
-	 * @param itemsList  进出场记录箱明细
-	 * @param type  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 *
+	 * @param boxDynamicsRecord 进出场记录
+	 * @param itemsList         进出场记录箱明细
+	 * @param type              操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean synchronizationV1(BoxDynamicsRecord boxDynamicsRecord, List<BoxDynamicsRecordItems> itemsList, String type) throws IOException {
 		if (itemsList.stream().anyMatch(e -> ObjectUtils.isNull(e.getObjective()))) {
@@ -2028,7 +2041,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							return false;
 						}
 						//存储上一步数据
-						BoxNumUtils.storagePreviousStepData(archives,recordItems);
+						BoxNumUtils.storagePreviousStepData(archives, recordItems);
 
 						String containerNumberType = "";
 						//原放箱号数据处理
@@ -2649,7 +2662,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
 						if (archives != null) {
 							//存储上一步数据
-							BoxNumUtils.storagePreviousStepData(archives,item);
+							BoxNumUtils.storagePreviousStepData(archives, item);
 
 							archives.setContainerNumberOw(item.getContainerNumber());
 							archives.setContainerNumberTypeOw(putBox.getBoxClass());
@@ -2976,7 +2989,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							return false;
 						}
 						//存储上一步数据
-						BoxNumUtils.storagePreviousStepData(archives,recordItems);
+						BoxNumUtils.storagePreviousStepData(archives, recordItems);
 
 						//放箱号数据处理
 						PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(recordItems.getContainerNumber())
@@ -3397,7 +3410,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						return false;
 					}
 					//存储上一步数据
-					BoxNumUtils.storagePreviousStepData(archives,recordItems);
+					BoxNumUtils.storagePreviousStepData(archives, recordItems);
 
 					//放箱号数据处理
 					PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(recordItems.getContainerNumber())
@@ -4072,7 +4085,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					.eq(PutBoxItems::getIsDeleted, 0)
 					.eq(PutBoxItems::getTenantId, boxDynamicsRecord.getTenantId())
 					.in(PutBoxItems::getPid, putBoxIdList));
-                //验证黑名单
+				//验证黑名单
 				String blacklist = sysClient.getParamService("box.blacklist");
 				String text = BoxNumUtils.verifyBlacklist(blacklist, boxCodeList, boxDynamicsRecord.getTenantId());
 				if (ObjectUtils.isNotNull(text)) {
@@ -4134,7 +4147,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
 						if (archives != null) {
 							//存储上一步数据
-							BoxNumUtils.storagePreviousStepData(archives,item);
+							BoxNumUtils.storagePreviousStepData(archives, item);
 							if (!archives.getTypeName().equals(item.getBoxType())) {
 								failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
 								return false;
@@ -4415,6 +4428,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 									tradingBoxItem.setPolCyCname(item.getStationCname());
 									tradingBoxItem.setPolCyEname(item.getStationEname());
 									if (ObjectUtils.isNull(tradingBoxItem.getPolPickUpDate())) {
+										tradingBoxItem.setRentEndDate(item.getApproachExitDate());
 										tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
 										tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
 									}
@@ -4552,30 +4566,32 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							.map(BoxDynamicsRecordItems::getHblno).filter(Objects::nonNull).collect(Collectors.toList());
 						List<Bills> billsList1 = new ArrayList<>();
 						if (!billsList.isEmpty()) {
-							billsList1 =  billsList.stream().filter(e -> "MH,DD".contains(e.getBillType()) &&
-									hblnoList.contains(e.getHblno())).collect(Collectors.toList());
+							billsList1 = billsList.stream().filter(e -> "MH,DD".contains(e.getBillType()) &&
+								hblnoList.contains(e.getHblno())).collect(Collectors.toList());
 						}
 						if (!billsList1.isEmpty()) {
-							for (Bills bills : billsList1){
+							int occupyNum = 0;
+							int remainingNum = 0;
+							for (Bills bills : billsList1) {
 								long sum = itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
-                                        && bills.getHblno().equals(e.getHblno())).count();
+									&& bills.getHblno().equals(e.getHblno())).count();
 								SeaContainerNumberItem containerNumberItems = containerNumberItemList.stream()
-									.filter(e-> e.getPid().equals(bills.getId()) && e.getSrcId().equals(item.getId()))
+									.filter(e -> e.getPid().equals(bills.getId()) && e.getSrcId().equals(item.getId()))
 									.findFirst().orElse(null);
-								if (containerNumberItems == null){
-									failureHandling(type, boxDynamicsRecord, "提单号:" + bills.getHblno() + "未占用放箱号");
-									return false;
-								}
-								if (sum> containerNumberItems.getOccupyNum()-containerNumberItems.getOutNum()){
-									failureHandling(type, boxDynamicsRecord, "提单号:" + bills.getHblno() + "出场箱数大于占用数量");
-									return false;
+								if (containerNumberItems == null) {
+									remainingNum = remainingNum + Integer.parseInt(sum + "");
+								}else{
+									if (sum > containerNumberItems.getOccupyNum() - containerNumberItems.getOutNum()) {
+										failureHandling(type, boxDynamicsRecord, "提单号:" + bills.getHblno() + "出场箱数大于占用数量");
+										return false;
+									}
+									occupyNum = occupyNum + Integer.parseInt(sum + "");
 								}
 							}
-						}
-						if (item.getOccupyNum() != 0 && item.getOccupyNum() > Integer.parseInt(count + "")) {
-							item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(count + ""));
+							item.setOccupyNum(item.getOccupyNum() - occupyNum);
+							item.setRemainingNum(item.getRemainingNum() - remainingNum);
 						} else {
-							item.setOccupyNum(0);
+							item.setRemainingNum(item.getRemainingNum() - Integer.parseInt(count + ""));
 						}
 						if (!containersList.isEmpty()) {
 							if (!"OW(放)".equals(item.getBoxClass())) {
@@ -4784,10 +4800,11 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 	}
 
 	/**
-	 *  进出场数据错误统一处理
-	 * @param type 操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 * 进出场数据错误统一处理
+	 *
+	 * @param type              操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 * @param boxDynamicsRecord 进出场记录
-	 * @param msg 错误内容
+	 * @param msg               错误内容
 	 */
 	private void failureHandling(String type, BoxDynamicsRecord boxDynamicsRecord, String msg) throws IOException {
 		if ("1".equals(type)) {
@@ -4804,13 +4821,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 正常出场-起运港出口超期箱使费
-	 * @param containersListNew  出口分单配箱明细
-	 * @param tradingBoxList ow/自有箱单据
+	 *
+	 * @param containersListNew     出口分单配箱明细
+	 * @param tradingBoxList        ow/自有箱单据
 	 * @param tradingBoxItemOldList ow/自有箱单据箱明细
-	 * @param putBoxItems 放箱号单据箱明细
-	 * @param putBoxList 放箱号单据
-	 * @param boxDynamicsRecord 进场记录
-	 * @param type 操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 * @param putBoxItems           放箱号单据箱明细
+	 * @param putBoxList            放箱号单据
+	 * @param boxDynamicsRecord     进场记录
+	 * @param type                  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean countOverdueFee(List<PutBox> putBoxList, List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
 									List<Containers> containersListNew, List<PutBoxItems> putBoxItems
@@ -5157,14 +5175,15 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 
 	/**
-	 *  无货返空-超期箱使费
-	 * @param billsList  出口分单数据
-	 * @param tradingBoxList ow/自有箱单据
+	 * 无货返空-超期箱使费
+	 *
+	 * @param billsList             出口分单数据
+	 * @param tradingBoxList        ow/自有箱单据
 	 * @param tradingBoxItemOldList ow/自有箱单据箱明细
-	 * @param putBoxItems 放箱号单据箱明细
-	 * @param putBoxList 放箱号单据
-	 * @param boxDynamicsRecord 进场记录
-	 * @param type 操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 * @param putBoxItems           放箱号单据箱明细
+	 * @param putBoxList            放箱号单据
+	 * @param boxDynamicsRecord     进场记录
+	 * @param type                  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean countOverdueFeeWHFK(List<PutBox> putBoxList, List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
 										List<Bills> billsList, List<PutBoxItems> putBoxItems
@@ -5357,9 +5376,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 获取具体超期箱使费标准
+	 *
 	 * @param storageFeesList 超期箱使费标准数据
-	 * @param bills 海运进出口单据
-	 * @param type 操作类型  1=起运港  2=目的港
+	 * @param bills           海运进出口单据
+	 * @param type            操作类型  1=起运港  2=目的港
 	 */
 	private StorageFees getStorageFees(List<StorageFees> storageFeesList, Bills bills, String type) {
 		StorageFees storageFees;
@@ -5383,14 +5403,15 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 	}
 
 	/**
-	 *  超期箱使费-费用中心数据拼接
-	 * @param item  放箱号箱明细
-	 * @param bills 进出口单据
-	 * @param fees 费用信息
+	 * 超期箱使费-费用中心数据拼接
+	 *
+	 * @param item             放箱号箱明细
+	 * @param bills            进出口单据
+	 * @param fees             费用信息
 	 * @param storageFeesItems 超期箱使费规则明细
-	 * @param curExrateList 汇率明细
-	 * @param overdueDays 超期天数
-	 * @param exrateType 本币币别
+	 * @param curExrateList    汇率明细
+	 * @param overdueDays      超期天数
+	 * @param exrateType       本币币别
 	 */
 	private FeeCenter addFeeCenter(PutBoxItems item, Bills bills, BFees fees,
 								   List<StorageFeesItems> storageFeesItems, List<BCurExrate> curExrateList,
@@ -5507,13 +5528,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 客户还箱-目的港进口超期箱使费
-	 * @param billsHYJK  进口分单
-	 * @param tradingBoxList ow/自有箱单据
+	 *
+	 * @param billsHYJK             进口分单
+	 * @param tradingBoxList        ow/自有箱单据
 	 * @param tradingBoxItemOldList ow/自有箱单据箱明细
-	 * @param putBoxItemsOldList 放箱号单据箱明细
-	 * @param putBoxList 放箱号单据
-	 * @param boxDynamicsRecord 进场记录
-	 * @param type 操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 * @param putBoxItemsOldList    放箱号单据箱明细
+	 * @param putBoxList            放箱号单据
+	 * @param boxDynamicsRecord     进场记录
+	 * @param type                  操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean countOverdueFeeV1(Bills billsHYJK, List<TradingBox> tradingBoxList,
 									  List<TradingBoxItem> tradingBoxItemOldList, List<PutBoxItems> putBoxItemsOldList,
@@ -5815,11 +5837,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 	/**
 	 * 费用明细生成账单数据
-	 * @param feeCenterList 费用明细
-	 * @param billsHYJK 进出口单据信息
-	 * @param exrateType 本币币别
+	 *
+	 * @param feeCenterList     费用明细
+	 * @param billsHYJK         进出口单据信息
+	 * @param exrateType        本币币别
 	 * @param boxDynamicsRecord 进出场记录
-	 * @param type 操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
+	 * @param type              操作类型  1=excel导入直接提示  2=api记录并修改状态为失败 3=只记录
 	 */
 	private Boolean generateAccBills(List<FeeCenter> feeCenterList, Bills billsHYJK, String exrateType,
 									 BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {

+ 2 - 3
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ArchivesMapper.xml

@@ -74,11 +74,10 @@
     <select id="selectDetele" resultType="org.springblade.los.box.entity.Archives">
         select * from container_archives
         where tenant_id = #{tenantId}
-        id IN
-        <foreach collection="archivesIdList" index="index" item="item" open="(" separator="," close=")">
+        AND id IN
+        <foreach collection="archivesIdList" item="item" open="(" separator="," close=")">
             #{item}
         </foreach>
-        )
     </select>
 
 </mapper>

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxItemsMapper.java

@@ -18,7 +18,9 @@ package org.springblade.los.box.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.los.box.entity.PutBoxItems;
+import org.springblade.los.box.excel.PortItemExcel;
 import org.springblade.los.box.vo.PutBoxItemsVO;
 
 import java.util.List;
@@ -40,4 +42,6 @@ public interface PutBoxItemsMapper extends BaseMapper<PutBoxItems> {
 	 */
 	List<PutBoxItemsVO> selectPutBoxItemsPage(IPage page, PutBoxItemsVO putBoxItems);
 
+	List<PortItemExcel> selectPutBoxItemsList(@Param("portId") Long portId, @Param("whetherLoseEfficacy")String whetherLoseEfficacy,
+											  @Param("tenantId")String tenantId, @Param("busType")String busType, @Param("stationId")Long stationId);
 }

+ 32 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxItemsMapper.xml

@@ -56,5 +56,37 @@
     <select id="selectPutBoxItemsPage" resultMap="putBoxItemsResultMap">
         select * from logistics_put_box_items where is_deleted = 0
     </select>
+    <select id="selectPutBoxItemsList" resultType="org.springblade.los.box.excel.PortItemExcel">
+        SELECT
+            lpb.container_number as containerNumber,
+            lpb.box_class as busType,
+            lpb.pol_cname as portName,
+            lpb.pol_station_cname as stationName,
+            lpb.box_type as boxType,
+            item.*
+        FROM
+            logistics_put_box lpb
+                LEFT JOIN logistics_put_box_items item ON lpb.id = item.pid
+        WHERE
+            lpb.is_deleted = 0
+          AND lpb.tenant_id = #{tenantId}
+          AND item.is_deleted = 0
+          AND item.tenant_id = #{tenantId}
+          AND item.`status` = '待使用'
+        AND lpb.whether_deactivate = '0'
+        <if test="portId !=null and portId != ''">
+            and lpb.pol_id = #{portId}
+        </if>
+        <if test="stationId !=null and stationId != ''">
+            and lpb.pol_station_id = #{stationId}
+        </if>
+        <if test="busType != null and busType != ''">
+            and lpb.box_class like concat(concat('%', #{busType}),'%')
+        </if>
+        <if test="whetherLoseEfficacy !=null and whetherLoseEfficacy != ''">
+            and DATE_FORMAT(lpb.effective_start_date,'%Y-%m-%d') &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
+            and DATE_FORMAT(lpb.effective_end_date,'%Y-%m-%d') &lt;= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
+        </if>
+    </select>
 
 </mapper>

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxItemsService.java

@@ -18,9 +18,13 @@ package org.springblade.los.box.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.los.box.entity.PutBoxItems;
+import org.springblade.los.box.excel.PortItemExcel;
 import org.springblade.los.box.vo.PutBoxItemsVO;
 
+import java.util.List;
+
 /**
  *  服务类
  *
@@ -38,4 +42,5 @@ public interface IPutBoxItemsService extends IService<PutBoxItems> {
 	 */
 	IPage<PutBoxItemsVO> selectPutBoxItemsPage(IPage<PutBoxItemsVO> page, PutBoxItemsVO putBoxItems);
 
+    List<PortItemExcel> selectPutBoxItemsList(Long portId, String whetherLoseEfficacy, String tenantId, String busType, Long stationId);
 }

+ 7 - 5
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java

@@ -27,9 +27,7 @@ import org.springblade.los.box.dto.BoxPoolItemDTO;
 import org.springblade.los.box.dto.BoxPoolPortDTO;
 import org.springblade.los.box.entity.PutBox;
 import org.springblade.los.box.entity.TradingBox;
-import org.springblade.los.box.excel.EmptyContainerAppearance;
-import org.springblade.los.box.excel.EmptyContainerAppearanceAnalysis;
-import org.springblade.los.box.excel.PortExcel;
+import org.springblade.los.box.excel.*;
 import org.springblade.los.box.vo.PutBoxVO;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.excel.PodStationR;
@@ -100,9 +98,13 @@ public interface IPutBoxService extends IService<PutBox> {
 
 	R updateBatchByIdAndVersion(List<PutBox> putBoxList);
 
-	List<BoxPoolPortDTO> listPortExport(BoxPoolDTO boxPoolDTO);
+	List<PortExcel> listPortExport(BoxPoolDTO boxPoolDTO);
 
-	List<BoxPoolContainerNumberDTO> listContainerNumberExport(BoxPoolDTO boxPoolDTO);
+	List<ContainerNumberExcel> listContainerNumberExport(BoxPoolDTO boxPoolDTO);
 
 	R whetherDeactivate(String id, String type);
+
+	List<PortItemExcel> listPortExportItems(BoxPoolDTO boxPoolDTO);
+
+	List<PortItemExcel> listContainerNumberExportItems(BoxPoolDTO boxPoolDTO);
 }

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxService.java

@@ -95,4 +95,6 @@ public interface ITradingBoxService extends IService<TradingBox> {
 	R batchAddPod(String ids, String podIds);
 
 	R deleteById(String ids);
+
+	R removeIds(List<Long> longList);
 }

+ 8 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxItemsServiceImpl.java

@@ -19,11 +19,14 @@ package org.springblade.los.box.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springblade.los.box.entity.PutBoxItems;
+import org.springblade.los.box.excel.PortItemExcel;
 import org.springblade.los.box.mapper.PutBoxItemsMapper;
 import org.springblade.los.box.service.IPutBoxItemsService;
 import org.springblade.los.box.vo.PutBoxItemsVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  *  服务实现类
  *
@@ -38,4 +41,9 @@ public class PutBoxItemsServiceImpl extends ServiceImpl<PutBoxItemsMapper, PutBo
 		return page.setRecords(baseMapper.selectPutBoxItemsPage(page, putBoxItems));
 	}
 
+	@Override
+	public List<PortItemExcel> selectPutBoxItemsList(Long portId, String whetherLoseEfficacy, String tenantId, String busType, Long stationId) {
+		return baseMapper.selectPutBoxItemsList( portId,whetherLoseEfficacy,tenantId,busType,stationId);
+	}
+
 }

+ 160 - 121
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

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

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

@@ -258,7 +258,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		} else if ("OW-HY".equals(tradingBox.getType())) {
 			billNoFormat = "OW-HY";
 			businessTypeCode = "OW-HY";
-		}else if ("TZ".equals(tradingBox.getType())) {
+		} else if ("TZ".equals(tradingBox.getType())) {
 			billNoFormat = "TZ";
 			businessTypeCode = "TZ";
 		} else {
@@ -2847,7 +2847,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			.eq(TradingBoxItem::getIsDeleted, 0)
 			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
 			.eq(TradingBoxItem::getPid, id)
-			.apply( "DATE_FORMAT(pol_pick_up_date,'%Y-%m') = '" + formatter.format(accountDate) + "'")
+			.apply("DATE_FORMAT(pol_pick_up_date,'%Y-%m') = '" + formatter.format(accountDate) + "'")
 			.eq(TradingBoxItem::getWhetherGeneratePickUpCost, "0"));
 
 		if (tradingBoxItems.isEmpty()) {
@@ -3932,4 +3932,52 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		return null;
 	}
 
+	@Override
+	public R removeIds(List<Long> longList) {
+		List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBoxItem::getIsDeleted, 0)
+			.in(TradingBoxItem::getPid, longList));
+		if (!tradingBoxItemList.isEmpty()) {
+			for (TradingBoxItem item : tradingBoxItemList) {
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setIsDeleted(1);
+			}
+			tradingBoxItemService.updateBatchById(tradingBoxItemList);
+		}
+		List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getIsDeleted, 0)
+			.in(FeeCenter::getPid, longList));
+		if (!feeCenterList.isEmpty()) {
+			if (feeCenterList.stream().anyMatch(e -> !"0".equals(e.getAuditStatus()))) {
+				throw new RuntimeException("费用已审核,禁止删除");
+			} else {
+				for (FeeCenter item : feeCenterList) {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setIsDeleted(1);
+				}
+				feeCenterService.updateBatchById(feeCenterList);
+			}
+		}
+		List<TradingBox> tradingBoxList = baseMapper.selectList(new LambdaQueryWrapper<TradingBox>()
+			.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBox::getIsDeleted, 0)
+			.in(TradingBox::getId, longList));
+		if (!tradingBoxList.isEmpty()) {
+			for (TradingBox item : tradingBoxList) {
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setIsDeleted(1);
+			}
+			this.updateBatchById(tradingBoxList);
+		}
+		return R.success("操作成功");
+	}
+
 }

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

@@ -1690,15 +1690,46 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 			String type = "";
 			if ("SE".equals(item.getBusinessType())) {
-				type = "海运出口";
+				type = "海运出口-"+(ObjectUtils.isNull(item.getHblno()) ? item.getBillNo() : item.getHblno());
 			} else if ("SI".equals(item.getBusinessType())) {
-				type = "海运进口";
+				type = "海运进口-"+(ObjectUtils.isNull(item.getHblno()) ? item.getBillNo() : item.getHblno());
 			} else if ("YDC".equals(item.getBusinessType())) {
-				type = "预定舱";
+				type = "预定舱-"+item.getBillNo();
 			} else if ("KHTS".equals(item.getBusinessType())) {
-				type = "客户订舱";
+				type = "客户订舱-"+item.getBillNo();
 			}
 			logUtils.saveOperationLog(OperatorType.DELETE, type, item.getId());
+			LocalDateTime now = LocalDateTime.now();
+			DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+			String formatted = now.format(formatter);
+			if (ObjectUtils.isNotNull(item.getCustomerServiceId())) {
+				Message sendMessage = new Message();
+				sendMessage.setParameter(item.getId() + "");
+				sendMessage.setUserName(AuthUtil.getUserName());
+				sendMessage.setUserId(null);
+				sendMessage.setToUserId(item.getCustomerServiceId());
+				sendMessage.setToUserName(item.getCustomerServiceName());
+				sendMessage.setMessageType(1);
+				sendMessage.setTenantId(AuthUtil.getTenantId());
+				sendMessage.setCreateUser(null);
+				sendMessage.setCreateTime(new Date());
+				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody(type+":" + (ObjectUtils.isNull(item.getHblno())
+					? item.getBillNo() : item.getHblno()) + "已删除!操作人:"+AuthUtil.getUserName()+"时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+			item.setUpdateUserName(AuthUtil.getUserName());
+			item.setUpdateUser(AuthUtil.getUserId());
+			item.setUpdateTime(new Date());
+			item.setIsDeleted(1);
+		}
+		if (!billsList.isEmpty()){
+			this.updateBatchById(billsList);
 		}
 		List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
@@ -1708,7 +1739,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			if (feeCenterList.stream().anyMatch(e -> !"0".equals(e.getAuditStatus()))) {
 				throw new RuntimeException("费用已审核,禁止删除");
 			} else {
-				feeCenterService.removeByIds(feeCenterList.stream().map(FeeCenter::getId).collect(Collectors.toList()));
+				for (FeeCenter item : feeCenterList){
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setIsDeleted(1);
+				}
+				feeCenterService.updateBatchById(feeCenterList);
 			}
 		}
 		List<SeaBillsDetail> seaBillsDetail = seaBillsDetailService.list(new LambdaQueryWrapper<SeaBillsDetail>()
@@ -1717,31 +1754,58 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (!seaBillsDetail.isEmpty()) {
 			seaBillsDetailService.removeByIds(seaBillsDetail.stream().map(SeaBillsDetail::getId).collect(Collectors.toList()));
 		}
+
 		List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
 			.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
 			.in(PreContainers::getPid, ids));
 		if (!preContainersList.isEmpty()) {
-			preContainersService.removeByIds(preContainersList.stream().map(PreContainers::getId).collect(Collectors.toList()));
+			for (PreContainers item : preContainersList) {
+				if ("已选择".equals(item.getContainerNumberStatus())) {
+					throw new RuntimeException("已占用放箱号,请先撤销后再退舱");
+				}
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setIsDeleted(1);
+			}
+			preContainersService.updateBatchById(preContainersList);
 		}
 		List<SeaContainerNumberItem> containerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
 			.eq(SeaContainerNumberItem::getTenantId, AuthUtil.getTenantId())
 			.in(SeaContainerNumberItem::getPid, ids));
 		if (!containerNumberItemList.isEmpty()) {
-			seaContainerNumberItemService.removeByIds(containerNumberItemList.stream().map(SeaContainerNumberItem::getId).collect(Collectors.toList()));
+			for (SeaContainerNumberItem item : containerNumberItemList) {
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setIsDeleted(1);
+			}
+			seaContainerNumberItemService.updateBatchById(containerNumberItemList);
 		}
 		List<FilesCenter> filesCenterList = filesCenterService.list(new LambdaQueryWrapper<FilesCenter>()
 			.eq(FilesCenter::getTenantId, AuthUtil.getTenantId())
 			.in(FilesCenter::getPid, ids));
 		if (!filesCenterList.isEmpty()) {
-			filesCenterService.removeByIds(filesCenterList.stream().map(FilesCenter::getId).collect(Collectors.toList()));
+			for (FilesCenter item : filesCenterList) {
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setIsDeleted(1);
+			}
+			filesCenterService.updateBatchById(filesCenterList);
 		}
 		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
 			.eq(Containers::getTenantId, AuthUtil.getTenantId())
 			.in(Containers::getPid, ids));
 		if (!containersList.isEmpty()) {
-			containersService.removeByIds(containersList.stream().map(Containers::getId).collect(Collectors.toList()));
+			for (Containers item : containersList) {
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setIsDeleted(1);
+			}
+			containersService.updateBatchById(containersList);
 		}
-		baseMapper.deleteBatchIds(ids);
 	}
 
 	@Override
@@ -1803,6 +1867,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				}
 			}
 		}
+		LocalDateTime now = LocalDateTime.now();
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+		String formatted = now.format(formatter);
 		for (Bills item : billsList) {
 			int version = StringUtil.isBlank(item.getVersion()) ? 1 : Integer.parseInt(item.getVersion());
 			item.setVersion(String.valueOf(version + 1));
@@ -1820,6 +1887,27 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 			item.setBillStatus(1);
 			item.setBookingWithdrawTime(new Date());
+			if (ObjectUtils.isNotNull(item.getCustomerServiceId())) {
+				Message sendMessage = new Message();
+				sendMessage.setParameter(item.getId() + "");
+				sendMessage.setUserName(AuthUtil.getUserName());
+				sendMessage.setUserId(null);
+				sendMessage.setToUserId(item.getCustomerServiceId());
+				sendMessage.setToUserName(item.getCustomerServiceName());
+				sendMessage.setMessageType(1);
+				sendMessage.setTenantId(AuthUtil.getTenantId());
+				sendMessage.setCreateUser(null);
+				sendMessage.setCreateTime(new Date());
+				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("单号:" + (ObjectUtils.isNull(item.getHblno())
+					? item.getBillNo() : item.getHblno()) + "已退舱请及时待处理!操作人:"+AuthUtil.getUserName()+"时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
 		}
 		this.updateBatchById(billsList);
 		return R.data("操作成功");
@@ -2537,6 +2625,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getIsDeleted, 0)
 			.in(Bills::getId, ids));
+		LocalDateTime now = LocalDateTime.now();
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+		String formatted = now.format(formatter);
 		for (Bills item : billsList) {
 			int version = StringUtil.isBlank(item.getVersion()) ? 1 : Integer.parseInt(item.getVersion());
 			item.setVersion(String.valueOf(version + 1));
@@ -2548,6 +2639,27 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 			item.setBillStatus(0);
 			item.setBookingWithdrawTime(new Date());
+			if (ObjectUtils.isNotNull(item.getCustomerServiceId())) {
+				Message sendMessage = new Message();
+				sendMessage.setParameter(item.getId() + "");
+				sendMessage.setUserName(AuthUtil.getUserName());
+				sendMessage.setUserId(null);
+				sendMessage.setToUserId(item.getCustomerServiceId());
+				sendMessage.setToUserName(item.getCustomerServiceName());
+				sendMessage.setMessageType(1);
+				sendMessage.setTenantId(AuthUtil.getTenantId());
+				sendMessage.setCreateUser(null);
+				sendMessage.setCreateTime(new Date());
+				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("单号:" + (ObjectUtils.isNull(item.getHblno())
+					? item.getBillNo() : item.getHblno()) + "已取消退舱请及时待处理!操作人:"+AuthUtil.getUserName()+"时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
 		}
 		this.updateBatchById(billsList);
 		return R.data("操作成功");
@@ -5304,6 +5416,30 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				}
 			}
 		}
+		List<User> userList = userClient.selectListByRoleAndDept("secondaryAdmin",bills.getBranchId(),AuthUtil.getTenantId());
+		if (!userList.isEmpty()){
+			for (User datum : userList){
+				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/businessCenter/customerLetter/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("您有客户订舱已提交,请及时待处理!客户订舱单号:" + (ObjectUtils.isNull(bills.getHblno())
+					? bills.getBillNo() : bills.getHblno()) + "时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+		}
 		return R.data(bills);
 	}
 

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java

@@ -2094,7 +2094,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 		BigDecimal amountCrLoc = new BigDecimal("0.00");
 		BigDecimal oceanFreightDr = new BigDecimal("0.00");
 		BigDecimal oceanFreightCr = new BigDecimal("0.00");
-		if ("HYJK,HYCK".contains(feeCenter.getBusinessType())) {
+		if ("SE,SI".contains(feeCenter.getBusinessType())) {
 			bills = billsMapper.selectById(feeCenterUpdateRecord.getPid());
 			if (bills == null) {
 				throw new RuntimeException("未查到单据信息");
@@ -2103,11 +2103,11 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.eq(FeeCenter::getIsDeleted, 0)
+				.ne(FeeCenter::getId, feeCenter.getId())
 				.eq(FeeCenter::getPid, bills.getId()));
 			if (feeCenterList.isEmpty()) {
 				throw new RuntimeException("未查到费用明细");
 			}
-
 			amountDr = feeCenterList.stream().filter(e -> "D".equals(e.getDc()) && exrateType.equals(e.getCurCode())
 				&& !e.getId().equals(feeCenter.getId())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
 			amountDrUsd = feeCenterList.stream().filter(e -> "D".equals(e.getDc()) && !exrateType.equals(e.getCurCode())

+ 15 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

@@ -351,6 +351,21 @@ public class UserClient implements IUserClient {
 		}
 	}
 
+	@Override
+	public List<User> selectListByRoleAndDept(String roleName, String branchId, String tenantId) {
+		R<String> res = sysClient.getRoleIds(tenantId, "roleName");
+		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+			return service.list(new LambdaQueryWrapper<User>()
+				.eq(User::getTenantId, tenantId)
+				.eq(User::getIsDeleted, 0)
+				.eq(User::getDeptId, branchId)
+				.apply("find_in_set('" + res.getData() + "',role_id)")
+			);
+		} else {
+			return new ArrayList<>();
+		}
+	}
+
 	/**
 	 * 获取用户
 	 * @param user