Jelajahi Sumber

2024年6月20日17:31:59

纪新园 1 tahun lalu
induk
melakukan
8c00db8660
21 mengubah file dengan 1253 tambahan dan 40 penghapusan
  1. 63 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/BoxNumberProfitQ.java
  2. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/dto/BoxNumberProfitDTO.java
  3. 89 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/entity/BoxNumberProfit.java
  4. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/vo/BoxNumberProfitVO.java
  5. 6 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/OrderItems.java
  6. 6 0
      blade-service-api/trade-purchase-api/src/main/java/com/trade/purchase/order/entity/OrderItems.java
  7. 199 0
      blade-service/blade-los/src/main/java/org/springblade/los/excel/BoxNumberProfitExcel.java
  8. 9 5
      blade-service/blade-los/src/main/java/org/springblade/los/finance/genleg/service/impl/FinPeriodServiceImpl.java
  9. 37 0
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/StatisticAnalysisController.java
  10. 9 1
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java
  11. 312 27
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  12. 115 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/controller/BoxNumberProfitController.java
  13. 44 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/BoxNumberProfitMapper.java
  14. 167 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/BoxNumberProfitMapper.xml
  15. 33 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/service/IBoxNumberProfitService.java
  16. 38 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/service/impl/BoxNumberProfitServiceImpl.java
  17. 10 1
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportEnquiryController.java
  18. 3 1
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportOrderController.java
  19. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java
  20. 3 3
      blade-service/trade-purchase/src/main/java/com/trade/purchase/enquiry/ShippingEnquiry.java
  21. 38 0
      blade-service/trade-purchase/src/main/java/com/trade/purchase/order/service/impl/OrderServiceImpl.java

+ 63 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/BoxNumberProfitQ.java

@@ -0,0 +1,63 @@
+package org.springblade.los.statisticAnalysis;
+
+import lombok.Data;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/11/29
+ */
+@Data
+public class BoxNumberProfitQ {
+
+	/**
+	 * 租户id
+	 */
+	private String tenantId;
+	/**
+	 * 分公司
+	 */
+	private String branchId;
+	/**
+	 * 业务类型
+	 */
+	private String businessType;
+	/**
+	 * 业务来源
+	 */
+	private String srcType;
+	/**
+	 * 来源人
+	 */
+	private String srcCnName;
+	/**
+	 * 船公司
+	 */
+	private String carrierCnName;
+	/**
+	 * 委托人
+	 */
+	private String corpCnName;
+	/**
+	 * 航线
+	 */
+	private String lineCnName;
+	/**
+	 * 场站
+	 */
+	private String cyCnName;
+	/**
+	 * 开始日期
+	 */
+	private String dateStart;
+	/**
+	 * 结束日期
+	 */
+	private String dateEnd;
+
+	/**
+	 * 统计类型
+	 */
+	private String type;
+
+
+}

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/dto/BoxNumberProfitDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.dto;
+
+import org.springblade.los.view.entity.BoxNumberProfit;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * VIEW数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BoxNumberProfitDTO extends BoxNumberProfit {
+	private static final long serialVersionUID = 1L;
+
+}

+ 89 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/entity/BoxNumberProfit.java

@@ -0,0 +1,89 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * VIEW实体类
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+@Data
+@TableName("los_box_number_profit")
+@ApiModel(value = "BoxNumberProfit对象", description = "VIEW")
+public class BoxNumberProfit implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	private String branchId;
+	private String tenantId;
+	private String businessType;
+	private String billNo;
+	private String mblno;
+	private String hblno;
+	private Long corpId;
+	private String corpCnName;
+	private Long carrierId;
+	private String carrierCnName;
+	private Long vesselId;
+	private String vesselCnName;
+	private String voyageNo;
+	private Long podId;
+	private String podCnName;
+	private String hPaymode;
+	private Long cyId;
+	private String cyCnName;
+	private Date etd;
+	private Date eta;
+	private Integer teu;
+	private Integer quantityV20;
+	private Integer quantityV40;
+	private Integer quantityV45;
+	private Integer quantityV48;
+	private Integer quantityV40hc;
+	private BigDecimal quantity;
+	private BigDecimal grossWeight;
+	private BigDecimal measurement;
+	private BigDecimal amountDr;
+	private BigDecimal amountCr;
+	private BigDecimal amountProfit;
+	private BigDecimal amountDrUsd;
+	private BigDecimal amountCrUsd;
+	private BigDecimal amountProfitUsd;
+	private BigDecimal amountDrLoc;
+	private BigDecimal amountCrLoc;
+	private BigDecimal amountProfitLoc;
+	private Long lineId;
+	private String lineCnName;
+	private String srcType;
+	private Long srcId;
+	private String srcCnName;
+	private Integer isDeleted;
+	private Long teamId;
+	private String teamName;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/vo/BoxNumberProfitVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.vo;
+
+import org.springblade.los.view.entity.BoxNumberProfit;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * VIEW视图实体类
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "BoxNumberProfitVO对象", description = "VIEW")
+public class BoxNumberProfitVO extends BoxNumberProfit {
+	private static final long serialVersionUID = 1L;
+
+}

+ 6 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/OrderItems.java

@@ -859,6 +859,12 @@ public class OrderItems implements Serializable {
 	@ApiModelProperty(value = "原订单数量")
 	private BigDecimal primaryQuantiy;
 
+	/**
+	 * 产品毛利
+	 */
+	@ApiModelProperty(value = "产品毛利")
+	private BigDecimal goodsGrossProfit;
+
 
 
 }

+ 6 - 0
blade-service-api/trade-purchase-api/src/main/java/com/trade/purchase/order/entity/OrderItems.java

@@ -732,4 +732,10 @@ public class OrderItems extends OrderBase {
 	 */
 	@ApiModelProperty("分管员名组")
 	private String supervisorUserNameGroup;
+
+	/**
+	 * 产品毛利
+	 */
+	@ApiModelProperty(value = "产品毛利")
+	private BigDecimal goodsGrossProfit;
 }

+ 199 - 0
blade-service/blade-los/src/main/java/org/springblade/los/excel/BoxNumberProfitExcel.java

