ソースを参照

申购通过生成申购需求单

fgd 1 年間 前
コミット
babc3755df

+ 10 - 0
sd-business/src/main/java/com/sd/business/entity/check/dto/CheckImportDataDto.java

@@ -2,6 +2,7 @@ package com.sd.business.entity.check.dto;
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -20,24 +21,28 @@ public class CheckImportDataDto {
     /**
      * 仓库名称
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "仓库", index = 0)
     private String warehouseName;
 
     /**
      * 品名
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "品名", index = 1)
     private String bomSpecName;
 
     /**
      * 品号
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "品号", index = 2)
     private String bomSpecCode;
 
     /**
      * 结存单价
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "结存单价", index = 3)
     private BigDecimal balanceUnitPrice;
 
@@ -45,30 +50,35 @@ public class CheckImportDataDto {
     /**
      * 数量
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "可用库存", index = 4)
     private BigDecimal quantity;
 
     /**
      * 锁定库存
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "锁定库存", index = 5)
     private BigDecimal lockQuantity;
 
     /**
      * 结存总价
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "结存总价", index = 6)
     private BigDecimal totalPrice;
 
     /**
      * 总库存
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "总库存", index = 7)
     private BigDecimal totalQuantity;
 
     /**
      * 实际库存
      */
+    @ColumnWidth(15)
     @ExcelProperty(value = "实际库存", index = 8)
     private BigDecimal realityQuantity;
 }

+ 1 - 0
sd-business/src/main/java/com/sd/business/flow/ApplyBuyFlow.java

@@ -58,6 +58,7 @@ public class ApplyBuyFlow extends FlowDelegate {
                 .set(BasePo::getUpdateTime, new Date())
                 .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
         );
+        applyBuyService.addBomAccessory(businessId);
     }
 
     /**

+ 5 - 0
sd-business/src/main/java/com/sd/business/service/apply/ApplyBuyService.java

@@ -38,4 +38,9 @@ public interface ApplyBuyService extends BaseService<ApplyBuy> {
      */
     void edit(ApplyBuyDto dto);
 
+    /**
+     * 新增备货需求附件
+     * @param id
+     */
+    void addBomAccessory(Long id);
 }

+ 157 - 1
sd-business/src/main/java/com/sd/business/service/apply/impl/ApplyBuyServiceImpl.java

@@ -1,28 +1,51 @@
 package com.sd.business.service.apply.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.file.entity.FileInfo;
+import com.fjhx.file.entity.ObsFile;
+import com.fjhx.file.service.FileInfoService;
+import com.fjhx.file.utils.ObsFileUtil;
+import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.sd.business.entity.apply.dto.ApplyBuyDto;
 import com.sd.business.entity.apply.dto.ApplyBuySelectDto;
 import com.sd.business.entity.apply.po.ApplyBuy;
 import com.sd.business.entity.apply.po.ApplyBuyBom;
+import com.sd.business.entity.apply.vo.ApplyBuyBomAccessoryVo;
 import com.sd.business.entity.apply.vo.ApplyBuyBomVo;
 import com.sd.business.entity.apply.vo.ApplyBuyVo;
+import com.sd.business.entity.bom.po.BomSpec;
+import com.sd.business.entity.department.constant.DepartmentConstant;
+import com.sd.business.entity.inventory.po.Inventory;
 import com.sd.business.mapper.apply.ApplyBuyMapper;
 import com.sd.business.service.apply.ApplyBuyBomService;
 import com.sd.business.service.apply.ApplyBuyService;
 import com.sd.business.service.bom.BomSpecService;
+import com.sd.business.service.inventory.InventoryService;
+import com.sd.business.service.order.OrderService;
+import com.sd.business.service.purchase.PurchaseBomService;
+import com.sd.business.upload.ObsUploadService;
 import com.sd.business.util.CodeEnum;
 import com.sd.framework.util.Assert;
+import com.sd.framework.util.StreamUtil;
+import com.sd.framework.util.excel.util.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.math.BigDecimal;
-import java.util.List;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
@@ -42,6 +65,21 @@ public class ApplyBuyServiceImpl extends ServiceImpl<ApplyBuyMapper, ApplyBuy> i
     @Autowired
     private BomSpecService bomSpecService;
 
