Browse Source

2023年12月12日17:59:32

纪新园 2 years ago
parent
commit
97ff27d663
18 changed files with 1173 additions and 4 deletions
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/dto/AmendsDTO.java
  2. 437 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/entity/Amends.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/vo/AmendsVO.java
  4. 4 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  5. 21 3
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  6. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/controller/AmendsController.java
  7. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.java
  8. 86 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.xml
  9. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/IAmendsService.java
  10. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  11. 4 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsStatisticsController.java
  12. 6 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.java
  13. 76 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml
  14. 6 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/IOrderService.java
  15. 15 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  16. 45 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/controller/StatisticsController.java
  17. 28 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/IStatisticsService.java
  18. 125 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/dto/AmendsDTO.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.business.amends.dto;
+
+import org.springblade.los.business.amends.entity.Amends;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-业务费用 AmendDate数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AmendsDTO extends Amends {
+	private static final long serialVersionUID = 1L;
+
+}

+ 437 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/entity/Amends.java

@@ -0,0 +1,437 @@
+/*
+ *      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.business.amends.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 业务-业务费用 AmendDate实体类
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+@Data
+@TableName("los_amends")
+@ApiModel(value = "Amends对象", description = "业务-业务费用 AmendDate")
+public class Amends implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建部门 Id
+	 */
+	@ApiModelProperty(value = "创建部门 Id")
+	private String createDept;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private String createDeptName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 业务类型, SEA=海运出口AMEND SIA=海运进口AMEND
+	 */
+	@ApiModelProperty(value = "业务类型, SEA=海运出口AMEND SIA=海运进口AMEND")
+	private String businessType;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 单据日期
+	 */
+	@ApiModelProperty(value = "单据日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date billDate;
+	/**
+	 * 财务日期
+	 */
+	@ApiModelProperty(value = "财务日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date accountDate;
+	/**
+	 * 操作 Id
+	 */
+	@ApiModelProperty(value = "操作 Id")
+	private Long operatorId;
+	/**
+	 * 操作
+	 */
+	@ApiModelProperty(value = "操作")
+	private String operatorName;
+	/**
+	 * 责任方
+	 */
+	@ApiModelProperty(value = "责任方")
+	private String responsibleParty;
+	/**
+	 * 原业务 id
+	 */
+	@ApiModelProperty(value = "原业务 id")
+	private Long origId;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String origBillNo;
+	/**
+	 * 单据日期
+	 */
+	@ApiModelProperty(value = "单据日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date origBillDate;
+	/**
+	 * 财务日期
+	 */
+	@ApiModelProperty(value = "财务日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date origAccountDate;
+	/**
+	 * 进出口, E=出口 I=进口
+	 */
+	@ApiModelProperty(value = "进出口, E=出口 I=进口")
+	private String origSeaType;
+	/**
+	 * 单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单
+	 */
+	@ApiModelProperty(value = "单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单")
+	private String origBillType;
+	/**
+	 * 原业务备注
+	 */
+	@ApiModelProperty(value = "原业务备注")
+	private String origRemarks;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 客户约号
+	 */
+	@ApiModelProperty(value = "客户约号")
+	private String corpArgreementNo;
+	/**
+	 * 航线 id
+	 */
+	@ApiModelProperty(value = "航线 id")
+	private Long lineId;
+	/**
+	 * 航线中文名称
+	 */
+	@ApiModelProperty(value = "航线中文名称")
+	private String lineCnName;
+	/**
+	 * 航线英文名称
+	 */
+	@ApiModelProperty(value = "航线英文名称")
+	private String lineEnName;
+	/**
+	 * 船公司 id
+	 */
+	@ApiModelProperty(value = "船公司 id")
+	private Long carrierId;
+	/**
+	 * 船公司中文名称
+	 */
+	@ApiModelProperty(value = "船公司中文名称")
+	private String carrierCnName;
+	/**
+	 * 船公司英文名称
+	 */
+	@ApiModelProperty(value = "船公司英文名称")
+	private String carrierEnName;
+	/**
+	 * 船公司约号
+	 */
+	@ApiModelProperty(value = "船公司约号")
+	private String carrierArgreementNo;
+	/**
+	 * 订舱号
+	 */
+	@ApiModelProperty(value = "订舱号")
+	private String bookingNo;
+	/**
+	 * 订舱日期
+	 */
+	@ApiModelProperty(value = "订舱日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date bookingDate;
+	/**
+	 * 船名 id
+	 */
+	@ApiModelProperty(value = "船名 id")
+	private Long vesselId;
+	/**
+	 * 中文船名
+	 */
+	@ApiModelProperty(value = "中文船名")
+	private String vesselCnName;
+	/**
+	 * 英文船名
+	 */
+	@ApiModelProperty(value = "英文船名")
+	private String vesselEnName;
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyageNo;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+	/**
+	 * Reference NO
+	 */
+	@ApiModelProperty(value = "Reference NO")
+	private String refno;
+	/**
+	 * 开船日期
+	 */
+	@ApiModelProperty(value = "开船日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date etd;
+	/**
+	 * 到港日期
+	 */
+	@ApiModelProperty(value = "到港日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date eta;
+	/**
+	 * 装货港 id
+	 */
+	@ApiModelProperty(value = "装货港 id")
+	private Long polId;
+	/**
+	 * 装货港代码
+	 */
+	@ApiModelProperty(value = "装货港代码")
+	private String polCode;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polCnName;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polEnName;
+	/**
+	 * 装货港英文名称打印 默认等于pol_en_name 可以编辑
+	 */
+	@ApiModelProperty(value = "装货港英文名称打印 默认等于pol_en_name 可以编辑")
+	private String polNamePrint;
+	/**
+	 * 卸货港 id
+	 */
+	@ApiModelProperty(value = "卸货港 id")
+	private Long podId;
+	/**
+	 * 卸货港代码
+	 */
+	@ApiModelProperty(value = "卸货港代码")
+	private String podCode;
+	/**
+	 * 卸货港中文名称
+	 */
+	@ApiModelProperty(value = "卸货港中文名称")
+	private String podCnName;
+	/**
+	 * 卸货港英文名称
+	 */
+	@ApiModelProperty(value = "卸货港英文名称")
+	private String podEnName;
+	/**
+	 * 卸货港英文名称打印 默认等于pol_en_name 可以编辑
+	 */
+	@ApiModelProperty(value = "卸货港英文名称打印 默认等于pol_en_name 可以编辑")
+	private String podNamePrint;
+	/**
+	 * 货物类别 dry=普货 danger=危险品 reefer=冻柜
+	 */
+	@ApiModelProperty(value = "货物类别 dry=普货 danger=危险品 reefer=冻柜")
+	private String cargoType;
+	/**
+	 * 包装单位 Id
+	 */
+	@ApiModelProperty(value = "包装单位 Id")
+	private Long packingUnitId;
+	/**
+	 * 包装单位
+	 */
+	@ApiModelProperty(value = "包装单位")
+	private String packingUnit;
+	/**
+	 * 件数
+	 */
+	@ApiModelProperty(value = "件数")
+	private BigDecimal quantity;
+	/**
+	 * 毛重 (KGM)
+	 */
+	@ApiModelProperty(value = "毛重 (KGM)")
+	private BigDecimal grossWeight;
+	/**
+	 * 净重 (KGM)
+	 */
+	@ApiModelProperty(value = "净重 (KGM)")
+	private BigDecimal netWeight;
+	/**
+	 * 体积 (CBM)
+	 */
+	@ApiModelProperty(value = "体积 (CBM)")
+	private BigDecimal measurement;
+	/**
+	 * 集装箱箱数英文,
+	 */
+	@ApiModelProperty(value = "集装箱箱数英文, ")
+	private String quantityCntrDescr;
+	/**
+	 * 商品包装件数英文,
+	 */
+	@ApiModelProperty(value = "商品包装件数英文, ")
+	private String quantityPackingDescr;
+	/**
+	 * 集装箱箱型箱数英文, 1*20GP,2*40HC
+	 */
+	@ApiModelProperty(value = "集装箱箱型箱数英文, 1*20GP,2*40HC")
+	private String quantityCntrTypesDescr;
+	/**
+	 * 状态(业务参数配置)
+	 */
+	@ApiModelProperty(value = "状态(业务参数配置)")
+	private Integer billStatus;
+	/**
+	 * 财务状态(业务参数配置)
+	 */
+	@ApiModelProperty(value = "财务状态(业务参数配置)")
+	private Integer accountStatus;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	@TableLogic(value = "0", delval = "1")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/vo/AmendsVO.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.business.amends.vo;
+
+import org.springblade.los.business.amends.entity.Amends;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-业务费用 AmendDate视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AmendsVO对象", description = "业务-业务费用 AmendDate")
+public class AmendsVO extends Amends {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -1515,4 +1515,8 @@ public class Bills implements Serializable {
 	private String pageLabel;
 
 
+	@TableField(exist = false)
+	private String FM;
+
+
 }

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

@@ -104,8 +104,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			.eq(BCurrency::getTenantId, AuthUtil.getTenantId())
 			.eq(BCurrency::getIsDeleted, 0)
 			.eq(BCurrency::getCode, "USD"));
-		List<Bills> list = new ArrayList<>();
-		if ("SE".equals(reports.getBusinessType())) {
+		if ("FYSH".equals(reports.getCode())) {
+			List<Bills> list = new ArrayList<>();
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				if (bCurrency != null) {
@@ -270,8 +270,26 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				}
 				list.add(0, bills);
 			}
+			map.put("data", list);
+		} else if ("PCTZD".equals(reports.getCode())) {
+			Bills bills = billsService.getById(billId);
+			if (bills != null) {
+				bills.setFM("jms");
+				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				map.put("data", bills);
+			} else {
+				map.put("data", null);
+			}
+		}else if ("RHTZ".equals(reports.getCode())) {
+			Bills bills = billsService.getById(billId);
+			if (bills != null) {
+				bills.setFM("jms");
+				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				map.put("data", bills);
+			} else {
+				map.put("data", null);
+			}
 		}
-		map.put("data", list);
 		map.put("url", reports.getUrl());
 		return R.data(map);
 	}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/controller/AmendsController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.business.amends.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.business.amends.entity.Amends;
+import org.springblade.los.business.amends.vo.AmendsVO;
+import org.springblade.los.business.amends.service.IAmendsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-业务费用 AmendDate 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/amends")
+@Api(value = "业务-业务费用 AmendDate", tags = "业务-业务费用 AmendDate接口")
+public class AmendsController extends BladeController {
+
+	private final IAmendsService amendsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入amends")
+	public R<Amends> detail(Amends amends) {
+		Amends detail = amendsService.getOne(Condition.getQueryWrapper(amends));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-业务费用 AmendDate
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入amends")
+	public R<IPage<Amends>> list(Amends amends, Query query) {
+		IPage<Amends> pages = amendsService.page(Condition.getPage(query), Condition.getQueryWrapper(amends));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-业务费用 AmendDate
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入amends")
+	public R<IPage<AmendsVO>> page(AmendsVO amends, Query query) {
+		IPage<AmendsVO> pages = amendsService.selectAmendsPage(Condition.getPage(query), amends);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-业务费用 AmendDate
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入amends")
+	public R save(@Valid @RequestBody Amends amends) {
+		return R.status(amendsService.save(amends));
+	}
+
+	/**
+	 * 修改 业务-业务费用 AmendDate
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入amends")
+	public R update(@Valid @RequestBody Amends amends) {
+		return R.status(amendsService.updateById(amends));
+	}
+
+	/**
+	 * 新增或修改 业务-业务费用 AmendDate
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入amends")
+	public R submit(@Valid @RequestBody Amends amends) {
+		return R.status(amendsService.saveOrUpdate(amends));
+	}
+
+
+	/**
+	 * 删除 业务-业务费用 AmendDate
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(amendsService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      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.business.amends.mapper;
+
+import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.vo.AmendsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-业务费用 AmendDate Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+public interface AmendsMapper extends BaseMapper<Amends> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param amends
+	 * @return
+	 */
+	List<AmendsVO> selectAmendsPage(IPage page, AmendsVO amends);
+
+}

+ 86 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.xml

@@ -0,0 +1,86 @@
+<?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.business.amends.mapper.AmendsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="amendsResultMap" type="org.springblade.los.business.amends.entity.Amends">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_dept_name" property="createDeptName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="business_type" property="businessType"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="account_date" property="accountDate"/>
+        <result column="operator_id" property="operatorId"/>
+        <result column="operator_name" property="operatorName"/>
+        <result column="responsible_party" property="responsibleParty"/>
+        <result column="orig_id" property="origId"/>
+        <result column="orig_bill_no" property="origBillNo"/>
+        <result column="orig_bill_date" property="origBillDate"/>
+        <result column="orig_account_date" property="origAccountDate"/>
+        <result column="orig_sea_type" property="origSeaType"/>
+        <result column="orig_bill_type" property="origBillType"/>
+        <result column="orig_remarks" property="origRemarks"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="corp_argreement_no" property="corpArgreementNo"/>
+        <result column="line_id" property="lineId"/>
+        <result column="line_cn_name" property="lineCnName"/>
+        <result column="line_en_name" property="lineEnName"/>
+        <result column="carrier_id" property="carrierId"/>
+        <result column="carrier_cn_name" property="carrierCnName"/>
+        <result column="carrier_en_name" property="carrierEnName"/>
+        <result column="carrier_argreement_no" property="carrierArgreementNo"/>
+        <result column="booking_no" property="bookingNo"/>
+        <result column="booking_date" property="bookingDate"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="vessel_en_name" property="vesselEnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="refno" property="refno"/>
+        <result column="etd" property="etd"/>
+        <result column="eta" property="eta"/>
+        <result column="pol_id" property="polId"/>
+        <result column="pol_code" property="polCode"/>
+        <result column="pol_cn_name" property="polCnName"/>
+        <result column="pol_en_name" property="polEnName"/>
+        <result column="pol_name_print" property="polNamePrint"/>
+        <result column="pod_id" property="podId"/>
+        <result column="pod_code" property="podCode"/>
+        <result column="pod_cn_name" property="podCnName"/>
+        <result column="pod_en_name" property="podEnName"/>
+        <result column="pod_name_print" property="podNamePrint"/>
+        <result column="cargo_type" property="cargoType"/>
+        <result column="packing_unit_id" property="packingUnitId"/>
+        <result column="packing_unit" property="packingUnit"/>
+        <result column="quantity" property="quantity"/>
+        <result column="gross_weight" property="grossWeight"/>
+        <result column="net_weight" property="netWeight"/>
+        <result column="measurement" property="measurement"/>
+        <result column="quantity_cntr_descr" property="quantityCntrDescr"/>
+        <result column="quantity_packing_descr" property="quantityPackingDescr"/>
+        <result column="quantity_cntr_types_descr" property="quantityCntrTypesDescr"/>
+        <result column="bill_status" property="billStatus"/>
+        <result column="account_status" property="accountStatus"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectAmendsPage" resultMap="amendsResultMap">
+        select * from los_amends where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/IAmendsService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.business.amends.service;
+
+import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.vo.AmendsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-业务费用 AmendDate 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+public interface IAmendsService extends IService<Amends> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param amends
+	 * @return
+	 */
+	IPage<AmendsVO> selectAmendsPage(IPage<AmendsVO> page, AmendsVO amends);
+
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.business.amends.service.impl;
+
+import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.vo.AmendsVO;
+import org.springblade.los.business.amends.mapper.AmendsMapper;
+import org.springblade.los.business.amends.service.IAmendsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-业务费用 AmendDate 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-12
+ */
+@Service
+public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> implements IAmendsService {
+
+	@Override
+	public IPage<AmendsVO> selectAmendsPage(IPage<AmendsVO> page, AmendsVO amends) {
+		return page.setRecords(baseMapper.selectAmendsPage(page, amends));
+	}
+
+}

+ 4 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsStatisticsController.java

@@ -58,6 +58,8 @@ public class CorpsStatisticsController {
 		for (PjCorpsDesc corpsDescDto1 : pages.getRecords()) {
 			LambdaQueryWrapper<PjOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 			lambdaQueryWrapper.eq(PjOrder::getCustomerId, corpsDescDto1.getId());
+			lambdaQueryWrapper.eq(PjOrder::getIsDeleted,0)
+				.eq(PjOrder::getTenantId,AuthUtil.getTenantId());
 			if (corpsDescDto1.getCorpType().equals("KH")) {
 				lambdaQueryWrapper.eq(PjOrder::getBsType, "XS");
 				lambdaQueryWrapper.apply("find_in_set(status,'待确认,待发货,已发货')");
@@ -110,6 +112,8 @@ public class CorpsStatisticsController {
 		for (PjCorpsDesc corpsDescDto1 : corpsDescDtoList) {
 			LambdaQueryWrapper<PjOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 			lambdaQueryWrapper.eq(PjOrder::getCustomerId, corpsDescDto1.getId());
+			lambdaQueryWrapper.eq(PjOrder::getIsDeleted,0)
+				.eq(PjOrder::getTenantId,AuthUtil.getTenantId());
 			if (corpsDescDto1.getCorpType().equals("KH")) {
 				lambdaQueryWrapper.eq(PjOrder::getBsType, "XS");
 				lambdaQueryWrapper.apply("find_in_set(status,'待确认,待发货,已发货')");

+ 6 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.java

@@ -70,4 +70,10 @@ public interface OrderMapper extends BaseMapper<PjOrder> {
     int corpAnalysis(@Param("order") PjOrder order);
 
     List<PjShipStockDetails> stockDataDetailsOrder(@Param("order")PjShipStockDetails pjShipStockDetails);
+
+	List<Map<String, Object>> brandSalesVolume(@Param("statusDate") String statusDate, @Param("endDate")String endDate, @Param("deptId")String deptId, @Param("tenantId")String tenantId);
+
+	List<Map<String, Object>> corpsSalesVolume(@Param("statusDate")String statusDate, @Param("endDate")String endDate, @Param("deptId")String deptId, @Param("tenantId")String tenantId);
+
+	List<Map<String, Object>> sizeSalesVolumeProportion(@Param("statusDate")String statusDate, @Param("endDate")String endDate,@Param("deptId")String deptId, @Param("tenantId")String tenantId);
 }

+ 76 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml

@@ -395,5 +395,81 @@
         ps.ord_no
         ORDER BY ps.busines_date asc
     </select>
+    <select id="brandSalesVolume" resultType="java.util.Map">
+        SELECT
+            pbd.cname AS cname,
+            if(SUM( poi.goods_num ),SUM( poi.goods_num ),0) AS number
+        FROM
+            pjpf_order_items poi
+                LEFT JOIN pjpf_order po ON poi.pid = po.id
+                LEFT JOIN pjpf_brand_desc pbd ON poi.brand_id = pbd.id
+        WHERE
+            po.tenant_id = #{tenantId}
+          AND po.is_deleted = '0'
+          AND find_in_set(po.sales_company_id,#{deptId})
+          AND poi.is_deleted = '0'
+          AND poi.tenant_id = #{tenantId}
+          AND po.bs_type = 'XS'
+          AND (( po.business_source = '外部销售' AND FIND_IN_SET( po.actual_payment_status, '2,3' ) )
+                   OR (po.business_source = '内部销售' AND FIND_IN_SET( po.actual_payment_status, '0,1,2,3' )))
+          AND po.status = '已发货'
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &gt;= DATE_FORMAT(#{statusDate},'%Y-%m')
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &lt;= DATE_FORMAT(#{endDate},'%Y-%m')
+        GROUP BY
+            poi.brand_id
+            LIMIT 10
+    </select>
+    <select id="corpsSalesVolume" resultType="java.util.Map">
+        SELECT
+            pcd.cname AS cname,
+            if(SUM( poi.goods_num ),SUM( poi.goods_num ),0) AS number
+        FROM
+            pjpf_order po
+                LEFT JOIN pjpf_order_items poi ON po.id = poi.pid
+                LEFT JOIN pjpf_corps_desc pcd ON po.customer_id = pcd.id
+        WHERE
+            po.tenant_id = #{tenantId}
+          AND po.is_deleted = '0'
+          AND find_in_set(po.sales_company_id,#{deptId})
+          AND poi.is_deleted = '0'
+          AND poi.tenant_id = #{tenantId}
+          AND po.bs_type = 'XS'
+          AND (( po.business_source = '外部销售' AND FIND_IN_SET( po.actual_payment_status, '2,3' ) )
+            OR (po.business_source = '内部销售' AND FIND_IN_SET( po.actual_payment_status, '0,1,2,3' )))
+          AND po.status = '已发货'
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &gt;= DATE_FORMAT(#{statusDate},'%Y-%m')
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &lt;= DATE_FORMAT(#{endDate},'%Y-%m')
+        GROUP BY
+            po.customer_id
+        ORDER BY
+            number DESC
+            LIMIT 10
+    </select>
+    <select id="sizeSalesVolumeProportion" resultType="java.util.Map">
+        SELECT
+            pbd.goods_size AS cname,
+            IF
+                ( SUM( poi.goods_num ), SUM( poi.goods_num ), 0 ) AS number
+        FROM
+            pjpf_order_items poi
+                LEFT JOIN pjpf_order po ON poi.pid = po.id
+                LEFT JOIN pjpf_goods_desc pbd ON poi.goods_id = pbd.id
+        WHERE
+            po.tenant_id = #{tenantId}
+          AND po.is_deleted = '0'
+          AND find_in_set(po.sales_company_id,#{deptId})
+          AND poi.is_deleted = '0'
+          AND poi.tenant_id = #{tenantId}
+          AND po.bs_type = 'XS'
+          AND (( po.business_source = '外部销售' AND FIND_IN_SET( po.actual_payment_status, '2,3' ) )
+            OR (po.business_source = '内部销售' AND FIND_IN_SET( po.actual_payment_status, '0,1,2,3' )))
+          AND po.status = '已发货'
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &gt;= DATE_FORMAT(#{statusDate},'%Y-%m')
+          AND DATE_FORMAT(po.business_date,'%Y-%m') &lt;= DATE_FORMAT(#{endDate},'%Y-%m')
+        GROUP BY
+            pbd.goods_size
+        ORDER BY
+            number DESC
+    </select>
 
 </mapper>

+ 6 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/IOrderService.java

@@ -180,4 +180,10 @@ public interface IOrderService extends IService<PjOrder> {
 	R confirmInventory(PjOrder order);
 
 	R<List<PjOrderItems>> importItem(List<StockExportExcel> excelList);
+
+	List<Map<String, Object>> brandSalesVolume(String statusDate, String endDate, String deptId, String tenantId);
+
+	List<Map<String, Object>> corpsSalesVolume(String statusDate, String endDate, String deptId, String tenantId);
+
+	List<Map<String, Object>> sizeSalesVolumeProportion(String statusDate, String endDate, String deptId, String tenantId);
 }

+ 15 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -992,6 +992,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 		return R.data(list);
 	}
 
+	@Override
+	public List<Map<String, Object>> brandSalesVolume(String statusDate, String endDate, String deptId, String tenantId) {
+		return baseMapper.brandSalesVolume(statusDate,endDate,deptId,tenantId);
+	}
+
+	@Override
+	public List<Map<String, Object>> corpsSalesVolume(String statusDate, String endDate, String deptId, String tenantId) {
+		return baseMapper.corpsSalesVolume(statusDate,endDate,deptId,tenantId);
+	}
+
+	@Override
+	public List<Map<String, Object>> sizeSalesVolumeProportion(String statusDate, String endDate, String deptId, String tenantId) {
+		return baseMapper.sizeSalesVolumeProportion(statusDate,endDate,deptId,tenantId);
+	}
+
 	/**
 	 * 保存订单信息
 	 *

+ 45 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/controller/StatisticsController.java

@@ -39,8 +39,52 @@ public class StatisticsController {
 	 * 首页待办订单
 	 */
 	@PostMapping("/stayDoOrder")
-	public R<List<StayDoOrder>> stayDoOrder( @RequestBody StayDoOrder stayDoOrder) {
+	public R<List<StayDoOrder>> stayDoOrder(@RequestBody StayDoOrder stayDoOrder) {
 		return statisticsService.stayDoOrder(stayDoOrder);
 	}
 
+	/**
+	 * 销售数量
+	 */
+	@GetMapping("/stayDoOrder")
+	public R dayNumber() {
+		return statisticsService.dayNumber();
+	}
+
+	/**
+	 * 销量/客户数量/平均客单价/客户流失率
+	 */
+	@GetMapping("/salesVolumesStatistics")
+	public R salesVolumesStatistics(@RequestParam(value = "statusDate") String statusDate,
+							  @RequestParam(value = "endDate") String endDate) {
+		return statisticsService.salesVolumesStatistics(statusDate, endDate);
+	}
+
+	/**
+	 * 品牌销量
+	 */
+	@GetMapping("/brandSalesVolume")
+	public R brandSalesVolume(@RequestParam(value = "statusDate") String statusDate,
+							  @RequestParam(value = "endDate") String endDate) {
+		return statisticsService.brandSalesVolume(statusDate, endDate);
+	}
+
+	/**
+	 * 客户销量
+	 */
+	@GetMapping("/corpsSalesVolume")
+	public R corpsSalesVolume(@RequestParam(value = "statusDate") String statusDate,
+							  @RequestParam(value = "endDate") String endDate) {
+		return statisticsService.corpsSalesVolume(statusDate, endDate);
+	}
+
+	/**
+	 * 尺寸销量占比
+	 */
+	@GetMapping("/sizeSalesVolumeProportion")
+	public R sizeSalesVolumeProportion(@RequestParam(value = "statusDate") String statusDate,
+									   @RequestParam(value = "endDate") String endDate) {
+		return statisticsService.sizeSalesVolumeProportion(statusDate, endDate);
+	}
+
 }

+ 28 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/IStatisticsService.java

@@ -42,4 +42,32 @@ public interface IStatisticsService {
 	 * @return
 	 */
 	R<List<StayDoOrder>> stayDoOrder(StayDoOrder stayDoOrder);
+
+	R dayNumber();
+
+	/**
+	 * 品牌销量
+	 * @return
+	 */
+	R brandSalesVolume(String statusDate,String endDate);
+
+	/**
+	 * 客户销量
+	 * @return
+	 */
+	R corpsSalesVolume(String statusDate,String endDate);
+
+	/**
+	 * 尺寸销量占比
+	 * @return
+	 */
+	R sizeSalesVolumeProportion(String statusDate,String endDate);
+
+	/**
+	 * 销量/客户数量/平均客单价/客户流失率
+	 * @param statusDate
+	 * @param endDate
+	 * @return
+	 */
+	R salesVolumesStatistics(String statusDate, String endDate);
 }

+ 125 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

@@ -32,6 +32,7 @@ import org.springblade.salesPart.statistics.service.IStatisticsService;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.math.MathContext;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -256,4 +257,128 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		}
 		return R.data(stayDoOrderList);
 	}
+
+	@Override
+	public R dayNumber() {
+		List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
+			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+			.eq(PjOrder::getIsDeleted, 0)
+			.eq(PjOrder::getBsType, "XS")
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
+			.apply("status = '已发货' and busines_date = CURDATE()"));
+		if (pjOrderList.size() > 0) {
+			BigDecimal number = pjOrderList.stream().map(PjOrder::getGoodsTotalNum)
+				.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, BigDecimal.ROUND_HALF_UP);
+			return R.data(number);
+		} else {
+
+			return R.data(0);
+		}
+	}
+
+	@Override
+	public R brandSalesVolume(String statusDate, String endDate) {
+		List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
+			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+			.eq(PjOrder::getIsDeleted, 0)
+			.eq(PjOrder::getBsType, "XS")
+			.gt(PjOrder::getBusinesDate, statusDate)
+			.lt(PjOrder::getBusinesDate, endDate)
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
+			.apply("status = '已发货'"));
+		List<Map<String, Object>> mapList = orderService.brandSalesVolume(statusDate, endDate, AuthUtil.getDeptId(), AuthUtil.getTenantId());
+		if (pjOrderList.size() > 0) {
+			BigDecimal sum = pjOrderList.stream().map(PjOrder::getGoodsTotalNum).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			for (Map<String, Object> map : mapList) {
+				BigDecimal number = new BigDecimal(map.get("number").toString());
+				if (number.compareTo(new BigDecimal("0")) != 0) {
+					map.put("percentage", number.divide(sum, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")));
+				} else {
+					map.put("percentage", new BigDecimal("0"));
+				}
+			}
+		}
+		return R.data(mapList);
+	}
+
+	@Override
+	public R corpsSalesVolume(String statusDate, String endDate) {
+		List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
+			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+			.eq(PjOrder::getIsDeleted, 0)
+			.eq(PjOrder::getBsType, "XS")
+			.gt(PjOrder::getBusinesDate, statusDate)
+			.lt(PjOrder::getBusinesDate, endDate)
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
+			.apply("status = '已发货'"));
+		List<Map<String, Object>> mapList = orderService.corpsSalesVolume(statusDate, endDate, AuthUtil.getDeptId(), AuthUtil.getTenantId());
+		if (pjOrderList.size() > 0) {
+			BigDecimal sum = pjOrderList.stream().map(PjOrder::getGoodsTotalNum).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			for (Map<String, Object> map : mapList) {
+				BigDecimal number = new BigDecimal(map.get("number").toString());
+				if (number.compareTo(new BigDecimal("0")) != 0) {
+					map.put("percentage", number.divide(sum, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")));
+				} else {
+					map.put("percentage", new BigDecimal("0"));
+				}
+			}
+		}
+		return R.data(mapList);
+	}
+
+	@Override
+	public R sizeSalesVolumeProportion(String statusDate, String endDate) {
+		List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
+			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+			.eq(PjOrder::getIsDeleted, 0)
+			.eq(PjOrder::getBsType, "XS")
+			.gt(PjOrder::getBusinesDate, statusDate)
+			.lt(PjOrder::getBusinesDate, endDate)
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
+			.apply("status = '已发货'"));
+		List<Map<String, Object>> mapList = orderService.sizeSalesVolumeProportion(statusDate, endDate, AuthUtil.getDeptId(), AuthUtil.getTenantId());
+		if (pjOrderList.size() > 0) {
+			BigDecimal sum = pjOrderList.stream().map(PjOrder::getGoodsTotalNum).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			for (Map<String, Object> map : mapList) {
+				BigDecimal number = new BigDecimal(map.get("number").toString());
+				if (number.compareTo(new BigDecimal("0")) != 0) {
+					map.put("percentage", number.divide(sum, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")));
+				} else {
+					map.put("percentage", new BigDecimal("0"));
+				}
+			}
+		}
+		return R.data(mapList);
+	}
+
+	@Override
+	public R salesVolumesStatistics(String statusDate, String endDate) {
+		Map<String, Object> map = new HashMap<>();
+		LambdaQueryWrapper<PjOrder> lambdaQueryWrapperXS = new LambdaQueryWrapper<PjOrder>().eq(PjOrder::getIsDeleted, 0)
+			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+			.ge(ObjectUtils.isNotNull(statusDate), PjOrder::getBusinesDate, statusDate)
+			.le(ObjectUtils.isNotNull(endDate), PjOrder::getBusinesDate, endDate)
+			.eq(PjOrder::getStatus, "已发货")
+			.eq(PjOrder::getBsType, "XS");
+		lambdaQueryWrapperXS.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))");
+		List<PjOrder> pjOrderListXS = orderService.list(lambdaQueryWrapperXS);
+		//销售
+		BigDecimal income = new BigDecimal("0.00");
+		//平均客单价
+		BigDecimal averageAmount = new BigDecimal("0.00");
+		//客户数量
+		BigDecimal corpsNumber = new BigDecimal("0.00");
+
+		if (pjOrderListXS.size() > 0) {
+			long sum = pjOrderListXS.stream().map(PjOrder::getCustomerId).filter(Objects::nonNull).distinct().count();
+			corpsNumber = corpsNumber.add(new BigDecimal(sum));
+			income = pjOrderListXS.stream().map(PjOrder::getTotalMoney).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			averageAmount = averageAmount.add(income.divide(new BigDecimal(pjOrderListXS.size()), MathContext.DECIMAL32).setScale(2, BigDecimal.ROUND_HALF_UP));
+		}
+		map.put("income", income);
+		map.put("averageAmount", averageAmount);
+		map.put("corpsNumber", corpsNumber);
+		return R.data(map);
+	}
 }