Ver código fonte

周转率新增字段

fgd 1 ano atrás
pai
commit
226b552dfa

+ 15 - 0
sd-business/src/main/java/com/sd/business/entity/board/bo/TurnoverRateSalesShipmentStatisticsBo.java

@@ -25,6 +25,21 @@ public class TurnoverRateSalesShipmentStatisticsBo {
     private String bomSpecName;
 
     /**
+     * 宽
+     */
+    private BigDecimal width;
+
+    /**
+     * 高
+     */
+    private BigDecimal height;
+
+    /**
+     * 色层 字典:bom_chromatophore
+     */
+    private String chromatophore;
+
+    /**
      * 90天销售数量
      */
     private BigDecimal ninetyDaysSalesQuantity;

+ 17 - 2
sd-business/src/main/java/com/sd/business/entity/board/dto/TurnoverRateBoardSelectDto.java

@@ -3,7 +3,7 @@ package com.sd.business.entity.board.dto;
 import lombok.Getter;
 import lombok.Setter;
 
-import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
 
 /**
  * 周转率查询入参实体
@@ -16,7 +16,22 @@ import javax.validation.constraints.NotNull;
 public class TurnoverRateBoardSelectDto {
 
     /**
-     * bom分类 1-裸垫,2-裸砖
+     * bom分类 1-瑜伽垫裸垫,2-瑜伽垫裸砖,3-跳绳垫裸垫
      */
     private Integer bomClassify;
+
+    /**
+     * 宽
+     */
+    private BigDecimal width;
+
+    /**
+     * 高
+     */
+    private BigDecimal height;
+
+    /**
+     * 色层 字典:bom_chromatophore
+     */
+    private String chromatophore;
 }

+ 25 - 7
sd-business/src/main/java/com/sd/business/entity/board/vo/TurnoverRateStatisticsVo.java

@@ -31,44 +31,62 @@ public class TurnoverRateStatisticsVo {
     private String bomSpecName;
 
     /**
+     * 宽
+     */
+    @ExcelProperty(value = "宽", index = 2)
+    private BigDecimal width;
+
+    /**
+     * 高
+     */
+    @ExcelProperty(value = "高", index = 3)
+    private BigDecimal height;
+
+    /**
+     * 色层 字典:bom_chromatophore
+     */
+    @ExcelProperty(value = "色层", index = 4)
+    private String chromatophore;
+
+    /**
      * 周转率
      */
-    @ExcelProperty(value = "30天周转率", index = 2)
+    @ExcelProperty(value = "30天周转率", index = 5)
     private BigDecimal turnoverRateThirtyDays;
 
     /**
      * 30天销售量
      */
-    @ExcelProperty(value = "30天销售量", index = 3)
+    @ExcelProperty(value = "30天销售量", index = 6)
     private BigDecimal salesQuantityThirtyDays;
 
     /**
      * 周转率
      */
-    @ExcelProperty(value = "60天周转率", index = 4)
+    @ExcelProperty(value = "60天周转率", index = 7)
     private BigDecimal turnoverRateSixtyDays;
 
     /**
      * 60天销售量
      */
-    @ExcelProperty(value = "60天销售量", index = 5)
+    @ExcelProperty(value = "60天销售量", index = 8)
     private BigDecimal salesQuantitySixtyDays;
 
     /**
      * 周转率
      */
-    @ExcelProperty(value = "90天周转率", index = 6)
+    @ExcelProperty(value = "90天周转率", index = 9)
     private BigDecimal turnoverRateNinetyDays;
 
     /**
      * 90天销售量
      */
-    @ExcelProperty(value = "90天销售量", index = 7)
+    @ExcelProperty(value = "90天销售量", index = 10)
     private BigDecimal salesQuantityNinetyDays;
 
     /**
      * 库存数量
      */
-    @ExcelProperty(value = "库存数量", index = 8)
+    @ExcelProperty(value = "库存数量", index = 11)
     private BigDecimal quantity;
 }

+ 11 - 4
sd-business/src/main/java/com/sd/business/entity/purchase/vo/PurchaseInTransitBomVo.java

@@ -51,28 +51,35 @@ public class PurchaseInTransitBomVo {
     private String purchaseCode;
 
     /**
+     * e10 采购合同编号
+     */
+    @ColumnWidth(20)
+    @ExcelProperty(value = "E10采购合同编号", index = 3)
+    private String purchaseErpCode;
+
+    /**
      * 供应商名称
      */
     @ColumnWidth(20)
-    @ExcelProperty(value = "供应商名称", index = 3)
+    @ExcelProperty(value = "供应商名称", index = 4)
     private String supplierName;
 
     /**
      * 采购数量
      */
-    @ExcelProperty(value = "采购数量", index = 4)
+    @ExcelProperty(value = "采购数量", index = 5)
     private BigDecimal purchaseQuantity;
 
     /**
      * 在途数量
      */
-    @ExcelProperty(value = "在途数量", index = 5)
+    @ExcelProperty(value = "在途数量", index = 6)
     private BigDecimal inTransitQuantity;
 
     /**
      * 交付日期
      */
     @ColumnWidth(20)
-    @ExcelProperty(value = "交付日期", index = 6)
+    @ExcelProperty(value = "交付日期", index = 7)
     private Date deliveryDate;
 }

+ 18 - 1
sd-business/src/main/java/com/sd/business/service/order/impl/OrderSalesShipmentStatisticsServiceImpl.java

