Browse Source

1.海运进出口保存接口逻辑修改
2.海运出口增加转单接口
3.海运出口-增加获取放箱号明细接口
4.海运出口-增加选择导入放箱号接口
5.海运出口-增加撤销选中放箱号接口

纪新园 8 months ago
parent
commit
a3f61021c6
18 changed files with 1114 additions and 203 deletions
  1. 12 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/ExpenseApplication.java
  2. 96 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  3. 78 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Containers.java
  4. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/PreContainers.java
  5. 10 1
      blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java
  6. 25 23
      blade-service/blade-los/src/main/java/org/springblade/los/Util/StringTools.java
  7. 36 4
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java
  8. 45 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxController.java
  9. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java
  10. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/RouteCostMapper.xml
  11. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  12. 8 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  13. 20 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/SeaContainerNumberItemController.java
  14. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java
  15. 6 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/ISeaContainerNumberItemService.java
  16. 657 161
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  17. 107 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/SeaContainerNumberItemServiceImpl.java
  18. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java

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

@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.los.check.entity.LosAuditPathsLevels;
 import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.system.entity.Dept;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -148,6 +149,11 @@ public class ExpenseApplication implements Serializable {
 	 */
 	@TableField(exist = false)
 	private List<FeeCenter> feeCenterList;
+	/**
+	 * 费用中心
+	 */
+	@TableField(exist = false)
+	private List<FeeCenter> feeCenterListC;
 
 	//审核-跳转对应页面的路由
 	@TableField(exist = false)
@@ -171,5 +177,11 @@ public class ExpenseApplication implements Serializable {
 	@TableField(exist = false)
 	private List<LosAuditPathsLevels> auditPathsLevels;
 
+	/**
+	 * 报表打印抬头
+	 */
+	@TableField(exist = false)
+	private Dept dept;
+
 
 }

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

@@ -1239,6 +1239,21 @@ public class Bills implements Serializable {
 	@ApiModelProperty(value = "POD场站联系人电话")
 	private String podCyTel;
 	/**
+	 * POD场站地址
+	 */
+	@ApiModelProperty(value = "POD场站地址")
+	private String podCyAddress;
+	/**
+	 * POD场站联系人
+	 */
+	@ApiModelProperty(value = "POD场站联系人")
+	private String podCyContacts;
+	/**
+	 * POD场站备注
+	 */
+	@ApiModelProperty(value = "POD场站备注")
+	private String podCyRemarks;
+	/**
 	 * 箱属
 	 */
 	@ApiModelProperty(value = "箱属")
@@ -1343,6 +1358,85 @@ public class Bills implements Serializable {
 	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date actualEta;
+	/**
+	 * 物流状态
+	 */
+	@ApiModelProperty(value = "物流状态")
+	private String logisticsStatus;
+
+	/**
+	 * 船务员工
+	 */
+	@ApiModelProperty(value = "船务员工")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Long shippingStaffId;
+
+	/**
+	 * 船务员工
+	 */
+	@ApiModelProperty(value = "船务员工")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private String shippingStaffName;
+	/**
+	 * 转单状态
+	 */
+	@ApiModelProperty(value = "转单状态")
+	private String transferOrderStatus;
+
+	/**
+	 * 国外代理id
+	 */
+	@ApiModelProperty(value = "国外代理id")
+	private Long foreignAgencyId;
+	/**
+	 * 国外代理代码
+	 */
+	@ApiModelProperty(value = "国外代理代码")
+	private String foreignAgencyCode;
+	/**
+	 * 国外代理中文名称
+	 */
+	@ApiModelProperty(value = "国外代理中文名称")
+	private String foreignAgencyCnName;
+	/**
+	 * 国外代理英文名称
+	 */
+	@ApiModelProperty(value = "国外代理英文名称")
+	private String foreignAgencyEnName;
+	/**
+	 * 国外代理提单描述
+	 */
+	@ApiModelProperty(value = "国外代理提单描述")
+	@LosSpecialHandle(massage = "", space = true, conversion = true)
+	private String foreignAgencyDetails;
+
+	/**
+	 * 目的港公司
+	 */
+	@ApiModelProperty(value = "目的港公司")
+	private Long podCompanyId;
+	/**
+	 * 目的港公司
+	 */
+	@ApiModelProperty(value = "目的港公司")
+	private String podCompanyName;
+
+	/**
+	 * 目的港员工
+	 */
+	@ApiModelProperty(value = "目的港员工")
+	private Long podStaffId;
+	/**
+	 * 目的港员工
+	 */
+	@ApiModelProperty(value = "目的港员工")
+	private String podStaffName;
+
+	/**
+	 * 来源业务id
+	 */
+	@ApiModelProperty(value = "来源业务id")
+	private Long srcBusId;
 
 	/**
 	 * 到港日期
@@ -1807,7 +1901,7 @@ public class Bills implements Serializable {
 	@TableField(exist = false)
 	private List<FilesCenter> filesList;
 
-/**
+	/**
 	 * 业务放箱号明细
 	 */
 	@TableField(exist = false)
@@ -2034,7 +2128,7 @@ public class Bills implements Serializable {
 	 */
 	@TableField(exist = false)
 	private String capitalLetters;
-/**
+	/**
 	 * 件数大写+包装
 	 */
 	@TableField(exist = false)

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

@@ -417,6 +417,78 @@ public class Containers implements Serializable {
 	private String cyCntrCode;
 
 	/**
+	 * pol 堆场
+	 */
+	@ApiModelProperty(value = "pol 堆场")
+	private Long polCyId;
+	/**
+	 * pol 堆场编码
+	 */
+	@ApiModelProperty(value = "pol 堆场编码")
+	private String polCyCode;
+	/**
+	 * pol 堆场中文
+	 */
+	@ApiModelProperty(value = "pol 堆场中文")
+	private String polCyCname;
+	/**
+	 * pol 堆场英文
+	 */
+	@ApiModelProperty(value = "pol 堆场英文")
+	private String polCyEname;
+
+	/**
+	 * pol预出场日期
+	 */
+	@ApiModelProperty(value = "pol预出场日期")
+	private Date polPreAppearanceDate;
+	/**
+	 * pol场站空箱出场日期
+	 */
+	@ApiModelProperty(value = "pol场站空箱出场日期")
+	private Date polStationEmptyContainerExitDate;
+	/**
+	 * pol还箱日期
+	 */
+	@ApiModelProperty(value = "pol还箱日期")
+	private Date polReturnDate;
+	/**
+	 * pol超期箱使天数
+	 */
+	@ApiModelProperty(value = "pol超期箱使天数")
+	private Integer polOverdueBoxUseDays;
+	/**
+	 * pod空箱还箱日期
+	 */
+	@ApiModelProperty(value = "pod空箱还箱日期")
+	private Date podEmptyContainerReturnDate;
+	/**
+	 * pod场站
+	 */
+	@ApiModelProperty(value = "pod场站")
+	private Long podStationId;
+	/**
+	 * pod场站编码
+	 */
+	@ApiModelProperty(value = "pod场站编码")
+	private String podStationCode;
+	/**
+	 * pod场站中文
+	 */
+	@ApiModelProperty(value = "pod场站中文")
+	private String podStationCname;
+	/**
+	 * pod场站英文
+	 */
+	@ApiModelProperty(value = "pod场站英文")
+	private String podStationEname;
+	/**
+	 * pod箱使天数
+	 */
+	@ApiModelProperty(value = "pod箱使天数")
+	private Integer podBoxUseDays;
+
+	/**
 	 * 配箱类型
 	 */
 	@TableField(exist = false)
@@ -445,5 +517,11 @@ public class Containers implements Serializable {
 	@TableField(exist = false)
 	private WaitingBox waitingBox;
 
+	/**
+	 * 临时来源id
+	 */
+	@TableField(exist = false)
+	private Long srcId;
+
 
 }

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

@@ -328,5 +328,11 @@ public class PreContainers implements Serializable {
 	@ApiModelProperty(value = "超高 厘米")
 	private BigDecimal overHeight;
 
+	/**
+	 * 放箱号状态
+	 */
+	@ApiModelProperty(value = "放箱号状态")
+	private String containerNumberStatus;
+
 
 }

+ 10 - 1
blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java

@@ -11,10 +11,18 @@ public class MagicValues {
 	public static final String HYJKBG = "海运进口报关";
 	public static final String KYCKBG = "空运出口报关";
 	public static final String KYJKBG = "空运进口报关";
+	public static final String HY = "XG";
+	public static final String XG = "XG";
 	public static final String OW = "OW";
-
 	public static final String OW_N = "OW-N";
 	public static final String OW_F = "OW-F";
+	public static final String BUY = "BUY";
+	public static final String ZR = "ZR";
+	public static final String DL = "DL";
+	public static final String XGFY = "XGFY";
+	public static final String XGDX = "XGDX";
+	public static final String CCSQ = "CCSQ";
+	public static final String DXCB = "DXCB";
 	public static final String DOCUMENT = "单证";
 	public static final String COST = "费用";
 	public static final String PAID_APPLICATION = "付费申请";
@@ -51,6 +59,7 @@ public class MagicValues {
 	public static final String KYCK = "KYCK";
 	public static final String KYJK = "KYJK";
 	public static final String MYDL = "MYDL";
+	public static final String FYSQ = "FYSQ";
 
 	public static final String MYDL_STL = "MYDL-STL";
 	public static final String AMEND = "AMEND";

+ 25 - 23
blade-service/blade-los/src/main/java/org/springblade/los/Util/StringTools.java

@@ -293,32 +293,34 @@ public class StringTools {
 			SeaReleaseBill bVessels = JSONObject.parseObject(JSONObject.toJSONString(data), SeaReleaseBill.class);
 			for (Field field : fileds) {
 				String name = field.getName();
-				System.out.println("字段名:" + name);
-				// 设置访问权限为true,否则无法获取private字段的值
-				field.setAccessible(true);
-				Object value = field.get(bVessels);
-				System.out.println("字段值:" + value);
-				Class<SeaReleaseBill> clazz = SeaReleaseBill.class;
-				Field field1 = clazz.getDeclaredField(name);
-				Annotation[] annotations = field1.getAnnotations(); // 获取字段上的所有注解
-				for (Annotation annotation : annotations) {
-					if (annotation instanceof LosSpecialHandle) {
-						LosSpecialHandle myAnnotation = (LosSpecialHandle) annotation;
-						boolean conversion = myAnnotation.conversion();
-						boolean space = myAnnotation.space();
-						if (conversion) {
-							if (ObjectUtils.isNotNull(value)) {
-								value = value.toString().toUpperCase();
+				if (ObjectUtils.isNotNull(name)){
+					System.out.println("字段名:" + name);
+					// 设置访问权限为true,否则无法获取private字段的值
+					field.setAccessible(true);
+					Object value = field.get(bVessels);
+					System.out.println("字段值:" + value);
+					Class<SeaReleaseBill> clazz = SeaReleaseBill.class;
+					Field field1 = clazz.getDeclaredField(name);
+					Annotation[] annotations = field1.getAnnotations(); // 获取字段上的所有注解
+					for (Annotation annotation : annotations) {
+						if (annotation instanceof LosSpecialHandle) {
+							LosSpecialHandle myAnnotation = (LosSpecialHandle) annotation;
+							boolean conversion = myAnnotation.conversion();
+							boolean space = myAnnotation.space();
+							if (conversion) {
+								if (ObjectUtils.isNotNull(value)) {
+									value = value.toString().toUpperCase();
+								}
 							}
-						}
-						if (space) {
-							if (ObjectUtils.isNotNull(value)) {
-								value = value.toString().trim();
+							if (space) {
+								if (ObjectUtils.isNotNull(value)) {
+									value = value.toString().trim();
+								}
 							}
+							field.set(bVessels, value);
+							System.out.println("注解值:" + myAnnotation.conversion());
+							System.out.println("注解值:" + myAnnotation.space());
 						}
-						field.set(bVessels, value);
-						System.out.println("注解值:" + myAnnotation.conversion());
-						System.out.println("注解值:" + myAnnotation.space());
 					}
 				}
 			}

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

@@ -16,6 +16,7 @@
  */
 package org.springblade.los.basic.reports.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -25,17 +26,20 @@ import org.springblade.los.Util.MagicValues;
 import org.springblade.los.basic.corps.entity.BCorps;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.reports.service.IReportsBoxService;
+import org.springblade.los.box.entity.ExpenseApplication;
 import org.springblade.los.box.entity.TradingBox;
+import org.springblade.los.box.service.IExpenseApplicationService;
 import org.springblade.los.box.service.ITradingBoxService;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 基础资料-报表打印记录 服务实现类
@@ -57,6 +61,10 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 
 	private final IBCorpsService bCorpsService;
 
+	private final IExpenseApplicationService expenseApplicationService;
+
+	private final IFeeCenterService feeCenterService;
+
 
 	@Override
 	public R getReportData(String billId, String reportCode, String groupCode, String corpIds, String itemIds, String type, String curCode) {
@@ -98,8 +106,32 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
+		} else if ((MagicValues.OW_N.equals(reportCode) || MagicValues.OW_F.equals(reportCode)
+			|| MagicValues.BUY.equals(reportCode) || MagicValues.ZR.equals(reportCode)
+			|| MagicValues.DL.equals(reportCode) || MagicValues.XGFY.equals(reportCode)
+			|| MagicValues.XGDX.equals(reportCode) || MagicValues.CCSQ.equals(reportCode)
+			|| MagicValues.DXCB.equals(reportCode)|| MagicValues.HYCK.equals(reportCode)
+			|| MagicValues.HYJK.equals(reportCode)) && MagicValues.FYSQ.equals(groupCode) && MagicValues.FYSQ.equals(type)) {
+			ExpenseApplication expenseApplication = expenseApplicationService.getById(billId);
+			if (expenseApplication != null) {
+				LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<>();
+				feeCenterLambdaQueryWrapper.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getStlPid, expenseApplication.getId());
+				List<FeeCenter> feeCenterList = feeCenterService.list(feeCenterLambdaQueryWrapper);
+				if (!feeCenterList.isEmpty()){
+					List<FeeCenter> feeCenterListD = feeCenterList.stream().filter(e-> "D".equals(e.getDc())).collect(Collectors.toList());
+					List<FeeCenter> feeCenterListC = feeCenterList.stream().filter(e-> "C".equals(e.getDc())).collect(Collectors.toList());
+					expenseApplication.setFeeCenterList(feeCenterListD.isEmpty() ? new ArrayList<>() : feeCenterListD);
+					expenseApplication.setFeeCenterListC(feeCenterListC.isEmpty() ? new ArrayList<>() : feeCenterListC);
+				}
+				expenseApplication.setDept(dept);
+				map.put(MagicValues.DATA, expenseApplication);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
 		} else {
-			throw new RuntimeException("未查到数据");
+			map.put(MagicValues.DATA, null);
 		}
 		return R.data(map);
 	}

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

@@ -32,9 +32,9 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.box.entity.PutBox;
 import org.springblade.los.box.entity.PutBoxItems;
-import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.service.IPutBoxItemsService;
 import org.springblade.los.box.service.IPutBoxService;
+import org.springblade.los.business.sea.entity.SeaContainerNumberItem;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -181,6 +181,50 @@ public class PutBoxController extends BladeController {
 	}
 
 
+	/**
+	 * 海运进出口获取放箱号
+	 */
+	@GetMapping("/getItemListHY")
+	public R getItemListHY(PutBox putBox) {
+		LambdaQueryWrapper<PutBox> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.eq(PutBox::getBoxType, putBox.getBoxType())
+			.apply("remaining_num != 0")
+			.like(ObjectUtils.isNotNull(putBox.getPodId()), PutBox::getPodId, putBox.getPodId())
+			.like(ObjectUtils.isNotNull(putBox.getPolId()), PutBox::getPolId, putBox.getPolId())
+			.orderByAsc(PutBox::getPriorityLevel);
+		if ("固定".equals(putBox.getCabinType())) {
+			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(putBox.getCabinType()), PutBox::getCabinType, putBox.getCabinType());
+			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(putBox.getAirlineId()), PutBox::getAirlineId, putBox.getAirlineId());
+		}
+		List<PutBox> putBoxList = putBoxService.list(lambdaQueryWrapper);
+		List<SeaContainerNumberItem> containerNumberItemList = new ArrayList<>();
+		for (PutBox item : putBoxList) {
+			SeaContainerNumberItem seaContainerNumberItem = new SeaContainerNumberItem();
+			seaContainerNumberItem.setBoxEastId(item.getBoxEastId());
+			seaContainerNumberItem.setBoxEastName(item.getBoxEastName());
+			seaContainerNumberItem.setContainerNumber(item.getContainerNumber());
+			seaContainerNumberItem.setBusType(item.getBusType());
+			seaContainerNumberItem.setPolId(item.getPolId());
+			seaContainerNumberItem.setPolCname(item.getPolCname());
+			seaContainerNumberItem.setPodId(item.getPodId());
+			seaContainerNumberItem.setPodCname(item.getPodCname());
+			seaContainerNumberItem.setPolStationId(item.getPolStationId());
+			seaContainerNumberItem.setPolStationCname(item.getPolStationCname());
+			seaContainerNumberItem.setBoxType(item.getBoxType());
+			seaContainerNumberItem.setRemainingNum(item.getRemainingNum());
+			seaContainerNumberItem.setPodStationId(item.getPodStationId());
+			seaContainerNumberItem.setPodStationCname(item.getPodStationCname());
+			seaContainerNumberItem.setInternalContainerNumber(item.getInternalContainerNumber());
+			seaContainerNumberItem.setInternalBoxClass(item.getInternalBoxClass());
+			seaContainerNumberItem.setSrcId(item.getId());
+			seaContainerNumberItem.setPriorityLevel(item.getPriorityLevel());
+			seaContainerNumberItem.setBoxRemarks(item.getRemarks());
+			containerNumberItemList.add(seaContainerNumberItem);
+		}
+		return R.data(containerNumberItemList);
+	}
 
 
 }

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

@@ -104,8 +104,8 @@ public class RouteCostController extends BladeController {
 			.like(ObjectUtils.isNotNull(routeCost.getVoyage()), RouteCost::getVoyage, routeCost.getVoyage());
 		if (ObjectUtils.isNotNull(routeCost.getEffectiveStartDate()) && ObjectUtils.isNotNull(routeCost.getEffectiveEndDate())) {
 			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
-			lambdaQueryWrapper.apply(ObjectUtils.isNotNull(routeCost.getEffectiveStartDate()), "DATE_FORMAT(effective_date,'%Y-%m-%d') >= '" + formatter.format(routeCost.getEffectiveStartDate()) + "'")
-				.apply(ObjectUtils.isNotNull(routeCost.getEffectiveEndDate()), "DATE_FORMAT(expiry_date,'%Y-%m-%d') <= '" + formatter.format(routeCost.getEffectiveEndDate()) + "'");
+			lambdaQueryWrapper.apply(ObjectUtils.isNotNull(routeCost.getEffectiveStartDate()), "DATE_FORMAT(effective_start_date,'%Y-%m-%d') >= '" + formatter.format(routeCost.getEffectiveStartDate()) + "'")
+				.apply(ObjectUtils.isNotNull(routeCost.getEffectiveEndDate()), "DATE_FORMAT(effective_end_date,'%Y-%m-%d') <= '" + formatter.format(routeCost.getEffectiveEndDate()) + "'");
 		}
 		if ("0".equals(routeCost.getSort())) {
 			lambdaQueryWrapper.orderByAsc(RouteCost::getTotalProfit);

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

@@ -153,7 +153,7 @@
             and DATE_FORMAT(lrc.effective_end_date,'%Y-%m-%d')  &lt;= DATE_FORMAT(#{data.effectiveEndDate},'%Y-%m-%d')
         </if>
         <if test='data.sort != null and data.sort == "0"'>
-            ORDER BY item.total_profit DESC
+            ORDER BY item.profit DESC
         </if>
         <if test='data.sort != null and data.sort == "1"'>
             ORDER BY lrc.pod_cname ASC
@@ -230,7 +230,7 @@
             and DATE_FORMAT(lrc.effective_end_date,'%Y-%m-%d')  &lt;= DATE_FORMAT(#{data.effectiveEndDate},'%Y-%m-%d')
         </if>
         <if test='data.sort != null and data.sort == "0"'>
-            ORDER BY item.total_profit DESC
+            ORDER BY item.profit DESC
         </if>
         <if test='data.sort != null and data.sort == "1"'>
             ORDER BY lrc.pod_cname ASC

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

@@ -182,7 +182,7 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 		feeCenterService.updateBatchById(expenseApplication.getFeeCenterList());
 		Integer actId = 1130;
 		String processType = "请核费用";
-		String checkType = "FYQH";
+		String checkType = "FYSQ";
 		//审批数据
 		LosAuditProecessDTO auditProecessDTO = new LosAuditProecessDTO();
 		//获取审批级次

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

@@ -772,5 +772,13 @@ public class BillsController extends BladeController {
 	public R logisticsRevokeSubmission(@Valid @RequestBody Bills bills) {
 		return billsService.logisticsRevokeSubmission(bills);
 	}
+
+	/**
+	 * 转单
+	 */
+	@PostMapping("/transferOrder")
+	public R transferOrder(@Valid @RequestBody Bills bills) {
+		return billsService.transferOrder(bills);
+	}
 }
 

+ 20 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/SeaContainerNumberItemController.java

@@ -34,6 +34,8 @@ import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
 import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  * 业务放箱号明细 控制器
  *
@@ -111,7 +113,23 @@ public class SeaContainerNumberItemController extends BladeController {
 		return R.status(seaContainerNumberItemService.saveOrUpdate(seaContainerNumberItem));
 	}
 
-	
+	/**
+	 * 选中放箱号
+	 */
+	@PostMapping("/selectedContainerNumber")
+	public R selectedContainerNumber(@Valid @RequestBody List<SeaContainerNumberItem> containerNumberItemList) {
+		return seaContainerNumberItemService.selectedContainerNumber(containerNumberItemList);
+	}
+
+	/**
+	 * 撤销选中放箱号
+	 */
+	@GetMapping("/revokeSelectedContainerNumber")
+	public R revokeSelectedContainerNumber(@RequestParam("boxType") String boxType,@RequestParam("billId") String billId) {
+		return seaContainerNumberItemService.revokeSelectedContainerNumber(boxType,billId);
+	}
+
+
 	/**
 	 * 删除 业务放箱号明细
 	 */
@@ -122,5 +140,5 @@ public class SeaContainerNumberItemController extends BladeController {
 		return R.status(seaContainerNumberItemService.removeByIds(Func.toLongList(ids)));
 	}
 
-	
+
 }

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

@@ -166,4 +166,6 @@ public interface IBillsService extends IService<Bills> {
 	R logisticsSubmission(Bills bills);
 
 	R logisticsRevokeSubmission(Bills bills);
+
+	R transferOrder(Bills bills);
 }

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

@@ -16,11 +16,14 @@
  */
 package org.springblade.los.business.sea.service;
 
+import org.springblade.core.tool.api.R;
 import org.springblade.los.business.sea.entity.SeaContainerNumberItem;
 import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+
 /**
  * 业务放箱号明细 服务类
  *
@@ -38,4 +41,7 @@ public interface ISeaContainerNumberItemService extends IService<SeaContainerNum
 	 */
 	IPage<SeaContainerNumberItemVO> selectSeaContainerNumberItemPage(IPage<SeaContainerNumberItemVO> page, SeaContainerNumberItemVO seaContainerNumberItem);
 
+    R selectedContainerNumber(List<SeaContainerNumberItem> containerNumberItemList);
+
+	R revokeSelectedContainerNumber(String boxType, String billId);
 }

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

@@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.AllArgsConstructor;
+import org.springblade.client.entity.Message;
+import org.springblade.client.feign.IMessageClient;
 import org.springblade.common.enums.CommonEnum;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
@@ -76,6 +78,8 @@ import org.springblade.los.trade.mapper.DispatchVehiclesMapper;
 import org.springblade.los.trade.mapper.InOutStorageMapper;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -159,6 +163,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 	private final ISeaContainerNumberItemService seaContainerNumberItemService;
 
+	private final IMessageClient messageClient;
+
+	private final IUserClient userClient;
+
 	@Override
 	public IPage<BillsVO> selectBillsPage(IPage<BillsVO> page, BillsVO bills) {
 		return page.setRecords(baseMapper.selectBillsPage(page, bills));
@@ -188,12 +196,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			.eq(Bills::getCreateDept, branchId)
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getIsDeleted, 0)
-			.eq(Bills::getMblno, bills.getMblno()));
-		if ("SE".equals(bills.getBusinessType())) {
-			bills.setBillDate(bills.getEtd());
-		} else {
-			bills.setBillDate(bills.getEta());
-		}
+			.eq(Bills::getMblno, bills.getMblno())
+			.eq(Bills::getBusinessType, bills.getBusinessType())
+		);
 		if (ObjectUtils.isNotNull(bills.getVesselCnName())) {
 			BVessels vessels = vesselsMapper.selectOne(new LambdaQueryWrapper<BVessels>()
 				.eq(BVessels::getTenantId, AuthUtil.getTenantId())
@@ -304,7 +309,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 			// 每更新一次往上累加一次版本
 			// 旧数据处理
-			int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 :Integer.parseInt(dataSourceBill.getVersion());
+			int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 : Integer.parseInt(dataSourceBill.getVersion());
 			bills.setVersion(String.valueOf(version + 1));
 			List<Long> ids = count.stream().map(Bills::getId).distinct().collect(Collectors.toList());
 			if (!"MH".equals(bills.getBillType())) {
@@ -317,158 +322,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setUpdateUser(AuthUtil.getUserId());
 			bills.setUpdateTime(new Date());
 			bills.setUpdateUserName(AuthUtil.getUserName());
-
 			//主单信息同步分单
-			if ("MM".equals(bills.getBillType())) {
-				Bills details = baseMapper.selectOne(new LambdaQueryWrapper<Bills>()
-					.select(Bills::getId, Bills::getVesselId, Bills::getVoyageNo, Bills::getEtd, Bills::getEta)
-					.eq(Bills::getId, bills.getId()));
-				boolean status = false;
-				if ("SE".equals(bills.getBillType())) {
-					if (!details.getEtd().equals(bills.getEtd())) {
-						status = true;
-					}
-				} else {
-					if (!details.getEta().equals(bills.getEta())) {
-						status = true;
-					}
-				}
-				if (!details.getVesselId().equals(bills.getVesselId()) || !details.getVoyageNo().equals(bills.getVoyageNo()) || status) {
-					List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
-						.select(Bills::getId, Bills::getEtd, Bills::getVesselId, Bills::getVesselCnName, Bills::getVesselEnName, Bills::getVoyageNo, Bills::getPolId
-							, Bills::getPolCnName, Bills::getPolEnName, Bills::getPolCode, Bills::getPolNamePrint, Bills::getPodId, Bills::getPodCnName
-							, Bills::getPodEnName, Bills::getPodNamePrint, Bills::getPodCode, Bills::getPlaceReceiptId, Bills::getPlaceReceiptCode, Bills::getPlaceReceiptName
-							, Bills::getPlaceReceiptNamePrint, Bills::getPlaceDeliveryId, Bills::getPlaceDeliveryCode, Bills::getPlaceDeliveryName, Bills::getPlaceDeliveryNamePrint, Bills::getDestinationId
-							, Bills::getDestinationName, Bills::getDestinationCode, Bills::getDestinationNamePrint, Bills::getFinalDestinationId, Bills::getFinalDestinationCode, Bills::getFinalDestinationName
-							, Bills::getFinalDestinationNamePrint, Bills::getCyId, Bills::getCyCode, Bills::getCyCnName, Bills::getCyEnName, Bills::getCyAddress
-							, Bills::getCyTel, Bills::getCyRemarks, Bills::getCyTrailerTime, Bills::getCyReturnTime, Bills::getCarrierId, Bills::getCarrierCnName
-							, Bills::getCarrierEnName, Bills::getCarrierArgreementNo, Bills::getBookingDate)
-						.eq(Bills::getCreateDept, branchId)
-						.eq(Bills::getTenantId, AuthUtil.getTenantId())
-						.eq(Bills::getIsDeleted, 0)
-						.eq(Bills::getMblno, bills.getMblno()));
-					if (!billsList.isEmpty()) {
-						for (Bills item : billsList) {
-							item.setEtd(bills.getEtd());
-							item.setVesselId(bills.getVesselId());
-							item.setVesselCnName(bills.getVesselCnName());
-							item.setVesselEnName(bills.getVesselEnName());
-							item.setVoyageNo(bills.getVoyageNo());
-							item.setPolId(bills.getPolId());
-							item.setPolCnName(bills.getPolCnName());
-							item.setPolEnName(bills.getPolEnName());
-							item.setPolCode(bills.getPolCode());
-							item.setPolNamePrint(bills.getPolNamePrint());
-							item.setPodId(bills.getPodId());
-							item.setPodCnName(bills.getPodCnName());
-							item.setPodEnName(bills.getPodEnName());
-							item.setPodNamePrint(bills.getPodNamePrint());
-							item.setPodCode(bills.getPodCode());
-							item.setPlaceReceiptId(bills.getPlaceReceiptId());
-							item.setPlaceReceiptCode(bills.getPlaceReceiptCode());
-							item.setPlaceReceiptName(bills.getPlaceReceiptName());
-							item.setPlaceReceiptNamePrint(bills.getPlaceReceiptNamePrint());
-							item.setPlaceDeliveryId(bills.getPlaceDeliveryId());
-							item.setPlaceDeliveryCode(bills.getPlaceDeliveryCode());
-							item.setPlaceDeliveryName(bills.getPlaceDeliveryName());
-							item.setPlaceDeliveryNamePrint(bills.getPlaceDeliveryNamePrint());
-							item.setDestinationId(bills.getDestinationId());
-							item.setDestinationName(bills.getDestinationName());
-							item.setDestinationCode(bills.getDestinationCode());
-							item.setDestinationNamePrint(bills.getDestinationNamePrint());
-							item.setFinalDestinationId(bills.getFinalDestinationId());
-							item.setFinalDestinationCode(bills.getFinalDestinationCode());
-							item.setFinalDestinationName(bills.getFinalDestinationName());
-							item.setFinalDestinationNamePrint(bills.getFinalDestinationNamePrint());
-							item.setCyId(bills.getCyId());
-							item.setCyCode(bills.getCyCode());
-							item.setCyCnName(bills.getCyCnName());
-							item.setCyEnName(bills.getCyEnName());
-							item.setCyAddress(bills.getCyAddress());
-							item.setCyTel(bills.getCyTel());
-							item.setCyRemarks(bills.getCyRemarks());
-							item.setCyTrailerTime(bills.getCyTrailerTime());
-							item.setCyReturnTime(bills.getCyReturnTime());
-							item.setCarrierId(bills.getCarrierId());
-							item.setCarrierCnName(bills.getCarrierCnName());
-							item.setCarrierEnName(bills.getCarrierEnName());
-							item.setCarrierArgreementNo(bills.getCarrierArgreementNo());
-							item.setBookingDate(bills.getBookingDate());
-						}
-						if (!billsList.isEmpty()) {
-							this.updateBatchById(billsList);
-						}
-						List<Long> billIds = billsList.stream().map(Bills::getId).collect(Collectors.toList());
-						List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
-							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-							.eq(FeeCenter::getIsDeleted, 0)
-							.eq(FeeCenter::getPid, billIds));
-						for (FeeCenter item : feeCenterList) {
-							item.setVesselId(bills.getVesselId());
-							item.setVesselCnName(bills.getVesselCnName());
-							item.setVesselEnName(bills.getVesselEnName());
-							item.setVoyageNo(bills.getVoyageNo());
-							item.setPolId(bills.getPolId());
-							item.setPolCnName(bills.getPolCnName());
-							item.setPolEnName(bills.getPolEnName());
-							item.setPolCode(bills.getPolCode());
-							item.setPodId(bills.getPodId());
-							item.setPodCnName(bills.getPodCnName());
-							item.setPodEnName(bills.getPodEnName());
-							item.setPodCode(bills.getPodCode());
-						}
-						feeCenterService.updateBatchById(feeCenterList);
-						List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
-							.eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
-							.eq(FinAccBills::getIsDeleted, 0)
-							.eq(FinAccBills::getBusinessBillDivideId, billIds));
-						for (FinAccBills item : finAccBillsList) {
-							item.setVesselId(bills.getVesselId());
-							item.setVesselCnName(bills.getVesselCnName());
-							item.setVesselEnName(bills.getVesselEnName());
-							item.setVoyageNo(bills.getVoyageNo());
-							item.setPolId(bills.getPolId());
-							item.setPolCnName(bills.getPolCnName());
-							item.setPolEnName(bills.getPolEnName());
-							item.setPolCode(bills.getPolCode());
-							item.setPodId(bills.getPodId());
-							item.setPodCnName(bills.getPodCnName());
-							item.setPodEnName(bills.getPodEnName());
-							item.setPodCode(bills.getPodCode());
-						}
-						finAccBillsService.updateBatchById(finAccBillsList);
-						for (Bills item : billsList) {
-							item.setVesselId(bills.getVesselId());
-							item.setVesselCnName(bills.getVesselCnName());
-							item.setVesselEnName(bills.getVesselEnName());
-							item.setVoyageNo(bills.getVoyageNo());
-							item.setPolId(bills.getPolId());
-							item.setPolCnName(bills.getPolCnName());
-							item.setPolEnName(bills.getPolEnName());
-							item.setPolCode(bills.getPolCode());
-							item.setPodId(bills.getPodId());
-							item.setPodCnName(bills.getPodCnName());
-							item.setPodEnName(bills.getPodEnName());
-							item.setPodCode(bills.getPodCode());
-							item.setCyId(bills.getCyId());
-							item.setCyCode(bills.getCyCode());
-							item.setCyCnName(bills.getCyCnName());
-							item.setCyEnName(bills.getCyEnName());
-							item.setCyAddress(bills.getCyAddress());
-							item.setCyTel(bills.getCyTel());
-							item.setCyRemarks(bills.getCyRemarks());
-							item.setCyTrailerTime(bills.getCyTrailerTime());
-							item.setCyReturnTime(bills.getCyReturnTime());
-							item.setCarrierId(bills.getCarrierId());
-							item.setCarrierCnName(bills.getCarrierCnName());
-							item.setCarrierEnName(bills.getCarrierEnName());
-							item.setCarrierArgreementNo(bills.getCarrierArgreementNo());
-							item.setBookingDate(bills.getBookingDate());
-						}
-						this.updateBatchById(billsList);
-					}
-				}
-			}
+			this.synchronous(bills);
 		}
 		Integer V20 = 0;
 		Integer V40 = 0;
@@ -560,7 +415,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						.distinct().filter(Objects::nonNull).collect(Collectors.joining(",")));
 				}
 			}
-		}else{
+		} else {
 			bills.setQuantityCntrDescr(null);
 		}
 		bills.setQuantityV20(V20);
@@ -934,6 +789,141 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		return R.data(bills);
 	}
 
+	private void synchronous(Bills bills) {
+		if ("MM".equals(bills.getBillType())) {
+			Bills details = baseMapper.selectById(bills.getId());
+			boolean statusEtd = false;
+			boolean statusEta = false;
+			boolean statusAtd = false;
+			boolean statusAta = false;
+			if ("SE".equals(bills.getBillType())) {
+				if (!details.getEtd().equals(bills.getEtd())) {
+					statusEtd = true;
+				}
+				if (!details.getActualEtd().equals(bills.getActualEtd())) {
+					statusAtd = true;
+				}
+			} else if ("SI".equals(bills.getBillType())) {
+				if (!details.getEta().equals(bills.getEta())) {
+					statusEta = true;
+				}
+				if (!details.getActualEta().equals(bills.getActualEta())) {
+					statusAta = true;
+				}
+			}
+			boolean statusVessel = !details.getVesselId().equals(bills.getVesselId());
+			boolean statusVoyageNo = !details.getVoyageNo().equals(bills.getVoyageNo());
+			boolean statusMblno = !details.getMblno().equals(bills.getMblno());
+			boolean statusPolId = !details.getPolId().equals(bills.getPolId());
+			boolean statusPodId = !details.getPodId().equals(bills.getPodId());
+			boolean statusCyTrailerTime = !details.getCyTrailerTime().equals(bills.getCyTrailerTime());
+			boolean statusCyReturnTime = !details.getCyReturnTime().equals(bills.getCyReturnTime());
+			boolean statusLineId = !details.getLineId().equals(bills.getLineId());
+			boolean statusForwarding = !details.getForwarding().equals(bills.getForwarding());
+			boolean statusBookingAgentId = !details.getBookingAgentId().equals(bills.getBookingAgentId());
+			if (statusEtd || statusEta || statusAtd || statusAta || statusVessel || statusVoyageNo || statusMblno || statusPolId
+				|| statusPodId || statusCyTrailerTime || statusCyReturnTime || statusLineId || statusForwarding || statusBookingAgentId) {
+				List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getMasterId, details.getId()));
+				if (!billsList.isEmpty()) {
+					for (Bills item : billsList) {
+						item.setEtd(bills.getEtd());
+						item.setEta(bills.getEta());
+						item.setActualEta(bills.getActualEta());
+						item.setActualEtd(bills.getActualEtd());
+						item.setVesselId(bills.getVesselId());
+						item.setVesselCnName(bills.getVesselCnName());
+						item.setVesselEnName(bills.getVesselEnName());
+						item.setVoyageNo(bills.getVoyageNo());
+						item.setPolId(bills.getPolId());
+						item.setPolCnName(bills.getPolCnName());
+						item.setPolEnName(bills.getPolEnName());
+						item.setPolCode(bills.getPolCode());
+						item.setPolNamePrint(bills.getPolNamePrint());
+						item.setPodId(bills.getPodId());
+						item.setPodCnName(bills.getPodCnName());
+						item.setPodEnName(bills.getPodEnName());
+						item.setPodNamePrint(bills.getPodNamePrint());
+						item.setPodCode(bills.getPodCode());
+						item.setMblno(bills.getMblno());
+						item.setCyTrailerTime(bills.getCyTrailerTime());
+						item.setCyReturnTime(bills.getCyReturnTime());
+						item.setLineId(bills.getLineId());
+						item.setLineCnName(bills.getLineCnName());
+						item.setLineEnName(bills.getLineEnName());
+						item.setForwarding(bills.getForwarding());
+						item.setBookingAgentId(bills.getBookingAgentId());
+						item.setBookingAgentCnName(bills.getBookingAgentCnName());
+						item.setBookingAgentEnName(bills.getBookingAgentEnName());
+					}
+					if (!billsList.isEmpty()) {
+						this.updateBatchById(billsList);
+					}
+					List<Long> billIds = billsList.stream().map(Bills::getId).collect(Collectors.toList());
+					List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+						.eq(FeeCenter::getIsDeleted, 0)
+						.eq(FeeCenter::getPid, billIds));
+					for (FeeCenter item : feeCenterList) {
+						item.setVesselId(bills.getVesselId());
+						item.setVesselCnName(bills.getVesselCnName());
+						item.setVesselEnName(bills.getVesselEnName());
+						item.setVoyageNo(bills.getVoyageNo());
+						item.setPolId(bills.getPolId());
+						item.setPolCnName(bills.getPolCnName());
+						item.setPolEnName(bills.getPolEnName());
+						item.setPolCode(bills.getPolCode());
+						item.setPodId(bills.getPodId());
+						item.setPodCnName(bills.getPodCnName());
+						item.setPodEnName(bills.getPodEnName());
+						item.setPodCode(bills.getPodCode());
+					}
+					feeCenterService.updateBatchById(feeCenterList);
+					List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
+						.eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
+						.eq(FinAccBills::getIsDeleted, 0)
+						.eq(FinAccBills::getBusinessBillDivideId, billIds));
+					for (FinAccBills item : finAccBillsList) {
+						item.setVesselId(bills.getVesselId());
+						item.setVesselCnName(bills.getVesselCnName());
+						item.setVesselEnName(bills.getVesselEnName());
+						item.setVoyageNo(bills.getVoyageNo());
+						item.setPolId(bills.getPolId());
+						item.setPolCnName(bills.getPolCnName());
+						item.setPolEnName(bills.getPolEnName());
+						item.setPolCode(bills.getPolCode());
+						item.setPodId(bills.getPodId());
+						item.setPodCnName(bills.getPodCnName());
+						item.setPodEnName(bills.getPodEnName());
+						item.setPodCode(bills.getPodCode());
+					}
+					finAccBillsService.updateBatchById(finAccBillsList);
+				}
+				if ("SI".equals(bills.getBillType())) {
+					Bills detailsCk = baseMapper.selectById(details.getSrcBusId());
+					if (detailsCk != null) {
+						List<Bills> billsListCkNew = new ArrayList<>();
+						detailsCk.setActualEta(bills.getActualEta());
+						billsListCkNew.add(detailsCk);
+						List<Bills> billsListCk = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+							.eq(Bills::getTenantId, AuthUtil.getTenantId())
+							.eq(Bills::getIsDeleted, 0)
+							.eq(Bills::getMasterId, detailsCk.getId()));
+						if (!billsListCk.isEmpty()) {
+							for (Bills item : billsListCk) {
+								item.setActualEta(bills.getActualEta());
+							}
+							billsListCkNew.addAll(billsListCk);
+						}
+						this.updateBatchById(billsListCkNew);
+					}
+				}
+			}
+		}
+	}
+
 	@Override
 	public Bills detail(Bills bills) {
 		if (bills.getId() == null) {
@@ -3513,13 +3503,519 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R logisticsSubmission(Bills bills) {
-		return null;
+		if (bills.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Bills detail = baseMapper.selectById(bills.getId());
+		if ("已提交".equals(detail.getLogisticsStatus())) {
+			throw new RuntimeException("已提交,请勿重复提交");
+		}
+		detail.setLogisticsStatus("已提交");
+		detail.setUpdateUser(AuthUtil.getUserId());
+		detail.setUpdateUserName(AuthUtil.getUserName());
+		detail.setUpdateTime(new Date());
+		detail.setShippingStaffId(bills.getShippingStaffId());
+		detail.setShippingStaffName(bills.getShippingStaffName());
+		baseMapper.updateById(detail);
+		LocalDateTime now = LocalDateTime.now();
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+		String formatted = now.format(formatter);
+		//发送消息
+		if (ObjectUtils.isNotNull(bills.getShippingStaffId())) {
+			R<User> userR = userClient.userInfoById(bills.getShippingStaffId());
+			if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
+				User datum = userR.getData();
+				Message sendMessage = new Message();
+				sendMessage.setParameter(detail.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/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("您有新的海运出口物流已提交,请及时待处理!提单号:" + detail.getMblno() + "时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				System.out.println("发送结果:" + save);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			} else {
+				throw new SecurityException("未查到船务员工用户信息");
+			}
+		} else {
+			throw new SecurityException("请选择接收船务员工");
+		}
+		return R.data(detail);
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R logisticsRevokeSubmission(Bills bills) {
-		return null;
+		if (bills.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Bills detail = baseMapper.selectById(bills.getId());
+		if ("录入".equals(detail.getLogisticsStatus())) {
+			throw new RuntimeException("已撤销提交,请勿重复撤销");
+		}
+		LocalDateTime now = LocalDateTime.now();
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+		String formatted = now.format(formatter);
+		//发送消息
+		if (ObjectUtils.isNotNull(detail.getShippingStaffId())) {
+			R<User> userR = userClient.userInfoById(detail.getShippingStaffId());
+			if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
+				User datum = userR.getData();
+				Message sendMessage = new Message();
+				sendMessage.setParameter(detail.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/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("您的海运出口物流提交已撤销!提单号:" + detail.getMblno() + "时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				System.out.println("发送结果:" + save);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			} else {
+				throw new SecurityException("未查到船务员工用户信息");
+			}
+		} else {
+			throw new SecurityException("请选择接收船务员工");
+		}
+		detail.setLogisticsStatus("录入");
+		detail.setUpdateUser(AuthUtil.getUserId());
+		detail.setUpdateUserName(AuthUtil.getUserName());
+		detail.setUpdateTime(new Date());
+		detail.setShippingStaffId(null);
+		detail.setShippingStaffName("");
+		baseMapper.updateById(detail);
+		return R.data(detail);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R transferOrder(Bills bills) {
+		if (bills.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Bills detail = baseMapper.selectById(bills.getId());
+		detail.setTransferOrderStatus("已转单");
+		detail.setUpdateUser(AuthUtil.getUserId());
+		detail.setUpdateUserName(AuthUtil.getUserName());
+		detail.setUpdateTime(new Date());
+		baseMapper.updateById(detail);
+		Bills billsJk = new Bills();
+		BeanUtil.copyProperties(detail, billsJk);
+		billsJk.setId(null);
+		billsJk.setUpdateUser(null);
+		billsJk.setUpdateUserName(null);
+		billsJk.setUpdateTime(null);
+		billsJk.setCheckDrStatus(null);
+		billsJk.setCheckDrStatusDescr(null);
+		billsJk.setCheckCrStatus(null);
+		billsJk.setCheckCrStatusDescr(null);
+		billsJk.setStlDrStatus(null);
+		billsJk.setStlDrStatusDescr(null);
+		billsJk.setStlCrStatus(null);
+		billsJk.setStlCrStatusDescr(null);
+		billsJk.setInvoiceDrStatus(null);
+		billsJk.setInvoiceDrStatusDescr(null);
+		billsJk.setInvoiceCrStatus(null);
+		billsJk.setInvoiceCrStatusDescr(null);
+		billsJk.setBillStatus(null);
+		billsJk.setAccountStatus(null);
+		billsJk.setExtendedData(null);
+		billsJk.setStatus(null);
+		billsJk.setCharData(null);
+		billsJk.setBillingStatus(null);
+		billsJk.setEdiStatus(null);
+		billsJk.setApprovedDate(null);
+		billsJk.setIssueStatus(null);
+		billsJk.setSrcBusId(detail.getId());
+		String deptId = billsJk.getPodCompanyId() + "";
+		String deptName = billsJk.getPodCompanyName();
+		String branchId = billsJk.getPodCompanyId() + "";
+		List<Bills> count = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.select(Bills::getId)
+			.eq(Bills::getCreateDept, branchId)
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.eq(Bills::getMblno, billsJk.getMblno())
+			.eq(Bills::getBusinessType, "SI")
+			.eq(Bills::getSeaType, "I")
+		);
+		if (ObjectUtils.isNotNull(billsJk.getBillDate())) {
+			LocalDate date = billsJk.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+			int year = date.getYear();
+			int month = date.getMonthValue();
+			FinPeriod finPeriod = finPeriodMapper.selectOne(new LambdaQueryWrapper<FinPeriod>()
+				.eq(FinPeriod::getTenantId, AuthUtil.getTenantId())
+				.eq(FinPeriod::getIsDeleted, 0)
+				.eq(FinPeriod::getPeriodYear, year)
+				.eq(FinPeriod::getPeriodMonth, month));
+			if (finPeriod != null) {
+				if (1 == finPeriod.getIsClosed()) {
+					throw new RuntimeException(year + "年" + month + "月账期已结转,保存失败");
+				}
+				if (1 == finPeriod.getLockingStatus()) {
+					throw new RuntimeException(year + "年" + month + "月账期已锁定,保存失败");
+				}
+			}
+		}
+		if (ObjectUtils.isNotNull(bills.getMblno())) {
+			if (!"MH".equals(bills.getBillType())) {
+				if (!count.isEmpty()) {
+					throw new RuntimeException("提单号不允许重复:" + bills.getMblno());
+				}
+			}
+		}
+		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, "HYJK"));
+		if (businessType == null) {
+			throw new RuntimeException("未找到可用业务类型");
+		}
+		BusinessBillNo businessBillNo = new BusinessBillNo();
+		businessBillNo.setBusinessTypeId(businessType.getId());
+		businessBillNo.setCode("HYJK");
+		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+		if (!clientBillNo.isSuccess()) {
+			throw new RuntimeException("生成订单编号失败");
+		}
+		billsJk.setBillNo((String) clientBillNo.getData());
+		billsJk.setCreateTime(new Date());
+		billsJk.setCreateUser(AuthUtil.getUserId());
+		billsJk.setCreateUserName(AuthUtil.getUserName());
+		billsJk.setTenantId(AuthUtil.getTenantId());
+		if (ObjectUtils.isNotNull(branchId)) {
+			billsJk.setBranchId(branchId);
+			billsJk.setCreateDept(deptId);
+			billsJk.setCreateDeptName(deptName);
+		}
+		// 初始创建为1
+		billsJk.setVersion("1");
+		baseMapper.insert(billsJk);
+		if (ObjectUtils.isNotNull(billsJk.getPreContainersList())) {
+			List<PreContainers> preContainersList = new ArrayList<>();
+			for (PreContainers item : billsJk.getPreContainersList()) {
+				item.setSrcId(item.getId());
+				item.setId(null);
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				if (ObjectUtils.isNotNull(branchId)) {
+					item.setBranchId(branchId);
+					item.setCreateDept(deptId);
+					item.setCreateDeptName(deptName);
+				}
+				item.setUpdateUser(null);
+				item.setUpdateTime(null);
+				item.setUpdateUserName(null);
+				item.setPid(billsJk.getId());
+				preContainersList.add(item);
+			}
+			preContainersService.saveBatch(preContainersList);
+		}
+		if (ObjectUtils.isNotNull(billsJk.getContainersList())) {
+			List<Containers> containersList = new ArrayList<>();
+			List<ContainersCommodity> containersCommodityList = new ArrayList<>();
+			List<ContainersBills> containersBillsList = new ArrayList<>();
+			for (Containers item : billsJk.getContainersList()) {
+				item.setSrcId(item.getId());
+				item.setId(null);
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				if (ObjectUtils.isNotNull(branchId)) {
+					item.setBranchId(branchId);
+					item.setCreateDept(deptId);
+					item.setCreateDeptName(deptName);
+				}
+				item.setUpdateUser(null);
+				item.setUpdateTime(null);
+				item.setUpdateUserName(null);
+				item.setPid(billsJk.getId());
+				if (ObjectUtils.isNotNull(item.getContainersCommodityList()) && !item.getContainersCommodityList().isEmpty()) {
+					containersCommodityList.addAll(item.getContainersCommodityList());
+				}
+				if (ObjectUtils.isNotNull(item.getContainersBillsList()) && !item.getContainersBillsList().isEmpty()) {
+					containersBillsList.addAll(item.getContainersBillsList());
+				}
+				containersList.add(item);
+			}
+			containersService.saveBatch(containersList);
+			if (!containersCommodityList.isEmpty()) {
+				for (ContainersCommodity item : containersCommodityList) {
+					Containers containers = containersList.stream().filter(e -> e.getSrcId().equals(item.getPid())).findFirst().orElse(null);
+					if (containers != null) {
+						item.setId(null);
+						item.setCreateTime(new Date());
+						item.setCreateUser(AuthUtil.getUserId());
+						item.setCreateUserName(AuthUtil.getUserName());
+						if (ObjectUtils.isNotNull(branchId)) {
+							item.setBranchId(branchId);
+							item.setCreateDept(deptId);
+							item.setCreateDeptName(deptName);
+						}
+						item.setUpdateUser(null);
+						item.setUpdateTime(null);
+						item.setUpdateUserName(null);
+						item.setPid(containers.getId());
+						item.setPpId(billsJk.getId());
+					} else {
+						throw new RuntimeException("装箱明细数据错误,请联系管理员");
+					}
+				}
+				containersCommodityService.saveBatch(containersCommodityList);
+			}
+			if (!containersBillsList.isEmpty()) {
+				for (ContainersBills item : containersBillsList) {
+					Containers containers = containersList.stream().filter(e -> e.getSrcId().equals(item.getPid())).findFirst().orElse(null);
+					if (containers != null) {
+						item.setId(null);
+						item.setCreateTime(new Date());
+						item.setCreateUser(AuthUtil.getUserId());
+						item.setCreateUserName(AuthUtil.getUserName());
+						if (ObjectUtils.isNotNull(branchId)) {
+							item.setBranchId(branchId);
+							item.setCreateDept(deptId);
+							item.setCreateDeptName(deptName);
+						}
+						item.setUpdateUser(null);
+						item.setUpdateTime(null);
+						item.setUpdateUserName(null);
+						item.setPid(containers.getId());
+						item.setPpId(billsJk.getId());
+					} else {
+						throw new RuntimeException("装箱明细数据错误,请联系管理员");
+					}
+				}
+				containersBillsService.saveBatch(containersBillsList);
+			}
+		}
+
+		BigDecimal amountCr = new BigDecimal("0.00");
+		BigDecimal amountProfit;
+		BigDecimal amountCrUsd = new BigDecimal("0.00");
+		BigDecimal amountProfitUsd;
+		BigDecimal amountCrLoc = new BigDecimal("0.00");
+		BigDecimal amountProfitLoc;
+
+		Date date = new Date();
+		BigDecimal exrateC = bCurrencyService.getCnyExrate(date, "USD", "C", "1");
+		//应收
+		int statusD = 0;
+		if (ObjectUtils.isNotNull(billsJk.getFeeCenterListD())) {
+			List<FeeCenter> feeCenterListAll = new ArrayList<>();
+			List<FeeCenter> feeCenterListD = billsJk.getFeeCenterListD()
+				.stream().filter(e -> e.getCorpId().equals(billsJk.getForeignAgencyId())).collect(Collectors.toList());
+			if (!feeCenterListD.isEmpty()) {
+				statusD += 1;
+				for (FeeCenter item : feeCenterListD) {
+					//计算字段null值处理
+					item.setQuantity(ObjectUtils.isNotNull(item.getQuantity()) ? item.getQuantity() : new BigDecimal("0.00"));
+					item.setPrice(ObjectUtils.isNotNull(item.getPrice()) ? item.getPrice() : new BigDecimal("0.00"));
+					item.setSurchargeRate(ObjectUtils.isNotNull(item.getSurchargeRate()) ? item.getSurchargeRate() : new BigDecimal("0.00"));
+					item.setTaxRate(ObjectUtils.isNotNull(item.getTaxRate()) ? item.getTaxRate() : new BigDecimal("0.00"));
+					item.setAmountDiscount(ObjectUtils.isNotNull(item.getAmountDiscount()) ? item.getAmountDiscount() : new BigDecimal("0.00"));
+					item.setStlTtlAmount(ObjectUtils.isNotNull(item.getStlTtlAmount()) ? item.getStlTtlAmount() : new BigDecimal("0.00"));
+
+					item.setId(null);
+					item.setPid(billsJk.getId());
+					item.setBillNo(bills.getBillNo());
+					item.setBusinessType(billsJk.getBusinessType());
+					item.setDc("C");
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId);
+						item.setBranchId(branchId);
+						item.setCreateDeptName(deptName);
+					}
+					item.setUpdateUser(null);
+					item.setUpdateTime(null);
+					item.setUpdateUserName(null);
+
+					// 去税金额 = 数量quantity * 单价price
+					BigDecimal amountNet = new BigDecimal("0.00");
+					// 税额 = 去税金额amountNet * 税率taxRateSum
+					BigDecimal amountTax = new BigDecimal("0.00");
+					// 金额,amountTax + 去税金额amountNet - 折扣金额amountDiscount
+					BigDecimal amount = new BigDecimal("0.00");
+					//总税率  = 税率taxRate + 附加税率surchargeRate
+					BigDecimal taxRate = new BigDecimal("0.00");
+					// 税率 = 总税率/100
+					BigDecimal taxRateSum = new BigDecimal("0.00");
+
+					amountNet = amountNet.add(item.getQuantity().multiply(item.getPrice()))
+						.setScale(2, RoundingMode.HALF_UP);
+					taxRate = taxRate.add(item.getTaxRate()).add(item.getSurchargeRate());
+					taxRateSum = taxRateSum.add(taxRate.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP));
+					amountTax = amountTax.add(amountNet.multiply(taxRateSum)).setScale(2, RoundingMode.HALF_UP);
+					amount = amount.add(amountNet.add(amountTax).subtract(item.getAmountDiscount()));
+
+					//判断是否是本位币
+					if ("CNY".equals(item.getCurCode())) {
+						item.setAmountNetLoc(amountNet);
+						item.setAmountTaxLoc(amountTax);
+						item.setAmountLoc(amount);
+						item.setAmountDiscountLoc(amount);
+						amountCr = amountCr.add(item.getAmount());
+					} else {
+						item.setAmountNetLoc(amountNet.multiply(exrateC));
+						item.setAmountTaxLoc(amountTax.multiply(exrateC));
+						item.setAmountLoc(amount.multiply(exrateC));
+						item.setAmountDiscountLoc(amount.multiply(exrateC));
+						amountCrUsd = amountCrUsd.add(item.getAmount());
+					}
+					item.setAmountNet(amountNet);
+					item.setAmountTax(amountTax);
+					item.setAmount(amount);
+					item.setUnsettledAmount(item.getAmount().subtract(item.getStlTtlAmount()));
+					feeCenterListAll.add(item);
+				}
+			}
+			if (!feeCenterListAll.isEmpty()) {
+				feeCenterService.saveBatch(feeCenterListAll);
+			}
+		}
+		if (0 == statusD) {
+			billsJk.setAccountStatus(0);
+		} else if (1 == statusD) {
+			billsJk.setAccountStatus(2);
+		}
+		//主单应加上分单费用
+		if ("MM".equals(billsJk.getBillType()) && ObjectUtils.isNotNull(billsJk.getId())) {
+			List<Bills> details = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getMasterId, bills.getId()));
+			if (!details.isEmpty()) {
+				for (Bills item : details) {
+					item.setSrcBusId(item.getId());
+					item.setId(null);
+					item.setUpdateUser(null);
+					item.setUpdateUserName(null);
+					item.setUpdateTime(null);
+					item.setCheckDrStatus(null);
+					item.setCheckDrStatusDescr(null);
+					item.setCheckCrStatus(null);
+					item.setCheckCrStatusDescr(null);
+					item.setStlDrStatus(null);
+					item.setStlDrStatusDescr(null);
+					item.setStlCrStatus(null);
+					item.setStlCrStatusDescr(null);
+					item.setInvoiceDrStatus(null);
+					item.setInvoiceDrStatusDescr(null);
+					item.setInvoiceCrStatus(null);
+					item.setInvoiceCrStatusDescr(null);
+					item.setBillStatus(null);
+					item.setAccountStatus(null);
+					item.setExtendedData(null);
+					item.setStatus(null);
+					item.setCharData(null);
+					item.setBillingStatus(null);
+					item.setEdiStatus(null);
+					item.setApprovedDate(null);
+					item.setIssueStatus(null);
+					item.setMasterId(billsJk.getId());
+					item.setMasterBillNo(billsJk.getBillNo());
+					BusinessBillNo businessBillNo1 = new BusinessBillNo();
+					businessBillNo1.setBusinessTypeId(businessType.getId());
+					businessBillNo1.setCode("HYJK");
+					R clientBillNo1 = businessBillNoService.getBillNoLos(businessBillNo1);
+					if (!clientBillNo1.isSuccess()) {
+						throw new RuntimeException("生成订单编号失败");
+					}
+					item.setBillNo((String) clientBillNo1.getData());
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					item.setTenantId(AuthUtil.getTenantId());
+					if (ObjectUtils.isNotNull(branchId)) {
+						item.setBranchId(branchId);
+						item.setCreateDept(deptId);
+						item.setCreateDeptName(deptName);
+					}
+					// 初始创建为1
+					item.setVersion("1");
+				}
+				this.saveBatch(details);
+				amountCr = amountCr.add(details.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountCrUsd = amountCrUsd.add(details.stream().map(Bills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountCrLoc = amountCrLoc.add(details.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			}
+		}
+		//利润 = 收 - 付
+		amountProfit = new BigDecimal("0.00").subtract(amountCr);
+		amountProfitUsd = new BigDecimal("0.00").subtract(amountCrUsd);
+		if (amountCrUsd.compareTo(new BigDecimal("0.00")) != 0) {
+			amountCrLoc = amountCrLoc.add(amountCrUsd.multiply(exrateC)).add(amountCr);
+		} else {
+			amountCrLoc = amountCrLoc.add(amountCr);
+		}
+		amountProfitLoc = new BigDecimal("0.00").subtract(amountCrLoc);
+		billsJk.setAmountCr(amountCr);
+		billsJk.setAmountProfit(amountProfit);
+		billsJk.setAmountCrUsd(amountCrUsd);
+		billsJk.setAmountProfitUsd(amountProfitUsd);
+		billsJk.setAmountCrLoc(amountCrLoc);
+		billsJk.setAmountProfitLoc(amountProfitLoc);
+		this.updateById(billsJk);
+		if (ObjectUtils.isNotNull(billsJk.getDetail())) {
+			SeaBillsDetail seaBillsDetail = billsJk.getDetail();
+			seaBillsDetail.setUpdateUser(null);
+			seaBillsDetail.setUpdateUserName(null);
+			seaBillsDetail.setUpdateTime(null);
+			seaBillsDetail.setId(null);
+			seaBillsDetail.setPid(billsJk.getId());
+			seaBillsDetail.setBranchId(billsJk.getBranchId());
+			seaBillsDetail.setCreateUser(AuthUtil.getUserId());
+			seaBillsDetail.setCreateUserName(AuthUtil.getUserName());
+			seaBillsDetail.setCreateDept(billsJk.getCreateDept());
+			seaBillsDetail.setCreateDeptName(billsJk.getCreateDeptName());
+			seaBillsDetail.setCreateTime(new Date());
+			seaBillsDetailService.save(seaBillsDetail);
+		}
+		if (ObjectUtils.isNotNull(billsJk.getFilesList())) {
+			List<FilesCenter> filesList = new ArrayList<>();
+			for (FilesCenter item : billsJk.getFilesList()) {
+				item.setId(null);
+				item.setPid(billsJk.getId());
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+					item.setCreateDeptName(deptName);
+				}
+				item.setUpdateUser(null);
+				item.setUpdateTime(null);
+				item.setUpdateUserName(null);
+				filesList.add(item);
+			}
+			filesCenterService.saveBatch(filesList);
+		}
+		return R.data(billsJk);
 	}
 
 }

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

@@ -16,13 +16,26 @@
  */
 package org.springblade.los.business.sea.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.box.entity.PutBox;
+import org.springblade.los.box.service.IPutBoxService;
+import org.springblade.los.business.sea.entity.PreContainers;
 import org.springblade.los.business.sea.entity.SeaContainerNumberItem;
-import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
 import org.springblade.los.business.sea.mapper.SeaContainerNumberItemMapper;
+import org.springblade.los.business.sea.service.IPreContainersService;
 import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 业务放箱号明细 服务实现类
@@ -31,11 +44,102 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  * @since 2025-05-12
  */
 @Service
+@AllArgsConstructor
 public class SeaContainerNumberItemServiceImpl extends ServiceImpl<SeaContainerNumberItemMapper, SeaContainerNumberItem> implements ISeaContainerNumberItemService {
 
+	private final IPutBoxService putBoxService;
+
+	private final IPreContainersService preContainersService;
+
 	@Override
 	public IPage<SeaContainerNumberItemVO> selectSeaContainerNumberItemPage(IPage<SeaContainerNumberItemVO> page, SeaContainerNumberItemVO seaContainerNumberItem) {
 		return page.setRecords(baseMapper.selectSeaContainerNumberItemPage(page, seaContainerNumberItem));
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R selectedContainerNumber(List<SeaContainerNumberItem> containerNumberItemList) {
+		for (SeaContainerNumberItem item : containerNumberItemList) {
+			item.setCreateTime(new Date());
+			item.setCreateUser(AuthUtil.getUserId());
+			item.setCreateUserName(AuthUtil.getUserName());
+		}
+		this.saveBatch(containerNumberItemList);
+		List<Long> idList = containerNumberItemList.stream().map(SeaContainerNumberItem::getSrcId).collect(Collectors.toList());
+		List<PutBox> putBoxList = putBoxService.list(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.in(PutBox::getId, idList));
+
+
+		for (PutBox item : putBoxList) {
+			item.setUpdateTime(new Date());
+			item.setUpdateUser(AuthUtil.getUserId());
+			item.setUpdateUserName(AuthUtil.getUserName());
+			SeaContainerNumberItem containerNumberItem = containerNumberItemList.stream()
+				.filter(e -> e.getSrcId().equals(item.getId())).findFirst().orElse(null);
+			if (containerNumberItem == null) {
+				throw new RuntimeException("数据错误,请联系管理员");
+			}
+			item.setOccupyNum(item.getOccupyNum() + containerNumberItem.getOccupyNum());
+			item.setRemainingNum(item.getTotalNum() - item.getOccupyNum());
+		}
+		putBoxService.updateBatchById(putBoxList);
+		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()
+			.eq(PreContainers::getPid, containerNumberItemList.get(0).getPid())
+			.eq(PreContainers::getCntrTypeCode, containerNumberItemList.get(0).getBoxType()));
+		if (preContainers == null) {
+			throw new RuntimeException("数据错误,请联系管理员");
+		}
+		preContainers.setUpdateTime(new Date());
+		preContainers.setUpdateUser(AuthUtil.getUserId());
+		preContainers.setUpdateUserName(AuthUtil.getUserName());
+		preContainers.setContainerNumberStatus("已选择");
+		preContainersService.updateById(preContainers);
+		return R.data(containerNumberItemList);
+	}
+
+	@Override
+	public R revokeSelectedContainerNumber(String boxType, String billId) {
+		List<SeaContainerNumberItem> containerNumberItemList = baseMapper.selectList(new LambdaQueryWrapper<SeaContainerNumberItem>()
+			.eq(SeaContainerNumberItem::getTenantId, AuthUtil.getTenantId())
+			.eq(SeaContainerNumberItem::getIsDeleted, 0)
+			.eq(SeaContainerNumberItem::getBoxType, boxType)
+			.eq(SeaContainerNumberItem::getPid, billId));
+		if (containerNumberItemList.isEmpty()) {
+			throw new RuntimeException("未查到放箱号数据");
+		}
+		List<Long> idList = containerNumberItemList.stream().map(SeaContainerNumberItem::getSrcId).collect(Collectors.toList());
+		this.removeByIds(idList);
+		List<PutBox> putBoxList = putBoxService.list(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.in(PutBox::getId, idList));
+		for (PutBox item : putBoxList) {
+			item.setUpdateTime(new Date());
+			item.setUpdateUser(AuthUtil.getUserId());
+			item.setUpdateUserName(AuthUtil.getUserName());
+			SeaContainerNumberItem containerNumberItem = containerNumberItemList.stream()
+				.filter(e -> e.getSrcId().equals(item.getId())).findFirst().orElse(null);
+			if (containerNumberItem == null) {
+				throw new RuntimeException("数据错误,请联系管理员");
+			}
+			item.setOccupyNum(item.getOccupyNum() - containerNumberItem.getOccupyNum());
+			item.setRemainingNum(item.getTotalNum() - item.getOccupyNum());
+		}
+		putBoxService.updateBatchById(putBoxList);
+		PreContainers preContainers = preContainersService.getOne(new LambdaQueryWrapper<PreContainers>()
+			.eq(PreContainers::getPid, billId)
+			.eq(PreContainers::getCntrTypeCode, boxType));
+		if (preContainers == null) {
+			throw new RuntimeException("数据错误,请联系管理员");
+		}
+		preContainers.setUpdateTime(new Date());
+		preContainers.setUpdateUser(AuthUtil.getUserId());
+		preContainers.setUpdateUserName(AuthUtil.getUserName());
+		preContainers.setContainerNumberStatus("录入");
+		preContainersService.updateById(preContainers);
+		return R.data("操作成功");
+	}
+
 }

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java

@@ -252,7 +252,7 @@ public class AuditProecessController extends BladeController {
 			auditProecessService.agentCheck(auditProecess);
 		}else if ("HXCB_SOC".equals(proecess.getCheckType()) || "HXCB_COC".equals(proecess.getCheckType())) {
 			auditProecessService.routeCostCheck(auditProecess);
-		}else if ("FYQH".equals(proecess.getCheckType())) {
+		}else if ("FYSQ".equals(proecess.getCheckType())) {
 			auditProecessService.pleaseVerifyCostCheck(auditProecess);
 		}
 		return R.data(auditProecess);