纪新园 1 год назад
Родитель
Сommit
43ce980ff0

+ 84 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/customsDeclaration/entity/CustomsDeclaration.java

@@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.los.business.files.entity.FilesCenter;
+import org.springblade.los.business.sea.dto.ContainersReports;
+import org.springblade.los.finance.fee.dto.FeeCenterReports;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -671,5 +673,87 @@ public class CustomsDeclaration implements Serializable {
 	@TableField(exist = false)
 	private List<CustomsDeclarationGoods> customsDeclarationGoodsList;
 
+	@TableField(exist = false)
+	private String FM;
+
+	/**
+	 * 账户银行
+	 */
+	@TableField(exist = false)
+	private String accountBank;
+	/**
+	 * 银行账号
+	 */
+	@TableField(exist = false)
+	private String accountNo;
+
+	/**
+	 * 地址
+	 */
+	@TableField(exist = false)
+	private String address;
+	/**
+	 * Swift Code
+	 */
+	@TableField(exist = false)
+	private String swiftCode;
+
+	/**
+	 * Swift Code
+	 */
+	@TableField(exist = false)
+	private BigDecimal boxWeightSum;
+	/**
+	 * 本位币利润(CNY)
+	 */
+	@TableField(exist = false)
+	private BigDecimal amountProfitUpdate;
+	/**
+	 * 利润(USD)
+	 */
+	@TableField(exist = false)
+	private BigDecimal amountProfitUsdUpdate;
+	/**
+	 * 综合利润(CNY)
+	 */
+	@TableField(exist = false)
+	private BigDecimal amountProfitLocUpdate;
+
+	/**
+	 * 责任方
+	 */
+	@TableField(exist = false)
+	private String responsibleParty;
+
+	/**
+	 * analysis
+	 */
+	@TableField(exist = false)
+	private String analysis;
+
+	/**
+	 * 利润率
+	 */
+	@TableField(exist = false)
+	private String profitMargin;
+
+	/**
+	 * 毛利率
+	 */
+	@TableField(exist = false)
+	private BigDecimal grossMargin;
+
+	/**
+	 * 汇率
+	 */
+	@TableField(exist = false)
+	private BigDecimal rate;
+
+	/**
+	 * 物流-费用中心(总)
+	 */
+	@TableField(exist = false)
+	private List<FeeCenterReports> feeCenterList;
+
 
 }

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

