yzc 1 год назад
Родитель
Сommit
c9f317ed09

+ 6 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/dto/ProductInfoSelectDto.java

@@ -101,4 +101,10 @@ public class ProductInfoSelectDto extends BaseSelectDto {
      */
     private Integer isNeRawMaterial;
 
+    /**
+     * 归属公司Id
+     */
+    private Long companyId;
+
+
 }

+ 5 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/vo/ProductInfoVo.java

@@ -64,4 +64,9 @@ public class ProductInfoVo extends ProductInfo {
      * 原材料编号
      */
     private String rawMaterialCode;
+
+    /**
+     * 归属公司名称
+     */
+    private String companyName;
 }

+ 18 - 0
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -37,11 +37,13 @@ import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
 import com.fjhx.tenant.service.dict.DictTenantDataService;
 import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.core.domain.BasePo;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.SqlField;
+import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.utils.UserUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,6 +77,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     private FtpFileService ftpFileService;
     @Autowired
     private ProductAvailableRecordService productAvailableRecordService;
+    @Autowired
+    private ISysDeptService sysDeptService;
 
     @Override
     public Page<ProductInfoVo> getPage(ProductInfoSelectDto dto) {
@@ -97,6 +101,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
                 new SqlField("pi", ProductInfo::getSpec)
         );
 
+        //归属公司id过滤
+        wrapper.eq(ProductInfo::getCompanyId, dto.getCompanyId());
+
         //不显示原材料数据
         Integer isNeRawMaterial = dto.getIsNeRawMaterial();
         if (Objects.equals(isNeRawMaterial, 1)) {
@@ -136,6 +143,14 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             rawMaterialMap = this.mapKEntity(ProductInfo::getId, q -> q.in(ProductInfo::getId, rawMaterialIds));
         }
 
+        //获取归属公司信息
+        Map<Long, String> sysDeptMap = new HashMap<>();
+        List<Long> companyIds = records.stream().map(ProductInfo::getCompanyId).collect(Collectors.toList());
+        if (ObjectUtil.isNotEmpty(companyIds)) {
+            List<SysDept> deptList = sysDeptService.list(Wrappers.<SysDept>query().in("dept_id", companyIds));
+            sysDeptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+        }
+
         for (ProductInfoVo record : records) {
             Long productClassifyId = record.getProductClassifyId();
             ProductClassify productClassify = productClassifyMap.get(productClassifyId);
@@ -161,6 +176,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
                 record.setRawMaterialCode(productInfo.getCustomCode());
             }
 
+            //赋值归属公司名称
+            record.setCompanyName(sysDeptMap.get(record.getCompanyId()));
+
         }
 
         return page;

+ 2 - 1
hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml

@@ -38,7 +38,8 @@
                pi.cost_currency,
                pi.raw_material_id,
                pi.prod_img_path,
-               pi.prod_file_path
+               pi.prod_file_path,
+               pi.company_id
         FROM product_info pi
     </sql>
 

+ 1 - 1
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -135,7 +135,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         wrapper.le("sq", SaleQuotation::getCreateTime, dto.getEndTime());
 
         wrapper.ne("sq", SaleQuotation::getStatus, FlowStatusEnum1.UPDATE);
-        wrapper.ne("eq", SaleQuotation::getStatus, dto.getStatus());
+        wrapper.ne("sq", SaleQuotation::getStatus, dto.getStatus());
 
 
         Page<SaleQuotationVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);