+    @Autowired
+    private PurchaseBomService purchaseBomService;
+
+    @Autowired
+    private InventoryService inventoryService;
+
+    @Autowired
+    private FileInfoService fileInfoService;
+
+    @Autowired
+    private OrderService orderService;
+
+    @Autowired
+    private ObsUploadService obsUploadService;
+
     @Override
     public Page<ApplyBuyVo> getPage(ApplyBuySelectDto dto) {
 
@@ -121,4 +159,122 @@ public class ApplyBuyServiceImpl extends ServiceImpl<ApplyBuyMapper, ApplyBuy> i
         applyBuyBomService.editLinked(applyBuyBomList, ApplyBuyBom::getApplyBuyId, applyBuyId);
     }
 
+    @DSTransactional
+    @Override
+    public void addBomAccessory(Long id) {
+        // 新增备货需求附件
+        List<ApplyBuyBomAccessoryVo> applyData = this.getApplyData(id);
+        // 修改表头
+        Map<String, String> keys = new HashMap<>();
+        Date date = DateUtil.date();
+        Date lastMonthDate = DateUtil.offsetMonth(date, -1);
+        Date beforeLastMonthDate = DateUtil.offsetMonth(date, -2);
+        keys.put("currentMonthSales", (DateUtil.month(date) + 1) + "月销量");
+        keys.put("lastMonthSales", (DateUtil.month(lastMonthDate) + 1) + "月销量");
+        keys.put("beforeLastMonthSales", (DateUtil.month(beforeLastMonthDate) + 1) + "月销量");
+
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        EasyExcel.write(os, ExcelUtil.getClassNew(new ApplyBuyBomAccessoryVo(), keys)).sheet("sheetName").doWrite(applyData);
+        String fileName = "胜德体育备货需求.xlsx";
+        // 上传文件
+        ByteArrayInputStream bis = new ByteArrayInputStream(os.toByteArray());
+        String fileUrl = obsUploadService.uploadFileByte(bis, fileName);
+
+        // 保存文件
+        FileInfo fileInfo = new FileInfo();
+        fileInfo.setFileUrl(fileUrl);
+        fileInfo.setFileName(fileName);
+        fileInfoService.save(fileInfo);
+        // 新增附件列表
+        ObsFile obsFile = new ObsFile();
+        obsFile.setId(fileInfo.getId());
+        obsFile.setFileName(fileName);
+        obsFile.setFileUrl(fileUrl);
+        ObsFileUtil.saveFile(obsFile, id);
+    }
+
+
+    /**
+     * 获取需求单数据
+     * @param applyBuyId
+     * @return
+     */
+    private List<ApplyBuyBomAccessoryVo> getApplyData(Long applyBuyId) {
+        List<ApplyBuyBomAccessoryVo> accessoryList = new ArrayList<>();
+        List<ApplyBuyBom> list = applyBuyBomService.list(q -> q.eq(ApplyBuyBom::getApplyBuyId, applyBuyId));
+        Map<Long, BomSpec> bomSpecMap = bomSpecService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, list.stream().map(ApplyBuyBom::getBomSpecId).collect(Collectors.toList())));
+        for (ApplyBuyBom applyBuyBom : list) {
+            Long bomSpecId = applyBuyBom.getBomSpecId();
+            BomSpec bomSpec = bomSpecMap.get(bomSpecId);
+            ApplyBuyBomAccessoryVo vo = new ApplyBuyBomAccessoryVo();
+            // 当月时间
+            Date date = DateUtil.date();
+            Date currentMonthBeginDate = DateUtil.beginOfMonth(date);
+            BigDecimal currentMonthSalesQuantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, currentMonthBeginDate, date);
+            // 上个月时间
+            Date lastMonthDate = DateUtil.offsetMonth(date, -1);
+            Date lastMonthBeginDate = DateUtil.beginOfMonth(lastMonthDate);
+            Date lastMonthEndDate = DateUtil.endOfMonth(lastMonthDate);
+            BigDecimal lastMonthSalesQuantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, lastMonthBeginDate, lastMonthEndDate);
+            // 上上个月时间
+            Date beforeLastMonthDate = DateUtil.offsetMonth(date, -2);
+            Date beforeLastMonthBeginDate = DateUtil.beginOfMonth(beforeLastMonthDate);
+            Date beforeLastMonthEndDate = DateUtil.endOfMonth(beforeLastMonthDate);
+            BigDecimal beforeLastMonth00Quantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, beforeLastMonthBeginDate, beforeLastMonthEndDate);
+            List<Inventory> inventoryList = inventoryService.list(q -> q
+                    .eq(Inventory::getBomSpecId, bomSpecId)
+                    .eq(Inventory::getDepartmentId, DepartmentConstant.SD_SPORTS));
+            // 当前库存数
+            BigDecimal inventoryQuantity = ObjectUtil.isEmpty(inventoryList) ? BigDecimal.ZERO : StreamUtil.bigDecimalAdd(inventoryList, Inventory::getQuantity);
+            // 在途数量
+            BigDecimal inTransitSum = purchaseBomService.getPurchaseBomInTransitSum(bomSpecId);
+            // 月平均消耗
+            BigDecimal averageMonthSales = currentMonthSalesQuantity
+                    .add(lastMonthSalesQuantity)
+                    .add(beforeLastMonth00Quantity)
+                    .divide(new BigDecimal(90), 2, RoundingMode.HALF_UP);
+            // 实际销量可消耗天数
+            BigDecimal actualSalesDays;
+            if (ObjectUtil.equals(averageMonthSales, BigDecimal.ZERO)) {
+                actualSalesDays = BigDecimal.ZERO;
+            } else {
+                actualSalesDays = inventoryQuantity.divide(averageMonthSales, 0, RoundingMode.HALF_UP);
+            }
+            // 短缺数量合计
+            BigDecimal shortageQuantity;
+            if (ObjectUtil.equals(currentMonthSalesQuantity, BigDecimal.ZERO)) {
+                shortageQuantity = BigDecimal.ZERO;
+            } else {
+                shortageQuantity = inventoryQuantity
+                        .add(inTransitSum)
+                        .subtract(currentMonthSalesQuantity
+                                .divide(new BigDecimal(90), 2, RoundingMode.HALF_UP)
+                                .multiply(new BigDecimal(60))
+                        );
+            }
+            // 规格
+            String length = bomSpec.getLength() == null ? "0" : bomSpec.getLength().stripTrailingZeros().toPlainString();
+            String width = bomSpec.getWidth() == null ? "0" : bomSpec.getWidth().stripTrailingZeros().toPlainString();
+            String height = bomSpec.getHeight() == null ? "0" : bomSpec.getHeight().stripTrailingZeros().toPlainString();
+            // 赋值
+            vo.setBomSpecCode(bomSpec.getCode());
+            vo.setBomSpecName(bomSpec.getName());
+            vo.setSpecification(length + " * " + width + " * " + height);
+            vo.setColour(bomSpec.getColour());
+            vo.setStockQuantity(inventoryQuantity);
+            vo.setInTransitQuantity(inTransitSum);
+            vo.setCurrentMonthSales(currentMonthSalesQuantity);
+            vo.setLastMonthSales(lastMonthSalesQuantity);
+            vo.setBeforeLastMonthSales(beforeLastMonth00Quantity);
+            vo.setAverageMonthSales(averageMonthSales);
+            vo.setActualSalesDays(actualSalesDays);
+            vo.setShortageQuantity(shortageQuantity);
+            vo.setApplyBuyQuantity(applyBuyBom.getQuantity());
+            vo.setApplyBuyQuantity(applyBuyBom.getQuantity());
+            accessoryList.add(vo);
+        }
+
+        return accessoryList;
+    }
+
 }

