Jelajahi Sumber

1.箱池动态-导出模板-空箱提箱进场接口
2.箱池动态-导入 POL空箱提箱进场接口
3.OW(拿)(放)增加空箱提箱进场时间
4.OW(拿)(放)计算租金起始日期修改
5.OW(拿)(放)撤销计算租金接口替换租金计算截止日期字段
6.箱池动态-导入 POL空箱出场接口增加同步出口装箱信息
7.箱池动态-导入 POD空箱返场接口增加同步出口装箱信息
8.箱池动态-导入 POL无货返空接口增加同步出口装箱信息
9.换单,撤销换单,退押,撤销退押接口逻辑增加
10.调试海运进出口费用申请接口

纪新园 10 bulan lalu
induk
melakukan
11ec20cf60
14 mengubah file dengan 979 tambahan dan 103 penghapusan
  1. 1 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/ArchivesFiles.java
  2. 24 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBoxItems.java
  3. 24 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBoxItem.java
  4. 69 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/EmptyContainerEntry.java
  5. 69 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/GiveAnEncore.java
  6. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  7. 3 3
      blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java
  8. 30 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/BoxPoolController.java
  9. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java
  10. 21 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  11. 591 23
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  12. 4 4
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  13. 84 48
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  14. 51 23
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

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

