Browse Source

2023年12月26日08:40:40

纪新园 2 years ago
parent
commit
ef2e441faf

+ 6 - 10
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/fees/dto/BFeesExcel.java

@@ -20,6 +20,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -70,30 +71,25 @@ public class BFeesExcel implements Serializable {
 	@ExcelProperty(value = "收付,D:收 C 付")
 	private String dc;
 	/**
-	 * 财务核算要素 Id
-	 */
-	@ExcelProperty(value = "财务核算要素 Id")
-	private Long accElementId;
-	/**
 	 * 财务核算要素名称
 	 */
-	@ExcelProperty(value = "财务核算要素名称")
-	private Long accElementName;
+	@ExcelProperty(value = "财务核算要素名称(必填)")
+	private String accElementName;
 	/**
 	 * 科目 Id
 	 */
 	@ExcelProperty(value = "科目 Id")
-	private Long accId;
+	private String accId;
 	/**
 	 * 科目编号
 	 */
 	@ExcelProperty(value = "科目编号")
-	private Long accNo;
+	private String accNo;
 	/**
 	 * 科目全称
 	 */
 	@ExcelProperty(value = "科目全称")
-	private Long accFullName;
+	private String accFullName;
 
 	/**
 	 * 备注

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

@@ -141,7 +141,7 @@ public class BFees implements Serializable {
 	 * 科目 Id
 	 */
 	@ApiModelProperty(value = "科目 Id")
-	private Long accId;
+	private String accId;
 	/**
 	 * 科目编号
 	 */

+ 26 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/RegularUtils.java

@@ -0,0 +1,26 @@
+package org.springblade.los.Util;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/12/25
+ */
+public class RegularUtils {
+	public RegularUtils() {
+	}
+
+
+	/**
+	 * 字符串只允许出现英文字母
+	 *
+	 * @param data  内容
+	 * @return  结果
+	 */
+	public static Boolean regularEn(String data) {
+		String regex = "^[a-zA-Z0-9]+$";
+		Pattern pattern = Pattern.compile(regex);
+		return pattern.matcher(data).matches();
+	}
+
+}

+ 29 - 13
blade-service/blade-los/src/main/java/org/springblade/los/basic/cntr/service/impl/BCntrTypesServiceImpl.java

@@ -24,12 +24,12 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.los.basic.commodity.entity.BCommodity;
-import org.springblade.los.excel.BCntrTypesExcel;
+import org.springblade.los.Util.RegularUtils;
 import org.springblade.los.basic.cntr.entity.BCntrTypes;
 import org.springblade.los.basic.cntr.mapper.CntrTypesMapper;
 import org.springblade.los.basic.cntr.service.IBCntrTypesService;
 import org.springblade.los.basic.cntr.vo.BCntrTypesVO;
+import org.springblade.los.excel.BCntrTypesExcel;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 
@@ -92,23 +92,39 @@ public class BCntrTypesServiceImpl extends ServiceImpl<CntrTypesMapper, BCntrTyp
 			if (ObjectUtils.isNull(item.getCnName())) {
 				throw new RuntimeException("中文名称不能为空");
 			}
+			if (1 == item.getIsDanger() || 0 == item.getIsDanger()) {
+
+			} else {
+				throw new RuntimeException("是否危柜数据错误");
+			}
+			if (1 == item.getIsReefer() || 0 == item.getIsReefer()) {
+
+			} else {
+				throw new RuntimeException("是否冻柜数据错误");
+			}
+			if (1 == item.getIsGeneral() || 0 == item.getIsGeneral()) {
+
+			} else {
+				throw new RuntimeException("是否普柜数据错误");
+			}
+
 			BCntrTypes detail = baseMapper.selectOne(new LambdaQueryWrapper<BCntrTypes>()
 				.eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
 				.eq(BCntrTypes::getIsDeleted, 0)
 				.eq(BCntrTypes::getCnName, item.getCnName()));
 			if (detail == null) {
-			BeanUtil.copy(item, bCntrTypes);
-			bCntrTypes.setCreateTime(new Date());
-			bCntrTypes.setCreateUser(AuthUtil.getUserId());
-			bCntrTypes.setCreateUserName(AuthUtil.getUserName());
-			//获取部门ids对应中文名
-			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
-				bCntrTypes.setCreateDept(AuthUtil.getDeptId());
-				R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
-				if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
-					bCntrTypes.setCreateDeptName(String.join(",", res.getData()));
+				BeanUtil.copy(item, bCntrTypes);
+				bCntrTypes.setCreateTime(new Date());
+				bCntrTypes.setCreateUser(AuthUtil.getUserId());
+				bCntrTypes.setCreateUserName(AuthUtil.getUserName());
+				//获取部门ids对应中文名
+				if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+					bCntrTypes.setCreateDept(AuthUtil.getDeptId());
+					R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+					if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+						bCntrTypes.setCreateDeptName(String.join(",", res.getData()));
+					}
 				}