@@ -0,0 +1,199 @@
+package org.springblade.los.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/6/20
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class BoxNumberProfitExcel {
+
+	/**
+	 * 业务类型
+	 */
+	@ExcelProperty(value = "业务类型")
+	private String businessType;
+	/**
+	 * 单据编号
+	 */
+	@ExcelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * MBLNO
+	 */
+	@ExcelProperty(value = "MBLNO")
+	private String mblno;
+	/**
+	 * HBLNO
+	 */
+	@ExcelProperty(value = "HBLNO")
+	private String hblno;
+	/**
+	 * 客户
+	 */
+	@ExcelProperty(value = "客户")
+	private String corpCnName;
+	/**
+	 * 船公司
+	 */
+	@ExcelProperty(value = "船公司")
+	private String carrierCnName;
+	/**
+	 * 船名
+	 */
+	@ExcelProperty(value = "船名")
+	private String vesselCnName;
+	/**
+	 * 航次
+	 */
+	@ExcelProperty(value = "航次")
+	private String voyageNo;
+	/**
+	 * 目的港
+	 */
+	@ExcelProperty(value = "目的港")
+	private String podCnName;
+	/**
+	 * 支付类型
+	 */
+	@ExcelProperty(value = "支付类型")
+	private String hPaymode;
+	/**
+	 * 场站
+	 */
+	@ExcelProperty(value = "场站")
+	private String cyCnName;
+	/**
+	 * etd
+	 */
+	@ExcelProperty(value = "etd")
+	private Date etd;
+	/**
+	 * eta
+	 */
+	@ExcelProperty(value = "eta")
+	private Date eta;
+	/**
+	 * teu
+	 */
+	@ExcelProperty(value = "teu")
+	private Integer teu;
+	/**
+	 * 20
+	 */
+	@ExcelProperty(value = "20")
+	private Integer quantityV20;
+	/**
+	 * 40
+	 */
+	@ExcelProperty(value = "40")
+	private Integer quantityV40;
+	/**
+	 * 45
+	 */
+	@ExcelProperty(value = "45")
+	private Integer quantityV45;
+	/**
+	 * 48
+	 */
+	@ExcelProperty(value = "48")
+	private Integer quantityV48;
+	/**
+	 * 40Hc
+	 */
+	@ExcelProperty(value = "40Hc")
+	private Integer quantityV40hc;
+	/**
+	 * 件数
+	 */
+	@ExcelProperty(value = "件数")
+	private BigDecimal quantity;
+	/**
+	 * 毛重
+	 */
+	@ExcelProperty(value = "毛重")
+	private BigDecimal grossWeight;
+	/**
+	 * 体积
+	 */
+	@ExcelProperty(value = "体积")
+	private BigDecimal measurement;
+	/**
+	 * 人民币应收
+	 */
+	@ExcelProperty(value = "人民币应收")
+	private BigDecimal amountDr;
+	/**
+	 * 人民币应付
+	 */
+	@ExcelProperty(value = "人民币应付")
+	private BigDecimal amountCr;
+	/**
+	 * 人民币利润
+	 */
+	@ExcelProperty(value = "人民币利润")
+	private BigDecimal amountProfit;
+	/**
+	 * 美金应收
+	 */
+	@ExcelProperty(value = "美金应收")
+	private BigDecimal amountDrUsd;
+	/**
+	 * 美金应付
+	 */
+	@ExcelProperty(value = "美金应付")
+	private BigDecimal amountCrUsd;
+	/**
+	 * 美金利润
+	 */
+	@ExcelProperty(value = "美金利润")
+	private BigDecimal amountProfitUsd;
+	/**
+	 * 合计应收
+	 */
+	@ExcelProperty(value = "合计应收")
+	private BigDecimal amountDrLoc;
+	/**
+	 * 合计应付
+	 */
+	@ExcelProperty(value = "合计应付")
+	private BigDecimal amountCrLoc;
+	/**
+	 * 合计利润
+	 */
+	@ExcelProperty(value = "合计利润")
+	private BigDecimal amountProfitLoc;
+	/**
+	 * 航线
+	 */
+	@ExcelProperty(value = "航线")
+	private String lineCnName;
+	/**
+	 * 来源类型
+	 */
+	@ExcelProperty(value = "来源类型")
+	private String srcType;
+	/**
+	 * 来源人员
+	 */
+	@ExcelProperty(value = "来源人员")
+	private String srcCnName;
+	/**
+	 * 团队
+	 */
+	@ExcelProperty(value = "团队")
+	private String teamName;
+
+}

+ 9 - 5
blade-service/blade-los/src/main/java/org/springblade/los/finance/genleg/service/impl/FinPeriodServiceImpl.java

@@ -863,7 +863,7 @@ public class FinPeriodServiceImpl extends ServiceImpl<FinPeriodMapper, FinPeriod
 		exchange.setStatus(0);
 		exchange.setBsType("FM-CURRENCY-PL-TRANSFER");
 		exchange.setVkno("转");
