Ver código fonte

添加归属公司名称返回

yzc 1 ano atrás
pai
commit
9c291d7393
21 arquivos alterados com 170 adições e 24 exclusões
  1. 2 2
      hx-purchase/src/main/java/com/fjhx/purchase/entity/invoice/vo/InvoiceVo.java
  2. 2 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/pay/vo/PayVo.java
  3. 31 10
      hx-purchase/src/main/java/com/fjhx/purchase/service/invoice/impl/InvoiceServiceImpl.java
  4. 10 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/pay/impl/PayServiceImpl.java
  5. 13 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java
  6. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/ext/dto/ExtQuotationSelectDto.java
  7. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/ext/vo/ExtQuotationVo.java
  8. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/purchase/vo/PurchaseBackVo.java
  9. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/sale/dto/SaleQuotationSelectDto.java
  10. 7 1
      hx-sale/src/main/java/com/fjhx/sale/entity/sale/vo/SaleQuotationVo.java
  11. 3 1
      hx-sale/src/main/java/com/fjhx/sale/flow/ContractFlow.java
  12. 3 1
      hx-sale/src/main/java/com/fjhx/sale/flow/PayFlow.java
  13. 3 1
      hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseBackFlow.java
  14. 1 0
      hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java
  15. 11 3
      hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java
  16. 21 2
      hx-sale/src/main/java/com/fjhx/sale/service/purchase/impl/PurchaseBackServiceImpl.java
  17. 12 3
      hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java
  18. 2 0
      hx-wms/src/main/java/com/fjhx/wms/entity/stock/vo/StockJournalDetailsVo.java
  19. 2 0
      hx-wms/src/main/java/com/fjhx/wms/entity/stock/vo/StockWaitVo.java
  20. 15 0
      hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockJournalDetailsServiceImpl.java
  21. 12 0
      hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockWaitServiceImpl.java

+ 2 - 2
hx-purchase/src/main/java/com/fjhx/purchase/entity/invoice/vo/InvoiceVo.java

@@ -1,7 +1,5 @@
 package com.fjhx.purchase.entity.invoice.vo;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fjhx.file.entity.ObsFile;
 import com.fjhx.purchase.entity.invoice.po.Invoice;
 import lombok.Getter;
 import lombok.Setter;
@@ -34,4 +32,6 @@ public class InvoiceVo extends Invoice {
      */
     private List<InvoiceDetailsVo> invoiceDetailsVoList;
 
+    private String companyName;
+
 }

+ 2 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/pay/vo/PayVo.java

@@ -38,4 +38,6 @@ public class PayVo extends Pay {
      */
     private String accountManagementName;
 
+    private String companyName;
+
 }

+ 31 - 10
hx-purchase/src/main/java/com/fjhx/purchase/service/invoice/impl/InvoiceServiceImpl.java

@@ -18,10 +18,12 @@ import com.fjhx.purchase.service.invoice.InvoiceDetailsService;
 import com.fjhx.purchase.service.invoice.InvoiceService;
 import com.fjhx.supply.entity.supplier.po.SupplierInfo;
 import com.fjhx.supply.service.supplier.SupplierInfoService;
+import com.ruoyi.common.core.domain.entity.SysDept;
 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 org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -51,6 +53,9 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
     @Autowired
     private SupplierInfoService supplierInfoService;
 