@@ -124,7 +124,7 @@ public class ArchivesFiles implements Serializable {
 	private String value;
 
 	/**
-	 * 分类 1空箱出场 2 空箱进场excel 3无货返空
+	 * 分类 0空箱提箱进场 1空箱出场 2 空箱进场excel 3无货返空
 	 */
 	@ApiModelProperty(value = "分类")
 	private String type;

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

@@ -16,10 +16,14 @@
  */
 package org.springblade.los.box.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -212,16 +216,25 @@ public class PutBoxItems implements Serializable {
 	 * pol预出场日期
 	 */
 	@ApiModelProperty(value = "pol预出场日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polPreAppearanceDate;
 	/**
 	 * pol场站空箱出场日期
 	 */
 	@ApiModelProperty(value = "pol场站空箱出场日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polStationEmptyContainerExitDate;
 	/**
 	 * pol还箱日期
 	 */
 	@ApiModelProperty(value = "pol还箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polReturnDate;
 	/**
 	 * pol超期箱使天数
@@ -229,6 +242,14 @@ public class PutBoxItems implements Serializable {
 	@ApiModelProperty(value = "pol超期箱使天数")
 	private Integer polOverdueBoxUseDays;
 	/**
+	 * pol提箱日期
+	 */
+	@ApiModelProperty(value = "pol提箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date polPickUpDate;
+	/**
 	 * eta
 	 */
 	@ApiModelProperty(value = "eta")
@@ -237,6 +258,9 @@ public class PutBoxItems implements Serializable {
 	 * pod空箱还箱日期
 	 */
 	@ApiModelProperty(value = "pod空箱还箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date podEmptyContainerReturnDate;
 	/**
 	 * pod场站

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

@@ -386,16 +386,25 @@ public class TradingBoxItem implements Serializable {
 	 * pol提箱日期
 	 */
 	@ApiModelProperty(value = "pol提箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polPickUpDate;
 	/**
 	 * pod还箱日期
 	 */
 	@ApiModelProperty(value = "pod还箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date podReturnDate;
 	/**
 	 * etd
 	 */
 	@ApiModelProperty(value = "etd")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date etd;
 	/**
 	 * pol 堆场
@@ -426,16 +435,25 @@ public class TradingBoxItem implements Serializable {
 	 * pol预出场日期
 	 */
 	@ApiModelProperty(value = "pol预出场日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polPreAppearanceDate;
 	/**
 	 * pol场站空箱出场日期
 	 */
 	@ApiModelProperty(value = "pol场站空箱出场日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polStationEmptyContainerExitDate;
 	/**
 	 * pol还箱日期
 	 */
 	@ApiModelProperty(value = "pol还箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date polReturnDate;
 	/**
 	 * pol超期箱使天数
@@ -446,11 +464,17 @@ public class TradingBoxItem implements Serializable {
 	 * eta
 	 */
 	@ApiModelProperty(value = "eta")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date eta;
 	/**
 	 * pod空箱还箱日期
 	 */
 	@ApiModelProperty(value = "pod空箱还箱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date podEmptyContainerReturnDate;
 	/**
 	 * pod场站

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

@@ -0,0 +1,69 @@
+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 lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2025/4/17
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class EmptyContainerEntry {
+
+	/**
+	 * 放箱号
+	 */
+	@ExcelProperty(value = "放箱号*")
+	private String containerNumber;
+
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号*")
+	private String boxCode;
+
+	/**
+	 * 箱型
+	 */
+	@ExcelProperty(value = "箱型*")
+	private String boxType;
+
+	/**
+	 * 港口
+	 */
+	@ExcelProperty(value = "港口*")
+	private String portName;
+
+	/**
+	 * 场站
+	 */
+	@ExcelProperty(value = "场站*")
+	private String stationName;
+
+	/**
+	 * 提单号
+	 */
+	@ExcelProperty(value = "提单号")
+	private String mblno;
+
+	/**
+	 * 箱动态
+	 */
+	@ExcelProperty(value = "箱动态")
+	private String boxStatus;
+
+	/**
+	 * 动态日期
+	 */
+	@ExcelProperty(value = "动态日期")
+	private Date boxStatusDate;
+
+}

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

@@ -0,0 +1,69 @@
+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 lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2025/4/17
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class GiveAnEncore {
+
+	/**
+	 * 放箱号
+	 */
+	@ExcelProperty(value = "放箱号*")
+	private String containerNumber;
+
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号*")
+	private String boxCode;
+
+	/**
+	 * 箱型
+	 */
+	@ExcelProperty(value = "箱型*")
+	private String boxType;
+
+	/**
+	 * 港口
+	 */
+	@ExcelProperty(value = "港口*")
+	private String portName;
+
+	/**
+	 * 场站
+	 */
+	@ExcelProperty(value = "场站*")
+	private String stationName;
+
+	/**
+	 * 提单号
+	 */
+	@ExcelProperty(value = "提单号")
+	private String mblno;
+
+	/**
+	 * 箱动态
+	 */
+	@ExcelProperty(value = "箱动态")
+	private String boxStatus;
+
+	/**
+	 * 动态日期
+	 */
+	@ExcelProperty(value = "动态日期")
+	private Date boxStatusDate;
+
+}

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

@@ -1487,6 +1487,12 @@ public class Bills implements Serializable {
 	private String returningSecurityMoneyStatus;
 
 	/**
+	 * ML-MB/L NO
+	 */
+	@ApiModelProperty(value = "ML-MB/L NO")
+	private String mlMblno;
+
+	/**
 	 * 到港日期
 	 */
 	@TableField(exist = false)

+ 3 - 3
blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java

@@ -109,7 +109,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 			yyyyMM = DateFormatUtils.format(date, yearMmDd);
 		}
 		billNo = head + yyyyMM;
-		List<BillNoCenter> billNoCenterList = billNoCenterService.list(new LambdaQueryWrapper<BillNoCenter>()
+		/*List<BillNoCenter> billNoCenterList = billNoCenterService.list(new LambdaQueryWrapper<BillNoCenter>()
 			.eq(BillNoCenter::getTenantId, AuthUtil.getTenantId())
 			.eq(BillNoCenter::getIsDeleted, 0)
 			.eq(BillNoCenter::getBusinessTypeId, detail.getBusinessTypeId())
@@ -122,7 +122,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 		);
 		if (!billNoCenterList.isEmpty()) {
 			return R.data(billNoCenterList.get(0).getBillNo());
-		} else {
+		} else {*/
 			BillNoSerial billNoSerial1 = new BillNoSerialVO();
 			//判断是否有生成过编码记录
 			BillNoSerial billNoSerial = billNoSerialService.getOne(new LambdaQueryWrapper<BillNoSerial>()
@@ -182,7 +182,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 			}
 			billNoSerialService.saveOrUpdate(billNoSerial1);
 			return R.data(billNo);
-		}
+//		}
 	}
 
 	@Override

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

@@ -29,6 +29,8 @@ 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.excel.EmptyContainerAppearance;
+import org.springblade.los.box.excel.EmptyContainerEntry;
+import org.springblade.los.box.excel.GiveAnEncore;
 import org.springblade.los.box.service.IPutBoxService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -76,12 +78,30 @@ public class BoxPoolController extends BladeController {
 	}
 
 	/**
+	 * 导出模板-空箱提箱进场
+	 */
+	@GetMapping("/emptyContainerEntry/template")
+	public void emptyContainerEntryTemplate(HttpServletResponse response) {
+		List<EmptyContainerEntry> list = new ArrayList<>();
+		ExcelUtil.export(response, "空箱提箱进场模板", "空箱提箱进场", list, EmptyContainerEntry.class);
+	}
+
+	/**
+	 * 导入 POL空箱提箱进场
+	 */
+	@PostMapping("/emptyContainerEntry")
+	@RepeatSubmit
+	public R emptyContainerEntry(@RequestParam("file") MultipartFile file) throws IOException {
+		return putBoxService.emptyContainerEntry(file);
+	}
+
+	/**
 	 * 导出模板-空箱出场
 	 */
 	@GetMapping("/emptyContainerAppearance/template")
 	public void exportBCountrysTemplate(HttpServletResponse response) {
 		List<EmptyContainerAppearance> list = new ArrayList<>();
-		ExcelUtil.export(response, "导入模板", "导入模板", list, EmptyContainerAppearance.class);
+		ExcelUtil.export(response, "空箱出场模板", "空箱出场", list, EmptyContainerAppearance.class);
 	}
 
 	/**
@@ -94,6 +114,15 @@ public class BoxPoolController extends BladeController {
 	}
 
 	/**
+	 * 导出模板-POD返场
+	 */
+	@GetMapping("/giveAnEncore/template")
+	public void giveAnEncoreTemplate(HttpServletResponse response) {
+		List<GiveAnEncore> list = new ArrayList<>();
+		ExcelUtil.export(response, "空箱出场模板", "空箱出场", list, GiveAnEncore.class);
+	}
+
+	/**
 	 * 导入 POD返场
 	 */
 	@PostMapping("/giveAnEncore")

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

@@ -75,4 +75,6 @@ public interface IPutBoxService extends IService<PutBox> {
 	R returnEmpty(MultipartFile file)throws IOException;
 
 	PutBox copyDocument(PutBox putBox);
+
+	R emptyContainerEntry(MultipartFile file)throws IOException;
 }

+ 21 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java

@@ -31,6 +31,8 @@ import org.springblade.los.box.mapper.ExpenseApplicationMapper;
 import org.springblade.los.box.service.IExpenseApplicationService;
 import org.springblade.los.box.service.ITradingBoxService;
 import org.springblade.los.box.vo.ExpenseApplicationVO;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.service.IBillsService;
 import org.springblade.los.check.dto.LosAuditProecessDTO;
 import org.springblade.los.check.entity.LosAuditPathsActs;
 import org.springblade.los.check.entity.LosAuditPathsLevels;
@@ -64,6 +66,8 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 
 	private final ITradingBoxService tradingBoxService;
 
+	private final IBillsService billsService;
+
 	private final IAuditPathsActsService auditPathsActsService;
 
 	private final IAuditPathsLevelsService auditPathsLevelsService;
@@ -165,6 +169,23 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 			expenseApplication.setCorpId(tradingBox.getPurchaseCompanyId());
 			expenseApplication.setCorpCnName(tradingBox.getPurchaseCompanyName());
 			expenseApplication.setCorpEnName(tradingBox.getPurchaseCompanyName());
+		}else if ("HYJK,HYCK".contains(expenseApplication.getSrcType())) {
+			Bills bills = billsService.getById(expenseApplication.getSrcId());
+			if (bills == null) {
+				throw new RuntimeException("未查到单据信息");
+			}
+			expenseApplication.setCreateUser(AuthUtil.getUserId());
+			expenseApplication.setCreateTime(new Date());
+			expenseApplication.setCreateUserName(AuthUtil.getUserName());
+			expenseApplication.setSrcNo(bills.getBillNo());
+			expenseApplication.setSrcMblno(bills.getMblno());
+			expenseApplication.setSrcContainerNumber("");
+			expenseApplication.setSrcContractNo(bills.getBookingNo());
+			expenseApplication.setStatus("审核提交");
+			expenseApplication.setSrcBusDate(new Date());
+			expenseApplication.setCorpId(bills.getCorpId());
+			expenseApplication.setCorpCnName(bills.getCorpCnName());
+			expenseApplication.setCorpEnName(bills.getCorpEnName());
 		} else {
 			throw new RuntimeException("类型错误,未查到单据");
 		}

+ 591 - 23
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -43,11 +43,17 @@ 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.GiveAnEncore;
 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.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.Containers;
+import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.excel.RouteCostProfitExcel;
 import org.springblade.resource.feign.IOssClient;
 import org.springblade.system.feign.ISysClient;
@@ -97,6 +103,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 
 	private final IBCorpsService bCorpsService;
 
+	private final BillsMapper billsMapper;
+
+	private final IContainersService containersService;
+
 	@Override
 	public IPage<PutBoxVO> selectPutBoxPage(IPage<PutBoxVO> page, PutBoxVO putBox) {
 		return null;
@@ -640,6 +650,22 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(BCorps::getIsDeleted, 0)
 				.in(BCorps::getCnName, stationName));
 		}
+		List<String> mblno = excelList.stream().map(EmptyContainerAppearance::getMblno).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<Containers> containersList = new ArrayList<>();
+		List<Containers> containersListNew = new ArrayList<>();
+		if (!mblno.isEmpty()) {
+			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getMblno, portName));
+			if (!billsList.isEmpty()) {
+				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.in(Containers::getMblno, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+			}
+		}
 		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
 			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
 			.eq(PutBox::getIsDeleted, 0)
@@ -860,10 +886,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									tradingBoxItem.setPolCyCname(corps.getCnName());
 									tradingBoxItem.setPolCyEname(corps.getEnName());
 									if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
-										tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
 										tradingBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 									} else {
-										tradingBoxItem.setRentEndDate(new Date());
 										tradingBoxItem.setPolStationEmptyContainerExitDate(new Date());
 									}
 									tradingBoxItem.setStatus("待使用");
@@ -899,10 +923,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									tradingBoxItem.setPolCyEname(corps.getEnName());
 									tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
 									if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
-										tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
 										tradingBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 									} else {
-										tradingBoxItem.setRentEndDate(new Date());
 										tradingBoxItem.setPolStationEmptyContainerExitDate(new Date());
 									}
 									tradingBoxItem.setStatus("待使用");
@@ -938,10 +960,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 								tradingBoxItem.setPolCyEname(corps.getEnName());
 								tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
 								if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
-									tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
 									tradingBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 								} else {
-									tradingBoxItem.setRentEndDate(new Date());
 									tradingBoxItem.setPolStationEmptyContainerExitDate(new Date());
 								}
 								tradingBoxItem.setStatus("待使用");
@@ -959,6 +979,18 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			} else {
 				throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
 			}
+			if (!containersList.isEmpty()) {
+				Containers containers = containersList.stream().filter(e -> ObjectUtils.isNotNull(item.getMblno()) &&
+					item.getMblno().equals(e.getMblno()) && item.getBoxCode().equals(e.getCntrNo())).findFirst().orElse(null);
+				if (containers != null) {
+					containers.setPolCyId(corps.getId());
+					containers.setPolCyCode(corps.getCode());
+					containers.setPolCyCname(corps.getCnName());
+					containers.setPolCyEname(corps.getEnName());
+					containers.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
+					containersListNew.add(containers);
+				}
+			}
 		}
 		if (!putBoxes.isEmpty()) {
 			for (PutBox item : putBoxes) {
@@ -1005,6 +1037,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (!putBoxItems.isEmpty()) {
 			putBoxItemsService.saveOrUpdateBatch(putBoxItems);
 		}
+		if (!containersListNew.isEmpty()) {
+			containersService.saveOrUpdateBatch(containersListNew);
+		}
 		if (!archivesArrayList.isEmpty()) {
 			archivesService.saveOrUpdateBatch(archivesArrayList);
 		}
@@ -1077,11 +1112,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 	@Transactional(rollbackFor = Exception.class)
 	public R giveAnEncore(MultipartFile file) throws IOException {
 		//导入数据
-		List<EmptyContainerAppearance> excelList = ExcelUtil.read(file, EmptyContainerAppearance.class);
+		List<GiveAnEncore> excelList = ExcelUtil.read(file, GiveAnEncore.class);
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode)
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -1105,13 +1140,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (!containerNumberOwList.isEmpty()) {
 			containerNumberList.addAll(containerNumberOwList);
 		}
-		List<String> boxType = excelList.stream().map(EmptyContainerAppearance::getBoxType).filter(Objects::nonNull)
+		List<String> boxType = excelList.stream().map(GiveAnEncore::getBoxType).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BCntrTypes> cntrTypesList = bCntrTypesService.list(new LambdaQueryWrapper<BCntrTypes>()
 			.eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
 			.eq(BCntrTypes::getIsDeleted, 0)
 			.in(BCntrTypes::getCnName, boxType));
-		List<String> portName = excelList.stream().map(EmptyContainerAppearance::getPortName).filter(Objects::nonNull)
+		List<String> portName = excelList.stream().map(GiveAnEncore::getPortName).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BPorts> portsList = new ArrayList<>();
 		if (!portName.isEmpty()) {
@@ -1120,7 +1155,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(BPorts::getIsDeleted, 0)
 				.in(BPorts::getCnName, portName));
 		}
-		List<String> stationName = excelList.stream().map(EmptyContainerAppearance::getStationName).filter(Objects::nonNull)
+		List<String> stationName = excelList.stream().map(GiveAnEncore::getStationName).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BCorps> corpsList = new ArrayList<>();
 		if (!stationName.isEmpty()) {
@@ -1129,6 +1164,22 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(BCorps::getIsDeleted, 0)
 				.in(BCorps::getCnName, stationName));
 		}
+		List<String> mblno = excelList.stream().map(GiveAnEncore::getMblno).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<Containers> containersList = new ArrayList<>();
+		List<Containers> containersListNew = new ArrayList<>();
+		if (!mblno.isEmpty()) {
+			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getMblno, portName));
+			if (!billsList.isEmpty()) {
+				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.in(Containers::getMblno, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+			}
+		}
 		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
 			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
 			.eq(PutBox::getIsDeleted, 0)
@@ -1178,7 +1229,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (businessType == null) {
 			throw new RuntimeException("未找到可用业务类型");
 		}
-		for (EmptyContainerAppearance item : excelList) {
+		for (GiveAnEncore item : excelList) {
 			BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
 			if (ports == null) {
 				throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
@@ -1254,11 +1305,23 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					throw new RemoteException("箱号:" + item.getBoxCode() + "放箱号类型错误");
 				}
 			}
+			if (!containersList.isEmpty()) {
+				Containers containers = containersList.stream().filter(e -> ObjectUtils.isNotNull(item.getMblno()) &&
+					item.getMblno().equals(e.getMblno()) && item.getBoxCode().equals(e.getCntrNo())).findFirst().orElse(null);
+				if (containers != null) {
+					containers.setPodStationId(corps.getId());
+					containers.setPodStationCode(corps.getCode());
+					containers.setPodStationCname(corps.getCnName());
+					containers.setPodStationEname(corps.getEnName());
+					containers.setPodEmptyContainerReturnDate(item.getBoxStatusDate());
+					containersListNew.add(containers);
+				}
+			}
 		}
 		if (!putBoxNewList.isEmpty()) {
 			this.saveOrUpdateBatch(putBoxNewList);
 		}
-		for (EmptyContainerAppearance item : excelList) {
+		for (GiveAnEncore item : excelList) {
 			BCntrTypes cntrTypes = cntrTypesList.stream().filter(e -> e.getCnName().equals(item.getBoxType())).findFirst().orElse(null);
 			if (cntrTypes == null) {
 				throw new RemoteException("请先维护箱型:" + item.getBoxType() + "基础资料");
@@ -1373,6 +1436,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (!archivesDateleList.isEmpty()) {
 			archivesService.removeByIds(archivesDateleList);
 		}
+		if (!containersListNew.isEmpty()) {
+			containersService.removeByIds(containersListNew);
+		}
 		if (!putBoxItemsOldList.isEmpty()) {
 			putBoxItemsService.updateBatchById(putBoxItemsOldList);
 		}
@@ -1395,7 +1461,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		return R.data("操作成功");
 	}
 
-	private Archives updateArchives(Archives archives, EmptyContainerAppearance item, BPorts ports, BCorps corps) {
+	private Archives updateArchives(Archives archives, GiveAnEncore item, BPorts ports, BCorps corps) {
 		archives.setUpdateTime(new Date());
 		archives.setUpdateUser(AuthUtil.getUserId());
 		archives.setUpdateUserName(AuthUtil.getUserName());
@@ -1413,7 +1479,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		return archives;
 	}
 
-	private List<TradingBoxItem> updatePutBoxItemsTrading(List<PutBox> putBoxList, Archives archives, EmptyContainerAppearance item,
+	private List<TradingBoxItem> updatePutBoxItemsTrading(List<PutBox> putBoxList, Archives archives, GiveAnEncore item,
 														  BCorps corps, List<TradingBox> tradingBoxList,
 														  List<TradingBoxItem> tradingBoxItemList, BPorts ports, String status) {
 		PutBox putBoxOld;
@@ -1473,7 +1539,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		return tradingBoxItemOldList;
 	}
 
-	private List<PutBoxItems> updatePutBoxItems(List<PutBox> putBoxList, Archives archives, EmptyContainerAppearance item,
+	private List<PutBoxItems> updatePutBoxItems(List<PutBox> putBoxList, Archives archives, GiveAnEncore item,
 												BCorps corps, List<PutBoxItems> putBoxItemsList, String status) {
 		PutBox putBoxOld;
 		if ("1".equals(status)) {
@@ -1633,11 +1699,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 	@Transactional(rollbackFor = Exception.class)
 	public R returnEmpty(MultipartFile file) throws IOException {
 		//导入数据
-		List<EmptyContainerAppearance> excelList = ExcelUtil.read(file, EmptyContainerAppearance.class);
+		List<GiveAnEncore> excelList = ExcelUtil.read(file, GiveAnEncore.class);
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode)
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -1656,13 +1722,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		}
 		List<String> containerNumberList = archivesList.stream().map(Archives::getContainerNumber)
 			.distinct().collect(Collectors.toList());
-		List<String> boxType = excelList.stream().map(EmptyContainerAppearance::getBoxType).filter(Objects::nonNull)
+		List<String> boxType = excelList.stream().map(GiveAnEncore::getBoxType).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BCntrTypes> cntrTypesList = bCntrTypesService.list(new LambdaQueryWrapper<BCntrTypes>()
 			.eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
 			.eq(BCntrTypes::getIsDeleted, 0)
 			.in(BCntrTypes::getCnName, boxType));
-		List<String> portName = excelList.stream().map(EmptyContainerAppearance::getPortName).filter(Objects::nonNull)
+		List<String> portName = excelList.stream().map(GiveAnEncore::getPortName).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BPorts> portsList = new ArrayList<>();
 		if (!portName.isEmpty()) {
@@ -1671,7 +1737,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(BPorts::getIsDeleted, 0)
 				.in(BPorts::getCnName, portName));
 		}
-		List<String> stationName = excelList.stream().map(EmptyContainerAppearance::getStationName).filter(Objects::nonNull)
+		List<String> stationName = excelList.stream().map(GiveAnEncore::getStationName).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 		List<BCorps> corpsList = new ArrayList<>();
 		if (!stationName.isEmpty()) {
@@ -1680,6 +1746,22 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(BCorps::getIsDeleted, 0)
 				.in(BCorps::getCnName, stationName));
 		}
+		List<String> mblno = excelList.stream().map(GiveAnEncore::getMblno).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<Containers> containersList = new ArrayList<>();
+		List<Containers> containersListNew = new ArrayList<>();
+		if (!mblno.isEmpty()) {
+			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getMblno, portName));
+			if (!billsList.isEmpty()) {
+				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.in(Containers::getMblno, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+			}
+		}
 		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
 			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
 			.eq(PutBox::getIsDeleted, 0)
@@ -1729,7 +1811,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (businessType == null) {
 			throw new RuntimeException("未找到可用业务类型");
 		}
-		for (EmptyContainerAppearance item : excelList) {
+		for (GiveAnEncore item : excelList) {
 			BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
 			if (ports == null) {
 				throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
@@ -1800,13 +1882,25 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			} else {
 				throw new RemoteException("箱号:" + item.getBoxCode() + "放箱号类型错误");
 			}
+			if (!containersList.isEmpty()) {
+				Containers containers = containersList.stream().filter(e -> ObjectUtils.isNotNull(item.getMblno()) &&
+					item.getMblno().equals(e.getMblno()) && item.getBoxCode().equals(e.getCntrNo())).findFirst().orElse(null);
+				if (containers != null) {
+					containers.setPolCyId(corps.getId());
+					containers.setPolCyCode(corps.getCode());
+					containers.setPolCyCname(corps.getCnName());
+					containers.setPolCyEname(corps.getEnName());
+					containers.setPolReturnDate(item.getBoxStatusDate());
+					containersListNew.add(containers);
+				}
+			}
 		}
 		if (!putBoxNewList.isEmpty()) {
 			this.saveOrUpdateBatch(putBoxNewList);
 		} else {
 			throw new RemoteException("保存放箱号单据失败");
 		}
-		for (EmptyContainerAppearance item : excelList) {
+		for (GiveAnEncore item : excelList) {
 			BCntrTypes cntrTypes = cntrTypesList.stream().filter(e -> e.getCnName().equals(item.getBoxType())).findFirst().orElse(null);
 			if (cntrTypes == null) {
 				throw new RemoteException("请先维护箱型:" + item.getBoxType() + "基础资料");
@@ -1911,13 +2005,24 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (!archivesArrayList.isEmpty()) {
 			archivesService.saveOrUpdateBatch(archivesArrayList);
 		}
+		if (!containersListNew.isEmpty()) {
+			containersService.saveOrUpdateBatch(containersListNew);
+		}
 		if (!archivesDateleList.isEmpty()) {
 			archivesService.removeByIds(archivesDateleList);
 		}
 		if (!putBoxItemsOldList.isEmpty()) {
+			for (PutBoxItems item : putBoxItemsOldList){
+				item.setPolReturnDate(item.getPodEmptyContainerReturnDate());
+				item.setPodEmptyContainerReturnDate(null);
+			}
 			putBoxItemsService.updateBatchById(putBoxItemsOldList);
 		}
 		if (!tradingBoxItemOldList.isEmpty()) {
+			for (TradingBoxItem item : tradingBoxItemOldList){
+				item.setPolReturnDate(item.getPodEmptyContainerReturnDate());
+				item.setPodEmptyContainerReturnDate(null);
+			}
 			tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
 		}
 		ArchivesFiles archivesFiles = new ArchivesFiles();
@@ -1954,4 +2059,467 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		details.setInternalContainerNumber("");
 		return details;
 	}
+
+	@Override
+	public R emptyContainerEntry(MultipartFile file) throws IOException {
+		//导入数据
+		List<EmptyContainerAppearance> excelList = ExcelUtil.read(file, EmptyContainerAppearance.class);
+		if (CollectionUtils.isEmpty(excelList)) {
+			throw new SecurityException("数据不能为空");
+		}
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode)
+			.distinct().collect(Collectors.toList());
+		//箱档案数据
+		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
+			.eq(Archives::getTenantId, AuthUtil.getTenantId())
+			.eq(Archives::getIsDeleted, 0)
+			.in(Archives::getCode, boxCodeList));
+		List<String> containerNumberList = excelList.stream().map(EmptyContainerAppearance::getContainerNumber)
+			.distinct().collect(Collectors.toList());
+		List<String> boxType = excelList.stream().map(EmptyContainerAppearance::getBoxType).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<BCntrTypes> cntrTypesList = bCntrTypesService.list(new LambdaQueryWrapper<BCntrTypes>()
+			.eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
+			.eq(BCntrTypes::getIsDeleted, 0)
+			.in(BCntrTypes::getCnName, boxType));
+		List<String> portName = excelList.stream().map(EmptyContainerAppearance::getPortName).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<BPorts> portsList = new ArrayList<>();
+		if (!portName.isEmpty()) {
+			portsList = bPortsService.list(new LambdaQueryWrapper<BPorts>()
+				.eq(BPorts::getTenantId, AuthUtil.getTenantId())
+				.eq(BPorts::getIsDeleted, 0)
+				.in(BPorts::getCnName, portName));
+		}
+		List<String> stationName = excelList.stream().map(EmptyContainerAppearance::getStationName).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<BCorps> corpsList = new ArrayList<>();
+		if (!stationName.isEmpty()) {
+			corpsList = bCorpsService.list(new LambdaQueryWrapper<BCorps>()
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0)
+				.in(BCorps::getCnName, stationName));
+		}
+		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.in(PutBox::getContainerNumber, containerNumberList));
+		if (putBoxList.isEmpty()) {
+			throw new RuntimeException("未查到放箱号单据");
+		}
+		List<Long> putBoxIdList = putBoxList.stream().map(PutBox::getId).collect(Collectors.toList());
+		List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
+			.eq(PutBoxItems::getIsDeleted, 0)
+			.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
+			.in(PutBoxItems::getPid, putBoxIdList));
+
+		String blacklist = sysClient.getParamService("box.blacklist");
+		if (ObjectUtils.isNotNull(blacklist)) {
+			StringBuilder text = new StringBuilder();
+			for (String item : boxCodeList) {
+				if (item.length() > 3) {
+					String head = item.substring(0, 3);
+					if (blacklist.contains(head)) {
+						text.append(item).append(",");
+					}
+				}
+			}
+			if (ObjectUtils.isNotNull(text.toString())) {
+				throw new RuntimeException("箱号:" + text + "为黑名单箱,请修改数据后再操作");
+			}
+		}
+		List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
+		List<TradingBox> tradingBoxList = new ArrayList<>();
+		if (!srcIdList.isEmpty()) {
+			tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
+				.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
+				.eq(TradingBox::getIsDeleted, 0)
+				.in(TradingBox::getId, srcIdList));
+		}
+		List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
+		if (!tradingBoxList.isEmpty()) {
+			List<Long> tradingBoxIdList = tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList());
+			tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+				.eq(TradingBoxItem::getIsDeleted, 0)
+				.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+				.in(TradingBoxItem::getPid, tradingBoxIdList));
+		}
+		List<PutBoxItems> putBoxItems = new ArrayList<>();
+		List<TradingBoxItem> tradingBoxItems = new ArrayList<>();
+		List<Archives> archivesArrayList = new ArrayList<>();
+		List<PutBox> putBoxes = new ArrayList<>();
+		List<TradingBox> tradingBoxes = new ArrayList<>();
+		for (EmptyContainerAppearance item : excelList) {
+			BCntrTypes cntrTypes = cntrTypesList.stream().filter(e -> e.getCnName().equals(item.getBoxType())).findFirst().orElse(null);
+			if (cntrTypes == null) {
+				throw new RemoteException("请先维护箱型:" + item.getBoxType() + "基础资料");
+			}
+			BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
+			if (ports == null) {
+				throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
+			}
+			BCorps corps = corpsList.stream().filter(e -> e.getCnName().equals(item.getStationName())).findFirst().orElse(null);
+			if (corps == null) {
+				throw new RemoteException("请先维护场站:" + item.getStationName() + "基础资料");
+			}
+			PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
+				&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
+				&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId())).findFirst().orElse(null);
+			if (putBox != null) {
+				if (!putBoxes.isEmpty()) {
+					if (!putBoxes.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBox.getId())) {
+						putBoxes.add(putBox);
+					}
+				} else {
+					putBoxes.add(putBox);
+				}
+				//箱档案数据处理
+				Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
+				if (archives != null) {
+					if ("OW(放)".equals(putBox.getBusType())) {
+						archives.setContainerNumberOw(item.getContainerNumber());
+						archives.setContainerNumberTypeOw("OW(放)");
+					}
+					if (!archives.getTypeName().equals(item.getBoxType())) {
+						throw new RemoteException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
+					}
+					if ("使用中".equals(archives.getStatus())) {
+						throw new RemoteException("箱号:" + item.getBoxCode() + "状态为使用中");
+					}
+					archives.setUpdateTime(new Date());
+					archives.setUpdateUser(AuthUtil.getUserId());
+					archives.setUpdateUserName(AuthUtil.getUserName());
+					archives.setStatus("待使用");
+					archives.setNewDate(item.getBoxStatusDate());
+					archives.setBoxDynamics("空箱提箱进场");
+					archives.setAddressId(ports.getId());
+					archives.setAddressCode(ports.getCode());
+					archives.setAddressCname(ports.getCnName());
+					archives.setAddressEname(ports.getEnName());
+					archives.setStationId(corps.getId());
+					archives.setStationCode(corps.getCode());
+					archives.setStationCname(corps.getCnName());
+					archives.setStationEname(corps.getEnName());
+				} else {
+					if (!"OW(拿)".equals(putBox.getBusType())) {
+						throw new RuntimeException("箱档案中未查到箱号:" + item.getBoxCode());
+					}
+					archives = new Archives();
+					archives.setCode(item.getBoxCode());
+					archives.setCreateTime(new Date());
+					archives.setCreateUser(AuthUtil.getUserId());
+					archives.setCreateUserName(AuthUtil.getUserName());
+					archives.setStatus("待使用");
+					archives.setNewDate(item.getBoxStatusDate());
+					archives.setBoxDynamics("空箱提箱进场");
+					archives.setBoxBelongsTo("SOC");
+					archives.setContainerNumber(item.getContainerNumber());
+					archives.setContainerNumberType(putBox.getBusType());
+					archives.setTypeId(cntrTypes.getId());
+					archives.setTypeName(cntrTypes.getCnName());
+					archives.setBoxType(putBox.getBusType());
+					archives.setAddressId(ports.getId());
+					archives.setAddressCode(ports.getCode());
+					archives.setAddressCname(ports.getCnName());
+					archives.setAddressEname(ports.getEnName());
+					archives.setStationId(corps.getId());
+					archives.setStationCode(corps.getCode());
+					archives.setStationCname(corps.getCnName());
+					archives.setStationEname(corps.getEnName());
+				}
+				archivesArrayList.add(archives);
+				if (ObjectUtils.isNotNull(putBox.getBoxType()) && !putBox.getBoxType().equals(item.getBoxType())) {
+					throw new RemoteException("放箱号:" + item.getContainerNumber() + "箱型不符合");
+				}
+				//放箱号明细数据处理
+				PutBoxItems putBoxItem;
+				if (!putBoxItemsList.isEmpty()) {
+					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()))
+						.findFirst().orElse(null);
+					if (putBoxItem != null) {
+						putBoxItem.setPid(putBox.getId());
+						putBoxItem.setMblno(item.getMblno());
+						putBoxItem.setBoxDynamics(item.getBoxStatus());
+						putBoxItem.setPolCyId(corps.getId());
+						putBoxItem.setPolCyCode(corps.getCode());
+						putBoxItem.setPolCyCname(corps.getCnName());
+						putBoxItem.setPolCyEname(corps.getEnName());
+						putBoxItem.setStatus("待使用");
+						putBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+					} else {
+						putBoxItem = new PutBoxItems();
+						putBoxItem.setBoxClass(putBox.getBusType());
+						putBoxItem.setBoxBelongsTo("SOC");
+						putBoxItem.setBoxCondition("新");
+						putBoxItem.setBoxStatus("好");
+						putBoxItem.setStatus("待使用");
+						putBoxItem.setPid(putBox.getId());
+						putBoxItem.setContainerNumber(item.getContainerNumber());
+						putBoxItem.setBoxCode(item.getBoxCode());
+						putBoxItem.setBoxType(item.getBoxType());
+						putBoxItem.setMblno(item.getMblno());
+						putBoxItem.setBoxDynamics(item.getBoxStatus());
+						putBoxItem.setPolCyId(corps.getId());
+						putBoxItem.setPolCyCode(corps.getCode());
+						putBoxItem.setPolCyCname(corps.getCnName());
+						putBoxItem.setPolCyEname(corps.getEnName());
+						putBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+					}
+				} else {
+					putBoxItem = new PutBoxItems();
+					putBoxItem.setBoxClass(putBox.getBusType());
+					putBoxItem.setBoxBelongsTo("SOC");
+					putBoxItem.setBoxCondition("新");
+					putBoxItem.setBoxStatus("好");
+					putBoxItem.setStatus("待使用");
+					putBoxItem.setPid(putBox.getId());
+					putBoxItem.setContainerNumber(item.getContainerNumber());
+					putBoxItem.setBoxCode(item.getBoxCode());
+					putBoxItem.setBoxType(item.getBoxType());
+					putBoxItem.setMblno(item.getMblno());
+					putBoxItem.setBoxDynamics(item.getBoxStatus());
+					putBoxItem.setPolCyId(corps.getId());
+					putBoxItem.setPolCyCode(corps.getCode());
+					putBoxItem.setPolCyCname(corps.getCnName());
+					putBoxItem.setPolCyEname(corps.getEnName());
+					putBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+				}
+				putBoxItem.setBoxEastId(Long.parseLong(putBox.getBoxEastId()));
+				putBoxItem.setBoxEastName(putBox.getBoxEastName());
+				putBoxItems.add(putBoxItem);
+				if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
+					if (!tradingBoxList.isEmpty()) {
+						TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
+							.findFirst().orElse(null);
+						if (tradingBox != null) {
+							if (!tradingBoxes.isEmpty()) {
+								if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
+									tradingBoxes.add(tradingBox);
+								}
+							} else {
+								tradingBoxes.add(tradingBox);
+							}
+							TradingBoxItem tradingBoxItem;
+							if (!tradingBoxItemList.isEmpty()) {
+								tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
+									.findFirst().orElse(null);
+								if (tradingBoxItem != null) {
+									tradingBoxItem.setPid(tradingBox.getId());
+									tradingBoxItem.setMblno(item.getMblno());
+									tradingBoxItem.setBoxDynamics(item.getBoxStatus());
+									tradingBoxItem.setPortId(ports.getId());
+									tradingBoxItem.setPortCode(ports.getCode());
+									tradingBoxItem.setPortCname(ports.getCnName());
+									tradingBoxItem.setPortEname(ports.getEnName());
+									tradingBoxItem.setStationId(corps.getId());
+									tradingBoxItem.setStationCode(corps.getCode());
+									tradingBoxItem.setStationCname(corps.getCnName());
+									tradingBoxItem.setStationEname(corps.getEnName());
+									tradingBoxItem.setPolCyId(corps.getId());
+									tradingBoxItem.setPolCyCode(corps.getCode());
+									tradingBoxItem.setPolCyCname(corps.getCnName());
+									tradingBoxItem.setPolCyEname(corps.getEnName());
+									if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
+										tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
+										tradingBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+									} else {
+										tradingBoxItem.setRentEndDate(new Date());
+										tradingBoxItem.setPolPickUpDate(new Date());
+									}
+									tradingBoxItem.setStatus("待使用");
+								} else {
+									tradingBoxItem = new TradingBoxItem();
+									tradingBoxItem.setBoxBelongsTo("SOC");
+									if ("OW-N".equals(tradingBox.getType())) {
+										tradingBoxItem.setBoxCategory("OW(拿)");
+									} else if ("OW-F".equals(tradingBox.getType())) {
+										tradingBoxItem.setBoxCategory("OW(放)");
+									}
+									putBoxItem.setBoxClass(putBox.getBusType());
+									tradingBoxItem.setBoxCondition("新");
+									tradingBoxItem.setBoxStatus("好");
+									tradingBoxItem.setPid(tradingBox.getId());
+									tradingBoxItem.setContainerNumber(item.getContainerNumber());
+									tradingBoxItem.setCode(item.getBoxCode());
+									tradingBoxItem.setMblno(item.getMblno());
+									tradingBoxItem.setBoxDynamics(item.getBoxStatus());
+									tradingBoxItem.setBoxType(cntrTypes.getCnName());
+									tradingBoxItem.setBoxTypeId(cntrTypes.getId());
+									tradingBoxItem.setPortId(ports.getId());
+									tradingBoxItem.setPortCode(ports.getCode());
+									tradingBoxItem.setPortCname(ports.getCnName());
+									tradingBoxItem.setPortEname(ports.getEnName());
+									tradingBoxItem.setStationId(corps.getId());
+									tradingBoxItem.setStationCode(corps.getCode());
+									tradingBoxItem.setStationCname(corps.getCnName());
+									tradingBoxItem.setStationEname(corps.getEnName());
+									tradingBoxItem.setPolCyId(corps.getId());
+									tradingBoxItem.setPolCyCode(corps.getCode());
+									tradingBoxItem.setPolCyCname(corps.getCnName());
+									tradingBoxItem.setPolCyEname(corps.getEnName());
+									tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
+									if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
+										tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
+										tradingBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+									} else {
+										tradingBoxItem.setRentEndDate(new Date());
+										tradingBoxItem.setPolPickUpDate(new Date());
+									}
+									tradingBoxItem.setStatus("待使用");
+								}
+							} else {
+								tradingBoxItem = new TradingBoxItem();
+								if ("OW-N".equals(tradingBox.getType())) {
+									tradingBoxItem.setBoxCategory("OW(拿)");
+								} else if ("OW-F".equals(tradingBox.getType())) {
+									tradingBoxItem.setBoxCategory("OW(放)");
+								}
+								tradingBoxItem.setBoxBelongsTo("SOC");
+								tradingBoxItem.setBoxCondition("新");
+								tradingBoxItem.setBoxStatus("好");
+								tradingBoxItem.setPid(tradingBox.getId());
+								tradingBoxItem.setContainerNumber(item.getContainerNumber());
+								tradingBoxItem.setCode(item.getBoxCode());
+								tradingBoxItem.setMblno(item.getMblno());
+								tradingBoxItem.setBoxDynamics(item.getBoxStatus());
+								tradingBoxItem.setBoxType(cntrTypes.getCnName());
+								tradingBoxItem.setBoxTypeId(cntrTypes.getId());
+								tradingBoxItem.setPortId(ports.getId());
+								tradingBoxItem.setPortCode(ports.getCode());
+								tradingBoxItem.setPortCname(ports.getCnName());
+								tradingBoxItem.setPortEname(ports.getEnName());
+								tradingBoxItem.setStationId(corps.getId());
+								tradingBoxItem.setStationCode(corps.getCode());
+								tradingBoxItem.setStationCname(corps.getCnName());
+								tradingBoxItem.setStationEname(corps.getEnName());
+								tradingBoxItem.setPolCyId(corps.getId());
+								tradingBoxItem.setPolCyCode(corps.getCode());
+								tradingBoxItem.setPolCyCname(corps.getCnName());
+								tradingBoxItem.setPolCyEname(corps.getEnName());
+								tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
+								if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
+									tradingBoxItem.setRentEndDate(item.getBoxStatusDate());
+									tradingBoxItem.setPolPickUpDate(item.getBoxStatusDate());
+								} else {
+									tradingBoxItem.setRentEndDate(new Date());
+									tradingBoxItem.setPolPickUpDate(new Date());
+								}
+								tradingBoxItem.setStatus("待使用");
+							}
+							tradingBoxItem.setBoxEastId(tradingBox.getPurchaseCompanyId());
+							tradingBoxItem.setBoxEastName(tradingBox.getPurchaseCompanyName());
+							tradingBoxItems.add(tradingBoxItem);
+						} else {
+							throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
+						}
+					} else {
+						throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
+					}
+				}
+			} else {
+				throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
+			}
+		}
+		if (!putBoxes.isEmpty()) {
+			for (PutBox item : putBoxes) {
+				if (ObjectUtils.isNotNull(item.getCode())) {
+					for (EmptyContainerAppearance e : excelList) {
+						if (e.getContainerNumber().equals(item.getContainerNumber()) && ObjectUtils.isNotNull(item.getCode())
+							&& !item.getCode().contains(e.getBoxCode())) {
+							item.setCode(item.getCode() + "," + e.getBoxCode());
+						} else {
+							item.setCode(e.getBoxCode());
+						}
+					}
+				} else {
+					item.setCode(excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+						.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
+				}
+				if (!tradingBoxes.isEmpty()) {
+					TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
+					if (tradingBox != null) {
+						if (ObjectUtils.isNotNull(item.getCode())) {
+							for (EmptyContainerAppearance e : excelList) {
+								if (e.getContainerNumber().equals(item.getContainerNumber()) && ObjectUtils.isNotNull(tradingBox.getCode())
+									&& !tradingBox.getCode().contains(e.getBoxCode())) {
+									tradingBox.setCode(tradingBox.getCode() + "," + e.getBoxCode());
+								} else {
+									tradingBox.setCode(e.getBoxCode());
+								}
+							}
+						} else {
+							tradingBox.setCode(excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+								.map(EmptyContainerAppearance::getBoxCode).collect(Collectors.joining(",")));
+						}
+						tradingBoxMapper.updateById(tradingBox);
+					}
+				}
+			}
+			this.saveOrUpdateBatch(putBoxes);
+		}
+		if (!putBoxItems.isEmpty()) {
+			putBoxItemsService.saveOrUpdateBatch(putBoxItems);
+		}
+		if (!archivesArrayList.isEmpty()) {
+			archivesService.saveOrUpdateBatch(archivesArrayList);
+		}
+		if (!tradingBoxItems.isEmpty()) {
+			tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
+			for (TradingBoxItem item : tradingBoxItems) {
+				TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
+				if (tradingBox != null) {
+					//记录箱轨迹信息
+					ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
+					archivesTrajectory.setPortId(tradingBox.getAddressId());
+					archivesTrajectory.setPortCode(tradingBox.getAddressCode());
+					archivesTrajectory.setPortCname(tradingBox.getAddressCname());
+					archivesTrajectory.setPortEname(tradingBox.getAddressEname());
+					archivesTrajectory.setStationId(tradingBox.getAddressId());
+					archivesTrajectory.setStationCode(tradingBox.getAddressCode());
+					archivesTrajectory.setStationCname(tradingBox.getAddressCname());
+					archivesTrajectory.setStationEname(tradingBox.getAddressEname());
+					archivesTrajectory.setContainerNumber(item.getContainerNumber());
+					archivesTrajectory.setBoxType(item.getBoxType());
+					archivesTrajectory.setBoxCategory(item.getBoxCategory());
+					archivesTrajectory.setBoxEastId(item.getBoxEastId());
+					archivesTrajectory.setBoxEastName(item.getBoxEastName());
+					archivesTrajectory.setMblno(item.getMblno());
+					archivesTrajectory.setBoxDynamics(item.getBoxDynamics());
+					archivesTrajectory.setNewDate(tradingBox.getRentDate());
+					if ("OW-N".equals(tradingBox.getType())) {
+						archivesTrajectory.setStatus("OW-拿");
+					} else if ("OW-F".equals(tradingBox.getType())) {
+						archivesTrajectory.setStatus("OW-放");
+					}
+					archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
+					archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
+					archivesTrajectory.setContractNo(tradingBox.getContractNo());
+					archivesTrajectory.setBillType(tradingBox.getType());
+					archivesTrajectory.setCode(item.getCode());
+					archivesTrajectory.setPortCname(tradingBox.getAddressCname());
+					archivesTrajectory.setNewDate(new Date());
+					archivesTrajectory.setCreateTime(new Date());
+					archivesTrajectory.setCreateUser(AuthUtil.getUserId());
+					archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
+					archivesTrajectory.setTenantId(AuthUtil.getTenantId());
+					archivesTrajectory.setSrcId(tradingBox.getId());
+					archivesTrajectoryMapper.insert(archivesTrajectory);
+				}
+			}
+		}
+		ArchivesFiles archivesFiles = new ArchivesFiles();
+		archivesFiles.setCreateUser(AuthUtil.getUserId());
+		archivesFiles.setCreateTime(new Date());
+		archivesFiles.setTenantId(AuthUtil.getTenantId());
+		archivesFiles.setType("0");
+		R<BladeFile> res = ossClient.putFile(file);
+		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+			archivesFiles.setUrl(res.getData().getLink());
+			archivesFiles.setFileName(res.getData().getOriginalName());
+		} else {
+			throw new RemoteException("文件保存失败");
+		}
+		archivesFilesService.save(archivesFiles);
+		return R.data("操作成功");
+	}
 }

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