-			}
 			} else {
 				Long id = detail.getId();
 				BeanUtil.copy(item, bCntrTypes);

+ 21 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/service/impl/BFeesServiceImpl.java

@@ -25,6 +25,8 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.los.basic.acc.entity.BAccElements;
+import org.springblade.los.basic.acc.service.IBAccElementsService;
 import org.springblade.los.basic.fees.dto.BFeesExcel;
 import org.springblade.los.basic.fees.entity.BFees;
 import org.springblade.los.basic.fees.entity.BFeesTypes;
@@ -32,7 +34,6 @@ import org.springblade.los.basic.fees.mapper.FeesMapper;
 import org.springblade.los.basic.fees.service.IBFeesService;
 import org.springblade.los.basic.fees.service.IBFeesTypesService;
 import org.springblade.los.basic.fees.vo.BFeesVO;
-import org.springblade.los.basic.lines.entity.BLines;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -56,6 +57,8 @@ public class BFeesServiceImpl extends ServiceImpl<FeesMapper, BFees> implements
 
 	private final IBFeesTypesService bFeesTypesService;
 
+	private final IBAccElementsService bAccElementsService;
+
 	@Override
 	public IPage<BFeesVO> selectBFeesPage(IPage<BFeesVO> page, BFeesVO bFees) {
 		return page.setRecords(baseMapper.selectBFeesPage(page, bFees));
@@ -136,6 +139,23 @@ public class BFeesServiceImpl extends ServiceImpl<FeesMapper, BFees> implements
 			if (ObjectUtils.isNull(item.getCnName())) {
 				throw new RuntimeException("中文名称不能为空");
 			}
+			if (ObjectUtils.isNotNull(item.getAccElementName())) {
+				BAccElements bAccElements = bAccElementsService.getOne(new LambdaQueryWrapper<BAccElements>()
+					.eq(BAccElements::getCnName, item.getAccElementName())
+					.eq(BAccElements::getTenantId, AuthUtil.getTenantId())
+					.eq(BAccElements::getIsDeleted, 0)
+				);
+				if (bAccElements != null) {
+					bFees.setAccElementName(bAccElements.getCnName());
+					bFees.setAccElementId(bAccElements.getId());
+				} else {
+					throw new RuntimeException("财务核算要素未查到");
+				}
+			} else {
+				if (ObjectUtils.isNull(item.getCnName())) {
+					throw new RuntimeException("财务核算要素名称不能为空");
+				}
+			}
 			BFees detail = baseMapper.selectOne(new LambdaQueryWrapper<BFees>()
 				.eq(BFees::getTenantId, AuthUtil.getTenantId())
 				.eq(BFees::getIsDeleted, 0)

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

@@ -63,6 +63,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 
 	private final IBCurrencyService ibCurrencyService;
 
+
 	@Override
 	public IPage<ReportsVO> selectReportsPage(IPage<ReportsVO> page, ReportsVO reports) {
 		return page.setRecords(baseMapper.selectReportsPage(page, reports));
@@ -119,7 +120,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				} else {
 					bills.setGrossMargin(new BigDecimal("0.00"));
 				}
-				if (!"DD".equals(bills.getBillType())) {
+				if ("MM".equals(bills.getBillType())) {
 					List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
 						.eq(Bills::getMasterId, bills.getId())
 						.eq(Bills::getTenantId, AuthUtil.getTenantId())
@@ -139,16 +140,15 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								for (FeeCenter fee : feeCenterList) {
 									FeeCenterReports feeCenterReports = new FeeCenterReports();
 									feeCenterReports.setPid(item.getId());
-									feeCenterReports.setBillCorpCnName(item.getCorpCnName());
 									feeCenterReports.setFeeCnName(fee.getFeeCnName());
 
 									List<FeeCenter> feeCenterListD = feeCenterListMh.stream()
 										.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
-											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()))
 										.collect(Collectors.toList());
 									if (feeCenterListD.size() > 0) {
-										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
 										feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
 											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 										feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
@@ -156,11 +156,11 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									}
 									List<FeeCenter> feeCenterListUsdD = feeCenterListMh.stream()
 										.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
-											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()))
 										.collect(Collectors.toList());
 									if (feeCenterListUsdD.size() > 0) {
-										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
 										feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
 											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 										feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
@@ -168,7 +168,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									}
 									List<FeeCenter> feeCenterListC = feeCenterListMh.stream()
 										.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
-											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()))
 										.collect(Collectors.toList());
 									if (feeCenterListC.size() > 0) {
@@ -180,7 +180,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									}
 									List<FeeCenter> feeCenterListUsdC = feeCenterListMh.stream()
 										.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
