Browse Source

2024年12月27日17:25:55

纪新园 1 year ago
parent
commit
0f68cd6497
25 changed files with 1139 additions and 122 deletions
  1. 6 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjStockDesc.java
  2. 18 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjStorageDesc.java
  3. 89 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsPointsExcel.java
  4. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/dto/TireMallStatisticsDTO.java
  5. 145 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/entity/TireMallStatistics.java
  6. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/vo/TireMallStatisticsVO.java
  7. 2 1
      blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java
  8. 38 10
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java
  9. 3 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/IGoodsDescService.java
  10. 208 6
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java
  11. 42 20
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/PjIntegralDetailMapper.xml
  12. 2 11
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  13. 26 12
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java
  14. 2 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java
  15. 26 3
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/smartLargeScreenApi/service/impl/ApiServiceImpl.java
  16. 58 57
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java
  17. 2 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/stock/mapper/StockDescMapper.xml
  18. 2 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/storage/service/IStorageDescService.java
  19. 5 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/storage/service/impl/StorageDescServiceImpl.java
  20. 126 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/controller/TireMallStatisticsController.java
  21. 46 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/mapper/TireMallStatisticsMapper.java
  22. 130 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/mapper/TireMallStatisticsMapper.xml
  23. 44 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/service/ITireMallStatisticsService.java
  24. 48 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/service/impl/TireMallStatisticsServiceImpl.java
  25. 1 1
      blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

+ 6 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjStockDesc.java

@@ -300,4 +300,10 @@ public class PjStockDesc implements Serializable {
 	@TableField(exist = false)
 	private String whetherIntegral;
 
+	/**
+	 * 兑换积分
+	 */
+	@TableField(exist = false)
+	private BigDecimal integral;
+
 }

+ 18 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjStorageDesc.java

@@ -145,5 +145,23 @@ public class PjStorageDesc implements Serializable {
 	@ApiModelProperty(value = "是否融资库")
 	private String whetherFinancing;
 
+	/**
+	 * 经度
+	 */
+	@ApiModelProperty(value = "经度")
+	private String longitude;
+
+	/**
+	 * 维度
+	 */
+	@ApiModelProperty(value = "维度")
+	private String dimension;
+
+	/**
+	 * 地址
+	 */
+	@ApiModelProperty(value = "地址")
+	private String address;
+
 
 }

+ 89 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsPointsExcel.java

@@ -0,0 +1,89 @@
+package org.springblade.salesPart.excel;
+
+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.io.Serializable;
+
+/**
+ * 商品导入模板实体类
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class GoodsPointsExcel implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 商品编码
+	 */
+	@ExcelProperty(value = "*商品编码")
+	private String code;
+
+	/**
+	 * 商品名称
+	 */
+	@ExcelProperty(value = "*商品名称")
+	private String cname;
+
+	/**
+	 * 商品分类
+	 */
+	@ExcelProperty(value = "*商品分类")
+	private String goodsTypeName;
+
+	/**
+	 * 计量单位
+	 */
+	@ExcelProperty(value = "*计量单位")
+	private String unit;
+
+	/**
+	 * 品牌
+	 */
+	@ExcelProperty(value = "*品牌")
+	private String brand;
+
+	/**
+	 * 规格型号
+	 */
+	@ExcelProperty(value = "*规格型号")
+	private String specificationAndModel;
+
+	/**
+	 * 所属公司名称
+	 */
+	@ExcelProperty(value = "*所属公司名称")
+	private String salesCompanyName;
+
+	/**
+	 * 产地
+	 */
+	@ExcelProperty(value = "产地")
+	private String placeProduction;
+
+	/**
+	 * 供应商名称
+	 */
+	@ExcelProperty(value = "供应商名称")
+	private String corpName;
+
+	/**
+	 * 商品描述
+	 */
+	@ExcelProperty(value = "商品描述")
+	private String goodsDescription;
+
+
+	/**
+	 * 商品IDS
+	 */
+	@ExcelProperty(value = "商品IDS")
+	private String goodIds;
+
+}

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/dto/TireMallStatisticsDTO.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.salesPart.tireMallStatistics.dto;
+
+import org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * VIEW数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-12-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TireMallStatisticsDTO extends TireMallStatistics {
+	private static final long serialVersionUID = 1L;
+
+}

+ 145 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/entity/TireMallStatistics.java

@@ -0,0 +1,145 @@
+/*
+ *      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.salesPart.tireMallStatistics.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-12-27
+ */
+@Data
+@TableName("pjpf_tire_mall_statistics")
+@ApiModel(value = "TireMallStatistics对象", description = "VIEW")
+public class TireMallStatistics implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	// 主表id
+	private Long id;
+	// 出入库单号
+	private String billno;
+	// 销售采购单号
+	private String ordNo;
+	// 销售微信单据号
+	private String srcOrdNo;
+	// 状态
+	private String status;
+	// 业务类型
+	private String bsType;
+	// 客户
+	private Long corpId;
+	// 客户
+	private String corpName;
+	// 销售-业务员 出入库-库管员
+	private Long salerId;
+	// 销售-业务员 出入库-库管员
+	private String salerName;
+	// 仓库
+	private Long storageId;
+	// 仓库
+	private String storageName;
+	// 业务来源  内部,外部
+	private String businessSource;
+	// 运费
+	private BigDecimal freight;
+	// 实际支付金额
+	private BigDecimal paymentAmountTl;
+	// 支付状态
+	private Long actualPaymentStatus;
+	// 业务日期
+	private Date businesDate;
+	// 发货日期
+	private Date deliveryBusinesDate;
+	// 融资方
+	private Long fundingPartyId;
+	// 融资方
+	private String fundingPartyName;
+	// 融资金额
+	private BigDecimal fundingAmount;
+	// 原融资金额
+	private BigDecimal primaryFundingAmount;
+	// 保证金额
+	private BigDecimal bondAmount;
+	// 原保证金额
+	private BigDecimal primaryBondAmount;
+	// 明细id
+	private Long itemId;
+	// 商品编号
+	private String goodsNo;
+	// 商品名称
+	private String goodsName;
+	// 商品id
+	private Long goodsId;
+	// 商品快捷号
+	private String cnameInt;
+	// 品牌
+	private Long brandId;
+	// 品牌
+	private String brandName;
+	// 规格型号
+	private String propertyName;
+	// 花纹
+	private String pattern;
+	// 商品描述
+	private String goodsDescription;
+	// 数量
+	private BigDecimal goodsNum;
+	// 单价
+	private BigDecimal price;
+	// 金额
+	private BigDecimal subTotalMoney;
+	// 成本单价
+	private BigDecimal costpriePrice;
+	// 成本
+	private BigDecimal costprie;
+	// 毛利
+	private BigDecimal grossProfit;
+	// 发货数量
+	private BigDecimal sendNum;
+	// 发货金额
+	private BigDecimal goodsTotalShipAmount;
+	// 合计金额
+	private BigDecimal totalAmount;
+	// 退货数量
+	private BigDecimal returnsNumber;
+	// 退货金额
+	private BigDecimal returnsAmount;
+	// 卖出数量
+	private BigDecimal outGoodsTotalShipNum;
+	// 卖出金额
+	private BigDecimal outGoodsTotalShipAmount;
+	// 原订单数量
+	private BigDecimal primaryGoodsTotalNum;
+	// 原订单金额
+	private BigDecimal primaryGoodsTotalAmount;
+	// 发货自有数量
+	private BigDecimal sendNumHave;
+	// 发货融资数量
+	private BigDecimal sendNumFinancing;
+	// 租户号
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/tireMallStatistics/vo/TireMallStatisticsVO.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.salesPart.tireMallStatistics.vo;
+
+import org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * VIEW视图实体类
+ *
+ * @author BladeX
+ * @since 2024-12-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "TireMallStatisticsVO对象", description = "VIEW")
+public class TireMallStatisticsVO extends TireMallStatistics {
+	private static final long serialVersionUID = 1L;
+
+}