-		Accounts accountsExchange = accountsService.getOne(new LambdaQueryWrapper<Accounts>()
+		/*Accounts accountsExchange = accountsService.getOne(new LambdaQueryWrapper<Accounts>()
 			.eq(Accounts::getTenantId, AuthUtil.getTenantId())
 			.eq(Accounts::getCode, "550303")
 		);
@@ -874,7 +874,7 @@ public class FinPeriodServiceImpl extends ServiceImpl<FinPeriodMapper, FinPeriod
 		exchange.setPlAccFnm(accountsExchange.getCode() + "-" + accountsExchange.getFullName());
 		exchange.setPlAccNo(accountsExchange.getCode());
 		exchange.setPlAccID(accountsExchange.getId() + "");
-		exchange.setDescr(accountsExchange.getCnName() + "结转");
+		exchange.setDescr(accountsExchange.getCnName() + "结转");*/
 		exchange.setAccItems(new ArrayList<>());
 		exchange.setDate(finPeriod.getPeriodYear() + "-" + finPeriod.getPeriodMonth());
 		finPeriod.setExchange(JSON.toJSONString(exchange));
@@ -883,7 +883,7 @@ public class FinPeriodServiceImpl extends ServiceImpl<FinPeriodMapper, FinPeriod
 		period.setStatus(0);
 		period.setBsType("FM-PERIOD-PL-TRANSFER");
 		period.setVkno("转");
-		Accounts accountsPeriod = accountsService.getOne(new LambdaQueryWrapper<Accounts>()
+		/*Accounts accountsPeriod = accountsService.getOne(new LambdaQueryWrapper<Accounts>()
 			.eq(Accounts::getTenantId, AuthUtil.getTenantId())
 			.eq(Accounts::getCode, "550304")
 		);
@@ -894,7 +894,7 @@ public class FinPeriodServiceImpl extends ServiceImpl<FinPeriodMapper, FinPeriod
 		period.setPlAccFnm(accountsPeriod.getCode() + "-" + accountsPeriod.getFullName());
 		period.setPlAccNo(accountsPeriod.getCode());
 		period.setPlAccID(accountsPeriod.getId() + "");
-		period.setDescr(accountsPeriod.getCnName() + "结转");
+		period.setDescr(accountsPeriod.getCnName() + "结转");*/
 		period.setAccItems(new ArrayList<>());
 		period.setDate(finPeriod.getPeriodYear() + "-" + finPeriod.getPeriodMonth());
 		finPeriod.setPeriod(JSON.toJSONString(period));
@@ -1274,7 +1274,11 @@ public class FinPeriodServiceImpl extends ServiceImpl<FinPeriodMapper, FinPeriod
 							finVouchersItemsList.add(finVouchersItems);
 						}
 					} else {
-						if ("550304".equals(item.getCode())) {
+						PeriodVouchersTemplate period = JSONObject.parseObject(finPeriod.getPeriod(), PeriodVouchersTemplate.class);
+						if (period == null) {
+							throw new RuntimeException("未找到期间损益配置");
+						}
+						if (period.getPlAccNo().equals(item.getCode())) {
 							finVouchersItems.setExrate(new BigDecimal("1"));
 							if ("C".equals(item.getDc())) {
 								if (new BigDecimal("0.00").compareTo(finGenleg.getAmountCr()) != 0) {

+ 37 - 0
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/StatisticAnalysisController.java

@@ -5,9 +5,12 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.los.excel.BoxNumberProfitExcel;
+import org.springblade.los.statisticAnalysis.BoxNumberProfitQ;
 import org.springblade.los.statisticAnalysis.DecisionAnalysis;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 
@@ -55,4 +59,37 @@ public class StatisticAnalysisController {
 		}
 	}
 
+	/**
+	 * 分页 海运箱量利润统计
+	 */
+	@GetMapping("/boxNumberProfitStatistics")
+	public R<IPage<BoxNumberProfitExcel>> boxNumberProfitStatistics(BoxNumberProfitQ boxNumberProfit, Query query) {
+		return statisticAnalysisService.boxNumberProfitStatistics(Condition.getPage(query), boxNumberProfit);
+	}
+
+	/**
+	 * 分页 海运箱量利润统计合计
+	 */
+	@GetMapping("/boxNumberProfitStatisticsSum")
+	public R boxNumberProfitStatisticsSum(BoxNumberProfitQ boxNumberProfit) {
+		return statisticAnalysisService.boxNumberProfitStatisticsSum(boxNumberProfit);
+	}
+
+	/**
+	 * 分页 海运箱量利润统计导出
+	 */
+	@GetMapping("/boxNumberProfitStatisticsExport")
+	public void boxNumberProfitStatisticsExport(BoxNumberProfitQ boxNumberProfit, HttpServletResponse response) {
+		List<BoxNumberProfitExcel> list = statisticAnalysisService.boxNumberProfitStatisticsList(boxNumberProfit);
+		ExcelUtil.export(response, "海运箱量利润统计", "海运箱量利润统计", list, BoxNumberProfitExcel.class);
+	}
+
+	/**
+	 * 分页 海运箱量利润统计图形数据
+	 */
+	@GetMapping("/boxNumberProfitStatisticsChart")
+	public R boxNumberProfitStatisticsChart(BoxNumberProfitQ boxNumberProfit) {
+		return statisticAnalysisService.boxNumberProfitStatisticsChart(boxNumberProfit);
+	}
+
 }

+ 9 - 1
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java

@@ -18,8 +18,8 @@ package org.springblade.los.statisticAnalysis.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.tool.api.R;
+import org.springblade.los.excel.BoxNumberProfitExcel;
 import org.springblade.los.statisticAnalysis.*;
-import org.springblade.los.view.entity.FinanceProfit;
 
 import java.util.List;
 import java.util.Map;
@@ -74,4 +74,12 @@ public interface IStatisticAnalysisService {
 	R financeProfitSum(FinanceProfitDtoList financeProfit);
 
 	List<FinanceProfitDtoList> financeProfitExport(FinanceProfitDtoList financeProfit);
+
+	R<IPage<BoxNumberProfitExcel>> boxNumberProfitStatistics(IPage<BoxNumberProfitExcel> page, BoxNumberProfitQ boxNumberProfit);
+
+	R boxNumberProfitStatisticsSum(BoxNumberProfitQ boxNumberProfit);
+
+	List<BoxNumberProfitExcel> boxNumberProfitStatisticsList(BoxNumberProfitQ boxNumberProfit);
+
+	R boxNumberProfitStatisticsChart(BoxNumberProfitQ boxNumberProfit);
 }

+ 312 - 27
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 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.Util.IDeptUtils;
+import org.springblade.los.basic.cur.entity.BCurrency;
 import org.springblade.los.basic.cur.service.IBCurrencyService;
 import org.springblade.los.business.aea.entity.AeaBills;
 import org.springblade.los.business.aea.mapper.AeaBillsMapper;
@@ -16,6 +18,7 @@ import org.springblade.los.business.customsDeclaration.entity.CustomsDeclaration
 import org.springblade.los.business.customsDeclaration.mapper.CustomsDeclarationMapper;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.excel.BoxNumberProfitExcel;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
 import org.springblade.los.finance.fee.mapper.FinAccBillsMapper;
@@ -25,6 +28,8 @@ import org.springblade.los.finance.stl.entity.FinStlBills;
 import org.springblade.los.finance.stl.mapper.FinStlBillsMapper;
 import org.springblade.los.statisticAnalysis.*;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
+import org.springblade.los.view.entity.BoxNumberProfit;
+import org.springblade.los.view.mapper.BoxNumberProfitMapper;
 import org.springblade.los.view.mapper.FinanceProfitMapper;
 import org.springframework.stereotype.Service;
 
@@ -58,6 +63,8 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	private final IDeptUtils deptUtils;
 
+	private final BoxNumberProfitMapper boxNumberProfitMapper;
+
 	@Override
 	public R<IPage<DecisionAnalysis>> decisionAnalysis(DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page) {
 		return R.data(page.setRecords(billsMapper.decisionAnalysis(decisionAnalysis, page)));
@@ -77,28 +84,11 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public R<IPage<FinanceProfitDtoList>> financeProfit(FinanceProfitDtoList financeProfit, IPage<FinanceProfitDtoList> page) {
-		/*if (financeProfit.getBillType().contains("SE") || financeProfit.getBillType().contains("AE")) {
-			List<FinanceProfitDtoList> financeProfitListHy = billsMapper.financeProfit(financeProfit);
-			if (!financeProfitListHy.isEmpty()) {
-				financeProfitList.addAll(financeProfitListHy);
-			}
-		} else if (financeProfit.getBillType().contains("SI") || financeProfit.getBillType().contains("AI")) {
-			List<FinanceProfitDtoList> financeProfitListKy = aeaBillsMapper.financeProfit(financeProfit);
-			if (!financeProfitListKy.isEmpty()) {
-				financeProfitList.addAll(financeProfitListKy);
-			}
-		} else if (financeProfit.getBillType().contains("BGSE") || financeProfit.getBillType().contains("BGSI")
-			|| financeProfit.getBillType().contains("BGAE") || financeProfit.getBillType().contains("BGAI")) {
-			List<FinanceProfitDtoList> financeProfitListBg = customsDeclarationMapper.financeProfit(financeProfit);
-			if (!financeProfitListBg.isEmpty()) {
-				financeProfitList.addAll(financeProfitListBg);
-			}
-		}*/
 		financeProfit.setTenantId(AuthUtil.getTenantId());
 		financeProfit.setBranchId(deptUtils.getDeptPid() + "");
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C","2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D","2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if ("1".equals(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfit(financeProfit, page);
@@ -267,10 +257,6 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
 			}
 			financeProfitList = financeProfitMapper.financeProfit(financeProfit, page);
-			/*List<FinanceProfitDtoList> financeProfitListBg = amendsMapper.financeProfit(financeProfit);
-			if (!financeProfitListBg.isEmpty()) {
-				financeProfitList.addAll(financeProfitListBg);
-			}*/
 		}
 		for (FinanceProfitDtoList item : financeProfitList) {
 			if (null != item) {
@@ -725,8 +711,8 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		financeProfit.setTenantId(AuthUtil.getTenantId());
 		financeProfit.setBranchId(deptUtils.getDeptPid() + "");
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C","2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D","2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if ("1".equals(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
@@ -929,8 +915,8 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		financeProfit.setTenantId(AuthUtil.getTenantId());
 		financeProfit.setBranchId(deptUtils.getDeptPid() + "");
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C","2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D","2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if (ObjectUtils.isNotNull(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
@@ -1110,4 +1096,303 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		}
 		return financeProfitList;
 	}
+
+	@Override
+	public R<IPage<BoxNumberProfitExcel>> boxNumberProfitStatistics(IPage<BoxNumberProfitExcel> page, BoxNumberProfitQ boxNumberProfit) {
+		boxNumberProfit.setTenantId(AuthUtil.getTenantId());
+		boxNumberProfit.setBranchId(deptUtils.getDeptPid() + "");
+		List<BoxNumberProfit> boxNumberProfitList = boxNumberProfitMapper.selectBoxNumberProfitPage(page, boxNumberProfit);
+		List<BoxNumberProfitExcel> boxNumberProfitExcelList = new ArrayList<>();
+		if (!boxNumberProfitList.isEmpty()) {
+			List<Long> ids = boxNumberProfitList.stream().map(BoxNumberProfit::getId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+			List<FeeCenter> feeCenterList = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, ids));
+			BCurrency bCurrencyD = new BCurrency();
+			bCurrencyD.setDc("D");
+			bCurrencyD.setType("1");
+			List<BCurrency> currencyListD = bCurrencyService.getExrate(bCurrencyD);
+			BCurrency bCurrencyC = new BCurrency();
+			bCurrencyC.setDc("C");
+			bCurrencyC.setType("1");
+			List<BCurrency> currencyListC = bCurrencyService.getExrate(bCurrencyC);
+			for (BoxNumberProfit item : boxNumberProfitList) {
+				if ("ASE".equals(item.getBusinessType()) || "ASI".equals(item.getBusinessType())) {
+					BigDecimal amountDr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDr);
+					BigDecimal amountCr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCr(amountCr);
+					BigDecimal amountDrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDrUsd);
+					BigDecimal amountCrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCrUsd(amountCrUsd);
+					currencyListD.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyD -> item.setAmountDrLoc(amountDr.add(amountDrUsd.multiply(currencyD.getExrate()))));
+					currencyListC.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyC -> item.setAmountCrLoc(amountCr.add(amountCrUsd.multiply(currencyC.getExrate()))));
+					item.setAmountProfit(amountDr.subtract(amountCr));
+					item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+					item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
+				}
+			}
+			boxNumberProfitExcelList = BeanUtil.copy(boxNumberProfitList, BoxNumberProfitExcel.class);
+		}
+		return R.data(page.setRecords(boxNumberProfitExcelList));
+	}
+
+	@Override
+	public R boxNumberProfitStatisticsSum(BoxNumberProfitQ boxNumberProfit) {
+		boxNumberProfit.setTenantId(AuthUtil.getTenantId());
+		boxNumberProfit.setBranchId(deptUtils.getDeptPid() + "");
+		List<BoxNumberProfit> boxNumberProfitList = boxNumberProfitMapper.selectBoxNumberProfitList(boxNumberProfit);
+		List<BoxNumberProfitExcel> boxNumberProfitExcelList = new ArrayList<>();
+		Map<String, Object> map = new HashMap<>();
+		if (!boxNumberProfitList.isEmpty()) {
+			List<Long> ids = boxNumberProfitList.stream().map(BoxNumberProfit::getId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+			List<FeeCenter> feeCenterList = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, ids));
+			BCurrency bCurrencyD = new BCurrency();
+			bCurrencyD.setDc("D");
+			bCurrencyD.setType("1");
+			List<BCurrency> currencyListD = bCurrencyService.getExrate(bCurrencyD);
+			BCurrency bCurrencyC = new BCurrency();
+			bCurrencyC.setDc("C");
+			bCurrencyC.setType("1");
+			List<BCurrency> currencyListC = bCurrencyService.getExrate(bCurrencyC);
+			for (BoxNumberProfit item : boxNumberProfitList) {
+				if ("ASE".equals(item.getBusinessType()) || "ASI".equals(item.getBusinessType())) {
+					BigDecimal amountDr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDr);
+					BigDecimal amountCr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCr(amountCr);
+					BigDecimal amountDrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDrUsd);
+					BigDecimal amountCrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCrUsd(amountCrUsd);
+					currencyListD.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyD -> item.setAmountDrLoc(amountDr.add(amountDrUsd.multiply(currencyD.getExrate()))));
+					currencyListC.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyC -> item.setAmountCrLoc(amountCr.add(amountCrUsd.multiply(currencyC.getExrate()))));
+					item.setAmountProfit(amountDr.subtract(amountCr));
+					item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+					item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
+				}
+			}
+			boxNumberProfitExcelList = BeanUtil.copy(boxNumberProfitList, BoxNumberProfitExcel.class);
+			map.put("teu", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("quantityV20", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getQuantityV20).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("quantityV40", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getQuantityV40).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("quantityV45", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getQuantityV45).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("quantityV48", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getQuantityV48).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("quantityV40hc", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getQuantityV40hc).filter(Objects::nonNull).reduce(0, Integer::sum));
+			map.put("amountDr", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountCr", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountProfit", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountDrUsd", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountDrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountCrUsd", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountProfitUsd", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountProfitUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountDrLoc", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountCrLoc", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			map.put("amountProfitLoc", boxNumberProfitExcelList.stream().map(BoxNumberProfitExcel::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+		} else {
+			map.put("teu", 0);
+			map.put("quantityV20", 0);
+			map.put("quantityV40", 0);
+			map.put("quantityV45", 0);
+			map.put("quantityV48", 0);
+			map.put("quantityV40hc", 0);
+			map.put("amountDr", new BigDecimal("0.00"));
+			map.put("amountCr", new BigDecimal("0.00"));
+			map.put("amountProfit", new BigDecimal("0.00"));
+			map.put("amountDrUsd", new BigDecimal("0.00"));
+			map.put("amountCrUsd", new BigDecimal("0.00"));
+			map.put("amountProfitUsd", new BigDecimal("0.00"));
+			map.put("amountDrLoc", new BigDecimal("0.00"));
+			map.put("amountCrLoc", new BigDecimal("0.00"));
+			map.put("amountProfitLoc", new BigDecimal("0.00"));
+		}
+		return R.data(map);
+	}
+
+	@Override
+	public List<BoxNumberProfitExcel> boxNumberProfitStatisticsList(BoxNumberProfitQ boxNumberProfit) {
+		boxNumberProfit.setTenantId(AuthUtil.getTenantId());
+		boxNumberProfit.setBranchId(deptUtils.getDeptPid() + "");
+		List<BoxNumberProfit> boxNumberProfitList = boxNumberProfitMapper.selectBoxNumberProfitList(boxNumberProfit);
+		List<BoxNumberProfitExcel> boxNumberProfitExcelList = new ArrayList<>();
+		if (!boxNumberProfitList.isEmpty()) {
+			List<Long> ids = boxNumberProfitList.stream().map(BoxNumberProfit::getId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+			List<FeeCenter> feeCenterList = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, ids));
+			BCurrency bCurrencyD = new BCurrency();
+			bCurrencyD.setDc("D");
+			bCurrencyD.setType("1");
+			List<BCurrency> currencyListD = bCurrencyService.getExrate(bCurrencyD);
+			BCurrency bCurrencyC = new BCurrency();
+			bCurrencyC.setDc("C");
+			bCurrencyC.setType("1");
+			List<BCurrency> currencyListC = bCurrencyService.getExrate(bCurrencyC);
+			for (BoxNumberProfit item : boxNumberProfitList) {
+				if ("ASE".equals(item.getBusinessType()) || "ASI".equals(item.getBusinessType())) {
+					BigDecimal amountDr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDr);
+					BigDecimal amountCr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCr(amountCr);
+					BigDecimal amountDrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDrUsd);
+					BigDecimal amountCrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCrUsd(amountCrUsd);
+					currencyListD.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyD -> item.setAmountDrLoc(amountDr.add(amountDrUsd.multiply(currencyD.getExrate()))));
+					currencyListC.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyC -> item.setAmountCrLoc(amountCr.add(amountCrUsd.multiply(currencyC.getExrate()))));
+					item.setAmountProfit(amountDr.subtract(amountCr));
+					item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+					item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
+				}
+			}
+			boxNumberProfitExcelList = BeanUtil.copy(boxNumberProfitList, BoxNumberProfitExcel.class);
+		}
+		return boxNumberProfitExcelList;
+	}
+
+	@Override
+	public R boxNumberProfitStatisticsChart(BoxNumberProfitQ boxNumberProfit) {
+		boxNumberProfit.setTenantId(AuthUtil.getTenantId());
+		boxNumberProfit.setBranchId(deptUtils.getDeptPid() + "");
+		List<BoxNumberProfit> boxNumberProfitList = boxNumberProfitMapper.selectBoxNumberProfitList(boxNumberProfit);
+		List<Map<String, Object>> mapList = new ArrayList<>();
+		if (!boxNumberProfitList.isEmpty()) {
+			List<Long> ids = boxNumberProfitList.stream().map(BoxNumberProfit::getId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+			List<FeeCenter> feeCenterList = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, ids));
+			BCurrency bCurrencyD = new BCurrency();
+			bCurrencyD.setDc("D");
+			bCurrencyD.setType("1");
+			List<BCurrency> currencyListD = bCurrencyService.getExrate(bCurrencyD);
+			BCurrency bCurrencyC = new BCurrency();
+			bCurrencyC.setDc("C");
+			bCurrencyC.setType("1");
+			List<BCurrency> currencyListC = bCurrencyService.getExrate(bCurrencyC);
+			for (BoxNumberProfit item : boxNumberProfitList) {
+				if ("ASE".equals(item.getBusinessType()) || "ASI".equals(item.getBusinessType())) {
+					BigDecimal amountDr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDr);
+					BigDecimal amountCr = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "CNY".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCr(amountCr);
+					BigDecimal amountDrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "D".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountDr(amountDrUsd);
+					BigDecimal amountCrUsd = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()) && "C".equals(e.getDc())
+						&& "USD".equals(e.getCurCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+					item.setAmountCrUsd(amountCrUsd);
+					currencyListD.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyD -> item.setAmountDrLoc(amountDr.add(amountDrUsd.multiply(currencyD.getExrate()))));
+					currencyListC.stream().filter(e -> "USD".equals(e.getCode())).findFirst()
+						.ifPresent(currencyC -> item.setAmountCrLoc(amountCr.add(amountCrUsd.multiply(currencyC.getExrate()))));
+					item.setAmountProfit(amountDr.subtract(amountCr));
+					item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+					item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
+				}
+			}
+			if ("1".equals(boxNumberProfit.getType())) {
+				List<Long> carrierId = boxNumberProfitList.stream().map(BoxNumberProfit::getCarrierId)
+					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				int teuSum = 0;
+				BigDecimal amountProfitSum = new BigDecimal("0.00");
+				BigDecimal profitMarginSum = new BigDecimal("0.00");
+				for (Long item : carrierId) {
+					Map<String, Object> map = new HashMap<>();
+					Integer teu = boxNumberProfitList.stream().filter(e -> e.getCarrierId().equals(item)).map(BoxNumberProfit::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
+					map.put("teu", teu);
+					teuSum = teuSum + teu;
+					BigDecimal amountDrLoc = boxNumberProfitList.stream().filter(e -> e.getCarrierId().equals(item)).map(BoxNumberProfit::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					BigDecimal amountProfitLoc = boxNumberProfitList.stream().filter(e -> e.getCarrierId().equals(item)).map(BoxNumberProfit::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					map.put("amountProfitLoc", amountProfitLoc);
+					amountProfitSum = amountProfitSum.add(amountProfitLoc);
+					BigDecimal profitMargin = amountProfitLoc.divide(amountDrLoc, MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+					map.put("profitMargin", profitMargin);
+					profitMarginSum = profitMarginSum.add(profitMargin);
+					mapList.add(map);
+				}
+				Map<String, Object> mapSum = new HashMap<>();
+				mapSum.put("teu", teuSum);
+				mapSum.put("amountProfitLoc", amountProfitSum);
+				mapSum.put("profitMargin", profitMarginSum);
+				mapList.add(0, mapSum);
+			} else if ("2".equals(boxNumberProfit.getType())) {
+				List<Long> corpId = boxNumberProfitList.stream().map(BoxNumberProfit::getCorpId)
+					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				int teuSum = 0;
+				BigDecimal amountProfitSum = new BigDecimal("0.00");
+				BigDecimal profitMarginSum = new BigDecimal("0.00");
+				for (Long item : corpId) {
+					Map<String, Object> map = new HashMap<>();
+					Integer teu = boxNumberProfitList.stream().filter(e -> e.getCorpId().equals(item)).map(BoxNumberProfit::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
+					map.put("teu", teu);
+					teuSum = teuSum + teu;
+					BigDecimal amountDrLoc = boxNumberProfitList.stream().filter(e -> e.getCorpId().equals(item)).map(BoxNumberProfit::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					BigDecimal amountProfitLoc = boxNumberProfitList.stream().filter(e -> e.getCorpId().equals(item)).map(BoxNumberProfit::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					map.put("amountProfitLoc", amountProfitLoc);
+					amountProfitSum = amountProfitSum.add(amountProfitLoc);
+					BigDecimal profitMargin = amountProfitLoc.divide(amountDrLoc, MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+					map.put("profitMargin", profitMargin);
+					profitMarginSum = profitMarginSum.add(profitMargin);
+					mapList.add(map);
+				}
+				Map<String, Object> mapSum = new HashMap<>();
+				mapSum.put("teu", teuSum);
+				mapSum.put("amountProfitLoc", amountProfitSum);
+				mapSum.put("profitMargin", profitMarginSum);
+				mapList.add(0, mapSum);
+			} else if ("3".equals(boxNumberProfit.getType())) {
+				List<Long> srcId = boxNumberProfitList.stream().filter(e -> e.getSrcType().equals("SALES")).map(BoxNumberProfit::getSrcId)
+					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				int teuSum = 0;
+				BigDecimal amountProfitSum = new BigDecimal("0.00");
+				BigDecimal profitMarginSum = new BigDecimal("0.00");
+				for (Long item : srcId) {
+					Map<String, Object> map = new HashMap<>();
+					Integer teu = boxNumberProfitList.stream().filter(e -> e.getSrcId().equals(item) && e.getSrcType().equals("SALES")).map(BoxNumberProfit::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
+					map.put("teu", teu);
+					teuSum = teuSum + teu;
+					BigDecimal amountDrLoc = boxNumberProfitList.stream().filter(e -> e.getSrcId().equals(item) && e.getSrcType().equals("SALES")).map(BoxNumberProfit::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					BigDecimal amountProfitLoc = boxNumberProfitList.stream().filter(e -> e.getSrcId().equals(item) && e.getSrcType().equals("SALES")).map(BoxNumberProfit::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					map.put("amountProfitLoc", amountProfitLoc);
+					amountProfitSum = amountProfitSum.add(amountProfitLoc);
+					BigDecimal profitMargin = amountProfitLoc.divide(amountDrLoc, MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+					map.put("profitMargin", profitMargin);
+					profitMarginSum = profitMarginSum.add(profitMargin);
+					mapList.add(map);
+				}
+				Map<String, Object> mapSum = new HashMap<>();
+				mapSum.put("teu", teuSum);
+				mapSum.put("amountProfitLoc", amountProfitSum);
+				mapSum.put("profitMargin", profitMarginSum);
+				mapList.add(0, mapSum);
+			}
+		}
+		return R.data(mapList);
+	}
 }

+ 115 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/controller/BoxNumberProfitController.java

@@ -0,0 +1,115 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.controller;
+
+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.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+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.view.entity.BoxNumberProfit;
+import org.springblade.los.view.vo.BoxNumberProfitVO;
+import org.springblade.los.view.service.IBoxNumberProfitService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * VIEW 控制器
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/boxnumberprofit")
+@Api(value = "VIEW", tags = "VIEW接口")
+public class BoxNumberProfitController extends BladeController {
+
+	private final IBoxNumberProfitService boxNumberProfitService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入boxNumberProfit")
+	public R<BoxNumberProfit> detail(BoxNumberProfit boxNumberProfit) {
+		BoxNumberProfit detail = boxNumberProfitService.getOne(Condition.getQueryWrapper(boxNumberProfit));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 VIEW
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入boxNumberProfit")
+	public R<IPage<BoxNumberProfit>> list(BoxNumberProfit boxNumberProfit, Query query) {
+		IPage<BoxNumberProfit> pages = boxNumberProfitService.page(Condition.getPage(query), Condition.getQueryWrapper(boxNumberProfit));
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 VIEW
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入boxNumberProfit")
+	public R save(@Valid @RequestBody BoxNumberProfit boxNumberProfit) {
+		return R.status(boxNumberProfitService.save(boxNumberProfit));
+	}
+
+	/**
+	 * 修改 VIEW
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入boxNumberProfit")
+	public R update(@Valid @RequestBody BoxNumberProfit boxNumberProfit) {
+		return R.status(boxNumberProfitService.updateById(boxNumberProfit));
+	}
+
+	/**
+	 * 新增或修改 VIEW
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入boxNumberProfit")
+	public R submit(@Valid @RequestBody BoxNumberProfit boxNumberProfit) {
+		return R.status(boxNumberProfitService.saveOrUpdate(boxNumberProfit));
+	}
+
+
+	/**
+	 * 删除 VIEW
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(boxNumberProfitService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 44 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/BoxNumberProfitMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.los.statisticAnalysis.BoxNumberProfitQ;
+import org.springblade.los.view.entity.BoxNumberProfit;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * VIEW Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+public interface BoxNumberProfitMapper extends BaseMapper<BoxNumberProfit> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param boxNumberProfit
+	 * @return
+	 */
+	List<BoxNumberProfit> selectBoxNumberProfitPage(IPage page, @Param("data") BoxNumberProfitQ boxNumberProfit);
+
+	List<BoxNumberProfit> selectBoxNumberProfitList(@Param("data")BoxNumberProfitQ boxNumberProfit);
+}

+ 167 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/BoxNumberProfitMapper.xml

@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.view.mapper.BoxNumberProfitMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="boxNumberProfitResultMap" type="org.springblade.los.view.entity.BoxNumberProfit">
+        <result column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="business_type" property="businessType"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="carrier_id" property="carrierId"/>
+        <result column="carrier_cn_name" property="carrierCnName"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="pod_id" property="podId"/>
+        <result column="pod_cn_name" property="podCnName"/>
+        <result column="h_paymode" property="hPaymode"/>
+        <result column="cy_id" property="cyId"/>
+        <result column="cy_cn_name" property="cyCnName"/>
+        <result column="etd" property="etd"/>
+        <result column="eta" property="eta"/>
+        <result column="teu" property="teu"/>
+        <result column="quantity_v20" property="quantityV20"/>
+        <result column="quantity_v40" property="quantityV40"/>
+        <result column="quantity_v45" property="quantityV45"/>
+        <result column="quantity_v48" property="quantityV48"/>
+        <result column="quantity_v40hc" property="quantityV40hc"/>
+        <result column="quantity" property="quantity"/>
+        <result column="gross_weight" property="grossWeight"/>
+        <result column="measurement" property="measurement"/>
+        <result column="amount_dr" property="amountDr"/>
+        <result column="amount_cr" property="amountCr"/>
+        <result column="amount_profit" property="amountProfit"/>
+        <result column="amount_dr_usd" property="amountDrUsd"/>
+        <result column="amount_cr_usd" property="amountCrUsd"/>
+        <result column="amount_profit_usd" property="amountProfitUsd"/>
+        <result column="amount_dr_loc" property="amountDrLoc"/>
+        <result column="amount_cr_loc" property="amountCrLoc"/>
+        <result column="amount_profit_loc" property="amountProfitLoc"/>
+        <result column="line_id" property="lineId"/>
+        <result column="line_cn_name" property="lineCnName"/>
+        <result column="src_type" property="srcType"/>
+        <result column="src_id" property="srcId"/>
+        <result column="src_cn_name" property="srcCnName"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="team_id" property="teamId"/>
+        <result column="team_name" property="teamName"/>
+    </resultMap>
+
+
+    <select id="selectBoxNumberProfitPage" resultMap="boxNumberProfitResultMap">
+        select *
+        from los_box_number_profit
+        where is_deleted = 0
+        AND tenant_id = #{data.tenantId}
+        AND branch_id = #{data.branchId}
+        <if test="data.businessType != null and data.businessType != ''">
+            and find_in_set(business_type,#{data.businessType})
+        </if>
+        <if test="data.srcType != null and data.srcType != ''">
+            and src_type = #{data.srcType}
+        </if>
+        <if test="data.srcCnName != null and data.srcCnName != ''">
+            and src_cn_name like concat('%', #{data.srcCnName}, '%')
+        </if>
+        <if test="data.carrierCnName != null and data.carrierCnName != ''">
+            and carrier_cn_name like concat('%', #{data.carrierCnName}, '%')
+        </if>
+        <if test="data.corpCnName != null and data.corpCnName != ''">
+            and corp_cn_name like concat('%', #{data.corpCnName}, '%')
+        </if>
+        <if test="data.lineCnName != null and data.lineCnName != ''">
+            and line_cn_name like concat('%', #{data.lineCnName}, '%')
+        </if>
+        <if test="data.cyCnName != null and data.cyCnName != ''">
+            and cy_cn_name like concat('%', #{data.cyCnName}, '%')
+        </if>
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SE' or data.businessType == 'ASE'">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and etd &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and etd &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY etd DESC
+        </if>
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SI' or data.businessType == 'ASI'">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and eta &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and eta &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY eta DESC
+        </if>
+        <if test="data.businessType == null or data.businessType == ''">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and etd &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and etd &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY etd DESC
+        </if>
+    </select>
+    <select id="selectBoxNumberProfitList" resultMap="boxNumberProfitResultMap">
+        select *
+        from los_box_number_profit
+        where is_deleted = 0
+        AND tenant_id = #{data.tenantId}
+        AND branch_id = #{data.branchId}
+        <if test="data.businessType != null and data.businessType != ''">
+            and find_in_set(business_type,#{data.businessType})
+        </if>
+        <if test="data.srcType != null and data.srcType != ''">
+            and src_type = #{data.srcType}
+        </if>
+        <if test="data.srcCnName != null and data.srcCnName != ''">
+            and src_cn_name like concat('%', #{data.srcCnName}, '%')
+        </if>
+        <if test="data.carrierCnName != null and data.carrierCnName != ''">
+            and carrier_cn_name like concat('%', #{data.carrierCnName}, '%')
+        </if>
+        <if test="data.corpCnName != null and data.corpCnName != ''">
+            and corp_cn_name like concat('%', #{data.corpCnName}, '%')
+        </if>
+        <if test="data.lineCnName != null and data.lineCnName != ''">
+            and line_cn_name like concat('%', #{data.lineCnName}, '%')
+        </if>
+        <if test="data.cyCnName != null and data.cyCnName != ''">
+            and cy_cn_name like concat('%', #{data.cyCnName}, '%')
+        </if>
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SE' or data.businessType == 'ASE'">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and etd &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and etd &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY etd DESC
+        </if>
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SI' or data.businessType == 'ASI'">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and eta &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and eta &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY eta DESC
+        </if>
+        <if test="data.businessType == null or data.businessType == ''">
+            <if test='data.dateStart != null and data.dateStart != null'>
+                and etd &gt;= #{data.dateStart}
+            </if>
+            <if test='data.dateEnd != null and data.dateEnd != null'>
+                and etd &lt;= #{data.dateEnd}
+            </if>
+            ORDER BY etd DESC
+        </if>
+    </select>
+
+</mapper>

+ 33 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/service/IBoxNumberProfitService.java

@@ -0,0 +1,33 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.service;
+
+import org.springblade.los.view.entity.BoxNumberProfit;
+import org.springblade.los.view.vo.BoxNumberProfitVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务类
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+public interface IBoxNumberProfitService extends IService<BoxNumberProfit> {
+
+
+}

+ 38 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/service/impl/BoxNumberProfitServiceImpl.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.service.impl;
+
+import org.springblade.los.view.entity.BoxNumberProfit;
+import org.springblade.los.view.vo.BoxNumberProfitVO;
+import org.springblade.los.view.mapper.BoxNumberProfitMapper;
+import org.springblade.los.view.service.IBoxNumberProfitService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-06-20
+ */
+@Service
+public class BoxNumberProfitServiceImpl extends ServiceImpl<BoxNumberProfitMapper, BoxNumberProfit> implements IBoxNumberProfitService {
+
+
+
+}

+ 10 - 1
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportEnquiryController.java

@@ -23,6 +23,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.purchase.sales.entity.Order;
+import org.springblade.purchase.sales.entity.OrderEnum;
 import org.springblade.purchase.sales.entity.OrderItems;
 import org.springblade.purchase.sales.excel.EnquiryExcel;
 import org.springblade.purchase.sales.service.*;
@@ -110,7 +111,6 @@ public class ExportEnquiryController extends BladeController {
 		lambdaQueryWrapper.le(Func.isNotEmpty(order.getDeliveryEndDate()), Order::getRequiredDeliveryDate, order.getDeliveryEndDate());//要求发货日期结束
 		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getArrivalDateStart()), Order::getRequiredArrivalDate, order.getArrivalDateStart());//要求到货日期开始
 		lambdaQueryWrapper.le(Func.isNotEmpty(order.getArrivalDateEnd()), Order::getRequiredArrivalDate, order.getArrivalDateEnd());//要求到货日期结束
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderStatus()), Order::getOrderStatus, order.getOrderStatus());//单据状态
 		lambdaQueryWrapper.like(Func.isNotEmpty(order.getSysNo()), Order::getSysNo, order.getSysNo());//系统编号
 		lambdaQueryWrapper.eq(Func.isNotEmpty(order.getCreateUser()), Order::getCreateUser, order.getCreateUser());//制单人
 		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getCreateTimeStart()), Order::getCreateTime, order.getCreateTimeStart());//制单日期开始
@@ -123,6 +123,15 @@ public class ExportEnquiryController extends BladeController {
 		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPortOfDestination()), Order::getPortOfDestination, order.getPortOfDestination());//目的港
 		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryStart()), Order::getPlannedDeliveryDate, order.getPlannedDeliveryStart());//计划交货开始
 		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryEnd()), Order::getPlannedDeliveryDate, order.getPlannedDeliveryEnd());//计划交货结束
+		if ("1".equals(order.getTabType())) {
+			lambdaQueryWrapper.apply("order_status != '已提交'");
+		} else if ("2".equals(order.getTabType())) {
+			lambdaQueryWrapper.eq(Order::getOrderStatus, OrderEnum.SUBMIT.getStatus());
+		} else if ("3".equals(order.getTabType())) {
+			lambdaQueryWrapper.eq(Order::getOrderStatus, "已取消");
+		}else{
+			lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderStatus()), Order::getOrderStatus, order.getOrderStatus());//单据状态
+		}
 		lambdaQueryWrapper.orderByDesc(Order::getId);
 		IPage<Order> page = orderService.page(Condition.getPage(query), lambdaQueryWrapper);
 		if (CollectionUtils.isNotEmpty(page.getRecords())) {

+ 3 - 1
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportOrderController.java

@@ -152,9 +152,11 @@ public class ExportOrderController extends BladeController {
 		if ("1".equals(order.getTabType())) {
 			lambdaQueryWrapper.eq(Order::getDocumentaryStatus, "寄单");
 		} else if ("2".equals(order.getTabType())) {
-			lambdaQueryWrapper.apply("documentary_status != '寄单' and order_status != '已取消'");
+			lambdaQueryWrapper.apply("(documentary_status is null or documentary_status != '寄单'  ) and order_status != '已取消'");
 		} else if ("3".equals(order.getTabType())) {
 			lambdaQueryWrapper.eq(Order::getOrderStatus, "已取消");
+		}else if ("4".equals(order.getTabType())) {
+			lambdaQueryWrapper.eq(Order::getOrderStatus, "录入");
 		}
 		lambdaQueryWrapper.orderByDesc(Order::getId);
 		IPage<Order> page = orderService.page(Condition.getPage(query), lambdaQueryWrapper);

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java

@@ -1156,8 +1156,8 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				stockDesc.setCode(item.getGoodsNo());
 				stockDesc.setCname(goodsDesc.getCname());
 				stockDesc.setInventoryAlert(goodsDesc.getInventoryAlert());
-				stockDesc.setBrandId(item.getBrandId());
-				stockDesc.setBrandName(item.getBrandName());
+				stockDesc.setBrandId(goodsDesc.getBrandId());
+				stockDesc.setBrandName(goodsDesc.getBrandName());
 				stockDesc.setTypeno(item.getPropertyName());
 				stockDesc.setBrandItem(item.getPattern());
 				stockDesc.setProductDescription(item.getGoodsDescription());

+ 3 - 3
blade-service/trade-purchase/src/main/java/com/trade/purchase/enquiry/ShippingEnquiry.java

@@ -177,7 +177,7 @@ public class ShippingEnquiry extends BladeController {
 	}
 
 	/**
-	 * 修改 出口采购询价
+	 * 修改 出口船务询价
 	 */
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
@@ -196,8 +196,8 @@ public class ShippingEnquiry extends BladeController {
 		sendMessage.setParameter(String.valueOf(orderMessage.getId()));
 		sendMessage.setUserName(AuthUtil.getUserName());
 		sendMessage.setUserId(AuthUtil.getUserId());
-		sendMessage.setToUserId(orderMessage.getBuyerId());
-		sendMessage.setToUserName(orderMessage.getBuyerName());
+		sendMessage.setToUserId(orderMessage.getDocumenterId());
+		sendMessage.setToUserName(orderMessage.getDocumenterName());
 		sendMessage.setMessageType(1);
 		sendMessage.setTenantId(AuthUtil.getTenantId());
 		sendMessage.setCreateUser(AuthUtil.getUserId());

+ 38 - 0
blade-service/trade-purchase/src/main/java/com/trade/purchase/order/service/impl/OrderServiceImpl.java

@@ -333,6 +333,25 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 		orderMessage.setId(order.getId());
 		orderMessage.setIfEnquiry("已询价");
 		baseMapper.updateById(orderMessage);
+		//循环发送消息
+		Message sendMessage = new Message();
+		sendMessage.setParameter(String.valueOf(purchaseEnquiry.getId()));
+		sendMessage.setUserName(AuthUtil.getUserName());
+		sendMessage.setUserId(AuthUtil.getUserId());
+		sendMessage.setToUserId(orderMessage.getBuyerId());
+		sendMessage.setToUserName(orderMessage.getBuyerName());
+		sendMessage.setMessageType(1);
+		sendMessage.setTenantId(AuthUtil.getTenantId());
+		sendMessage.setCreateUser(AuthUtil.getUserId());
+		sendMessage.setCreateTime(new Date());
+		sendMessage.setUrl("/exportTrade/shippingInquiry/index");
+		sendMessage.setPageLabel(order.getPageLabel());
+		sendMessage.setPageStatus(order.getPageStatus());
+		sendMessage.setMessageBody("您有采购询价" + purchaseEnquiry.getOrderNo() + "待处理,请查看");
+		R save = messageClient.save(sendMessage);
+		if (!save.isSuccess()) {
+			throw new SecurityException("发送消息失败");
+		}
 		return R.data(vo);
 	}
 
@@ -575,6 +594,25 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 					, item.getSupervisorUserIdGroup(), item.getSupervisorUserNameGroup());
 			});
 		}
+		//循环发送消息
+		Message sendMessage = new Message();
+		sendMessage.setParameter(String.valueOf(order.getId()));
+		sendMessage.setUserName(AuthUtil.getUserName());
+		sendMessage.setUserId(AuthUtil.getUserId());
+		sendMessage.setToUserId(order.getCreateUser());
+		sendMessage.setToUserName(order.getCreateUserName());
+		sendMessage.setMessageType(1);
+		sendMessage.setTenantId(AuthUtil.getTenantId());
+		sendMessage.setCreateUser(AuthUtil.getUserId());
+		sendMessage.setCreateTime(new Date());
+		sendMessage.setUrl("/exportTrade/customerInquiry/index");
+		sendMessage.setPageLabel(order.getPageLabel());
+		sendMessage.setPageStatus(order.getPageStatus());
+		sendMessage.setMessageBody("单号:" + order.getOrderNo() + "船务询价已完成,请查看");
+		R save = messageClient.save(sendMessage);
+		if (!save.isSuccess()) {
+			throw new SecurityException("发送消息失败");
+		}
 		return R.data(order);
 	}