Browse Source

1.海运进出口增加箱型箱量,件数包装大写
2.海运进出口批量复制接口
3.费用类别增加字段编码
4.基础资料-费用信息增加费用类别编码,并且查询接口增加类别检索条件
5.费用中心,费用基础信息增加字段是否强制币别

纪新园 7 months ago
parent
commit
e30bc7af54

+ 11 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/fees/entity/BFees.java

@@ -16,6 +16,8 @@
  */
 package org.springblade.los.basic.fees.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -183,13 +185,22 @@ public class BFees implements Serializable {
 	 * 费用类别
 	 */
 	@ApiModelProperty(value = "费用类别")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String feesTypeId;
 
 	/**
 	 * 费用类别
 	 */
 	@ApiModelProperty(value = "费用类别")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String feesTypeName;
 
+	/**
+	 * 费用类别编码
+	 */
+	@ApiModelProperty(value = "费用类别编码")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private String feesTypeCode;
+
 
 }

+ 7 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/fees/entity/BFeesDefine.java

@@ -106,6 +106,13 @@ public class BFeesDefine implements Serializable {
 	@ApiModelProperty(value = "英文名称")
 	@NotEmpty(message = "英文名称不能为空")
 	private String enName;
+
+	/**
+	 * 编码
+	 */
+	@ApiModelProperty(value = "编码")
+	@NotEmpty(message = "编码不能为空")
+	private String code;
 	/**
 	 * 排序
 	 */

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

@@ -982,22 +982,27 @@ public class Bills implements Serializable {
 	@ApiModelProperty(value = "40HC 集装箱箱数")
 	private Integer quantityV40hc;
 	/**
-	 * 集装箱箱数英文,
+	 * 箱型箱量
 	 */
-	@ApiModelProperty(value = "集装箱箱数英文, ")
+	@ApiModelProperty(value = "箱型箱量 ")
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String quantityCntrDescr;
 	/**
-	 * 商品包装件数英文,
+	 * 商品包装件数英文大写
 	 */
-	@ApiModelProperty(value = "商品包装件数英文, ")
+	@ApiModelProperty(value = "商品包装件数英文大写")
 	private String quantityPackingDescr;
 	/**
-	 * 集装箱箱型箱数英文, 1*20GP,2*40HC
+	 * 箱型箱量大写
 	 */
-	@ApiModelProperty(value = "集装箱箱型箱数英文, 1*20GP,2*40HC")
+	@ApiModelProperty(value = "箱型箱量大写")
 	private String quantityCntrTypesDescr;
 	/**
+	 * 大写取值规则  0 件数包装大写  1 箱型箱量大写
+	 */
+	@ApiModelProperty(value = "大写取值规则")
+	private Integer capitalLettersRule;
+	/**
 	 * 危险品分类代码(IMDG CODE)
 	 */
 	@ApiModelProperty(value = "危险品分类代码(IMDG CODE)")
@@ -1940,13 +1945,18 @@ public class Bills implements Serializable {
 	 */
 	@ApiModelProperty(value = "报价方式")
 	private String quotationMethod;
-/**
+	/**
 	 * 结算方式
 	 */
 	@ApiModelProperty(value = "结算方式")
 	private String accountPeriodType;
 
 	/**
+	 * 临时来源id
+	 */
+	@TableField(exist = false)
+	private Long temporaryId;
+	/**
 	 * 入库
 	 */
 	@TableField(exist = false)

+ 13 - 13
blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/controller/BFeesController.java

@@ -17,18 +17,16 @@
 package org.springblade.los.basic.fees.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-
 import org.springblade.common.annotation.RepeatSubmit;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -36,18 +34,16 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.los.basic.corps.entity.BCorps;
-import org.springblade.los.basic.countrys.entity.BCountrys;
 import org.springblade.los.basic.fees.dto.BFeesExcel;
-import org.springblade.system.feign.ISysClient;
-import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.los.basic.fees.entity.BFees;
-import org.springblade.los.basic.fees.vo.BFeesVO;
 import org.springblade.los.basic.fees.service.IBFeesService;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.los.basic.fees.vo.BFeesVO;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -90,6 +86,8 @@ public class BFeesController extends BladeController {
 			.and(ObjectUtils.isNotNull(bFees.getCnName()), i -> i.like(BFees::getCnName, bFees.getCnName()).or()
 				.like(BFees::getEnName, bFees.getCnName()).or().like(BFees::getCode, bFees.getCnName()))
 			.like(ObjectUtils.isNotNull(bFees.getStatus()), BFees::getStatus, bFees.getStatus())
+			.and(i -> i.like(ObjectUtils.isNotNull(bFees.getFeesTypeCode()), BFees::getFeesTypeCode, bFees.getFeesTypeCode()).or()
+				.isNull(BFees::getFeesTypeCode))
 			.like(ObjectUtils.isNotNull(bFees.getCode()), BFees::getCode, bFees.getCode())
 			.like(ObjectUtils.isNotNull(bFees.getEnName()), BFees::getEnName, bFees.getEnName())
 			.like(ObjectUtils.isNotNull(bFees.getFeesTypeId()), BFees::getFeesTypeId, bFees.getFeesTypeId());
@@ -219,6 +217,8 @@ public class BFeesController extends BladeController {
 			.and(ObjectUtils.isNotNull(bFees.getCnName()), i -> i.like(BFees::getCnName, bFees.getCnName()).or()
 				.like(BFees::getEnName, bFees.getCnName()).or().like(BFees::getCode, bFees.getCnName()))
 			.like(ObjectUtils.isNotNull(bFees.getStatus()), BFees::getStatus, bFees.getStatus())
+			.and(i -> i.like(ObjectUtils.isNotNull(bFees.getFeesTypeCode()), BFees::getFeesTypeCode, bFees.getFeesTypeCode()).or()
+				.isNull(BFees::getFeesTypeCode))
 			.like(ObjectUtils.isNotNull(bFees.getCode()), BFees::getCode, bFees.getCode())
 			.like(ObjectUtils.isNotNull(bFees.getEnName()), BFees::getEnName, bFees.getEnName())
 			.like(ObjectUtils.isNotNull(bFees.getFeesTypeId()), BFees::getFeesTypeId, bFees.getFeesTypeId());
@@ -230,7 +230,7 @@ public class BFeesController extends BladeController {
 		} else {
 			lambdaQueryWrapper.orderByDesc(BFees::getCreateTime);
 		}
-		List<BFees> pages = bFeesService.list( lambdaQueryWrapper);
+		List<BFees> pages = bFeesService.list(lambdaQueryWrapper);
 		return R.data(pages);
 	}
 

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

@@ -5126,16 +5126,16 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									if ("1".equals(status)) {
 										BigDecimal amountHYD = item.getFeeCenterList().stream()
 											.filter(e -> e.getFeeCnName().equals("海运费") && "D".equals(e.getDc()))
-											.map(FeeCenterReports::getAmountUsdD).reduce(BigDecimal.ZERO, BigDecimal::add);
+											.map(FeeCenterReports::getAmountUsdD).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 										BigDecimal amountHYC = item.getFeeCenterList().stream()
 											.filter(e -> e.getFeeCnName().equals("海运费") && "C".equals(e.getDc()))
-											.map(FeeCenterReports::getAmountUsdC).reduce(BigDecimal.ZERO, BigDecimal::add);
+											.map(FeeCenterReports::getAmountUsdC).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 										BigDecimal amountPSD = item.getFeeCenterList().stream()
 											.filter(e -> e.getFeeCnName().equals("PS") && "D".equals(e.getDc()))
-											.map(FeeCenterReports::getAmountUsdD).reduce(BigDecimal.ZERO, BigDecimal::add);
+											.map(FeeCenterReports::getAmountUsdD).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 										BigDecimal amountPSC = item.getFeeCenterList().stream()
 											.filter(e -> e.getFeeCnName().equals("PS") && "C".equals(e.getDc()))
-											.map(FeeCenterReports::getAmountUsdC).reduce(BigDecimal.ZERO, BigDecimal::add);
+											.map(FeeCenterReports::getAmountUsdC).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 										BCorps bCorps = bCorpsService.getById(item.getCorpId());
 										BigDecimal PSAmount = amountPSC.subtract(amountPSD);
 										BigDecimal HYAmount = amountHYD.subtract(amountHYC);

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

@@ -162,25 +162,25 @@ public class BillsController extends BladeController {
 				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
 				&& !AuthUtil.getUserRole().contains("经理")) {
 				if (AuthUtil.getUserRole().contains("操作经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("操作员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("销售经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
 			}
-		}else if ("2".equals(jurisdiction)) {
+		} else if ("2".equals(jurisdiction)) {
 			//动态权限不做任何处理
-		}  else {
+		} else {
 			if (AuthUtil.getUserRole().contains("业务员")) {
 				lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 			} else {
@@ -333,25 +333,25 @@ public class BillsController extends BladeController {
 				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
 				&& !AuthUtil.getUserRole().contains("经理")) {
 				if (AuthUtil.getUserRole().contains("操作经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("操作员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("销售经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
 			}
-		}else if ("2".equals(jurisdiction)) {
+		} else if ("2".equals(jurisdiction)) {
 			//动态权限不做任何处理
-		}  else {
+		} else {
 			if (AuthUtil.getUserRole().contains("业务员")) {
 				lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 			} else {
@@ -642,6 +642,23 @@ public class BillsController extends BladeController {
 	}
 
 	/**
+	 * 批量复制单据
+	 *
+	 * @param ids      复制单据ids
+	 * @param billType 复制后单据类型 空=业务类型不变
+	 * @param copyCntr 1=复制箱型箱量
+	 * @param copyFee  1=复制费用信息
+	 */
+	@GetMapping("/batchCopyBills")
+	@RepeatSubmit
+	public R batchCopyBills(@RequestParam("ids") String ids,
+							@RequestParam(value = "billType", required = false) String billType,
+							@RequestParam(value = "copyCntr", required = false) String copyCntr,
+							@RequestParam(value = "copyFee", required = false) String copyFee) {
+		return billsService.batchCopyBills(ids, billType, copyCntr,copyFee);
+	}
+
+	/**
 	 * 详情
 	 */
 	@GetMapping("/getDetail")
@@ -743,25 +760,25 @@ public class BillsController extends BladeController {
 				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
 				&& !AuthUtil.getUserRole().contains("经理")) {
 				if (AuthUtil.getUserRole().contains("操作经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorDept, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("操作员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getOperatorId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("销售经理")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcDeptId, AuthUtil.getDeptId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
-					lambdaQueryWrapper.and(i-> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
 			}
-		}else if ("2".equals(jurisdiction)) {
+		} else if ("2".equals(jurisdiction)) {
 			//动态权限不做任何处理
-		}  else {
+		} else {
 			if (AuthUtil.getUserRole().contains("业务员")) {
 				lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
 			} else {
@@ -897,7 +914,7 @@ public class BillsController extends BladeController {
 	 */
 	@PostMapping("/documentVerification")
 	@RepeatSubmit
-	public R documentVerification(@RequestBody Bills bills)throws Exception {
+	public R documentVerification(@RequestBody Bills bills) throws Exception {
 		return billsService.documentVerification(bills);
 	}
 }

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

@@ -164,4 +164,6 @@ public interface IBillsService extends IService<Bills> {
 	void removeHblNo(Long id);
 
     R documentVerification(Bills bills)throws Exception;
+
+	R batchCopyBills(String ids, String billType, String copyCntr, String copyFee);
 }

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

@@ -29,6 +29,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.los.Util.BigDecimalUtils;
 import org.springblade.los.Util.IDeptUtils;
 import org.springblade.los.Util.StringTools;
 import org.springblade.los.Util.ZrUtil;
@@ -487,6 +488,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		Integer other = 0;
 		BigDecimal teu = new BigDecimal("0.00");
 		StringBuilder boxTypeSum = new StringBuilder();
+		StringBuilder quantityCntrTypesDescr = new StringBuilder();
+		quantityCntrTypesDescr.append("SAY ");
 		if (ObjectUtils.isNull(bills.getCfsQuantity()) || bills.getCfsQuantity().compareTo(new BigDecimal("0.00")) == 0) {
 			if (ObjectUtils.isNotNull(bills.getPreContainersList())) {
 				bills.setCfsMeasurement(new BigDecimal("0.00"));
@@ -538,10 +541,17 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						other += item.getQuantity();
 					}
 					boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
+					quantityCntrTypesDescr.append(BigDecimalUtils.convertToEnglish(new BigDecimal(item.getQuantity() + ""))).append(" AND");
 					if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
 						teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
 					}
 				}
+
+				if (quantityCntrTypesDescr.length() > 0) {
+					quantityCntrTypesDescr = new StringBuilder(quantityCntrTypesDescr.substring(0, quantityCntrTypesDescr.length() - 4));
+					quantityCntrTypesDescr.append("ONLY.");
+					bills.setQuantityCntrTypesDescr(quantityCntrTypesDescr.toString());
+				}
 				preContainersService.saveOrUpdateBatch(bills.getPreContainersList());
 				List<Long> idList = bills.getPreContainersList().stream().map(PreContainers::getId).collect(Collectors.toList());
 				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
@@ -847,7 +857,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		bills.setQuantity(quantity);
 		bills.setGrossWeight(grossWeight);
 		bills.setMeasurement(measurement);
-
+		bills.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
 		if (ObjectUtils.isNotNull(bills.getDetail())) {
 			Object seaBillsDetailObject = StringTools.handle(bills.getDetail(), "SeaBillsDetail");
 			SeaBillsDetail seaBillsDetail = JSONObject.parseObject(JSONObject.toJSONString(seaBillsDetailObject), SeaBillsDetail.class);
@@ -3576,4 +3586,227 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		return R.data("0");
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R batchCopyBills(String ids, String billType, String copyCntr, String copyFee) {
+		if (ObjectUtils.isNull(ids)) {
+			throw new SecurityException("缺少必要参数");
+		}
+		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getId, Func.toLongList(ids)));
+		if (billsList.isEmpty()) {
+			throw new SecurityException("未查到单据信息");
+		}
+		List<SeaBillsDetail> seaBillsDetailList = seaBillsDetailService.list(new LambdaQueryWrapper<SeaBillsDetail>()
+			.eq(SeaBillsDetail::getTenantId, AuthUtil.getTenantId())
+			.in(SeaBillsDetail::getPid, Func.toLongList(ids)));
+		List<FeeCenter> feeCenterList = new ArrayList<>();
+		if (ObjectUtils.isNotNull(copyFee) && "1".equals(copyFee)) {
+			feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, Func.toLongList(ids)));
+		}
+		List<PreContainers> preContainersList = new ArrayList<>();
+		if (ObjectUtils.isNotNull(copyFee) && "1".equals(copyCntr)) {
+			preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
+				.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+				.eq(PreContainers::getIsDeleted, 0)
+				.in(PreContainers::getPid, Func.toLongList(ids)));
+		}
+		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, billsList.get(0).getBusinessTypes()));
+		if (businessType == null) {
+			throw new RuntimeException("未找到可用业务类型");
+		}
+		List<Bills> copyBillsList = new ArrayList<>();
+		for (Bills item : billsList) {
+			Bills copyBills = new Bills();
+			BeanUtil.copyProperties(item, copyBills);
+			copyBills.setTemporaryId(item.getId());
+			copyBills.setId(null);
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			if ("dry".equals(copyBills.getCargoType())) {
+				businessBillNo.setCode(item.getBusinessTypes() + "-PH");
+			} else if ("danger".equals(copyBills.getCargoType())) {
+				businessBillNo.setCode(item.getBusinessTypes() + "-WXP");
+			} else if ("reefer".equals(copyBills.getCargoType())) {
+				businessBillNo.setCode(item.getBusinessTypes() + "-DG");
+			} else {
+				businessBillNo.setCode(item.getBusinessTypes() + "-PH");
+			}
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				throw new RuntimeException("生成订单编号失败");
+			}
+			copyBills.setBillNo((String) clientBillNo.getData());
+			copyBills.setOperatorId(AuthUtil.getUserId());
+			copyBills.setOperatorName(AuthUtil.getUserName());
+			copyBills.setBillNo("");
+			copyBills.setMblno("");
+			copyBills.setHblno("");
+			copyBills.setRefno("");
+			copyBills.setBookingNo("");
+			copyBills.setStatus(0);
+			copyBills.setBillStatus(0);
+			copyBills.setBillingStatus(0);
+			copyBills.setAmountDr(new BigDecimal("0.00"));
+			copyBills.setAmountCr(new BigDecimal("0.00"));
+			copyBills.setAmountProfit(new BigDecimal("0.00"));
+			copyBills.setAmountDrUsd(new BigDecimal("0.00"));
+			copyBills.setAmountCrUsd(new BigDecimal("0.00"));
+			copyBills.setAmountProfitUsd(new BigDecimal("0.00"));
+			copyBills.setAmountDrLoc(new BigDecimal("0.00"));
+			copyBills.setAmountCrLoc(new BigDecimal("0.00"));
+			copyBills.setAmountProfitLoc(new BigDecimal("0.00"));
+			copyBills.setCheckDrStatus(0);
+			copyBills.setCheckDrStatusDescr("未对账");
+			copyBills.setCheckCrStatus(0);
+			copyBills.setCheckCrStatusDescr("未申请");
+			copyBills.setStlDrStatus(0);
+			copyBills.setStlDrStatusDescr("未结");
+			copyBills.setStlCrStatus(0);
+			copyBills.setStlCrStatusDescr("未结");
+			copyBills.setInvoiceDrStatus(0);
+			copyBills.setInvoiceDrStatusDescr("未开");
+			copyBills.setInvoiceCrStatus(0);
+			copyBills.setInvoiceCrStatusDescr("未开");
+			copyBills.setBillStatus(0);
+			copyBills.setAccountStatus(0);
+			copyBills.setCfsQuantity(new BigDecimal("0.00"));
+			copyBills.setCfsGrossWeight(new BigDecimal("0.00"));
+			copyBills.setCfsMeasurement(new BigDecimal("0.00"));
+			copyBillsList.add(copyBills);
+		}
+		this.saveBatch(copyBillsList);
+		List<FeeCenter> copyFeeCenterList = new ArrayList<>();
+		List<PreContainers> copyPreContainersList = new ArrayList<>();
+		List<SeaBillsDetail> copySeaBillsDetailList = new ArrayList<>();
+		for (Bills item : copyBillsList) {
+			if (!seaBillsDetailList.isEmpty()) {
+				SeaBillsDetail seaBillsDetail = seaBillsDetailList.stream().filter(e -> e.getPid().equals(item.getTemporaryId()))
+					.findFirst().orElse(null);
+				if (seaBillsDetail != null) {
+					seaBillsDetail.setId(null);
+					seaBillsDetail.setPid(item.getId());
+					seaBillsDetail.setCreateUser(AuthUtil.getUserId());
+					seaBillsDetail.setCreateUserName(AuthUtil.getUserName());
+					seaBillsDetail.setCreateDept(item.getCreateDept());
+					seaBillsDetail.setCreateDeptName(item.getCreateDeptName());
+					seaBillsDetail.setCreateTime(new Date());
+					copySeaBillsDetailList.add(seaBillsDetail);
+				}
+			}
+			if (ObjectUtils.isNotNull(copyFee) && "1".equals(copyFee) && !feeCenterList.isEmpty()) {
+				List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> e.getPid().equals(item.getTemporaryId()))
+					.collect(Collectors.toList());
+				for (FeeCenter feeCenter : feeCenters) {
+					feeCenter.setId(null);
+					feeCenter.setPid(item.getId());
+					feeCenter.setCreateUser(AuthUtil.getUserId());
+					feeCenter.setCreateUserName(AuthUtil.getUserName());
+					feeCenter.setCreateDept(item.getCreateDept());
+					feeCenter.setCreateDeptName(item.getCreateDeptName());
+					feeCenter.setCreateTime(new Date());
+					feeCenter.setAccBillId(null);
+					feeCenter.setAccBillNo("");
+					feeCenter.setAccDate(null);
+					feeCenter.setAccStatus(0);
+					feeCenter.setAccById(0L);
+					feeCenter.setAccByName("");
+					feeCenter.setCheckBillId(0L);
+					feeCenter.setCheckBillNo("");
+					feeCenter.setCheckDate(null);
+					feeCenter.setCheckAmount(new BigDecimal("0.00"));
+					feeCenter.setCheckStatus(0);
+					feeCenter.setCheckById(0L);
+					feeCenter.setCheckByName("");
+					feeCenter.setStlBillId(0L);
+					feeCenter.setStlBillNo("");
+					feeCenter.setStlDate(null);
+					feeCenter.setStlOrgAmount(new BigDecimal("0.00"));
+					feeCenter.setStlCurCode("");
+					feeCenter.setStlExrate(new BigDecimal("0.00"));
+					feeCenter.setStlExrateLoc(new BigDecimal("0.00"));
+					feeCenter.setStlAmount(new BigDecimal("0.00"));
+					feeCenter.setStlAmountLoc(new BigDecimal("0.00"));
+					feeCenter.setStlStatus(0);
+					feeCenter.setStlById(0L);
+					feeCenter.setStlByName("");
+					feeCenter.setStlTtlAmount(new BigDecimal("0.00"));
+					feeCenter.setUnsettledAmount(feeCenter.getAmount());
+					feeCenter.setVoucherBillId(0L);
+					feeCenter.setVoucherBillNo("");
+					feeCenter.setVoucherNo("");
+					feeCenter.setVoucherDate(null);
+					feeCenter.setVoucherStatus(0);
+					feeCenter.setVoucherById(0L);
+					feeCenter.setVoucherByName("");
+					feeCenter.setInvoiceBillId("");
+					feeCenter.setInvoiceBillNo("");
+					feeCenter.setInvoiceNo("");
+					feeCenter.setInvoiceDate(null);
+					feeCenter.setInvoiceStatus(0);
+					feeCenter.setInvoiceCurCode("");
+					feeCenter.setInvoiceExrate(new BigDecimal("0.00"));
+					feeCenter.setInvoiceAmount(new BigDecimal("0.00"));
+					feeCenter.setInvoiceAmountLoc(new BigDecimal("0.00"));
+					feeCenter.setUninvoicedAmount(new BigDecimal("0.00"));
+					feeCenter.setAppliedAmount(new BigDecimal("0.00"));
+					feeCenter.setAppliedInvoiceAmount(new BigDecimal("0.00"));
+					feeCenter.setReconciliationAmount(new BigDecimal("0.00"));
+					feeCenter.setAppliedAmountStl(new BigDecimal("0.00"));
+					feeCenter.setAppliedInvoiceAmountStl(new BigDecimal("0.00"));
+					feeCenter.setInvoiceById(0L);
+					feeCenter.setInvoiceByName("");
+					feeCenter.setIsSignfor(0);
+					feeCenter.setSignforId(0);
+					feeCenter.setSignforName("");
+					feeCenter.setSignforDate(null);
+					feeCenter.setApplyId(0L);
+					feeCenter.setApplyName("");
+					feeCenter.setApplyTime(null);
+					feeCenter.setApproverId(0L);
+					feeCenter.setApproverName("");
+					feeCenter.setApproveTime(null);
+					feeCenter.setAuditStatus("0");
+					feeCenter.setStlPid(null);
+					copyFeeCenterList.add(feeCenter);
+				}
+			}
+			if (ObjectUtils.isNotNull(copyFee) && "1".equals(copyCntr) && !preContainersList.isEmpty()) {
+				List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getPid().equals(item.getTemporaryId()))
+					.collect(Collectors.toList());
+				for (PreContainers containers : preContainers) {
+					containers.setId(null);
+					containers.setPid(item.getId());
+					containers.setCreateUser(AuthUtil.getUserId());
+					containers.setCreateUserName(AuthUtil.getUserName());
+					containers.setCreateDept(item.getCreateDept());
+					containers.setCreateDeptName(item.getCreateDeptName());
+					containers.setCreateTime(new Date());
+					copyPreContainersList.add(containers);
+				}
+			}
+		}
+		if (!copyFeeCenterList.isEmpty()) {
+			feeCenterService.saveBatch(copyFeeCenterList);
+		}
+		if (!copyPreContainersList.isEmpty()) {
+			preContainersService.saveBatch(copyPreContainersList);
+		}
+		if (!copySeaBillsDetailList.isEmpty()) {
+			seaBillsDetailService.saveBatch(copySeaBillsDetailList);
+		}
+		return R.data("操作成功");
+	}
+
 }