+    @Autowired
+    private ISysDeptService deptService;
+
     /**
      * 分页
      *
@@ -77,17 +82,30 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
         wrapper.orderByDesc("t1", Invoice::getCreateTime);
         Page<InvoiceVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<InvoiceVo> list = page.getRecords();
-        if (CollectionUtils.isNotEmpty(list)) {
-            List<Long> supplyIds = list.stream().map(InvoiceVo::getSupplyId).collect(Collectors.toList());
-            List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
-            Map<Long, List<SupplierInfo>> supplyMap = supplierInfoList.stream().distinct().collect(Collectors.groupingBy(SupplierInfo::getId));
-            if (MapUtils.isNotEmpty(supplyMap)) {
-                for (InvoiceVo p : list) {
-                    List<SupplierInfo> supplys = supplyMap.getOrDefault(p.getSupplyId(), null);
-                    p.setSupplyName(supplys == null ? null : supplys.get(0).getName());
-                }
+
+        if (ObjectUtils.isEmpty(list)) {
+            return page;
+        }
+
+        List<Long> supplyIds = list.stream().map(InvoiceVo::getSupplyId).collect(Collectors.toList());
+        List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
+        Map<Long, List<SupplierInfo>> supplyMap = supplierInfoList.stream().distinct().collect(Collectors.groupingBy(SupplierInfo::getId));
+        if (MapUtils.isNotEmpty(supplyMap)) {
+            for (InvoiceVo p : list) {
+                List<SupplierInfo> supplys = supplyMap.getOrDefault(p.getSupplyId(), null);
+                p.setSupplyName(supplys == null ? null : supplys.get(0).getName());
             }
         }
+
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+
+        for (InvoiceVo record : list) {
+            //赋值归属公司
+            record.setCompanyName(companyMap.get(record.getCompanyId()));
+        }
+
         return page;
     }
 
@@ -125,8 +143,11 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
     @DSTransactional
     public void add(Invoice invoice) {
 
+
         Long companyId = SecurityUtils.getCompanyId();
-        invoice.setCompanyId(companyId);
+        if (ObjectUtils.isEmpty(invoice.getCompanyId())) {
+            invoice.setCompanyId(companyId);
+        }
         this.save(invoice);
         List<InvoiceDetails> invoiceDetailsList = invoice.getInvoiceDetailsList();
         if (CollectionUtils.isNotEmpty(invoiceDetailsList)) {

+ 10 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/pay/impl/PayServiceImpl.java

@@ -27,11 +27,13 @@ import com.fjhx.purchase.service.purchase.PurchaseService;
 import com.fjhx.supply.entity.supplier.po.SupplierInfo;
 import com.fjhx.supply.service.supplier.SupplierInfoService;
 import com.ruoyi.common.core.domain.BaseIdPo;
+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 org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -70,6 +72,8 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PaySe
 
     @Autowired
     private FlowExampleService flowExampleService;
+    @Autowired
+    private ISysDeptService deptService;
 
     /**
      * 分页
@@ -140,6 +144,10 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PaySe
         Map<Long, Long> flowMap = flowExampleService.mapKV(FlowExample::getBusinessId, BaseIdPo::getId,
                 q -> q.in(FlowExample::getBusinessId, ids));
 
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+
         for (PayVo p : list) {
 
             // 赋值付款状态
@@ -151,6 +159,8 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PaySe
             // 赋值流程id
             p.setFlowExampleId(flowMap.get(p.getId()));
 
+            p.setCompanyName(companyMap.get(p.getCompanyId()));
+
         }
 
         return page;

+ 13 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java

@@ -27,9 +27,11 @@ import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
 import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
 import com.fjhx.tenant.service.dict.DictTenantDataService;
 import com.fjhx.tenant.utils.DeptUstil;
+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.wrapper.IWrapper;
+import com.ruoyi.system.service.ISysDeptService;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -63,6 +65,8 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
 
     @Autowired
     private CorporationService corporationService;
+    @Autowired
+    private ISysDeptService deptService;
 
     /**
      * 分页
@@ -110,6 +114,7 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
             wrapper.eq("t2", SubscribeDetail::getCompanyId, dto.getCompanyId());
         }
 
+
         wrapper.orderByDesc("t2", SubscribeDetail::getCreateTime);
 
         //过滤作废的数据
@@ -122,6 +127,10 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
             return page;
         }
 
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+
         //获取合同物料数量
         List<Long> contractIds = records.stream().
                 filter(item -> Objects.equals(item.getDataType(), 1)).map(SubscribeDetail::getContractId).collect(Collectors.toList());
@@ -178,6 +187,10 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
             }
             BigDecimal count = purchaseDetails.stream().map(PurchaseDetail::getCount).reduce(BigDecimal.ZERO, BigDecimal::add);
             subscribeDetailVo.setPurchaseCount(count);
+
+
+            //赋值归属公司
+            subscribeDetailVo.setCompanyName(companyMap.get(subscribeDetailVo.getCompanyId()));
         }
 
         corporationService.attributeAssign(records, SubscribeDetailVo::getCorporationId, (item, corporation) -> {

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/dto/ExtQuotationSelectDto.java

@@ -27,6 +27,11 @@ public class ExtQuotationSelectDto extends BaseSelectDto {
     private Long companyId;
 
     /**
+     * 归属公司Id
+     */
+    private Long ofCompanyId;
+
+    /**
      * 报价时间
      */
     private Date quotationTimeSta;

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/vo/ExtQuotationVo.java

@@ -29,6 +29,11 @@ public class ExtQuotationVo extends ExtQuotation {
      * 归属公司名称
      */
     private String companyName;
+
+    /**
+     * 归属公司名称
+     */
+    private String ofCompanyName;
     /**
      * 商品列表
      */

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/purchase/vo/PurchaseBackVo.java

@@ -44,4 +44,9 @@ public class PurchaseBackVo extends PurchaseBack {
      */
     private String purchaseCode;
 
+    /**
+     * 归属公司名称
+     */
+    private String companyName;
+
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/sale/dto/SaleQuotationSelectDto.java

@@ -37,6 +37,11 @@ public class SaleQuotationSelectDto extends BaseSelectDto {
     private Long companyId;
 
     /**
+     * 归属公司Id
+     */
+    private Long ofCompanyId;
+
+    /**
      * 报价时间
      */
     private Date quotationTimeSta;

+ 7 - 1
hx-sale/src/main/java/com/fjhx/sale/entity/sale/vo/SaleQuotationVo.java

@@ -110,12 +110,18 @@ public class SaleQuotationVo extends SaleQuotation {
     private String contractTemplateName;
 
     /**
-     * 公司名称
+     * 报价公司名称
      */
     private String companyName;
 
 
     /**
+     * 归属公司名称
+     */
+    private String ofCompanyName;
+
+
+    /**
      * 报价趋势
      */
     private List<SaleQuotation> quotationTrendList;

+ 3 - 1
hx-sale/src/main/java/com/fjhx/sale/flow/ContractFlow.java

@@ -122,7 +122,9 @@ public class ContractFlow extends FlowDelegate {
         contract.setDeptId(SecurityUtils.getDeptId());
 
         //赋值归属公司
-        contract.setOfCompanyId(SecurityUtils.getCompanyId());
+        if (ObjectUtil.isEmpty(contract.getOfCompanyId())) {
+            contract.setOfCompanyId(SecurityUtils.getCompanyId());
+        }
 
         // 赋值城市省份信息
         CustomizeAreaUtil.setAreaId(contract);

+ 3 - 1
hx-sale/src/main/java/com/fjhx/sale/flow/PayFlow.java

@@ -77,7 +77,9 @@ public class PayFlow extends FlowDelegate {
 
         Long companyId = SecurityUtils.getCompanyId();
 
-        pay.setCompanyId(companyId);
+        if (ObjectUtils.isEmpty(pay.getCompanyId())) {
+            pay.setCompanyId(companyId);
+        }
 
         pay.setCurrency("CNY");
         pay.setStatus(PayStatusEnum1.UNDER_REVIEW.getKey());

+ 3 - 1
hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseBackFlow.java

@@ -56,7 +56,9 @@ public class PurchaseBackFlow extends FlowDelegate {
     public Long start(Long flowId, JSONObject submitData) {
         PurchaseBackDto purchaseBackDto = submitData.toJavaObject(PurchaseBackDto.class);
 
-        purchaseBackDto.setCompanyId(SecurityUtils.getCompanyId());
+        if (ObjectUtil.isEmpty(purchaseBackDto.getCompanyId())) {
+            purchaseBackDto.setCompanyId(SecurityUtils.getCompanyId());
+        }
 
         //赋值编号
         if (ObjectUtil.isEmpty(purchaseBackDto.getId())) {

+ 1 - 0
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -334,6 +334,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
 
         //生产公司过滤
         wrapper.eq("t1", Contract::getCompanyId, dto.getCompanyId());
+        wrapper.eq("t1", Contract::getOfCompanyId, dto.getOfCompanyId());
 
         wrapper.orderByDesc("t1", Contract::getCreateTime);
         if (StringUtils.isNotEmpty(dto.getStatus())) {

+ 11 - 3
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java

@@ -83,10 +83,14 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
     public Page<ExtQuotationVo> getPage(ExtQuotationSelectDto dto) {
         IWrapper<ExtQuotation> wrapper = getWrapper();
 
+        //权限过滤:
+
         //报价状态
         wrapper.eq(SaleQuotation::getQuotationStatus, dto.getQuotationStatus());
         //报价公司
         wrapper.eq(SaleQuotation::getCompanyId, dto.getCompanyId());
+        wrapper.eq(SaleQuotation::getOfCompanyId, dto.getOfCompanyId());
+
         //报价单类型
         wrapper.eq(SaleQuotation::getType, dto.getType());
 
@@ -137,8 +141,7 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
             item.setBuyCorporationName(customer.getName());
         });
 
-        List<Long> companyIds = records.stream().map(ExtQuotation::getCompanyId).collect(Collectors.toList());
-        List<SysDept> companyList = sysDeptService.list(Wrappers.<SysDept>query().in("dept_id", companyIds));
+        List<SysDept> companyList = sysDeptService.list();
         Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
 
         List<Long> ids = records.stream().map(ExtQuotationVo::getId).collect(Collectors.toList());
@@ -166,6 +169,9 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
             //赋值报价公司名称
             esq.setCompanyName(companyMap.get(esq.getCompanyId()));
 
+            //赋值报价公司名称
+            esq.setOfCompanyName(companyMap.get(esq.getOfCompanyId()));
+
             //赋值产品列表
             esq.setQuotationProductList(pMap.get(esq.getId()));
 
@@ -308,7 +314,9 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
      * 添加修改公共方法
      */
     private void saveOrEdit(ExtQuotationDto saleQuotationDto) {
-        saleQuotationDto.setOfCompanyId(SecurityUtils.getCompanyId());
+        if (ObjectUtil.isEmpty(saleQuotationDto.getOfCompanyId())) {
+            saleQuotationDto.setOfCompanyId(SecurityUtils.getCompanyId());
+        }
         this.saveOrUpdate(saleQuotationDto);
 
         List<ExtQuotationProductDto> quotationProductList = saleQuotationDto.getQuotationProductList();

+ 21 - 2
hx-sale/src/main/java/com/fjhx/sale/service/purchase/impl/PurchaseBackServiceImpl.java

@@ -21,9 +21,11 @@ import com.fjhx.sale.service.purchase.PurchaseBackDetailsService;
 import com.fjhx.sale.service.purchase.PurchaseBackService;
 import com.fjhx.supply.entity.supplier.po.SupplierInfo;
 import com.fjhx.supply.service.supplier.SupplierInfoService;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.SqlField;
+import com.ruoyi.system.service.ISysDeptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -50,15 +52,17 @@ public class PurchaseBackServiceImpl extends ServiceImpl<PurchaseBackMapper, Pur
     private final EhsdPurchaseService ehsdPurchaseService;
     private final PayDetailService payDetailService;
     private final SupplierInfoService supplierInfoService;
+    private final ISysDeptService deptService;
 
     @Autowired
-    public PurchaseBackServiceImpl(PurchaseBackDetailsService purchaseBackDetailsService, ProductInfoService productInfoService, EhsdPurchaseProductService purchaseProductService, EhsdPurchaseService ehsdPurchaseService, PayDetailService payDetailService, SupplierInfoService supplierInfoService) {
+    public PurchaseBackServiceImpl(PurchaseBackDetailsService purchaseBackDetailsService, ProductInfoService productInfoService, EhsdPurchaseProductService purchaseProductService, EhsdPurchaseService ehsdPurchaseService, PayDetailService payDetailService, SupplierInfoService supplierInfoService, ISysDeptService deptService) {
         this.purchaseBackDetailsService = purchaseBackDetailsService;
         this.productInfoService = productInfoService;
         this.purchaseProductService = purchaseProductService;
         this.ehsdPurchaseService = ehsdPurchaseService;
         this.payDetailService = payDetailService;
         this.supplierInfoService = supplierInfoService;
+        this.deptService = deptService;
     }
 
     @Override
@@ -76,7 +80,22 @@ public class PurchaseBackServiceImpl extends ServiceImpl<PurchaseBackMapper, Pur
         wrapper.keyword(dto.getKeyword(), new SqlField("pb.code"), new SqlField("p.code"));
 
         wrapper.orderByDesc("pb", PurchaseBack::getId);
-        return this.baseMapper.getPage(dto.getPage(), wrapper);
+        Page<PurchaseBackVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        List<PurchaseBackVo> records = page.getRecords();
+        if (ObjectUtil.isEmpty(records)) {
+            return page;
+        }
+
+
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+
+        for (PurchaseBackVo record : records) {
+            //赋值归属公司
+            record.setCompanyName(companyMap.get(record.getCompanyId()));
+        }
+        return page;
     }
 
     @Override

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

@@ -126,6 +126,11 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
             wrapper.eq(SaleQuotation::getOfCompanyId, companyId);
         }
 
+        //归属公司 报价公司过滤
+        wrapper.eq(SaleQuotation::getCompanyId, dto.getCompanyId());
+        wrapper.eq(SaleQuotation::getOfCompanyId, dto.getOfCompanyId());
+
+
         //报价状态
         wrapper.eq(SaleQuotation::getQuotationStatus, dto.getQuotationStatus());
 
@@ -173,8 +178,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         });
 
 
-        List<Long> companyIds = records.stream().map(SaleQuotation::getCompanyId).collect(Collectors.toList());
-        List<SysDept> companyList = sysDeptService.list(Wrappers.<SysDept>query().in("dept_id", companyIds));
+        List<SysDept> companyList = sysDeptService.list();
         Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
 
         List<Long> ids = records.stream().map(SaleQuotationVo::getId).collect(Collectors.toList());
@@ -197,6 +201,9 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
             //赋值报价公司名称
             saleQuotationVo.setCompanyName(companyMap.get(saleQuotationVo.getCompanyId()));
 
+            //赋值归属公司名称
+            saleQuotationVo.setOfCompanyName(companyMap.get(saleQuotationVo.getOfCompanyId()));
+
             //赋值产品列表
             saleQuotationVo.setQuotationProductList(pMap.get(saleQuotationVo.getId()));
         }
@@ -297,7 +304,9 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
      * 添加修改公共方法
      */
     private void saveOrEdit(SaleQuotationDto saleQuotationDto) {
-        saleQuotationDto.setOfCompanyId(SecurityUtils.getCompanyId());
+        if (ObjectUtil.isEmpty(saleQuotationDto.getOfCompanyId())) {
+            saleQuotationDto.setOfCompanyId(SecurityUtils.getCompanyId());
+        }
         this.saveOrUpdate(saleQuotationDto);
 
         List<QuotationProductDto> quotationProductList = saleQuotationDto.getQuotationProductList();

+ 2 - 0
hx-wms/src/main/java/com/fjhx/wms/entity/stock/vo/StockJournalDetailsVo.java

@@ -138,5 +138,7 @@ public class StockJournalDetailsVo extends StockJournalDetails {
 
     private String productColor;
 
+    private String companyName;
+
 
 }

+ 2 - 0
hx-wms/src/main/java/com/fjhx/wms/entity/stock/vo/StockWaitVo.java

@@ -20,4 +20,6 @@ public class StockWaitVo extends StockWait {
      */
     private List<StockWaitDetailsVo> stockWaitDetailsList;
 
+    private String companyName;
+
 }

+ 15 - 0
hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockJournalDetailsServiceImpl.java

@@ -14,14 +14,18 @@ import com.fjhx.wms.entity.stock.vo.StockJournalDetailsVo;
 import com.fjhx.wms.mapper.stock.StockJournalDetailsMapper;
 import com.fjhx.wms.service.stock.StockJournalDetailsService;
 import com.fjhx.wms.service.warehouse.WarehouseService;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.utils.UserUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 
 /**
@@ -38,6 +42,8 @@ public class StockJournalDetailsServiceImpl extends ServiceImpl<StockJournalDeta
     private ProductInfoService productInfoService;
     @Autowired
     private WarehouseService warehouseService;
+    @Autowired
+    private ISysDeptService deptService;
 
     @Override
     public Page<StockJournalDetailsVo> getPage(StockJournalSelectDto dto) {
@@ -111,6 +117,15 @@ public class StockJournalDetailsServiceImpl extends ServiceImpl<StockJournalDeta
         warehouseService.attributeAssign(records, StockJournalDetailsVo::getToWarehouseId, (item, warehouse) -> {
             item.setToWarehouseName(warehouse.getName());
         });
+
+
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+        for (StockJournalDetailsVo record : records) {
+            record.setCompanyName(companyMap.get(record.getCompanyId()));
+        }
+
         return page;
     }
 

+ 12 - 0
hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockWaitServiceImpl.java

@@ -21,9 +21,11 @@ import com.fjhx.wms.mapper.stock.StockWaitMapper;
 import com.fjhx.wms.service.stock.*;
 import com.fjhx.wms.service.warehouse.WarehouseService;
 import com.fjhx.wms.utils.CodeEnum;
+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.wrapper.IWrapper;
+import com.ruoyi.system.service.ISysDeptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -54,6 +56,9 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
     @Autowired
     private WarehouseService warehouseService;
 
+    @Autowired
+    private ISysDeptService deptService;
+
     @Override
     public Page<StockWaitVo> getPage(StockWaitSelectDto dto) {
         IWrapper<StockWait> wrapper = getWrapper();
@@ -120,6 +125,13 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
 
         //赋值明细列表
         records.forEach(item -> item.setStockWaitDetailsList(voMap.get(item.getId())));
+
+        //获取部门列表
+        List<SysDept> companyList = deptService.list();
+        Map<Long, String> companyMap = companyList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
+        for (StockWaitVo record : records) {
+            record.setCompanyName(companyMap.get(record.getCompanyId()));
+        }
     }
 
     @Override