+ 2 - 1
blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java

@@ -147,7 +147,8 @@ public class SybPayService {
 		}
 		params.put("remark", remark);
 		params.put("validtime", validtime);
-		params.put("limit_pay", limit_pay);
+//		params.put("limit_pay", limit_pay);
+		params.put("limit_pay", "");
 		params.put("randomstr", SybUtil.getValidatecode(8));
 		params.put("paytype", paytype);
 		params.put("signtype", transactionType);

+ 38 - 10
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java

@@ -43,6 +43,7 @@ import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.GoodsDescExportExcel;
 import org.springblade.salesPart.excel.GoodsExcel;
+import org.springblade.salesPart.excel.GoodsPointsExcel;
 import org.springblade.salesPart.goods.service.IGoodsDescService;
 import org.springblade.salesPart.goods.service.IGoodsFilesService;
 import org.springblade.salesPart.goods.service.IGoodsTypeService;
@@ -118,7 +119,7 @@ public class GoodsDescController extends BladeController {
 
 		lambdaQueryWrapper.select(PjGoodsDesc::getId, PjGoodsDesc::getCname, PjGoodsDesc::getCode, PjGoodsDesc::getSpecificationAndModel, PjGoodsDesc::getBrandItem,
 				PjGoodsDesc::getBrandName, PjGoodsDesc::getGoodsSize, PjGoodsDesc::getInventoryAlert, PjGoodsDesc::getGoodsDescription,
-				PjGoodsDesc::getStatus, PjGoodsDesc::getEnableOrNot,PjGoodsDesc::getUnit)
+				PjGoodsDesc::getStatus, PjGoodsDesc::getEnableOrNot,PjGoodsDesc::getUnit,PjGoodsDesc::getIntegral)
 			.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
 			.eq(PjGoodsDesc::getIsDeleted, 0)
 			.eq(PjGoodsDesc::getSalesCompanyId, AuthUtil.getDeptId())//公司
@@ -267,6 +268,15 @@ public class GoodsDescController extends BladeController {
 	}
 
 	/**
+	 * 同步基础资料
+	 */
+	@GetMapping("/synchronization")
+	@RepeatSubmit
+	public R importDesc() {
+		return goodsDescService.synchronization();
+	}
+
+	/**
 	 * 导入商品
 	 */
 	@PostMapping("/import-desc")
@@ -282,15 +292,6 @@ public class GoodsDescController extends BladeController {
 	}
 
 	/**
-	 * 同步基础资料
-	 */
-	@GetMapping("/synchronization")
-	@RepeatSubmit
-	public R importDesc() {
-		return goodsDescService.synchronization();
-	}
-
-	/**
 	 * 导出模板
 	 */
 	@GetMapping("/export-template")
@@ -328,6 +329,7 @@ public class GoodsDescController extends BladeController {
 			.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
 			.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
 			.like(ObjectUtils.isNotEmpty(goods.getCnameInt()), PjGoodsDesc::getCnameInt, goods.getCnameInt())
+			.like(ObjectUtils.isNotEmpty(goods.getWhetherIntegral()), PjGoodsDesc::getWhetherIntegral, goods.getWhetherIntegral())
 			.like(ObjectUtils.isNotEmpty(goods.getCode()), PjGoodsDesc::getCode, goods.getCode())//编码
 			.eq(ObjectUtils.isNotNull(goods.getEnableOrNot()), PjGoodsDesc::getEnableOrNot, goods.getEnableOrNot())//状态
 			.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
@@ -796,4 +798,30 @@ public class GoodsDescController extends BladeController {
 		}
 		return R.data(list);
 	}
+
+	/**
+	 * 导入积分商品信息
+	 */
+	@PostMapping("/import-desc-Points")
+	@ApiOperationSupport(order = 12)
+	@ApiOperation(value = "导入积分商品信息", notes = "传入excel")
+	@RepeatSubmit
+	public R importDescPoints(MultipartFile file) {
+		List<GoodsPointsExcel> excelList = ExcelUtil.read(file, GoodsPointsExcel.class);
+		if (CollectionUtils.isEmpty(excelList)) {
+			throw new SecurityException("数据不能为空");
+		}
+		return goodsDescService.importDescPoints(excelList, false);
+	}
+
+	/**
+	 * 导出模板-积分商品
+	 */
+	@GetMapping("/export-template-Points")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "导出模板")
+	public void exportPricePoints(HttpServletResponse response) {
+		List<GoodsPointsExcel> list = new ArrayList<>();
+		ExcelUtil.export(response, "导入模板-积分商品信息", "导入数据表", list, GoodsPointsExcel.class);
+	}
 }

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/IGoodsDescService.java

@@ -19,6 +19,7 @@ package org.springblade.salesPart.goods.service;
 import org.springblade.core.tool.api.R;
 import org.springblade.salesPart.entity.PjGoodsDesc;
 import org.springblade.salesPart.excel.GoodsExcel;
+import org.springblade.salesPart.excel.GoodsPointsExcel;
 import org.springblade.salesPart.vo.GoodsDescVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -94,4 +95,6 @@ public interface IGoodsDescService extends IService<PjGoodsDesc> {
 	R synchronization();
 
     List<PjGoodsDesc> selectGoodsList(String tenantId, String goodsIds);
+
+	R importDescPoints(List<GoodsPointsExcel> excelList, boolean b);
 }

+ 208 - 6
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java

@@ -25,7 +25,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -36,6 +35,7 @@ import org.springblade.salesPart.brand.mapper.BrandDescMapper;
 import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.GoodsExcel;
+import org.springblade.salesPart.excel.GoodsPointsExcel;
 import org.springblade.salesPart.goods.mapper.GoodsDescMapper;
 import org.springblade.salesPart.goods.mapper.GoodsTypeDescMapper;
 import org.springblade.salesPart.goods.mapper.GoodsTypeMapper;