+ 0 - 144
sd-business/src/main/java/com/sd/business/service/purchase/impl/PurchaseServiceImpl.java

@@ -1,15 +1,10 @@
 package com.sd.business.service.purchase.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.excel.EasyExcel;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fjhx.file.entity.FileInfo;
-import com.fjhx.file.entity.ObsFile;
-import com.fjhx.file.service.FileInfoService;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.enums.FlowStatusEnum;
 import com.ruoyi.common.constant.StatusConstant;
@@ -17,11 +12,7 @@ import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.sd.business.entity.apply.po.ApplyBuyBom;
-import com.sd.business.entity.apply.vo.ApplyBuyBomAccessoryVo;
-import com.sd.business.entity.bom.po.BomSpec;
-import com.sd.business.entity.department.constant.DepartmentConstant;
 import com.sd.business.entity.in.po.InOutStorageBom;
-import com.sd.business.entity.inventory.po.Inventory;
 import com.sd.business.entity.purchase.dto.PurchaseDto;
 import com.sd.business.entity.purchase.dto.PurchaseSelectDto;
 import com.sd.business.entity.purchase.dto.PurchaseSelectListDto;
@@ -34,20 +25,13 @@ import com.sd.business.entity.supplier.po.Supplier;
 import com.sd.business.mapper.purchase.PurchaseMapper;
 import com.sd.business.service.apply.ApplyBuyBomService;
 import com.sd.business.service.bom.BomSpecService;
-import com.sd.business.service.inventory.InventoryService;
-import com.sd.business.service.order.OrderService;
 import com.sd.business.service.purchase.PurchaseBomService;
 import com.sd.business.service.purchase.PurchaseService;