@@ -106,6 +106,11 @@ public class PreContainers implements Serializable {
 	@ApiModelProperty(value = "TEU")
 	private BigDecimal teu;
 	/**
+	 * 件数
+	 */
+	@ApiModelProperty(value = "件数")
+	private BigDecimal number;
+	/**
 	 * 集装箱箱量
 	 */
 	@ApiModelProperty(value = "集装箱箱量")

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

@@ -7,7 +7,10 @@ package org.springblade.los.Util;
 public class MagicValues {
 
 	public static final String BUSINESS = "业务";
-
+	public static final String HYCKBG = "海运出口报关";
+	public static final String HYJKBG = "海运进口报关";
+	public static final String KYCKBG = "空运出口报关";
+	public static final String KYJKBG = "空运进口报关";
 	public static final String DOCUMENT = "单证";
 	public static final String COST = "费用";
 	public static final String PAID_APPLICATION = "付费申请";
@@ -38,6 +41,10 @@ public class MagicValues {
 	public static final String SI = "SI";
 	public static final String AE = "AE";
 	public static final String AI = "AI";
+	public static final String BGSE = "BGSE";
+	public static final String BGSI = "BGSI";
+	public static final String BGAE = "BGAE";
+	public static final String BGAI = "BGAI";
 	public static final String USD = "USD";
 	public static final String CNY = "CNY";
 	public static final String D = "D";

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

@@ -39,6 +39,8 @@ import org.springblade.los.business.aea.entity.AeaBills;
 import org.springblade.los.business.aea.service.IAeaBillsService;
 import org.springblade.los.business.amends.entity.Amends;
 import org.springblade.los.business.amends.service.IAmendsService;
+import org.springblade.los.business.customsDeclaration.entity.CustomsDeclaration;
+import org.springblade.los.business.customsDeclaration.service.ICustomsDeclarationService;
 import org.springblade.los.business.sea.dto.ContainersReports;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.entity.Containers;
@@ -89,6 +91,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 
 	private final IAeaBillsService aeaBillsService;
 
+	private final ICustomsDeclarationService customsDeclarationService;
+
 	private final IBCorpsBankService bankService;
 
 	private final IFeeCenterService feeCenterService;
@@ -3649,6 +3653,333 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
+		} else if ((MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))
+			&& MagicValues.SALES_REPORT.equals(groupCode)
+			&& (MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))) {
+			List<CustomsDeclaration> list = new ArrayList<>();
+			CustomsDeclaration bills = customsDeclarationService.getById(billId);
+			if (bills != null) {
+				if (bCurrency != null) {
+					bills.setRate(bCurrency.getExrate());
+				} else {
+					bills.setRate(new BigDecimal(MagicValues.ZERO));
+				}
+				if (ObjectUtils.isNotNull(bills.getAmountProfitLoc()) && ObjectUtils.isNotNull(bills.getAmountDrLoc())) {
+					if (bills.getAmountProfitLoc().compareTo(new BigDecimal(MagicValues.ZERO)) == 0 ||
+						bills.getAmountDrLoc().compareTo(new BigDecimal(MagicValues.ZERO)) == 0) {
+						bills.setGrossMargin(new BigDecimal(MagicValues.ZERO));
+					} else {
+						bills.setGrossMargin(bills.getAmountProfitLoc().divide(bills.getAmountDrLoc(), 4, BigDecimal.ROUND_HALF_UP));
+					}
+				} else {
+					bills.setGrossMargin(new BigDecimal(MagicValues.ZERO));
+				}
+				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());
+						feeCenterReports.setDc(fee.getDc());
+						List<FeeCenter> feeCenterListD = feeCenterList.stream()
+							.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && MagicValues.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 -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && MagicValues.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 -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && MagicValues.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 -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && MagicValues.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.add(0, bills);
+				if (list.size() > 0) {
+					for (CustomsDeclaration item : list) {
+						List<FeeCenterReports> feeCenterReports = new ArrayList<>();
+						List<FeeCenterReports> feeCenterReportsD = item.getFeeCenterList().stream()
+							.filter(e -> MagicValues.D.equals(e.getDc())).collect(Collectors.toList()) == null ? new ArrayList<>() :
+							item.getFeeCenterList().stream().filter(e -> MagicValues.D.equals(e.getDc())).collect(Collectors.toList());
+						List<FeeCenterReports> feeCenterReportsC = item.getFeeCenterList().stream()
+							.filter(e -> MagicValues.C.equals(e.getDc())).collect(Collectors.toList()) == null ? new ArrayList<>() :
+							item.getFeeCenterList().stream().filter(e -> MagicValues.C.equals(e.getDc())).collect(Collectors.toList());
+						List<FeeCenterReports> feeCentersD = feeCenterReportsD.stream()
+							.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+								Comparator.comparing(e -> e.getFeeCnName() + e.getBillCorpCnName()))), ArrayList::new));
+						List<FeeCenterReports> feeCentersC = feeCenterReportsC.stream()
+							.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+								Comparator.comparing(e -> e.getFeeCnName() + e.getCorpCnName()))), ArrayList::new));
+						int countD = 0;
+						int countC = 0;
+						for (int i = 0; i < feeCentersD.size(); i++) {
+							FeeCenterReports feeCenterReports1 = new FeeCenterReports();
+							feeCenterReports1.setFeeCnName(feeCentersD.get(i).getFeeCnName());
+							feeCenterReports1.setHblno(feeCentersD.get(i).getHblno());
+							feeCenterReports1.setPid(feeCentersD.get(i).getPid());
+							int finalI = i;
+							FeeCenterReports feeCenterC = feeCenterReportsC.stream()
+								.filter(e -> e.getFeeCnName().equals(feeCentersD.get(finalI).getFeeCnName()) && !"1".equals(e.getMark())).findFirst().orElse(null);
+							feeCenterReports1.setBillCorpCnName(feeCentersD.get(i).getBillCorpCnName());
+							feeCenterReports1.setAmountD(feeCentersD.get(i).getAmountD());
+							feeCenterReports1.setAmountLocD(feeCentersD.get(i).getAmountLocD());
+							feeCenterReports1.setAmountUsdD(feeCentersD.get(i).getAmountUsdD());
+							if (feeCenterC != null) {
+								feeCenterC.setMark("1");
+								feeCenterReports1.setCorpCnName(feeCenterC.getCorpCnName());
+								feeCenterReports1.setAmountC(feeCenterC.getAmountC());
+								feeCenterReports1.setAmountLocC(feeCenterC.getAmountLocC());
+								feeCenterReports1.setAmountUsdC(feeCenterC.getAmountUsdC());
+								countC++;
+							}
+							feeCenterReports.add(feeCenterReports1);
+						}
+						if (countC < feeCenterReportsC.size()) {
+							List<String> corps = feeCenterReports.stream().map(FeeCenterReports::getCorpCnName).collect(Collectors.toList());
+							List<FeeCenterReports> feeCe = feeCenterReportsC.stream().filter(e -> !corps.contains(e.getCorpCnName())).collect(Collectors.toList());
+							for (FeeCenterReports i : feeCe) {
+								FeeCenterReports feeCenterReports1 = new FeeCenterReports();
+								feeCenterReports1.setFeeCnName(i.getFeeCnName());
+								feeCenterReports1.setHblno(i.getHblno());
+								feeCenterReports1.setPid(i.getPid());
+								feeCenterReports1.setCorpCnName(i.getCorpCnName());
+								feeCenterReports1.setAmountC(i.getAmountC());
+								feeCenterReports1.setAmountLocC(i.getAmountLocC());
+								feeCenterReports1.setAmountUsdC(i.getAmountUsdC());
+								feeCenterReports.add(feeCenterReports1);
+							}
+						}
+						item.setFeeCenterList(feeCenterReports);
+					}
+				}
+				map.put(MagicValues.DATA, list);
+			}
+		} else if ((MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))
+			&& MagicValues.RECEIVABLE.equals(groupCode)
+			&& (MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))) {
+			CustomsDeclaration bills = customsDeclarationService.getById(billId);
+			if (bills != null) {
+//				bills.setFM(MagicValues.FM);
+//				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				List<FeeCenter> feeCenterList;
+				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getDc, MagicValues.D)
+					.eq(FeeCenter::getIsDeleted, 0);
+				lambdaQueryWrapper.eq(FeeCenter::getPid, bills.getId());
+				if (ObjectUtils.isNotNull(corpIds)) {
+					lambdaQueryWrapper.eq(FeeCenter::getCorpId, corpIds);
+				} else {
+					if (ObjectUtils.isNotNull(itemIds)) {
+						lambdaQueryWrapper.apply("find_in_set(id,'" + itemIds + "')");
+					}
+				}
+				feeCenterList = feeCenterService.list(lambdaQueryWrapper);
+				BigDecimal amountDr = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCr = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfit;
+				BigDecimal amountDrUsd = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCrUsd = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfitUsd;
+				BigDecimal amountDrLoc = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCrLoc = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfitLoc;
+				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
+				for (FeeCenter item : feeCenterList) {
+					if (MagicValues.D.equals(item.getDc())) {
+						if (MagicValues.USD.equals(item.getCurCode())) {
+							amountDrUsd = amountDrUsd.add(item.getAmount());
+						} else if (MagicValues.CNY.equals(item.getCurCode())) {
+							amountDr = amountDr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountDrUsd = amountDrUsd.add(usd);
+						}
+					} else {
+						if (MagicValues.USD.equals(item.getCurCode())) {
+							amountCrUsd = amountCrUsd.add(item.getAmount());
+						} else if (MagicValues.CNY.equals(item.getCurCode())) {
+							amountCr = amountCr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountCrUsd = amountCrUsd.add(usd);
+						}
+					}
+					FeeCenterReports feeCenterReports = new FeeCenterReports();
+					feeCenterReports.setPid(item.getPid());
+					feeCenterReports.setCorpCnName(item.getCorpCnName());
+					feeCenterReports.setBillCorpCnName(item.getBillCorpCnName());
+					feeCenterReports.setFeeCnName(item.getFeeCnName());
+					if (MagicValues.CNY.equals(item.getCurCode())) {
+						feeCenterReports.setAmountD(item.getAmount());
+					} else {
+						feeCenterReports.setAmountUsdD(item.getAmount());
+					}
+					feeCenterReports.setAmountLocD(item.getAmountLoc());
+					feeCenterReports.setHblno(item.getHblno());
+					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getAmount());
+					feeCenterReportsList.add(feeCenterReports);
+				}
+				bills.setFeeCenterList(feeCenterReportsList);
+				amountProfit = amountDr.subtract(amountCr);
+				amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+				amountDrLoc = amountDrLoc.add(ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D)).add(amountDr);
+				amountCrLoc = amountCrLoc.add(ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C)).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)
+					.eq(BCorpsBank::getPid, bills.getCorpId()));
+				if (bCorpsBanks.size() > 0) {
+					bills.setAccountBank(bCorpsBanks.get(0).getAccountBank());
+					bills.setAccountNo(bCorpsBanks.get(0).getAccountNo());
+					bills.setAddress(bCorpsBanks.get(0).getAddress());
+					bills.setSwiftCode(bCorpsBanks.get(0).getSwiftCode());
+				}
+				map.put(MagicValues.DATA, bills);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
+		} else if ((MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))
+			&& MagicValues.MEET.equals(groupCode)
+			&& (MagicValues.BGSE.equals(type) || MagicValues.BGSI.equals(type) || MagicValues.BGAE.equals(type) || MagicValues.BGAI.equals(type))) {
+			CustomsDeclaration bills = customsDeclarationService.getById(billId);
+			if (bills != null) {
+//				bills.setFM(MagicValues.FM);
+//				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				List<FeeCenter> feeCenterList;
+				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getDc, MagicValues.C)
+					.eq(FeeCenter::getIsDeleted, 0);
+				lambdaQueryWrapper.eq(FeeCenter::getPid,  bills.getId());
+				if (ObjectUtils.isNotNull(corpIds)) {
+					lambdaQueryWrapper.eq(FeeCenter::getCorpId, corpIds);
+				} else {
+					if (ObjectUtils.isNotNull(itemIds)) {
+						lambdaQueryWrapper.apply("find_in_set(id,'" + itemIds + "')");
+					}
+				}
+				feeCenterList = feeCenterService.list(lambdaQueryWrapper);
+				BigDecimal amountDr = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCr = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfit;
+				BigDecimal amountDrUsd = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCrUsd = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfitUsd;
+				BigDecimal amountDrLoc = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountCrLoc = new BigDecimal(MagicValues.ZERO);
+				BigDecimal amountProfitLoc;
+				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
+				for (FeeCenter item : feeCenterList) {
+					if (MagicValues.D.equals(item.getDc())) {
+						if (MagicValues.USD.equals(item.getCurCode())) {
+							amountDrUsd = amountDrUsd.add(item.getAmount());
+						} else if (MagicValues.CNY.equals(item.getCurCode())) {
+							amountDr = amountDr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountDrUsd = amountDrUsd.add(usd);
+						}
+					} else {
+						if (MagicValues.USD.equals(item.getCurCode())) {
+							amountCrUsd = amountCrUsd.add(item.getAmount());
+						} else if (MagicValues.CNY.equals(item.getCurCode())) {
+							amountCr = amountCr.add(item.getAmount());
+						} else {
+							BigDecimal usd = ibCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountCrUsd = amountCrUsd.add(usd);
+						}
+					}
+					FeeCenterReports feeCenterReports = new FeeCenterReports();
+					feeCenterReports.setPid(item.getPid());
+					feeCenterReports.setCorpCnName(item.getCorpCnName());
+					feeCenterReports.setBillCorpCnName(item.getBillCorpCnName());
+					feeCenterReports.setFeeCnName(item.getFeeCnName());
+					if (MagicValues.CNY.equals(item.getCurCode())) {
+						feeCenterReports.setAmountC(item.getAmount());
+					} else {
+						feeCenterReports.setAmountUsdC(item.getAmount());
+					}
+					feeCenterReports.setAmountLocC(item.getAmountLoc());
+					feeCenterReports.setHblno(item.getHblno());
+					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getAmount());
+					feeCenterReportsList.add(feeCenterReports);
+				}
+				bills.setFeeCenterList(feeCenterReportsList);
+				amountProfit = amountDr.subtract(amountCr);
+				amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+				amountDrLoc = amountDrLoc.add(ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D)).add(amountDr);
+				amountCrLoc = amountCrLoc.add(ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C)).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(MagicValues.DATA, bills);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
 		}
 		return R.data(map);
 	}