-											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()))
 										.collect(Collectors.toList());
 									if (feeCenterListUsdC.size() > 0) {
@@ -197,76 +197,224 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							}
 						}
 					}
-				}
-				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
-					.eq(FeeCenter::getPid, bills.getId())
-					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-					.eq(FeeCenter::getIsDeleted, 0));
-				if (feeCenterList.size() > 0) {
-					List<FeeCenter> feeCenters = feeCenterList.stream()
-						.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
-							Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
-					List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
-					for (FeeCenter fee : feeCenters) {
-						FeeCenterReports feeCenterReports = new FeeCenterReports();
-						feeCenterReports.setPid(bills.getId());
-						feeCenterReports.setFeeCnName(fee.getFeeCnName());
+					List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+						.eq(FeeCenter::getPid, bills.getId())
+						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+						.eq(FeeCenter::getIsDeleted, 0));
+					if (feeCenterList.size() > 0) {
+						List<FeeCenter> feeCenters = feeCenterList.stream()
+							.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+								Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
+						List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+						for (FeeCenter fee : feeCenters) {
+							FeeCenterReports feeCenterReports = new FeeCenterReports();
+							feeCenterReports.setPid(bills.getId());
+							feeCenterReports.setFeeCnName(fee.getFeeCnName());
 
-						List<FeeCenter> feeCenterListD = feeCenterList.stream()
-							.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
-								e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
-								e.getCorpId().equals(fee.getCorpId()))
-							.collect(Collectors.toList());
-						if (feeCenterListD.size() > 0) {
-							feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
-							feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-							feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-						}
-						List<FeeCenter> feeCenterListUsdD = feeCenterList.stream()
-							.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
-								e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
-								e.getCorpId().equals(fee.getCorpId()))
-							.collect(Collectors.toList());
-						if (feeCenterListUsdD.size() > 0) {
-							feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
-							feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-							feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							List<FeeCenter> feeCenterListD = feeCenterList.stream()
+								.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListD.size() > 0) {
+								feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListUsdD = feeCenterList.stream()
+								.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListUsdD.size() > 0) {
+								feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListC = feeCenterList.stream()
+								.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListC.size() > 0) {
+								feeCenterReports.setCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListUsdC = feeCenterList.stream()
+								.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListUsdC.size() > 0) {
+								feeCenterReports.setCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							feeCenterReportList.add(feeCenterReports);
 						}
-						List<FeeCenter> feeCenterListC = feeCenterList.stream()
-							.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
-								e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
-								e.getCorpId().equals(fee.getCorpId()))
-							.collect(Collectors.toList());
-						if (feeCenterListC.size() > 0) {
-							feeCenterReports.setCorpCnName(fee.getCorpCnName());
-							feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-							feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						bills.setFeeCenterList(feeCenterReportList);
+					}
+					list.add(0,bills);
+				} else if ("MH".equals(bills.getBillType())) {
+					Bills details = billsService.getOne(new LambdaQueryWrapper<Bills>()
+						.eq(Bills::getId, bills.getMasterId())
+						.eq(Bills::getTenantId, AuthUtil.getTenantId())
+						.eq(Bills::getIsDeleted, 0));
+					if (details != null){
+						List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getPid, bills.getId())
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0));
+						if (feeCenterList.size() > 0) {
+							List<FeeCenter> feeCenters = feeCenterList.stream()
+								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+									Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
+							List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+							for (FeeCenter fee : feeCenters) {
+								FeeCenterReports feeCenterReports = new FeeCenterReports();
+								feeCenterReports.setPid(bills.getId());
+								feeCenterReports.setFeeCnName(fee.getFeeCnName());
+
+								List<FeeCenter> feeCenterListD = feeCenterList.stream()
+									.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+										e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+										e.getCorpId().equals(fee.getCorpId()))
+									.collect(Collectors.toList());
+								if (feeCenterListD.size() > 0) {
+									feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+									feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								}
+								List<FeeCenter> feeCenterListUsdD = feeCenterList.stream()
+									.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+										e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+										e.getCorpId().equals(fee.getCorpId()))
+									.collect(Collectors.toList());
+								if (feeCenterListUsdD.size() > 0) {
+									feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+									feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								}
+								List<FeeCenter> feeCenterListC = feeCenterList.stream()
+									.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+										e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+										e.getCorpId().equals(fee.getCorpId()))
+									.collect(Collectors.toList());
+								if (feeCenterListC.size() > 0) {
+									feeCenterReports.setCorpCnName(fee.getCorpCnName());
+									feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								}
+								List<FeeCenter> feeCenterListUsdC = feeCenterList.stream()
+									.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+										e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+										e.getCorpId().equals(fee.getCorpId()))
+									.collect(Collectors.toList());
+								if (feeCenterListUsdC.size() > 0) {
+									feeCenterReports.setCorpCnName(fee.getCorpCnName());
+									feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+										.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								}
+								feeCenterReportList.add(feeCenterReports);
+							}
+							bills.setFeeCenterList(feeCenterReportList);
 						}