@@ -3,11 +3,14 @@ package com.sd.business.service.order.impl;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.tenant.entity.dict.po.DictCommonData;
+import com.fjhx.tenant.service.dict.DictCommonDataService;
 import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.sd.business.entity.board.bo.TurnoverRateSalesShipmentStatisticsBo;
 import com.sd.business.entity.board.dto.TurnoverRateBoardSelectDto;
 import com.sd.business.entity.board.vo.TurnoverRateStatisticsVo;
+import com.sd.business.entity.bom.po.Bom;
 import com.sd.business.entity.bom.po.BomClassify;
 import com.sd.business.entity.bom.po.BomSpec;
 import com.sd.business.entity.department.constant.DepartmentConstant;
@@ -56,6 +59,9 @@ public class OrderSalesShipmentStatisticsServiceImpl extends ServiceImpl<OrderSa
     @Autowired
     private InventoryBackupService inventoryBackupService;
 
+    @Autowired
+    private DictCommonDataService dictCommonDataService;
+
     @Override
     public List<OrderSalesShipmentStatisticsVo> getSalesShipmentStatisticsByDate(OrderSalesShipmentStatisticsDto dto) {
         IWrapper<OrderSalesShipmentStatistics> wrapper = getWrapper();
@@ -83,11 +89,16 @@ public class OrderSalesShipmentStatisticsServiceImpl extends ServiceImpl<OrderSa
         wrapper.orderByDesc("osss", OrderSalesShipmentStatistics::getId);
         wrapper.between("osss", OrderSalesShipmentStatistics::getTotalDate, ninetyDaysDate, endDate);
         if (Objects.equals(dto.getBomClassify(), 1)) {
-            wrapper.in("bc", BomClassify::getCode, Arrays.asList("201.G","203.G"));
+            wrapper.eq("bc", BomClassify::getCode, "201.G");
         } else if (Objects.equals(dto.getBomClassify(), 2)){
             wrapper.eq("bc", BomClassify::getCode,"202.G");
+        } else if (Objects.equals(dto.getBomClassify(), 3)) {
+            wrapper.eq("bc", BomClassify::getCode,"203.G");
         }
         wrapper.ne("bs", BomSpec::getCode, "1010000007");
+        wrapper.eq("b", Bom::getChromatophore, dto.getChromatophore());
+        wrapper.like("bs", BomSpec::getWidth, dto.getWidth());
+        wrapper.like("bs", BomSpec::getHeight, dto.getHeight());
         wrapper.groupBy("osss.bom_spec_id");
         List<TurnoverRateSalesShipmentStatisticsBo> statisticsVoList = this.baseMapper.getTurnoverRateSalesShipmentStatisticsList(wrapper);
         if (ObjectUtil.isEmpty(statisticsVoList)) {
@@ -95,6 +106,9 @@ public class OrderSalesShipmentStatisticsServiceImpl extends ServiceImpl<OrderSa
         }
         List<Long> bomSpecIds = statisticsVoList.stream().map(TurnoverRateSalesShipmentStatisticsBo::getBomSpecId).collect(Collectors.toList());
 
+        Map<String, String> bomChromatophoreMap = dictCommonDataService.list(q -> q.eq(DictCommonData::getDictCode, "bom_chromatophore"))
+                .stream().collect(Collectors.toMap(DictCommonData::getDictKey, DictCommonData::getDictValue));
+
         // 查询前90、60、30天的所有库存数据
         List<InventoryBackup> inventoryBackupList = inventoryBackupService.list(q -> q
                 .in(InventoryBackup::getBackupDate, ninetyDaysDate, sixtyDaysDate, thirtyDaysDate)
@@ -198,6 +212,9 @@ public class OrderSalesShipmentStatisticsServiceImpl extends ServiceImpl<OrderSa
             TurnoverRateStatisticsVo vo = new TurnoverRateStatisticsVo();
             vo.setBomSpecCode(item.getBomSpecCode());
             vo.setBomSpecName(item.getBomSpecName());
+            vo.setWidth(item.getWidth());
+            vo.setHeight(item.getHeight());
+            vo.setChromatophore(bomChromatophoreMap.get(item.getChromatophore()));
             vo.setSalesQuantityThirtyDays(item.getThirtyDaysSalesQuantity());
             vo.setSalesQuantitySixtyDays(item.getSixtyDaysSalesQuantity());
             vo.setSalesQuantityNinetyDays(item.getNinetyDaysSalesQuantity());

+ 3 - 0
sd-business/src/main/resources/mapper/order/OrderSalesShipmentStatisticsMapper.xml

@@ -21,6 +21,9 @@
             osss.bom_spec_id,
             bs.code bomSpecCode,
             bs.name bomSpecName,
+            bs.width,
+            bs.height,
+            b.chromatophore,
             sum(case when osss.total_date >= date(date_sub(now(), interval 91 day)) then quantity else 0 end) ninetyDaysSalesQuantity,
             sum(case when osss.total_date >= date(date_sub(now(), interval 61 day)) then quantity else 0 end) sixtyDaysSalesQuantity,
             sum(case when osss.total_date >= date(date_sub(now(), interval 31 day)) then quantity else 0 end) thirtyDaysSalesQuantity

+ 1 - 0
sd-business/src/main/resources/mapper/purchase/PurchaseBomMapper.xml

@@ -81,6 +81,7 @@
             bs.code bomSpecCode,
             bs.name bomSpecName,
             p.code purchaseCode,
+            p.erp_code purchaseErpCode,
             s.name supplierName,
             pb.purchase_quantity,
             (pb.purchase_quantity - pb.arrival_quantity) inTransitQuantity,