@@ -172,10 +172,10 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 			goodsDesc.setEnableOrNot(1);
 			baseMapper.insert(goodsDesc);
 		} else {
-			if (count.stream().filter(e-> !e.getId().equals(goodsDesc.getId())).count() > 1) {
+			if (count.stream().filter(e -> !e.getId().equals(goodsDesc.getId())).count() > 1) {
 				throw new ServiceException("编码已存在");
 			}
-			if (countName.stream().filter(e-> !e.getId().equals(goodsDesc.getId())).count() > 1) {
+			if (countName.stream().filter(e -> !e.getId().equals(goodsDesc.getId())).count() > 1) {
 				throw new ServiceException("名称已存在");
 			}
 			if (1 == goodsDesc.getEnableOrNot()) {
@@ -463,7 +463,7 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 			goodsDesc.setOriginalFactory(e.getOriginalFactory());
 			goodsDesc.setSelfRecovery(e.getSelfRecovery());
 			goodsDesc.setGoodsSize(e.getGoodsSize());
-			if(ObjectUtils.isNotNull(e.getGoodIds())){
+			if (ObjectUtils.isNotNull(e.getGoodIds())) {
 				BigDecimal balanceQuantity = stockDescList.stream().filter(item -> item.getCname().equals(e.getCname()))
 					.map(PjStockDesc::getBalanceQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
 				if (balanceQuantity.compareTo(new BigDecimal("0")) != 0) {
@@ -473,7 +473,7 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				goodsDesc.setUpdateTime(new Date());
 				goodsDesc.setUpdateUser(AuthUtil.getUserId());
 				goodsDesc.setId(Long.parseLong(e.getGoodIds()));
-			}else{
+			} else {
 				PjGoodsDesc one = goodsDescList.stream().filter(i -> i.getCname().equals(e.getCname())).findFirst().orElse(null);
 				if (one == null) {
 					if (count > 0) {
@@ -604,7 +604,209 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 
 	@Override
 	public List<PjGoodsDesc> selectGoodsList(String tenantId, String goodsIds) {
-		return baseMapper.selectListNotTenantId(tenantId,goodsIds);
+		return baseMapper.selectListNotTenantId(tenantId, goodsIds);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R importDescPoints(List<GoodsPointsExcel> data, boolean b) {
+		if (CollectionUtils.isEmpty(data)) {
+			throw new SecurityException("导入数据不能为空");
+		}
+		for (GoodsPointsExcel e : data) {
+			e.setCname(e.getCname().trim());
+			e.setCode(e.getCode().trim());
+			e.setSpecificationAndModel(e.getSpecificationAndModel().trim());
+		}
+		String goodsTypeNames = data.stream().map(GoodsPointsExcel::getGoodsTypeName).distinct().filter(Objects::nonNull).collect(Collectors.joining(","));
+		List<PjGoodsType> goodsTypeList = goodsTypeMapper.selectList(new LambdaQueryWrapper<PjGoodsType>()
+			.eq(PjGoodsType::getIsDeleted, 0)
+			.eq(PjGoodsType::getTenantId, AuthUtil.getTenantId())
+			.apply("find_in_set(cname,'" + goodsTypeNames + "')"));
+		String brands = data.stream().map(GoodsPointsExcel::getBrand).distinct().filter(Objects::nonNull).collect(Collectors.joining(","));
+		List<PjBrandDesc> brandDescList = brandDescMapper.selectList(new LambdaQueryWrapper<PjBrandDesc>()
+			.eq(PjBrandDesc::getIsDeleted, 0)
+			.eq(PjBrandDesc::getTenantId, AuthUtil.getTenantId())
+			.apply("find_in_set(cname,'" + brands + "')"));
+		String corpNames = data.stream().map(GoodsPointsExcel::getCorpName).distinct().filter(Objects::nonNull).collect(Collectors.joining(","));
+		List<PjCorpsDesc> corpsDescList = corpsDescService.list(new LambdaQueryWrapper<PjCorpsDesc>()
+			.eq(PjCorpsDesc::getIsDeleted, 0)
+			.eq(PjCorpsDesc::getTenantId, AuthUtil.getTenantId())
+			.eq(PjCorpsDesc::getCorpType, "GYS")
+			.apply("find_in_set(cname,'" + corpNames + "')"));
+		String goodsNames = data.stream().map(GoodsPointsExcel::getCname).distinct().filter(Objects::nonNull).collect(Collectors.joining(","));
+		List<PjGoodsDesc> goodsDescList = baseMapper.selectList(new LambdaQueryWrapper<PjGoodsDesc>()
+			.eq(PjGoodsDesc::getIsDeleted, 0)
+			.eq(PjGoodsDesc::getWhetherIntegral, 1)
+			.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
+			.apply("find_in_set(cname,'" + goodsNames + "')"));
+		String salesCompanyNames = data.stream().map(GoodsPointsExcel::getSalesCompanyName).distinct().filter(Objects::nonNull).collect(Collectors.joining(","));
+		List<Dept> deptList = new ArrayList<>();
+		R<List<Dept>> res = iSysClient.getDeptListIByName(AuthUtil.getTenantId(), salesCompanyNames);
+		if (res.isSuccess()) {
+			deptList = res.getData();
+		}
+		List<Dept> finalDeptList = deptList;
+		List<String> cnameList = data.stream().map(GoodsPointsExcel::getCname).distinct().filter(Objects::nonNull).collect(Collectors.toList());
+		if (cnameList.size() != data.size()) {
+			throw new RuntimeException("商品名称存在重复");
+		}
+		List<String> codeList = data.stream().map(GoodsPointsExcel::getCode).distinct().filter(Objects::nonNull).collect(Collectors.toList());
+		if (codeList.size() != data.size()) {
+			throw new RuntimeException("商品编号存在重复");
+		}
+		String cnames = String.join(",", cnameList);
+		List<PjStockDesc> stockDescList = stockDescService.list(new LambdaQueryWrapper<PjStockDesc>()
+			.eq(PjStockDesc::getIsDeleted, 0)
+			.eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
+			.apply("find_in_set(cname,'" + cnames + "')"));
+		int q = 0;
+		List<PjGoodsDesc> pjGoodsDescList = new ArrayList<>();
+		for (GoodsPointsExcel e : data) {
+			if (ObjectUtils.isNull(e.getCname())) {
+				throw new RuntimeException("商品名称不能为空");
+			}
+			if (ObjectUtils.isNull(e.getCode())) {
+				throw new RuntimeException("商品编码不能为空");
+			}
+			if (ObjectUtils.isNull(e.getGoodsTypeName())) {
+				throw new RuntimeException("商品分类不能为空");
+			}
+			if (ObjectUtils.isNull(e.getUnit())) {
+				throw new RuntimeException("计量单位不能为空");
+			}
+			if (ObjectUtils.isNull(e.getBrand())) {
+				throw new RuntimeException("品牌不能为空");
+			}
+			if (ObjectUtils.isNull(e.getSpecificationAndModel())) {
+				throw new RuntimeException("规格型号不能为空");
+			}
+			if (ObjectUtils.isNull(e.getSalesCompanyName())) {
+				throw new RuntimeException("所属公司名称不能为空");
+			}
+			q++;
+			Integer count = baseMapper.selectCount(Wrappers.<PjGoodsDesc>lambdaQuery()
+				.eq(PjGoodsDesc::getCode, e.getCode())
+				.eq(PjGoodsDesc::getWhetherIntegral, 1)
+				.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
+				.eq(PjGoodsDesc::getIsDeleted, 0)
+			);
+			Integer countName = baseMapper.selectCount(Wrappers.<PjGoodsDesc>lambdaQuery()
+				.eq(PjGoodsDesc::getCname, e.getCname())
+				.eq(PjGoodsDesc::getWhetherIntegral, 1)
+				.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
+				.eq(PjGoodsDesc::getIsDeleted, 0)
+			);
+			PjGoodsType goodsType = goodsTypeList.stream().filter(i -> i.getCname().equals(e.getGoodsTypeName())).findFirst().orElse(null);
+			if (goodsType == null) {
+				throw new SecurityException("第" + (q + 1) + "行未添加分类或者分类不存在");
+			}
+			PjGoodsDesc goodsDesc = new PjGoodsDesc();
+			goodsDesc.setCode(e.getCode());
+			goodsDesc.setCname(e.getCname());
+			goodsDesc.setGoodsTypeId(String.valueOf(goodsType.getId()));
+			goodsDesc.setGoodsTypeName(e.getGoodsTypeName());
+			goodsDesc.setUnit(e.getUnit());
+			goodsDesc.setEnableOrNot(1);
+			goodsDesc.setWhetherIntegral("1");
+			//获得品牌
+			if (ObjectUtils.isNotNull(e.getBrand())) {
+				PjBrandDesc brandDesc = brandDescList.stream().filter(i -> i.getCname().equals(e.getBrand()))
+					.findFirst().orElse(null);
+				if (brandDesc != null) {
+					goodsDesc.setBrandId(brandDesc.getId());
+					goodsDesc.setBrandName(e.getBrand());
+				} else {
+					throw new RuntimeException("品牌名称错误或品牌不存在");
+				}
+			}
+
+			goodsDesc.setSpecificationAndModel(e.getSpecificationAndModel());
+			goodsDesc.setPlaceProduction(e.getPlaceProduction());
+			// 获取供应商
+			if (ObjectUtils.isNotNull(e.getCorpName())) {
+				PjCorpsDesc corpByName = corpsDescList.stream().filter(i -> i.getCname().equals(e.getCorpName()))
+					.findFirst().orElse(null);
+				if (corpByName != null) {
+					goodsDesc.setCorpId(corpByName.getId());
+					goodsDesc.setCorpName(corpByName.getCname());
+				} else {
+					throw new RuntimeException("供应商" + e.getCorpName() + "不存在");
+				}
+			}
+			//获得所属公司
+			if (StringUtil.isNotBlank(e.getSalesCompanyName())) {
+				Dept dept = finalDeptList.stream().filter(i -> i.getFullName().equals(e.getSalesCompanyName())).findFirst().orElse(null);
+				if (dept != null) {
+					goodsDesc.setSalesCompanyId(dept.getId());
+					goodsDesc.setSalesCompanyName(dept.getFullName());
+				} else {
+					throw new SecurityException("请输入正确的所属公司");
+				}
+			} else {
+				throw new SecurityException("请输入所属公司");
+			}
+			goodsDesc.setCnameInt(getCnameInt(e.getCname()));
+			goodsDesc.setGoodsDescription(e.getGoodsDescription());
+			goodsDesc.setWhether("0");
+			if (ObjectUtils.isNotNull(e.getGoodIds())) {
+				BigDecimal balanceQuantity = stockDescList.stream().filter(item -> item.getCname().equals(e.getCname()))
+					.map(PjStockDesc::getBalanceQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
+				if (balanceQuantity.compareTo(new BigDecimal("0")) != 0) {
+					goodsDesc.setWhether(null);
+				}
+				goodsDesc.setCnameInt(getCnameInt(goodsDesc.getCname()));
+				goodsDesc.setUpdateTime(new Date());
+				goodsDesc.setUpdateUser(AuthUtil.getUserId());
+				goodsDesc.setId(Long.parseLong(e.getGoodIds()));
+			} else {
+				PjGoodsDesc one = goodsDescList.stream().filter(i -> i.getCname().equals(e.getCname())).findFirst().orElse(null);
+				if (one == null) {
+					if (count > 0) {
+						throw new ServiceException(goodsDesc.getCode() + "编码已存在");
+					}
+					if (countName > 0) {
+						throw new ServiceException(goodsDesc.getCname() + "名称已存在");
+					}
+					goodsDesc.setTenantId(AuthUtil.getTenantId());
+					goodsDesc.setCreateTime(new Date());
+					goodsDesc.setCreateUser(AuthUtil.getUserId());
+					goodsDesc.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+				} else {
+					if (count > 1) {
+						throw new ServiceException(goodsDesc.getCode() + "编码已存在");
+					}
+					if (countName > 1) {
+						throw new ServiceException(goodsDesc.getCname() + "名称已存在");
+					}
+					BigDecimal balanceQuantity = stockDescList.stream().filter(item -> item.getCname().equals(e.getCname()))
+						.map(PjStockDesc::getBalanceQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
+					if (balanceQuantity.compareTo(new BigDecimal("0")) != 0) {
+						goodsDesc.setWhether(null);
+					}
+					goodsDesc.setCnameInt(getCnameInt(goodsDesc.getCname()));
+					goodsDesc.setUpdateTime(new Date());
+					goodsDesc.setUpdateUser(AuthUtil.getUserId());
+					goodsDesc.setId(one.getId());
+				}
+			}
+			pjGoodsDescList.add(goodsDesc);
+		}
+		this.saveOrUpdateBatch(pjGoodsDescList);
+		for (PjGoodsDesc e : pjGoodsDescList) {
+			PjGoodsDesc one = goodsDescList.stream().filter(i -> i.getCname().equals(e.getCname())).findFirst().orElse(null);
+			if (one == null) {
+				PjGoodsTypeDesc goodsTypeDes = new PjGoodsTypeDesc();
+				goodsTypeDes.setGoodsId(e.getId());
+				goodsTypeDes.setGoodsTypeId(Long.valueOf(e.getGoodsTypeId()));
+				goodsTypeDes.setCreateTime(new Date());
+				goodsTypeDes.setTenantId(AuthUtil.getTenantId());
+				goodsTypeDes.setCreateUser(AuthUtil.getUserId());
+				goodsTypeDes.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+				goodsTypeDescMapper.insert(goodsTypeDes);
+			}
+		}
+		return R.success("导入成功,请及时同步商品信息");
 	}
 
 	/**

+ 42 - 20
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/PjIntegralDetailMapper.xml

@@ -27,21 +27,32 @@
             pcd.id AS corpId,
             pcd.cname AS corpName,
             pcd.points_balance AS pointsBalance,
-            sum( bidA.integral ) AS addPoints,
-            sum( bidS.integral ) AS subPoints
+        (
+        SELECT
+        sum( integral )
+        FROM
+        business_integral_detail
+        WHERE
+        id = corp_id
+        AND is_deleted = '0'
+        AND tenant_id = '883868'
+        AND FIND_IN_SET( type, '购买获取,撤销兑换' )) AS addPoints,
+        (
+        SELECT
+        sum( integral )
+        FROM
+        business_integral_detail
+        WHERE
+        id = corp_id
+        AND is_deleted = '0'
+        AND tenant_id = '883868'
+        AND FIND_IN_SET( type, '积分退回,积分兑换' )) AS subPoints
         FROM
             pjpf_corps_desc pcd
-                LEFT JOIN business_integral_detail bidA ON pcd.id = bidA.corp_id
-                AND FIND_IN_SET( bidA.type, '购买获取,撤销兑换' )
-                LEFT JOIN business_integral_detail bidS ON pcd.id = bidS.corp_id
-                AND FIND_IN_SET( bidS.type, '积分退回,积分兑换' )
         WHERE
             pcd.is_deleted = '0'
+            and pcd.points_balance != 0
           AND pcd.tenant_id = #{data.tenantId}
-          AND bidA.is_deleted = '0'
-          AND bidA.tenant_id = #{data.tenantId}
-          AND bidS.is_deleted = '0'
-          AND bidS.tenant_id = #{data.tenantId}
         <if test="data.corpName !=null and data.corpName != ''">
             and pcd.cname = #{data.corpName}
         </if>
@@ -52,21 +63,32 @@
         pcd.id AS corpId,
         pcd.cname AS corpName,
         pcd.points_balance AS pointsBalance,
-        sum( bidA.integral ) AS addPoints,
-        sum( bidS.integral ) AS subPoints
+        (
+        SELECT
+        sum( integral )
+        FROM
+        business_integral_detail
+        WHERE
+        id = corp_id
+        AND is_deleted = '0'
+        AND tenant_id = '883868'
+        AND FIND_IN_SET( type, '购买获取,撤销兑换' )) AS addPoints,
+        (
+        SELECT
+        sum( integral )
+        FROM
+        business_integral_detail
+        WHERE
+        id = corp_id
+        AND is_deleted = '0'
+        AND tenant_id = '883868'
+        AND FIND_IN_SET( type, '积分退回,积分兑换' )) AS subPoints
         FROM
         pjpf_corps_desc pcd
-        LEFT JOIN business_integral_detail bidA ON pcd.id = bidA.corp_id
-        AND FIND_IN_SET( bidA.type, '购买获取,撤销兑换' )
-        LEFT JOIN business_integral_detail bidS ON pcd.id = bidS.corp_id
-        AND FIND_IN_SET( bidS.type, '积分退回,积分兑换' )
         WHERE
         pcd.is_deleted = '0'
+        and pcd.points_balance != 0
         AND pcd.tenant_id = #{data.tenantId}
-        AND bidA.is_deleted = '0'
-        AND bidA.tenant_id = #{data.tenantId}
-        AND bidS.is_deleted = '0'
-        AND bidS.tenant_id = #{data.tenantId}
         <if test="data.corpName !=null and data.corpName != ''">
             and pcd.cname = #{data.corpName}
         </if>

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

@@ -4428,7 +4428,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 						order.setBillType(1);
 					}
 				}
-
 				order.setOrdNo(billNo);
 				order.setSrcOrdNo(billNo);
 				order.setCreateTime(new Date());
@@ -4438,16 +4437,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				order.setStatus(OrderTypeEnum.XSLR.getType());
 				order.setBusinessSource(OrderTypeEnum.WEB.getType());
 				order.setActualPaymentStatus(1);
-
-				//根据客户账期计算应结日期
-				if (ObjectUtil.isNotEmpty(corpsDesc.getAccountPeriod()) && ObjectUtils.isNotNull(order.getBusinesDate())) {
-					Date now = order.getBusinesDate();
-					long sevenDays = corpsDesc.getAccountPeriod() * 24 * 60 * 60 * 1000L;
-					Date afterSevenDays = new Date(now.getTime() + sevenDays);
-					order.setDueDate(afterSevenDays);
-				} else {
-					order.setDueDate(new Date());
-				}
 				baseMapper.insert(order);
 			} else {
 				PjOrder orderVersion = baseMapper.selectById(order.getId());
@@ -4512,6 +4501,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					if (ObjectUtil.isEmpty(goodsDesc)) {
 						throw new RuntimeException("商品数据异常");
 					}
+					goodsName.append(goodsDesc.getCname()).append(",");
+					retrieval.append(goodsDesc.getCnameInt()).append(",");
 					item.setBrandName(goodsDesc.getBrandName());
 				}
 				orderItemsService.saveOrUpdateBatch(order.getOrderItemsList());

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

@@ -3549,9 +3549,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 		if (storageDescR == null) {
 			throw new RuntimeException("未找到调入仓库信息");
 		}
-		if (storageDescC.getWhetherFinancing().equals(storageDescR.getWhetherFinancing())) {
-			throw new RuntimeException("调入或调出仓库属性不一致,请修改");
-		}
 		//仓库名称
 		if (ObjectUtils.isNotNull(order.getStorageId())) {
 			order.setStorageName(storageDescC.getCname());
@@ -3622,9 +3619,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 		if (storageDescR == null) {
 			throw new RuntimeException("未找到调入仓库信息");
 		}
-		if (storageDescC.getWhetherFinancing().equals(storageDescR.getWhetherFinancing())) {
-			throw new RuntimeException("调入或调出仓库属性不一致,请修改");
-		}
 		if (CollectionUtils.isNotEmpty(order.getShipItemsList())) {
 			String status = sysClient.getParamService("whether.financing");
 			List<PjStockDesc> pjStockDescArrayList = new ArrayList<>();
@@ -3644,6 +3638,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					.eq(PjStockDesc::getIsDeleted, 0)
 					.eq(PjStockDesc::getSalesCompanyId, detail.getSalesCompanyId())
 					.eq(PjStockDesc::getGoodsId, orderItems.getGoodsId())
+					.ne(PjStockDesc::getBalanceQuantity, 0)
 					.eq(PjStockDesc::getStorageId, detail.getStorageId());
 				//管理批次号
 				if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
@@ -3651,14 +3646,18 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				} else {
 					lambdaQueryWrapperC.and(i -> i.eq(PjStockDesc::getDot, "").or().isNull(PjStockDesc::getDot));
 				}
-
 				PjStockDesc stockOneC = iStockDescService.getOne(lambdaQueryWrapperC);
 				if (ObjectUtil.isNotEmpty(stockOneC)) {
 					if (orderItems.getGoodsNum().compareTo(stockOneC.getBalanceQuantity()) > 0) {
 						throw new RuntimeException("库存不足,保存失败");
 					}
 					stockOneC.setBalanceQuantity(stockOneC.getBalanceQuantity().subtract(orderItems.getGoodsNum()));
-					if ("1".equals(status)){
+					if (!"1".equals(status)) {
+						if (orderItems.getGoodsNum().compareTo(stockOneC.getBalanceQuantityHave()) > 0) {
+							throw new RuntimeException("自有库存不足,保存失败");
+						}
+						stockOneC.setBalanceQuantityHave(stockOneC.getBalanceQuantityHave().subtract(orderItems.getGoodsNum()));
+					}else{
 						if (orderItems.getSendNumFinancing().compareTo(stockOneC.getBalanceQuantityFinancing()) > 0) {
 							throw new RuntimeException("融资库存不足,保存失败");
 						}
@@ -3693,7 +3692,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				PjStockDesc stockOneR = iStockDescService.getOne(lambdaQueryWrapperR);
 				if (ObjectUtil.isNotEmpty(stockOneR)) {
 					stockOneR.setBalanceQuantity(stockOneR.getBalanceQuantity().add(orderItems.getGoodsNum()));
-					if ("1".equals(status)) {
+					if (!"1".equals(status)) {
+						stockOneR.setBalanceQuantityHave(stockOneR.getBalanceQuantityHave().add(orderItems.getGoodsNum()));
+					}else{
 						stockOneR.setBalanceQuantityFinancing(stockOneR.getBalanceQuantityFinancing().add(orderItems.getSendNumFinancing()));
 						stockOneR.setBalanceQuantityHave(stockOneR.getBalanceQuantityHave().add(orderItems.getSendNumHave()));
 					}
@@ -3718,6 +3719,12 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockDesc.setGoodsTypeId(goodsDesc.getGoodsTypeId());
 					stockDesc.setGoodsTypeName(goodsDesc.getGoodsTypeName());
 					stockDesc.setBalanceQuantity(orderItems.getGoodsNum());
+					if (!"1".equals(status)) {
+						stockDesc.setBalanceQuantityHave(orderItems.getGoodsNum());
+					}else{
+						stockDesc.setBalanceQuantityFinancing(orderItems.getSendNumFinancing());
+						stockDesc.setBalanceQuantityHave(orderItems.getSendNumHave());
+					}
 					stockDesc.setStoreInventory(orderItems.getGoodsNum());
 					stockDesc.setInventoryAmount(orderItems.getGoodsNum().multiply(stockOneC.getInventoryCostPrice()));
 					stockDesc.setInventoryCostPrice(stockOneC.getInventoryCostPrice());
@@ -3784,11 +3791,12 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				} else {
 					lambdaQueryWrapperC.and(i -> i.eq(PjStockDesc::getDot, "").or().isNull(PjStockDesc::getDot));
 				}
-
 				PjStockDesc stockOneC = iStockDescService.getOne(lambdaQueryWrapperC);
 				if (ObjectUtil.isNotEmpty(stockOneC)) {
 					stockOneC.setBalanceQuantity(stockOneC.getBalanceQuantity().add(orderItems.getGoodsNum()));
-					if ("1".equals(status)){
+					if (!"1".equals(status)){
+						stockOneC.setBalanceQuantityHave(stockOneC.getBalanceQuantityHave().add(orderItems.getGoodsNum()));
+					}else{
 						stockOneC.setBalanceQuantityFinancing(stockOneC.getBalanceQuantityFinancing().add(orderItems.getSendNumFinancing()));
 						stockOneC.setBalanceQuantityHave(stockOneC.getBalanceQuantityHave().add(orderItems.getSendNumHave()));
 					}
@@ -3806,6 +3814,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					.eq(PjStockDesc::getIsDeleted, 0)
 					.eq(PjStockDesc::getSalesCompanyId, detail.getSalesCompanyId())
 					.eq(PjStockDesc::getGoodsId, orderItems.getGoodsId())
+					.ne(PjStockDesc::getBalanceQuantity, 0)
 					.eq(PjStockDesc::getStorageId, detail.getCallInStorageId());
 				//管理批次号
 				if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
@@ -3817,7 +3826,12 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				PjStockDesc stockOneR = iStockDescService.getOne(lambdaQueryWrapperR);
 				if (ObjectUtil.isNotEmpty(stockOneR)) {
 					stockOneR.setBalanceQuantity(stockOneR.getBalanceQuantity().subtract(orderItems.getGoodsNum()));
-					if ("1".equals(status)){
+					if (!"1".equals(status)){
+						if (orderItems.getGoodsNum().compareTo(stockOneR.getBalanceQuantityHave()) > 0) {
+							throw new RuntimeException("自有库存不足,保存失败");
+						}
+						stockOneR.setBalanceQuantityHave(stockOneR.getBalanceQuantityHave().subtract(orderItems.getGoodsNum()));
+					}else{
 						if (orderItems.getSendNumFinancing().compareTo(stockOneR.getBalanceQuantityFinancing()) > 0) {
 							throw new RuntimeException("融资库存不足,保存失败");
 						}

+ 2 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java

@@ -540,6 +540,7 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R generateOrderLimit(String address, List<Map<String, Object>> list, String payType) {
 		StringBuilder goodsName = new StringBuilder();
 		StringBuilder shortcutJoin = new StringBuilder();
@@ -795,6 +796,7 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R generateOrderPoints(String address, List<Map<String, Object>> list, String payType) {
 		StringBuilder goodsName = new StringBuilder();
 		StringBuilder shortcutJoin = new StringBuilder();

+ 26 - 3
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/smartLargeScreenApi/service/impl/ApiServiceImpl.java

@@ -426,7 +426,12 @@ public class ApiServiceImpl implements ApiService {
 		Map<String, Object> map = new HashMap<>();
 		if (!orderList.isEmpty()) {
 			map.put("name", "");
-			map.put("value", orderList.size());
+			BigDecimal complete = orderList.stream().map(PjOrder::getTotalMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
+			if (new BigDecimal("0.00").compareTo(complete) != 0) {
+				map.put("value", complete.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP));
+			} else {
+				map.put("value", 0);
+			}
 		} else {
 			map.put("name", "");
 			map.put("value", 0);
@@ -444,9 +449,13 @@ public class ApiServiceImpl implements ApiService {
 		if (!orderList.isEmpty()) {
 			if (ObjectUtils.isNotNull(data)) {
 				BigDecimal total = new BigDecimal(data);
-				BigDecimal complete = new BigDecimal(orderList.size());
+				BigDecimal complete = orderList.stream().map(PjOrder::getTotalMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
 				map.put("aims", total);
-				map.put("actual", complete);
+				if (new BigDecimal("0.00").compareTo(complete) != 0) {
+					map.put("actual", complete.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP));
+				} else {
+					map.put("actual", 0);
+				}
 			} else {
 				map.put("aims", 0);
 				map.put("actual", 0);
@@ -903,6 +912,20 @@ public class ApiServiceImpl implements ApiService {
 					map.put("name", item.getCname());
 					map.put("lat", item.getLongitude());
 					map.put("lng", item.getDimension());
+					map.put("info", "KH");
+					mapList.add(map);
+				}
+			}
+		}
+		List<PjStorageDesc> storageDescList = storageDescService.selectStorageList(tenantId);
+		if (!storageDescList.isEmpty()) {
+			for (PjStorageDesc item : storageDescList) {
+				Map<String, Object> map = new HashMap<>();
+				if (ObjectUtils.isNotNull(item.getLongitude()) && ObjectUtils.isNotNull(item.getDimension())) {
+					map.put("name", item.getCname());
+					map.put("lat", item.getLongitude());
+					map.put("lng", item.getDimension());
+					map.put("info", "CK");
 					mapList.add(map);
 				}
 			}

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

@@ -40,6 +40,7 @@ import org.springblade.salesPart.order.service.IOrderService;
 import org.springblade.salesPart.ship.service.IShipItemsService;
 import org.springblade.salesPart.ship.service.IShipService;
 import org.springblade.salesPart.statistics.service.IStatisticsService;
+import org.springblade.salesPart.tireMallStatistics.service.ITireMallStatisticsService;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -72,6 +73,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
 
 	private final IPjpfBalanceResetService pjpfBalanceResetService;
 
+	private final ITireMallStatisticsService tireMallStatisticsService;
+
 	@Override
 	public R<Map<String, Object>> amountStatistics() {
 		Map<String, Object> map = new HashMap<>();
@@ -559,6 +562,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		saleDetailDto.setTenantId(AuthUtil.getTenantId());
 		saleDetailDto.setSalesCompanyId(AuthUtil.getDeptId());
 		IPage<SaleDetailDto> saleDetailDtoIPage = orderItemsService.saleDetail(saleDetailDto, page);
+//		tireMallStatisticsService.saleDetail(saleDetailDto, page);
 		if (!saleDetailDtoIPage.getRecords().isEmpty()) {
 			String billNo = saleDetailDtoIPage.getRecords().stream().map(SaleDetailDto::getOrdNo).distinct().collect(Collectors.joining(","));
 			List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
@@ -909,16 +913,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()))
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				} else {
@@ -957,17 +961,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid())
-								&& new BigDecimal("0").compareTo(e.getReturnsNumber()) == 0)
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				}
@@ -1063,16 +1066,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()))
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				} else {
@@ -1111,17 +1114,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid()) &&
-								new BigDecimal("0").compareTo(e.getReturnsNumber()) == 0)
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				}
@@ -1221,16 +1223,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()))
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersCorpS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				} else {
@@ -1269,17 +1271,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						item.setReturnQuantity(item.getReturnQuantity().subtract(new BigDecimal("0").subtract(returnsNumber)));
 						item.setSalesAmount(subTotalMoney.subtract(returnsAmount));
 						item.setSalesQuantity(goodsNum.subtract(returnsNumber));
-						BigDecimal costprie = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid())
-								&& new BigDecimal("0").compareTo(e.getReturnsNumber()) == 0)
-							.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-						List<PjOrderItems> orderItemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid()) &&
-								(ObjectUtils.isNotNull(e.getReturnsNumber()) && new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0))
-							.collect(Collectors.toList());
-						BigDecimal returnCostprie = new BigDecimal("0.00");
-						for (PjOrderItems items : orderItemsList) {
-							returnCostprie = returnCostprie.add(items.getSubTotalMoney().subtract(items.getReturnsNumber().multiply(items.getCostpriePrice())));
+						List<PjOrderItems> itemsList = pjOrderItemsList.stream().filter(e -> finalOrdersSalerS.contains(e.getPid())).collect(Collectors.toList());
+						BigDecimal costprie = new BigDecimal("0.00");
+						for (PjOrderItems items : itemsList) {
+							if (new BigDecimal("0").compareTo(items.getReturnsNumber()) != 0){
+								BigDecimal returnCostprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								costprie = costprie.add(items.getCostprie().subtract(returnCostprie));
+							}else{
+								costprie = costprie.add(items.getCostprie());
+							}
 						}
-						costprie = costprie.subtract(returnCostprie);
 						item.setSalesProfit(item.getSalesAmount().subtract(costprie));
 					}
 				}

+ 2 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/stock/mapper/StockDescMapper.xml

@@ -171,7 +171,8 @@
         0 AS inventoryAmount,
         0 AS inventoryCostPrice,
         0 AS inventoryAlert,
-        null AS version
+        null AS version,
+        goods.integral AS integral
         FROM
         pjpf_goods_desc goods
         <where>

+ 2 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/storage/service/IStorageDescService.java

@@ -65,4 +65,6 @@ public interface IStorageDescService extends IService<PjStorageDesc> {
 	PjStorageDesc getMessageByName(String storageName);
 
     List<PjStorageDesc> getTenants(String tenantId);
+
+    List<PjStorageDesc> selectStorageList(String tenantId);
 }

+ 5 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/storage/service/impl/StorageDescServiceImpl.java

@@ -110,4 +110,9 @@ public class StorageDescServiceImpl extends ServiceImpl<StorageDescMapper, PjSto
 		return baseMapper.getTenants(tenantId);
 	}
 
+	@Override
+	public List<PjStorageDesc> selectStorageList(String tenantId) {
+		return baseMapper.getTenants(tenantId);
+	}
+
 }

+ 126 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/controller/TireMallStatisticsController.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.salesPart.tireMallStatistics.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.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import org.springblade.salesPart.tireMallStatistics.vo.TireMallStatisticsVO;
+import org.springblade.salesPart.tireMallStatistics.service.ITireMallStatisticsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * VIEW 控制器
+ *
+ * @author BladeX
+ * @since 2024-12-27
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/tiremallstatistics")
+@Api(value = "VIEW", tags = "VIEW接口")
+public class TireMallStatisticsController extends BladeController {
+
+	private final ITireMallStatisticsService tireMallStatisticsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入tireMallStatistics")
+	public R<TireMallStatistics> detail(TireMallStatistics tireMallStatistics) {
+		TireMallStatistics detail = tireMallStatisticsService.getOne(Condition.getQueryWrapper(tireMallStatistics));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 VIEW
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入tireMallStatistics")
+	public R<IPage<TireMallStatistics>> list(TireMallStatistics tireMallStatistics, Query query) {
+		IPage<TireMallStatistics> pages = tireMallStatisticsService.page(Condition.getPage(query), Condition.getQueryWrapper(tireMallStatistics));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 VIEW
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入tireMallStatistics")
+	public R<IPage<TireMallStatisticsVO>> page(TireMallStatisticsVO tireMallStatistics, Query query) {
+		IPage<TireMallStatisticsVO> pages = tireMallStatisticsService.selectTireMallStatisticsPage(Condition.getPage(query), tireMallStatistics);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 VIEW
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入tireMallStatistics")
+	public R save(@Valid @RequestBody TireMallStatistics tireMallStatistics) {
+		return R.status(tireMallStatisticsService.save(tireMallStatistics));
+	}
+
+	/**
+	 * 修改 VIEW
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入tireMallStatistics")
+	public R update(@Valid @RequestBody TireMallStatistics tireMallStatistics) {
+		return R.status(tireMallStatisticsService.updateById(tireMallStatistics));
+	}
+
+	/**
+	 * 新增或修改 VIEW
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入tireMallStatistics")
+	public R submit(@Valid @RequestBody TireMallStatistics tireMallStatistics) {
+		return R.status(tireMallStatisticsService.saveOrUpdate(tireMallStatistics));
+	}
+
+	
+	/**
+	 * 删除 VIEW
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(tireMallStatisticsService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 46 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/mapper/TireMallStatisticsMapper.java

@@ -0,0 +1,46 @@
+/*
+ *      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.salesPart.tireMallStatistics.mapper;
+
+import feign.Param;
+import org.springblade.salesPart.dto.SaleDetail;
+import org.springblade.salesPart.dto.SaleDetailDto;
+import org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import org.springblade.salesPart.tireMallStatistics.vo.TireMallStatisticsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * VIEW Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-12-27
+ */
+public interface TireMallStatisticsMapper extends BaseMapper<TireMallStatistics> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param tireMallStatistics
+	 * @return
+	 */
+	List<TireMallStatisticsVO> selectTireMallStatisticsPage(IPage page, TireMallStatisticsVO tireMallStatistics);
+
+    List<TireMallStatistics> saleDetailPage(@Param("page")IPage<TireMallStatistics> page,@Param("saleDetailDto") SaleDetail saleDetailDto);
+}

+ 130 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/mapper/TireMallStatisticsMapper.xml

@@ -0,0 +1,130 @@
+<?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.salesPart.tireMallStatistics.mapper.TireMallStatisticsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="tireMallStatisticsResultMap" type="org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics">
+        <result column="id" property="id"/>
+        <result column="billno" property="billno"/>
+        <result column="ord_no" property="ordNo"/>
+        <result column="src_ord_no" property="srcOrdNo"/>
+        <result column="status" property="status"/>
+        <result column="bs_type" property="bsType"/>
+        <result column="customer_id" property="corpId"/>
+        <result column="customer_name" property="corpName"/>
+        <result column="saler_id" property="salerId"/>
+        <result column="saler_name" property="salerName"/>
+        <result column="storage_id" property="storageId"/>
+        <result column="storage_name" property="storageName"/>
+        <result column="business_source" property="businessSource"/>
+        <result column="freight" property="freight"/>
+        <result column="payment_amount_tl" property="paymentAmountTl"/>
+        <result column="actual_payment_status" property="actualPaymentStatus"/>
+        <result column="busines_date" property="businesDate"/>
+        <result column="delivery_busines_date" property="deliveryBusinesDate"/>
+        <result column="funding_party_id" property="fundingPartyId"/>
+        <result column="funding_party_name" property="fundingPartyName"/>
+        <result column="funding_amount" property="fundingAmount"/>
+        <result column="primary_funding_amount" property="primaryFundingAmount"/>
+        <result column="bond_amount" property="bondAmount"/>
+        <result column="primary_bond_amount" property="primaryBondAmount"/>
+        <result column="item_id" property="itemId"/>
+        <result column="goods_no" property="goodsNo"/>
+        <result column="goods_name" property="goodsName"/>
+        <result column="goods_id" property="goodsId"/>
+        <result column="cname_int" property="cnameInt"/>
+        <result column="brand_id" property="brandId"/>
+        <result column="brand_name" property="brandName"/>
+        <result column="property_name" property="propertyName"/>
+        <result column="pattern" property="pattern"/>
+        <result column="goods_description" property="goodsDescription"/>
+        <result column="goods_num" property="goodsNum"/>
+        <result column="price" property="price"/>
+        <result column="sub_total_money" property="subTotalMoney"/>
+        <result column="costprie_price" property="costpriePrice"/>
+        <result column="costprie" property="costprie"/>
+        <result column="gross_profit" property="grossProfit"/>
+        <result column="send_num" property="sendNum"/>
+        <result column="goods_total_ship_amount" property="goodsTotalShipAmount"/>
+        <result column="total_amount" property="totalAmount"/>
+        <result column="returns_number" property="returnsNumber"/>
+        <result column="returns_amount" property="returnsAmount"/>
+        <result column="out_goods_total_ship_num" property="outGoodsTotalShipNum"/>
+        <result column="out_goods_total_ship_amount" property="outGoodsTotalShipAmount"/>
+        <result column="primary_goods_total_num" property="primaryGoodsTotalNum"/>
+        <result column="primary_goods_total_amount" property="primaryGoodsTotalAmount"/>
+        <result column="send_num_have" property="sendNumHave"/>
+        <result column="send_num_financing" property="sendNumFinancing"/>
+        <result column="tenant_id" property="tenantId"/>
+    </resultMap>
+
+
+    <select id="selectTireMallStatisticsPage" resultMap="tireMallStatisticsResultMap">
+        select * from pjpf_tire_mall_statistics where is_deleted = 0
+    </select>
+    <select id="saleDetailPage" resultType="org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics">
+        SELECT *
+        FROM pjpf_tire_mall_statistics tms
+        WHERE
+        find_in_set(tms.bs_type,#{saleDetailDto.bsType})
+        AND tms.tenant_id = #{saleDetailDto.tenantId}
+        <if test="saleDetailDto.storageId !=null and saleDetailDto.storageId != ''">
+            and tms.storage_id = #{saleDetailDto.storageId}
+        </if>
+        <if test="saleDetailDto.businessSource !=null and saleDetailDto.businessSource != ''">
+            and tms.business_source = #{saleDetailDto.businessSource}
+        </if>
+        <if test="saleDetailDto.customerName !=null and saleDetailDto.customerName != ''">
+            and tms.customer_name like concat('%', #{saleDetailDto.customerName}, '%')
+        </if>
+        <if test="saleDetailDto.code !=null and saleDetailDto.code != ''">
+            and tms.goods_no like concat('%', #{saleDetailDto.code}, '%')
+        </if>
+        <if test="saleDetailDto.brandName !=null and saleDetailDto.brandName != ''">
+            and tms.brand_name like concat('%', #{saleDetailDto.brandName}, '%')
+        </if>
+        <if test="saleDetailDto.salerName !=null and saleDetailDto.salerName != ''">
+            and tms.saler_name like concat('%', #{saleDetailDto.salerName}, '%')
+        </if>
+        <if test="saleDetailDto.ordNo !=null and saleDetailDto.ordNo != ''">
+            and tms.ord_no like concat('%', #{saleDetailDto.ordNo}, '%')
+        </if>
+        <if test="saleDetailDto.goodsName !=null and saleDetailDto.goodsName != ''">
+            and (tms.goods_name like concat('%', #{saleDetailDto.goodsName}, '%') or tms.cname_int like concat('%', #{saleDetailDto.goodsName}, '%'))
+        </if>
+        <if test="saleDetailDto.actualPaymentStatus !=null and saleDetailDto.actualPaymentStatus != ''">
+            and tms.actual_payment_status =#{saleDetailDto.actualPaymentStatus}
+        </if>
+        <if test="saleDetailDto.businesDateStart !=null and saleDetailDto.businesDateStart !=''">
+            and DATE_FORMAT(tms.busines_date,'%Y-%m-%d') &gt;= #{saleDetailDto.businesDateStart}
+        </if>
+        <if test="saleDetailDto.businesDateEnd !=null and saleDetailDto.businesDateEnd !=''">
+            and DATE_FORMAT(tms.busines_date,'%Y-%m-%d') &lt;= #{saleDetailDto.businesDateEnd}
+        </if>
+        <if test="saleDetailDto.dateStart !=null and saleDetailDto.dateStart !=''">
+            and DATE_FORMAT(tms.delivery_busines_date,'%Y-%m-%d') &gt;= #{saleDetailDto.dateStart}
+        </if>
+        <if test="saleDetailDto.dateEnd !=null and saleDetailDto.dateEnd !=''">
+            and DATE_FORMAT(tms.delivery_busines_date,'%Y-%m-%d') &lt;= #{saleDetailDto.dateEnd}
+        </if>
+        <if test='saleDetailDto.bsType !=null and saleDetailDto.bsType !="" and saleDetailDto.bsType == "XS"'>
+            and not FIND_IN_SET(tms.`status`,'退款请核,已取消,已退款,售后中')
+        </if>
+        <if test='saleDetailDto.isContain !=null and saleDetailDto.isContain !="" and saleDetailDto.isContain == "1"'>
+            and ( (FIND_IN_SET(tms.bs_type,'XS,CG,RZCG') and FIND_IN_SET(tms.`status`,'待确认,待发货,已发货,退款请核,已取消,已退款,售后中,已收货'))
+            or (FIND_IN_SET(tms.bs_type,'TKXS,TKCG') and FIND_IN_SET(tms.`status`,'已完成')) )
+        </if>
+        <if test='saleDetailDto.isContain !=null and saleDetailDto.isContain !="" and saleDetailDto.isContain == "0"'>
+            and ( (FIND_IN_SET(tms.bs_type,'XS,CG,RZCG') and FIND_IN_SET(tms.`status`,'已发货,退款请核,已取消,已退款,售后中,已收货'))
+            or (FIND_IN_SET(tms.bs_type,'TKXS,TKCG') and FIND_IN_SET(tms.`status`,'已完成')) )
+        </if>
+        <if test='saleDetailDto.isContain ==null or saleDetailDto.isContain ==""'>
+            and ( (FIND_IN_SET(tms.bs_type,'XS,CG,RZCG') and FIND_IN_SET(tms.`status`,'已发货,退款请核,已取消,已退款,售后中,已收货'))
+            or (FIND_IN_SET(tms.bs_type,'TKXS,TKCG') and FIND_IN_SET(tms.`status`,'已完成')) )
+        </if>
+        ORDER BY
+        tms.busines_date desc,
+        tms.ord_no desc
+    </select>
+
+</mapper>

+ 44 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/service/ITireMallStatisticsService.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.salesPart.tireMallStatistics.service;
+
+import org.springblade.salesPart.dto.SaleDetail;
+import org.springblade.salesPart.dto.SaleDetailDto;
+import org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import org.springblade.salesPart.tireMallStatistics.vo.TireMallStatisticsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务类
+ *
+ * @author BladeX
+ * @since 2024-12-27
+ */
+public interface ITireMallStatisticsService extends IService<TireMallStatistics> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param tireMallStatistics
+	 * @return
+	 */
+	IPage<TireMallStatisticsVO> selectTireMallStatisticsPage(IPage<TireMallStatisticsVO> page, TireMallStatisticsVO tireMallStatistics);
+
+	IPage<TireMallStatistics> saleDetail(SaleDetail saleDetailDto, IPage<TireMallStatistics> page);
+}

+ 48 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/tireMallStatistics/service/impl/TireMallStatisticsServiceImpl.java

@@ -0,0 +1,48 @@
+/*
+ *      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.salesPart.tireMallStatistics.service.impl;
+
+import org.springblade.salesPart.dto.SaleDetail;
+import org.springblade.salesPart.dto.SaleDetailDto;
+import org.springblade.salesPart.tireMallStatistics.entity.TireMallStatistics;
+import org.springblade.salesPart.tireMallStatistics.vo.TireMallStatisticsVO;
+import org.springblade.salesPart.tireMallStatistics.mapper.TireMallStatisticsMapper;
+import org.springblade.salesPart.tireMallStatistics.service.ITireMallStatisticsService;
+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-12-27
+ */
+@Service
+public class TireMallStatisticsServiceImpl extends ServiceImpl<TireMallStatisticsMapper, TireMallStatistics> implements ITireMallStatisticsService {
+
+	@Override
+	public IPage<TireMallStatisticsVO> selectTireMallStatisticsPage(IPage<TireMallStatisticsVO> page, TireMallStatisticsVO tireMallStatistics) {
+		return page.setRecords(baseMapper.selectTireMallStatisticsPage(page, tireMallStatistics));
+	}
+
+	@Override
+	public IPage<TireMallStatistics> saleDetail(SaleDetail saleDetailDto, IPage<TireMallStatistics> page) {
+		return page.setRecords(baseMapper.saleDetailPage(page, saleDetailDto));
+	}
+
+}

+ 1 - 1
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -180,7 +180,7 @@ public class UserController {
 
 		if (ObjectUtil.isNotEmpty(userVO.getDeptPid())) {
 			if ("1504336886057963521".equals(userVO.getDeptPid()) || "1567796746975727617".equals(userVO.getDeptPid())
-				|| "1862313560907030530".equals(userVO.getDeptPid())) {
+				|| "1862313560907030530".equals(userVO.getDeptPid())|| "1863853735860514817".equals(userVO.getDeptPid())) {
 				userVO.setRoleAlias("分管调度");
 			} else {
 				userVO.setRoleAlias("大件调度");