-						List<FeeCenter> feeCenterListUsdC = feeCenterList.stream()
-							.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
-								e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
-								e.getCorpId().equals(fee.getCorpId()))
-							.collect(Collectors.toList());
-						if (feeCenterListUsdC.size() > 0) {
-							feeCenterReports.setCorpCnName(fee.getCorpCnName());
-							feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-							feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
-								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						list.add(bills);
+						List<FeeCenter> feeCenterListMh = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getPid, details.getId())
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0));
+						List<FeeCenter> feeCenterList1 = feeCenterListMh.stream()
+							.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+								Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
+						List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+						for (FeeCenter fee : feeCenterList1) {
+							FeeCenterReports feeCenterReports = new FeeCenterReports();
+							feeCenterReports.setPid(details.getId());
+							feeCenterReports.setFeeCnName(fee.getFeeCnName());
+
+							List<FeeCenter> feeCenterListD = feeCenterListMh.stream()
+								.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(details.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListD.size() > 0) {
+								feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListUsdD = feeCenterListMh.stream()
+								.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(details.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListUsdD.size() > 0) {
+								feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListC = feeCenterListMh.stream()
+								.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(details.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListC.size() > 0) {
+								feeCenterReports.setCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							List<FeeCenter> feeCenterListUsdC = feeCenterListMh.stream()
+								.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(details.getId()) &&
+									e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+									e.getCorpId().equals(fee.getCorpId()))
+								.collect(Collectors.toList());
+							if (feeCenterListUsdC.size() > 0) {
+								feeCenterReports.setCorpCnName(fee.getCorpCnName());
+								feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+								feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+									.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							}
+							feeCenterReportList.add(feeCenterReports);
 						}
-						feeCenterReportList.add(feeCenterReports);
+						details.setFeeCenterList(feeCenterReportList);
+						list.add(0,details);
 					}
-					bills.setFeeCenterList(feeCenterReportList);
 				}