+ 9 - 5
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java

@@ -101,7 +101,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	public R submit(AeaBills aeaBills) {
 		String deptId = "";
 		String deptName = "";
-		String branchId = deptUtils.getDeptPid()+"";
+		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
 			deptId = AuthUtil.getDeptId();
@@ -121,8 +121,10 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			));
 		if (aeaBills.getId() == null) {
 			if ("MH".equals(aeaBills.getBillType())) {
-				if (count.size() > 0) {
-					throw new RuntimeException("提单号不允许重复");
+				if (ObjectUtils.isNotNull(aeaBills.getMblno())) {
+					if (count.size() > 0) {
+						throw new RuntimeException("提单号不允许重复");
+					}
 				}
 			}
 			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
@@ -153,8 +155,10 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 		} else {
 			List<Long> ids = count.stream().map(AeaBills::getId).distinct().collect(Collectors.toList());
 			if ("MH".equals(aeaBills.getBillType())) {
-				if (count.size() > 0 && !ids.contains(aeaBills.getId())) {
-					throw new RuntimeException("提单号不允许重复");
+				if (ObjectUtils.isNotNull(aeaBills.getMblno())) {
+					if (count.size() > 0 && !ids.contains(aeaBills.getId())) {
+						throw new RuntimeException("提单号不允许重复");
+					}
 				}
 			}
 			aeaBills.setUpdateUser(AuthUtil.getUserId());

+ 25 - 9
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/controller/CustomsDeclarationController.java

@@ -16,25 +16,27 @@
  */
 package org.springblade.los.business.customsDeclaration.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.validation.Valid;
-
 import org.springblade.common.annotation.RepeatSubmit;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.los.business.customsDeclaration.entity.CustomsDeclaration;
-import org.springblade.los.business.customsDeclaration.vo.CustomsDeclarationVO;
 import org.springblade.los.business.customsDeclaration.service.ICustomsDeclarationService;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.los.business.customsDeclaration.vo.CustomsDeclarationVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
 
 /**
  * 业务-报关 控制器
@@ -68,7 +70,21 @@ public class CustomsDeclarationController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入customsDeclaration")
 	public R<IPage<CustomsDeclaration>> list(CustomsDeclaration customsDeclaration, Query query) {
-		IPage<CustomsDeclaration> pages = customsDeclarationService.page(Condition.getPage(query), Condition.getQueryWrapper(customsDeclaration));
+		LambdaQueryWrapper<CustomsDeclaration> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(CustomsDeclaration::getIsDeleted, 0)
+			.eq(CustomsDeclaration::getTenantId, AuthUtil.getTenantId())
+			.eq(CustomsDeclaration::getBusinessType, customsDeclaration.getBusinessType())
+			.eq(ObjectUtils.isNotNull(customsDeclaration.getSeaType()),CustomsDeclaration::getSeaType, customsDeclaration.getSeaType())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getBillNo()),CustomsDeclaration::getBillNo, customsDeclaration.getBillNo())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getBookingNo()),CustomsDeclaration::getBookingNo, customsDeclaration.getBookingNo())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getMblno()),CustomsDeclaration::getMblno, customsDeclaration.getMblno())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getCustomsDeclarationNumber()),CustomsDeclaration::getCustomsDeclarationNumber, customsDeclaration.getCustomsDeclarationNumber())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getContractAgreementNumber()),CustomsDeclaration::getContractAgreementNumber, customsDeclaration.getContractAgreementNumber())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getRefno()),CustomsDeclaration::getRefno, customsDeclaration.getRefno())
+			.like(ObjectUtils.isNotNull(customsDeclaration.getCorpCnName()),CustomsDeclaration::getCorpCnName, customsDeclaration.getCorpCnName())
+			.orderByDesc(CustomsDeclaration::getCreateTime)
+		;
+		IPage<CustomsDeclaration> pages = customsDeclarationService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
 	}
 

+ 12 - 8
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/service/impl/CustomsDeclarationServiceImpl.java

@@ -149,11 +149,15 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
 			.eq(CustomsDeclaration::getCreateDept, AuthUtil.getDeptId())
 			.eq(CustomsDeclaration::getTenantId, AuthUtil.getTenantId())
 			.eq(CustomsDeclaration::getIsDeleted, 0)
+			.eq(CustomsDeclaration::getSeaType, customsDeclaration.getSeaType())
+			.eq(CustomsDeclaration::getBusinessType, customsDeclaration.getBusinessType())
 			.eq(CustomsDeclaration::getMblno, customsDeclaration.getMblno()
 			));
 		if (customsDeclaration.getId() == null) {
-			if (count.size() > 0) {
-				throw new RuntimeException("提单号不允许重复");
+			if (ObjectUtils.isNotNull(customsDeclaration.getMblno())) {
+				if (count.size() > 0) {
+					throw new RuntimeException("提单号不允许重复");
+				}
 			}
 			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
@@ -182,8 +186,10 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
 			}
 		} else {
 			List<Long> ids = count.stream().map(CustomsDeclaration::getId).distinct().collect(Collectors.toList());
-			if (count.size() > 0 && !ids.contains(customsDeclaration.getId())) {
-				throw new RuntimeException("提单号不允许重复");
+			if (ObjectUtils.isNotNull(customsDeclaration.getMblno())) {
+				if (count.size() > 0 && !ids.contains(customsDeclaration.getId())) {
+					throw new RuntimeException("提单号不允许重复");
+				}
 			}
 			customsDeclaration.setUpdateUser(AuthUtil.getUserId());
 			customsDeclaration.setUpdateTime(new Date());
@@ -301,13 +307,11 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
 			actId = 1119;
 			processType = "海运进口报关审核";
 			checkType = "BGSI";
-		}
-		else if ("BGAE".equals(declare.getBusinessType())) {
+		} else if ("BGAE".equals(declare.getBusinessType())) {
 			actId = 1120;
 			processType = "空运出口报关审核";
 			checkType = "BGAE";
-		}
-		else if ("BGAI".equals(declare.getBusinessType())) {
+		} else if ("BGAI".equals(declare.getBusinessType())) {
 			actId = 1121;
 			processType = "空运进口报关审核";
 			checkType = "BGAI";

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

@@ -117,7 +117,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	public R submit(Bills bills) {
 		String deptId = "";
 		String deptName = "";
-		String branchId = deptUtils.getDeptPid()+"";
+		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
 			deptId = AuthUtil.getDeptId();
@@ -143,8 +143,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		}
 		if (bills.getId() == null) {
 			if (!"MH".equals(bills.getBillType())) {
-				if (count.size() > 0) {
-					throw new RuntimeException("提单号不允许重复:"+bills.getMblno());
+				if (ObjectUtils.isNotNull(bills.getMblno())) {
+					if (count.size() > 0) {
+						throw new RuntimeException("提单号不允许重复:" + bills.getMblno());
+					}
 				}
 			}
 			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
@@ -176,8 +178,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		} else {
 			List<Long> ids = count.stream().map(Bills::getId).distinct().collect(Collectors.toList());
 			if (!"MH".equals(bills.getBillType())) {
-				if (count.size() > 0 && !ids.contains(bills.getId())) {
-					throw new RuntimeException("提单号不允许重复:"+bills.getMblno());
+				if (ObjectUtils.isNotNull(bills.getMblno())) {
+					if (count.size() > 0 && !ids.contains(bills.getId())) {
+						throw new RuntimeException("提单号不允许重复:" + bills.getMblno());
+					}
 				}
 			}
 			bills.setUpdateUser(AuthUtil.getUserId());
@@ -187,18 +191,18 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			//主单信息同步分单
 			if ("MM".equals(bills.getBillType())) {
 				Bills details = baseMapper.selectOne(new LambdaQueryWrapper<Bills>()
-					.select(Bills::getId,Bills::getVesselId,Bills::getVoyageNo,Bills::getEtd)
-					.eq(Bills::getId,bills.getId()));
+					.select(Bills::getId, Bills::getVesselId, Bills::getVoyageNo, Bills::getEtd)
+					.eq(Bills::getId, bills.getId()));
 				if (!details.getVesselId().equals(bills.getVesselId()) || !details.getVoyageNo().equals(bills.getVoyageNo()) || !details.getEtd().equals(bills.getEtd())) {
 					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)
+						.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, AuthUtil.getDeptId())
 						.eq(Bills::getTenantId, AuthUtil.getTenantId())
 						.eq(Bills::getIsDeleted, 0)
@@ -332,11 +336,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			LocalDateTime now = LocalDateTime.now();
 			DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 			String formatted = now.format(formatter);
-			System.out.println("起1 "+formatted);
+			System.out.println("起1 " + formatted);
 			this.saveOrUpdate(bills);
 			LocalDateTime now2 = LocalDateTime.now();
 			String formatted2 = now2.format(formatter);
-			System.out.println("止1 "+formatted2);
+			System.out.println("止1 " + formatted2);
 		}
 
 
@@ -363,7 +367,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					GP48 += item.getQuantity();
 				}
 				boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
-				if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())){
+				if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
 					teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
 				}
 			}
@@ -499,8 +503,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		//主单应加上分单费用
 		if ("MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
 			List<Bills> details = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
-				.select(Bills::getAmountDr,Bills::getAmountCr,Bills::getAmountDrUsd,Bills::getAmountCrUsd,Bills::getAmountDrLoc,Bills::getAmountCrLoc
-				   ,Bills::getQuantity,Bills::getGrossWeight,Bills::getMeasurement)
+				.select(Bills::getAmountDr, Bills::getAmountCr, Bills::getAmountDrUsd, Bills::getAmountCrUsd, Bills::getAmountDrLoc, Bills::getAmountCrLoc
+					, Bills::getQuantity, Bills::getGrossWeight, Bills::getMeasurement)
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getMasterId, bills.getId()));
@@ -518,10 +522,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 		} else if ("MH".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
 			Bills details = baseMapper.selectOne(new LambdaQueryWrapper<Bills>()
-				.select(Bills::getAmountDr,Bills::getAmountCr,Bills::getAmountProfit,Bills::getAmountDrUsd,Bills::getAmountCrUsd
-					,Bills::getAmountProfitUsd,Bills::getAmountDrLoc,Bills::getAmountCrLoc,Bills::getAmountProfitLoc
-					,Bills::getQuantity,Bills::getGrossWeight,Bills::getMeasurement)
-				.eq(Bills::getMasterId,bills.getMasterId()));
+				.select(Bills::getAmountDr, Bills::getAmountCr, Bills::getAmountProfit, Bills::getAmountDrUsd, Bills::getAmountCrUsd
+					, Bills::getAmountProfitUsd, Bills::getAmountDrLoc, Bills::getAmountCrLoc, Bills::getAmountProfitLoc
+					, Bills::getQuantity, Bills::getGrossWeight, Bills::getMeasurement)
+				.eq(Bills::getMasterId, bills.getMasterId()));
 			//重新计算主单合计
 			if (details != null) {
 				BigDecimal amountDrM = new BigDecimal("0.00");
@@ -537,7 +541,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				BigDecimal grossWeightM = new BigDecimal("0.00");
 				BigDecimal measurementM = new BigDecimal("0.00");
 				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
-					.select(FeeCenter::getCurCode,FeeCenter::getAmount,FeeCenter::getDc)
+					.select(FeeCenter::getCurCode, FeeCenter::getAmount, FeeCenter::getDc)
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getIsDeleted, 0)
 					.eq(FeeCenter::getPid, details.getId()));
@@ -563,8 +567,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					}
 				}
 				List<Bills> billsList = this.list(new LambdaQueryWrapper<Bills>()
-					.select(Bills::getAmountDr,Bills::getAmountCr,Bills::getAmountDrUsd,Bills::getAmountCrUsd,Bills::getAmountDrLoc
-						,Bills::getAmountCrLoc,Bills::getQuantity,Bills::getQuantity,Bills::getGrossWeight,Bills::getMeasurement)
+					.select(Bills::getAmountDr, Bills::getAmountCr, Bills::getAmountDrUsd, Bills::getAmountCrUsd, Bills::getAmountDrLoc
+						, Bills::getAmountCrLoc, Bills::getQuantity, Bills::getQuantity, Bills::getGrossWeight, Bills::getMeasurement)
 					.eq(Bills::getTenantId, AuthUtil.getTenantId())
 					.eq(Bills::getIsDeleted, 0)
 					.eq(Bills::getMasterId, details.getId()));
@@ -627,15 +631,14 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		bills.setMeasurement(measurement);
 
 
-
 		LocalDateTime now = LocalDateTime.now();
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 		String formatted = now.format(formatter);
-		System.out.println("起2 "+formatted);
+		System.out.println("起2 " + formatted);
 		this.saveOrUpdate(bills);
 		LocalDateTime now2 = LocalDateTime.now();
 		String formatted2 = now2.format(formatter);
-		System.out.println("止2 "+formatted2);
+		System.out.println("止2 " + formatted2);
 
 		/**-------------费用计算---------*/
 		return R.data(bills);
@@ -704,7 +707,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	public R add(Bills bills) {
 		String deptId = "";
 		String deptName = "";
-		String branchId = deptUtils.getDeptPid()+"";
+		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
 			deptId = AuthUtil.getDeptId();
@@ -1065,7 +1068,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(declare.getCorpId());
 			Dept dept = deptUtils.getDept(declare.getCreateDept());
-			if (dept != null){
+			if (dept != null) {
 				auditProecessDTO.setSalesCompanyId(dept.getId());
 				auditProecessDTO.setSalesCompanyName(dept.getDeptName());
 			}

+ 6 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java

@@ -457,8 +457,12 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 
 	@Override
 	public List<Map<String, Object>> listFeeCountByCorp(String dc, Long corpId) {
-		List<Map<String, Object>> mapList = baseMapper.listFeeCountByCorp(dc, AuthUtil.getTenantId(), deptUtils.getDeptPid(), AuthUtil.getPostId(), corpId);
-		return mapList;
+		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+			return baseMapper.listFeeCountByCorp(dc, AuthUtil.getTenantId(), deptUtils.getDeptPid(), AuthUtil.getPostId(), corpId);
+		} else {
+			return baseMapper.listFeeCountByCorp(dc, AuthUtil.getTenantId(), null, null, corpId);
+		}
+
 	}
 
 	private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {