浏览代码

sku报价板新增事业部查询

fgd 1 年之前
父节点
当前提交
7c234bfbd1

+ 5 - 0
sd-business/src/main/java/com/sd/business/entity/board/dto/SkuSpecQuotationDto.java

@@ -14,6 +14,11 @@ import lombok.Setter;
 public class SkuSpecQuotationDto {
 
     /**
+     * 事业部id
+     */
+    private Long departmentId;
+
+    /**
      * sku品号
      */
     private String skuSpecCode;

+ 3 - 3
sd-business/src/main/java/com/sd/business/service/sku/impl/SkuSpecServiceImpl.java

@@ -175,8 +175,8 @@ public class SkuSpecServiceImpl extends ServiceImpl<SkuSpecMapper, SkuSpec> impl
 
     @Override
     public List<SkuSpecQuotationVo> getSkuSpecQuotationList(SkuSpecQuotationDto dto) {
-        Long deptId = SecurityUtils.getDeptId();
-        Department department = departmentService.getById(deptId);
+        Assert.notNull(dto.getDepartmentId(), "事业部id不能为空");
+        Department department = departmentService.getById(dto.getDepartmentId());
         Assert.notNull(department, "未知事业部");
         String priceBillingStandardIdStr = department.getPriceBillingStandardId();
         Assert.notBlank(priceBillingStandardIdStr, "事业部未绑定加工计费标准");
@@ -211,7 +211,7 @@ public class SkuSpecServiceImpl extends ServiceImpl<SkuSpecMapper, SkuSpec> impl
         List<Long> skuSpecIds = skuSpecList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
         Map<Long, List<SkuSpecLink>> linkMap = skuSpecLinkService.mapKGroup(SkuSpecLink::getSkuSpecId,
                 q -> q.in(SkuSpecLink::getSkuSpecId, skuSpecIds)
-                        .eq(SkuSpecLink::getDepartmentId, deptId)
+                        .eq(SkuSpecLink::getDepartmentId, department.getId())
                         .eq(SkuSpecLink::getType, 1));
         Set<Long> bomSpecIds = skuSpecList.stream().map(SkuSpec::getBomSpecId).collect(Collectors.toSet());
         bomSpecIds.addAll(linkMap.values().stream().flatMap(item -> item.stream().map(SkuSpecLink::getBomSpecId)).collect(Collectors.toList()));