-				list.add(0, bills);
+				map.put("data", list);
+			}
+		} else if ("业务".equals(reportCode) && "MASTER 提单".equals(groupCode)) {
+			Bills bills = billsService.getById(billId);
+			if (bills != null) {
+				bills.setFM("jms");
+				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				map.put("data", bills);
+			} else {
+				map.put("data", null);
 			}
-			map.put("data", list);
 		} else if ("单证".equals(reportCode) && "派车通知单".equals(groupCode)) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
@@ -326,8 +474,36 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(FeeCenter::getIsDeleted, 0));
 					}
 				}
+				BigDecimal amountDr = new BigDecimal("0.00");
+				BigDecimal amountCr = new BigDecimal("0.00");
+				BigDecimal amountProfit = new BigDecimal("0.00");
+				BigDecimal amountDrUsd = new BigDecimal("0.00");
+				BigDecimal amountCrUsd = new BigDecimal("0.00");
+				BigDecimal amountProfitUsd = new BigDecimal("0.00");
+				BigDecimal amountDrLoc = new BigDecimal("0.00");
+				BigDecimal amountCrLoc = new BigDecimal("0.00");
+				BigDecimal amountProfitLoc = new BigDecimal("0.00");
 				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
 				for (FeeCenter item : feeCenterList) {
+					if ("D".equals(item.getDc())) {
+						if ("USD".equals(item.getCurCode())) {
+							amountDrUsd = amountDrUsd.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountDr = amountDr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount());
+							amountDrUsd = amountDrUsd.add(usd);
+						}
+					} else {
+						if ("USD".equals(item.getCurCode())) {
+							amountCrUsd = amountCrUsd.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountCr = amountCr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount());
+							amountCrUsd = amountCrUsd.add(usd);
+						}
+					}
 					FeeCenterReports feeCenterReports = new FeeCenterReports();
 					feeCenterReports.setPid(item.getPid());
 					feeCenterReports.setCorpCnName(item.getCorpCnName());
@@ -344,6 +520,20 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				bills.setFeeCenterList(feeCenterReportsList);
+				amountProfit = amountDr.subtract(amountCr);
+				amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+				amountDrLoc = amountDrLoc.add(ibCurrencyService.converterCny("USD", amountDrUsd)).add(amountDr);
+				amountCrLoc = amountCrLoc.add(ibCurrencyService.converterCny("USD", amountCrUsd)).add(amountCr);
+				amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
+				bills.setAmountDr(amountDr);
+				bills.setAmountCr(amountCr);
+				bills.setAmountProfit(amountProfit);
+				bills.setAmountDrUsd(amountDrUsd);
+				bills.setAmountCrUsd(amountCrUsd);
+				bills.setAmountProfitUsd(amountProfitUsd);
+				bills.setAmountDrLoc(amountDrLoc);
+				bills.setAmountCrLoc(amountCrLoc);
+				bills.setAmountProfitLoc(amountProfitLoc);
 				List<BCorpsBank> bCorpsBanks = bankService.list(new LambdaQueryWrapper<BCorpsBank>()
 					.eq(BCorpsBank::getTenantId, AuthUtil.getTenantId())
 					.eq(BCorpsBank::getIsDeleted, 0)
@@ -399,8 +589,36 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(FeeCenter::getIsDeleted, 0));
 					}
 				}
+				BigDecimal amountDr = new BigDecimal("0.00");
+				BigDecimal amountCr = new BigDecimal("0.00");
+				BigDecimal amountProfit = new BigDecimal("0.00");
+				BigDecimal amountDrUsd = new BigDecimal("0.00");
+				BigDecimal amountCrUsd = new BigDecimal("0.00");
+				BigDecimal amountProfitUsd = new BigDecimal("0.00");
+				BigDecimal amountDrLoc = new BigDecimal("0.00");
+				BigDecimal amountCrLoc = new BigDecimal("0.00");
+				BigDecimal amountProfitLoc = new BigDecimal("0.00");
 				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
 				for (FeeCenter item : feeCenterList) {
+					if ("D".equals(item.getDc())) {
+						if ("USD".equals(item.getCurCode())) {
+							amountDrUsd = amountDrUsd.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountDr = amountDr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount());
+							amountDrUsd = amountDrUsd.add(usd);
+						}
+					} else {
+						if ("USD".equals(item.getCurCode())) {
+							amountCrUsd = amountCrUsd.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountCr = amountCr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount());
+							amountCrUsd = amountCrUsd.add(usd);
+						}
+					}
 					FeeCenterReports feeCenterReports = new FeeCenterReports();
 					feeCenterReports.setPid(item.getPid());
 					feeCenterReports.setCorpCnName(item.getCorpCnName());
@@ -417,6 +635,20 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				bills.setFeeCenterList(feeCenterReportsList);
+				amountProfit = amountDr.subtract(amountCr);
+				amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+				amountDrLoc = amountDrLoc.add(ibCurrencyService.converterCny("USD", amountDrUsd)).add(amountDr);
+				amountCrLoc = amountCrLoc.add(ibCurrencyService.converterCny("USD", amountCrUsd)).add(amountCr);
+				amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
+				bills.setAmountDr(amountDr);
+				bills.setAmountCr(amountCr);
+				bills.setAmountProfit(amountProfit);
+				bills.setAmountDrUsd(amountDrUsd);
+				bills.setAmountCrUsd(amountCrUsd);
+				bills.setAmountProfitUsd(amountProfitUsd);
+				bills.setAmountDrLoc(amountDrLoc);
+				bills.setAmountCrLoc(amountCrLoc);
+				bills.setAmountProfitLoc(amountProfitLoc);
 				map.put("data", bills);
 			} else {
 				map.put("data", null);

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

@@ -784,6 +784,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			throw new SecurityException("审批通过失败");
 		}
 		bills.setStatus(3);
+		bills.setBillStatus(2);
 		baseMapper.updateById(bills);
 		List<FeeCenter> feeCenterList = new ArrayList<>();
 		feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
@@ -1175,6 +1176,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		filesCenter.setMblno(details.getMblno());
 		filesCenter.setHblno(details.getHblno());
 		filesCenter.setBillNo(details.getBillNo());
+		filesCenter.setBranchId(details.getBranchId());
 		filesCenter.setCreateDept(details.getCreateDept());
 		filesCenter.setCreateTime(details.getCreateTime());
 		filesCenter.setCreateDeptName(details.getCreateDeptName());

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/edi/api/EDISender.java