@@ -2128,7 +2128,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			LocalDate date1 = instant1.atZone(ZoneId.systemDefault()).toLocalDate();
 			LocalDate date2 = instant2.atZone(ZoneId.systemDefault()).toLocalDate();
 			Duration duration = Duration.between(date1.atStartOfDay(), date2.atStartOfDay());
-			if (!dateFormat.format(item.getRentEndDate()).equals(dateFormat.format(item.getPolStationEmptyContainerExitDate()))) {
+			if (!dateFormat.format(item.getRentEndDate()).equals(dateFormat.format(item.getPolPickUpDate()))) {
 				Calendar calendar = Calendar.getInstance();
 				calendar.setTime(item.getRentEndDate());
 				calendar.add(Calendar.DAY_OF_MONTH, 1);
@@ -2140,9 +2140,9 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			}
 			Integer days = feeCenter.getDays();
 			int earlySumDays = 0;
-			if (item.getRentEndDate().compareTo(item.getPolStationEmptyContainerExitDate()) != 0) {
+			if (item.getRentEndDate().compareTo(item.getPolPickUpDate()) != 0) {
 				Instant instant3 = item.getRentEndDate().toInstant();
-				Instant instant4 = item.getPolStationEmptyContainerExitDate().toInstant();
+				Instant instant4 = item.getPolPickUpDate().toInstant();
 				LocalDate date3 = instant3.atZone(ZoneId.systemDefault()).toLocalDate();
 				LocalDate date4 = instant4.atZone(ZoneId.systemDefault()).toLocalDate();
 				Duration duratio1 = Duration.between(date4.atStartOfDay(), date3.atStartOfDay());
@@ -2292,7 +2292,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				item.setUpdateUserName(AuthUtil.getUserName());
 				item.setCount(item.getCount() - 1);
 				if (feeCenterList.size() == 1) {
-					item.setRentEndDate(item.getPolStationEmptyContainerExitDate());
+					item.setRentEndDate(item.getPolPickUpDate());
 				} else {
 					Calendar calendar = Calendar.getInstance();
 					calendar.setTime(feeCenter.getStorageDate());

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

@@ -148,22 +148,34 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getAccountStatus()), Bills::getAccountStatus, bills.getAccountStatus())
 			.eq(ObjectUtils.isNotNull(bills.getStatus()), Bills::getStatus, bills.getStatus());
 		if (ObjectUtils.isNotNull(bills.getBillStatus())){
-			if ("1,2,3".contains(bills.getBillStatus()+"")){
-				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
-			}else if (0 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNull(Bills::getMblno);
-			}else if (4 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getMblno);
-			}else if (5 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
-			}else if (6 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
-			}else if (8 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
-			}else if (9 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
-			}else if (10 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+			if ("SE".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNull(Bills::getMblno);
+				}else if (4 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+				}else if (5 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}
+			}else if ("SI".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"3");
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"1");
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}else if (8 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
+				}else if (9 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
+				}else if (10 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+				}
 			}
 		}
 		if ("SE".equals(bills.getBusinessType())) {
@@ -268,22 +280,34 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getMasterBillNo()), Bills::getMasterBillNo, bills.getMasterBillNo())
 			.eq(ObjectUtils.isNotNull(bills.getMasterId()), Bills::getMasterId, bills.getMasterId());
 		if (ObjectUtils.isNotNull(bills.getBillStatus())){
-			if ("1,2,3".contains(bills.getBillStatus()+"")){
-				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
-			}else if (0 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNull(Bills::getMblno);
-			}else if (4 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getMblno);
-			}else if (5 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
-			}else if (6 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
-			}else if (8 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
-			}else if (9 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
-			}else if (10 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+			if ("SE".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNull(Bills::getMblno);
+				}else if (4 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+				}else if (5 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}
+			}else if ("SI".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"3");
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"1");
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}else if (8 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
+				}else if (9 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
+				}else if (10 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+				}
 			}
 		}
 		if ("SE".equals(bills.getBusinessType())) {
@@ -612,22 +636,34 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getStatus()), Bills::getStatus, bills.getStatus())
 			.orderByDesc(Bills::getCreateTime);
 		if (ObjectUtils.isNotNull(bills.getBillStatus())){
-			if ("1,2,3".contains(bills.getBillStatus()+"")){
-				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
-			}else if (0 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNull(Bills::getMblno);
-			}else if (4 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getMblno);
-			}else if (5 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
-			}else if (6 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
-			}else if (8 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
-			}else if (9 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
-			}else if (10 == bills.getBillStatus()){
-				lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+			if ("SE".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNull(Bills::getMblno);
+				}else if (4 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+				}else if (5 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}
+			}else if ("SI".equals(bills.getBusinessType())){
+				if ("1,2,3".contains(bills.getBillStatus()+"")){
+					lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+				}else if (0 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getMblno);
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"3");
+					lambdaQueryWrapper.ne(Bills::getBillStatus,"1");
+				}else if (6 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+				}else if (8 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getReturnEmptyDate);
+				}else if (9 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getChangeOrderDate);
+				}else if (10 == bills.getBillStatus()){
+					lambdaQueryWrapper.isNotNull(Bills::getClearanceDate);
+				}
 			}
 		}
 		List<Bills> list = billsService.list(lambdaQueryWrapper);

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