-import com.sd.business.upload.ObsUploadService;
 import com.sd.business.util.CodeEnum;
-import com.sd.framework.util.StreamUtil;
-import com.sd.framework.util.excel.util.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.io.*;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -72,18 +56,6 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase> i
     @Autowired
     private ApplyBuyBomService applyBuyBomService;
 
-    @Autowired
-    private OrderService orderService;
-
-    @Autowired
-    private InventoryService inventoryService;
-
-    @Autowired
-    private FileInfoService fileInfoService;
-
-    @Autowired
-    private ObsUploadService obsUploadService;
-
     @Override
     public Page<PurchaseVo> getPage(PurchaseSelectDto dto) {
         IWrapper<Purchase> wrapper = getWrapper();
@@ -186,39 +158,6 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase> i
         ArrayList<ApplyBuyBom> applyBuyBomList = new ArrayList<>(applyBuyBomMap.values());
         applyBuyBomService.updateBatchById(applyBuyBomList);
 
-        // 新增备货需求附件
-        List<ApplyBuyBomAccessoryVo> applyData = this.getApplyData(purchaseDto.getApplyBuyId());
-        // 修改表头
-        Map<String, String> keys = new HashMap<>();
-        Date date = DateUtil.date();
-        Date lastMonthDate = DateUtil.offsetMonth(date, -1);
-        Date beforeLastMonthDate = DateUtil.offsetMonth(date, -2);
-        keys.put("currentMonthSales", (DateUtil.month(date) + 1) + "月销量");
-        keys.put("lastMonthSales", (DateUtil.month(lastMonthDate) + 1) + "月销量");
-        keys.put("beforeLastMonthSales", (DateUtil.month(beforeLastMonthDate) + 1) + "月销量");
-
-        ByteArrayOutputStream os = new ByteArrayOutputStream();
-        EasyExcel.write(os, ExcelUtil.getClassNew(new ApplyBuyBomAccessoryVo(), keys)).sheet("sheetName").doWrite(applyData);
-        String fileName = "胜德体育备货需求.xlsx";
-        // 上传文件
-        ByteArrayInputStream bis = new ByteArrayInputStream(os.toByteArray());
-        String fileUrl = obsUploadService.uploadFileByte(bis, fileName);
-
-        // 保存文件
-        FileInfo fileInfo = new FileInfo();
-        fileInfo.setFileUrl(fileUrl);
-        fileInfo.setFileName(fileName);
-        fileInfoService.save(fileInfo);
-        // 新增附件列表
-        ObsFile obsFile = new ObsFile();
-        obsFile.setId(fileInfo.getId());
-        obsFile.setFileName(fileName);
-        obsFile.setFileUrl(fileUrl);
-        if (purchaseDto.getFileList() == null) {
-            purchaseDto.setFileList(new ArrayList<>());
-        }
-        purchaseDto.getFileList().add(obsFile);
-
         ObsFileUtil.saveFile(purchaseDto.getFileList(), purchaseDto.getId());
     }
 
@@ -357,87 +296,4 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase> i
         // 查询采购单数据
         return this.baseMapper.getPage(dto.getPage(), wrapper);
     }