@@ -25,7 +25,7 @@ public class EDISender {
 			SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmmss");
 			Date date = new Date();
 			//生成edi文件
-//			File file = new File("/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", "edi.txt");
+//			File file = new File("/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", sdf1.format(date) +"-edi.txt");
 			File file = new File("D:/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", sdf1.format(date) + "-edi.text");
 			file.createNewFile();
 			// 打开文件输出流进行写入操作

+ 5 - 16
blade-service/blade-los/src/main/java/org/springblade/los/excel/BCntrTypesExcel.java

@@ -39,26 +39,15 @@ public class BCntrTypesExcel implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 
-
-	/**
-	 * 箱型 ISO 代码,20GP,40HC etc.
-	 */
-	@ExcelProperty(value = "箱型 ISO 代码(必填)")
-	private String code;
-	/**
-	 * 箱型 95 码,22G1, 45R1 etc.
-	 */
-	@ExcelProperty(value = "箱型 95 码")
-	private String code95;
 	/**
 	 * 海关代码
 	 */
-	@ExcelProperty(value = "海关代码")
+	@ExcelProperty(value = "海关代码(必填)")
 	private String customsCode;
 	/**
 	 * 箱型 GP, HC, COLOAD etc.
 	 */
-	@ExcelProperty(value = "箱型(必填)")
+	@ExcelProperty(value = "箱型")
 	private String cntrType;
 	/**
 	 * 尺码 V20, V40, COLOAD etc.
@@ -73,7 +62,7 @@ public class BCntrTypesExcel implements Serializable {
 	/**
 	 * 英文名称
 	 */
-	@ExcelProperty(value = "英文名称")
+	@ExcelProperty(value = "英文名称(必填)")
 	private String enName;
 	/**
 	 * 皮重 KGS
@@ -83,12 +72,12 @@ public class BCntrTypesExcel implements Serializable {
 	/**
 	 * 净重,即货重 KGS
 	 */
-	@ExcelProperty(value = "净重,即货重 KGS")
+	@ExcelProperty(value = "净重")
 	private BigDecimal netWeight;
 	/**
 	 * 毛重,即最大总重 KGS
 	 */
-	@ExcelProperty(value = "毛重,即最大总重 KGS")
+	@ExcelProperty(value = "毛重")
 	private BigDecimal grossWeight;
 	/**
 	 * 体积 CBM

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/excel/BUnitsExcel.java

@@ -68,7 +68,7 @@ public class BUnitsExcel implements Serializable {
 	/**
 	 * quantity_rule=FIXED 时,默认的数量
 	 */
-	@ExcelProperty(value = "quantity_rule=FIXED 时,默认的数量")
+	@ExcelProperty(value = "默认的数量")
 	private BigDecimal quantity;
 
 	/**

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

@@ -32,7 +32,9 @@ import org.springblade.los.basic.cur.service.IBCurrencyService;
 import org.springblade.los.basic.fees.entity.FeesTemplateItems;
 import org.springblade.los.basic.fees.entity.LosBFeesTemplate;
 import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.PreContainers;
 import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.business.sea.service.IPreContainersService;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
@@ -68,6 +70,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 
 	private final IBCorpsService bCorpsService;
 
+	private final IPreContainersService preContainersService;
+
 	@Override
 	public IPage<FeeCenterVO> selectFeeCenterPage(IPage<FeeCenterVO> page, FeeCenterVO feeCenter) {
 		return page.setRecords(baseMapper.selectFeeCenterPage(page, feeCenter));
@@ -165,6 +169,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		if (bills == null) {
 			throw new RuntimeException("未找到主表信息");
 		}
+		List<PreContainers> preContainers = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
+			.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+			.eq(PreContainers::getIsDeleted, 0)
+			.eq(PreContainers::getPid, bills.getId()));
 		if (losBFeesTemplate.getFeesTemplateItemsList().size() > 0) {
 			String code = losBFeesTemplate.getFeesTemplateItemsList().stream().map(FeesTemplateItems::getCurCode).distinct().collect(Collectors.joining());
 			List<BCurrency> bCurrency = currencyMapper.selectList(new LambdaQueryWrapper<BCurrency>()
@@ -228,30 +236,92 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						feeCenter.setExrate(currency.getExrate());
 					}
 				}
-				if ("20GP".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(new BigDecimal((ObjectUtils.isNotNull(bills.getQuantityV20()) ? bills.getQuantityV20() : 0) + ""));
-					feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("40GP".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(new BigDecimal((ObjectUtils.isNotNull(bills.getQuantityV40()) ? bills.getQuantityV40() : 0) + ""));
-					feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("40HC".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(new BigDecimal((ObjectUtils.isNotNull(bills.getQuantityV40hc()) ? bills.getQuantityV40hc() : 0) + ""));
-					feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("45GP".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(new BigDecimal((ObjectUtils.isNotNull(bills.getQuantityV45()) ? bills.getQuantityV45() : 0) + ""));
-					feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("48GP".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(new BigDecimal((ObjectUtils.isNotNull(bills.getQuantityV48()) ? bills.getQuantityV48() : 0) + ""));
-					feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("TON".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(bills.getGrossWeight());
-					feeCenter.setAmount(items.getPrice().multiply(bills.getGrossWeight()));
-				} else if ("PKGS".equals(items.getUnitNo())) {
-					feeCenter.setQuantity(bills.getQuantity());
-					feeCenter.setAmount(items.getPrice().multiply(bills.getQuantity()));
+				if ("1".equals(items.getQuantityRule())) {
+					if (preContainers.size() == 0) {
+						continue;
+					}
+					if ("20GP".equals(items.getUnitNo())) {
+						Integer quantity = preContainers.stream().filter(e -> "20GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("40GP".equals(items.getUnitNo())) {
+						Integer quantity = preContainers.stream().filter(e -> "40GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("40HC".equals(items.getUnitNo())) {
+						Integer quantity = preContainers.stream().filter(e -> "40HC".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("45GP".equals(items.getUnitNo())) {
+						Integer quantity = preContainers.stream().filter(e -> "45GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("48GP".equals(items.getUnitNo())) {
+						Integer quantity = preContainers.stream().filter(e -> "48GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					}
+				} else if ("2".equals(items.getQuantityRule())) {
+					if ("JOB".equals(items.getUnitNo())) {
+						feeCenter.setQuantity(new BigDecimal("1"));
+						feeCenter.setAmount(items.getPrice().multiply(new BigDecimal("1")));
+					}else{
+						continue;
+					}
+				} else if ("3".equals(items.getQuantityRule())) {
+					if ("KGS".equals(items.getUnitNo())) {
+						feeCenter.setQuantity(bills.getGrossWeight());
+						feeCenter.setAmount(items.getPrice().multiply(bills.getGrossWeight()));
+					}else{
+						continue;
+					}
+				} else if ("4".equals(items.getQuantityRule())) {
+					if (preContainers.size() == 0) {
+						continue;
+					}
+					if ("TEU".equals(items.getUnitNo())) {
+						BigDecimal quantity20GP = preContainers.stream().filter(e -> "20GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+						BigDecimal quantity40GP = preContainers.stream().filter(e -> "40GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+						BigDecimal quantity40HC = preContainers.stream().filter(e -> "40HC".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+						BigDecimal quantity45GP = preContainers.stream().filter(e -> "45GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+						BigDecimal quantity48GP = preContainers.stream().filter(e -> "48GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+						BigDecimal  quantity = quantity20GP.add(quantity40GP).add(quantity40HC).add(quantity45GP).add(quantity48GP);
+						if (quantity.compareTo(new BigDecimal("0")) == 0) {
+							continue;
+						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					}
+				} else if ("5".equals(items.getQuantityRule())) {
+					if ("CBM".equals(items.getUnitNo())) {
+						feeCenter.setQuantity(bills.getMeasurement());
+						feeCenter.setAmount(items.getPrice().multiply(bills.getMeasurement()));
+					}else{
+						continue;
+					}
 				} else {
-					feeCenter.setQuantity(bills.getMeasurement());
-					feeCenter.setAmount(items.getPrice().multiply(bills.getMeasurement()));
+					feeCenter.setQuantity(new BigDecimal("1"));
+					feeCenter.setAmount(items.getPrice().multiply(new BigDecimal("1")));
 				}
 				list.add(feeCenter);
 			}
@@ -339,7 +409,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 	}
 
 	@Override
-	public List<BCorps> getFeeCenterCorpIds(Long billId,String dc) {
+	public List<BCorps> getFeeCenterCorpIds(Long billId, String dc) {
 		Bills bills = billsMapper.selectById(billId);
 		List<Long> corpIds = new ArrayList<>();
 		if (bills != null) {

+ 6 - 4
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java

@@ -475,7 +475,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 			throw new RuntimeException("缺少必要参数");
 		}
 		FinInvoices detail = baseMapper.selectById(finInvoices.getId());
-		if (ObjectUtils.isNotNull(finInvoices.getFinInvoicesItemsList())) {
+		/*if (ObjectUtils.isNotNull(finInvoices.getFinInvoicesItemsList())) {
 			//审批数据
 			LosAuditProecessDTO auditProecessDTO = new LosAuditProecessDTO();
 			//获取审批级次
@@ -537,7 +537,8 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				}
 			}
 			detail.setStatus(1);
-		}
+		}*/
+		detail.setStatus(3);
 		baseMapper.updateById(detail);
 		return R.data(detail);
 	}
@@ -548,7 +549,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 			throw new RuntimeException("缺少必要参数");
 		}
 		FinInvoices detail = baseMapper.selectById(finInvoices.getId());
-		if (ObjectUtils.isNotNull(finInvoices.getFinInvoicesItemsList())) {
+	/*	if (ObjectUtils.isNotNull(finInvoices.getFinInvoicesItemsList())) {
 			if (detail.getStatus() > 1) {
 				throw new RuntimeException("正在审核中,撤销失败");
 			}
@@ -557,7 +558,8 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				throw new SecurityException("操作失败,请联系管理员");
 			}
 			detail.setStatus(0);
-		}
+		}*/
+		detail.setStatus(0);
 		baseMapper.updateById(detail);
 		return R.data(detail);
 	}