@@ -783,14 +783,14 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			boolean statusEta = false;
 			boolean statusAtd = false;
 			boolean statusAta = false;
-			if ("SE".equals(bills.getBillType())) {
+			if ("SE".equals(bills.getBusinessType())) {
 				if (!details.getEtd().equals(bills.getEtd())) {
 					statusEtd = true;
 				}
 				if (!details.getActualEtd().equals(bills.getActualEtd())) {
 					statusAtd = true;
 				}
-			} else if ("SI".equals(bills.getBillType())) {
+			} else if ("SI".equals(bills.getBusinessType())) {
 				if (!details.getEta().equals(bills.getEta())) {
 					statusEta = true;
 				}
@@ -1292,7 +1292,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(Bills::getMasterId, item.getId())) > 0) {
 				throw new RuntimeException("该主单存在分单,请先撤销分单");
 			}
-			businessBillNoService.deteleBillNo(item);
+//			businessBillNoService.deteleBillNo(item);
 		}
 		List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
@@ -2130,7 +2130,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			if ("SE".equals(bills.getBusinessType())) {
 				bills.setEtd(date1);
 			} else if ("SI".equals(bills.getBusinessType())) {
-				bills.setEta(date1);
+				bills.setActualEta(date1);
 			}
 			bills.setBillDate(date1);
 		} catch (ParseException e) {
@@ -2450,7 +2450,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	@Override
 	public void removeHblNo(Long id) {
 		Bills bills = baseMapper.selectById(id);
-		businessBillNoService.deteleHblNo(bills);
+//		businessBillNoService.deteleHblNo(bills);
 		bills.setHblno("");
 		baseMapper.updateById(bills);
 	}
@@ -3066,10 +3066,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				sendMessage.setTenantId(AuthUtil.getTenantId());
 				sendMessage.setCreateUser(null);
 				sendMessage.setCreateTime(new Date());
-				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
-				sendMessage.setPageLabel("海运口");
+				sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
+				sendMessage.setPageLabel("海运口");
 				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
-				sendMessage.setMessageBody("您有新的海运出口物流已提交,请及时待处理!提单号:" + detail.getMblno() + "时间:" + formatted);
+				sendMessage.setMessageBody("您有新的海运进口已接收,请及时待处理!提单号:" + detail.getMblno() + "时间:" + formatted);
 				R save = messageClient.save(sendMessage);
 				System.out.println("发送结果:" + save);
 				if (!save.isSuccess()) {
@@ -3111,10 +3111,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				sendMessage.setTenantId(AuthUtil.getTenantId());
 				sendMessage.setCreateUser(null);
 				sendMessage.setCreateTime(new Date());
-				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
-				sendMessage.setPageLabel("海运口");
+				sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
+				sendMessage.setPageLabel("海运口");
 				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
-				sendMessage.setMessageBody("您的海运出口物流提交已撤销!提单号:" + detail.getMblno() + "时间:" + formatted);
+				sendMessage.setMessageBody("您的海运进口已撤销接收!提单号:" + detail.getMblno() + "时间:" + formatted);
 				R save = messageClient.save(sendMessage);
 				System.out.println("发送结果:" + save);
 				if (!save.isSuccess()) {
@@ -3140,10 +3140,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			throw new RuntimeException("缺少必要参数");
 		}
 		Bills detail = baseMapper.selectById(bills.getId());
-		if ("已换单".equals(detail.getChangeOrdersStatus())) {
-			throw new RuntimeException("已换单,请勿重复提交");
+		if ("录入".equals(bills.getChangeOrdersStatus())){
+			if ("可换单".equals(detail.getChangeOrdersStatus())) {
+				throw new RuntimeException("可换单,请勿重复提交");
+			}
+			detail.setChangeOrdersStatus("可换单");
+		}else{
+			if ("已换单".equals(detail.getChangeOrdersStatus())) {
+				throw new RuntimeException("已换单,请勿重复提交");
+			}
+			detail.setChangeOrdersStatus("已换单");
 		}
-		detail.setChangeOrdersStatus("已换单");
 		detail.setUpdateUser(AuthUtil.getUserId());
 		detail.setUpdateUserName(AuthUtil.getUserName());
 		detail.setUpdateTime(new Date());
@@ -3158,10 +3165,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			throw new RuntimeException("缺少必要参数");
 		}
 		Bills detail = baseMapper.selectById(bills.getId());
-		if ("录入".equals(detail.getChangeOrdersStatus())) {
-			throw new RuntimeException("已撤销换单,请勿重复撤销");
+		if ("可换单".equals(bills.getChangeOrdersStatus())){
+			if ("录入".equals(detail.getChangeOrdersStatus())) {
+				throw new RuntimeException("已撤销换单,请勿重复撤销");
+			}
+			detail.setChangeOrdersStatus("录入");
+		}else{
+			if ("可换单".equals(detail.getChangeOrdersStatus())) {
+				throw new RuntimeException("已撤销换单,请勿重复撤销");
+			}
+			detail.setChangeOrdersStatus("可换单");
 		}
-		detail.setChangeOrdersStatus("录入");
 		detail.setUpdateUser(AuthUtil.getUserId());
 		detail.setUpdateUserName(AuthUtil.getUserName());
 		detail.setUpdateTime(new Date());
@@ -3176,10 +3190,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			throw new RuntimeException("缺少必要参数");
 		}
 		Bills detail = baseMapper.selectById(bills.getId());
-		if ("已退押".equals(detail.getReturningSecurityMoneyStatus())) {
-			throw new RuntimeException("已退押,请勿重复提交");
+		if ("录入".equals(bills.getReturningSecurityMoneyStatus())){
+			if ("可退押".equals(detail.getReturningSecurityMoneyStatus())) {
+				throw new RuntimeException("可退押,请勿重复提交");
+			}
+			detail.setReturningSecurityMoneyStatus("可退押");
+		}else{
+			if ("已退押".equals(detail.getReturningSecurityMoneyStatus())) {
+				throw new RuntimeException("已退押,请勿重复提交");
+			}
+			detail.setReturningSecurityMoneyStatus("已退押");
 		}
-		detail.setReturningSecurityMoneyStatus("已退押");
 		detail.setUpdateUser(AuthUtil.getUserId());
 		detail.setUpdateUserName(AuthUtil.getUserName());
 		detail.setUpdateTime(new Date());
@@ -3193,10 +3214,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			throw new RuntimeException("缺少必要参数");
 		}
 		Bills detail = baseMapper.selectById(bills.getId());
-		if ("录入".equals(detail.getReturningSecurityMoneyStatus())) {
-			throw new RuntimeException("已撤销退押,请勿重复撤销");
+		if ("可退押".equals(bills.getReturningSecurityMoneyStatus())){
+			if ("录入".equals(detail.getChangeOrdersStatus())) {
+				throw new RuntimeException("已撤销退押,请勿重复撤销");
+			}
+			detail.setReturningSecurityMoneyStatus("录入");
+		}else{
+			if ("可退押".equals(detail.getReturningSecurityMoneyStatus())) {
+				throw new RuntimeException("已撤销退押,请勿重复撤销");
+			}
+			detail.setReturningSecurityMoneyStatus("可退押");
 		}
-		detail.setReturningSecurityMoneyStatus("录入");
 		detail.setUpdateUser(AuthUtil.getUserId());
 		detail.setUpdateUserName(AuthUtil.getUserName());
 		detail.setUpdateTime(new Date());