-
-    /**
-     * 获取需求单数据
-     * @param applyBuyId
-     * @return
-     */
-    private List<ApplyBuyBomAccessoryVo> getApplyData(Long applyBuyId) {
-        List<ApplyBuyBomAccessoryVo> accessoryList = new ArrayList<>();
-        List<ApplyBuyBom> list = applyBuyBomService.list(q -> q.eq(ApplyBuyBom::getApplyBuyId, applyBuyId));
-        Map<Long, BomSpec> bomSpecMap = bomSpecService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, list.stream().map(ApplyBuyBom::getBomSpecId).collect(Collectors.toList())));
-        for (ApplyBuyBom applyBuyBom : list) {
-            Long bomSpecId = applyBuyBom.getBomSpecId();
-            BomSpec bomSpec = bomSpecMap.get(bomSpecId);
-            ApplyBuyBomAccessoryVo vo = new ApplyBuyBomAccessoryVo();
-            // 当月时间
-            Date date = DateUtil.date();
-            Date currentMonthBeginDate = DateUtil.beginOfMonth(date);
-            BigDecimal currentMonthSalesQuantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, currentMonthBeginDate, date);
-            // 上个月时间
-            Date lastMonthDate = DateUtil.offsetMonth(date, -1);
-            Date lastMonthBeginDate = DateUtil.beginOfMonth(lastMonthDate);
-            Date lastMonthEndDate = DateUtil.endOfMonth(lastMonthDate);
-            BigDecimal lastMonthSalesQuantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, lastMonthBeginDate, lastMonthEndDate);
-            // 上上个月时间
-            Date beforeLastMonthDate = DateUtil.offsetMonth(date, -2);
-            Date beforeLastMonthBeginDate = DateUtil.beginOfMonth(beforeLastMonthDate);
-            Date beforeLastMonthEndDate = DateUtil.endOfMonth(beforeLastMonthDate);
-            BigDecimal beforeLastMonth00Quantity = orderService.getOrderBomSpecOutStorageQuantity(bomSpecId, beforeLastMonthBeginDate, beforeLastMonthEndDate);
-            List<Inventory> inventoryList = inventoryService.list(q -> q
-                    .eq(Inventory::getBomSpecId, bomSpecId)
-                    .eq(Inventory::getDepartmentId, DepartmentConstant.SD_SPORTS));
-            // 当前库存数
-            BigDecimal inventoryQuantity = ObjectUtil.isEmpty(inventoryList) ? BigDecimal.ZERO : StreamUtil.bigDecimalAdd(inventoryList, Inventory::getQuantity);
-            // 在途数量
-            BigDecimal inTransitSum = purchaseBomService.getPurchaseBomInTransitSum(bomSpecId);
-            // 月平均消耗
-            BigDecimal averageMonthSales = currentMonthSalesQuantity
-                    .add(lastMonthSalesQuantity)
-                    .add(beforeLastMonth00Quantity)
-                    .divide(new BigDecimal(90), 2, RoundingMode.HALF_UP);
-            // 实际销量可消耗天数
-            BigDecimal actualSalesDays;
-            if (ObjectUtil.equals(averageMonthSales, BigDecimal.ZERO)) {
-                actualSalesDays = BigDecimal.ZERO;
-            } else {
-                actualSalesDays = inventoryQuantity.divide(averageMonthSales, 0, RoundingMode.HALF_UP);
-            }
-            // 短缺数量合计
-            BigDecimal shortageQuantity;
-            if (ObjectUtil.equals(currentMonthSalesQuantity, BigDecimal.ZERO)) {
-                shortageQuantity = BigDecimal.ZERO;
-            } else {
-                shortageQuantity = inventoryQuantity
-                        .add(inTransitSum)
-                        .subtract(currentMonthSalesQuantity
-                                .divide(new BigDecimal(90), 2, RoundingMode.HALF_UP)
-                                .multiply(new BigDecimal(60))
-                        );
-            }
-            // 规格
-            String length = bomSpec.getLength() == null ? "0" : bomSpec.getLength().stripTrailingZeros().toPlainString();
-            String width = bomSpec.getWidth() == null ? "0" : bomSpec.getWidth().stripTrailingZeros().toPlainString();
-            String height = bomSpec.getHeight() == null ? "0" : bomSpec.getHeight().stripTrailingZeros().toPlainString();
-            // 赋值
-            vo.setBomSpecCode(bomSpec.getCode());
-            vo.setBomSpecName(bomSpec.getName());
-            vo.setSpecification(length + " * " + width + " * " + height);
-            vo.setColour(bomSpec.getColour());
-            vo.setStockQuantity(inventoryQuantity);
-            vo.setInTransitQuantity(inTransitSum);
-            vo.setCurrentMonthSales(currentMonthSalesQuantity);
-            vo.setLastMonthSales(lastMonthSalesQuantity);
-            vo.setBeforeLastMonthSales(beforeLastMonth00Quantity);
-            vo.setAverageMonthSales(averageMonthSales);
-            vo.setActualSalesDays(actualSalesDays);
-            vo.setShortageQuantity(shortageQuantity);
-            vo.setApplyBuyQuantity(applyBuyBom.getQuantity());
-            vo.setApplyBuyQuantity(applyBuyBom.getQuantity());
-            accessoryList.add(vo);
-        }
-
-        return accessoryList;
-    }
 }

+ 1 - 0
sd-business/src/main/resources/mapper/inventory/InventoryMapper.xml

@@ -14,6 +14,7 @@
                bs.name bomSpecName,
                bs.code bomSpecCode,
                d.name  departmentName,
+               i.quantity * i.balance_unit_price totalPrice,
                i.quantity + ifnull(i.lock_quantity, 0) totalQuantity
         from ${tableName} i
                  left join bom_spec bs on i.bom_spec_id = bs.id