Pārlūkot izejas kodu

添加了报价单的数据

wxf 2 gadi atpakaļ
vecāks
revīzija
2263b83739

+ 2 - 2
hx-sale/src/main/java/com/fjhx/sale/entity/documents/vo/DocumentsVo.java

@@ -17,13 +17,13 @@ public class DocumentsVo extends Documents {
     /**
      * 归属公司ID(卖方公司ID)
      */
-    private String sellCorporationId;
+    private Long sellCorporationId;
 
 
     /**
      * 客户ID(买方公司ID)
      */
-    private String buyCorporationId;
+    private Long buyCorporationId;
 
     /**
      * 归属公司名称(卖方公司名称)

+ 29 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/sale/vo/SaleQuotationVo.java

@@ -48,4 +48,33 @@ public class SaleQuotationVo extends SaleQuotation {
      * 类型 10 为报价单  20 合同
      */
     private Integer type;
+
+    /**
+     * 买方公司名称
+     */
+    private String buyCorporationName;
+
+
+    /**
+     * 买方公司国家
+     */
+    private String buyCountryName;
+
+    /**
+     * 买方公司省
+     */
+    private String buyProvinceName;
+
+    /**
+     * 买方公司市
+     */
+    private String buyCityName;
+
+    /**
+     * 卖方公司详细地址
+     */
+    private String buyDetailedAddress;
+
+
+
 }

+ 9 - 6
hx-sale/src/main/java/com/fjhx/sale/service/documents/impl/DocumentsServiceImpl.java

@@ -93,18 +93,21 @@ public class DocumentsServiceImpl extends ServiceImpl<DocumentsMapper, Documents
         DynamicDataSourceContextHolder.poll();
 
         List<DocumentsVo> records = page.getRecords();
-        if (ObjectUtil.isNotEmpty(records)){
+        if (ObjectUtil.isEmpty(records)){
             return page;
         }
         for (DocumentsVo record : records) {
             //赋值归属公司名称
-            List<Corporation> corporationList1 = corporationMap.get(record.getBuyCorporationId());
-            record.setBuyCorporationName(corporationList1.get(0).getName());
-
-            //赋值客户名称
             List<Corporation> corporationList2 = corporationMap.get(record.getSellCorporationId());
-            record.setSellCorporationId(corporationList2.get(0).getName());
+            if (ObjectUtil.isNotEmpty(corporationList2)){
+                record.setSellCorporationName(corporationList2.get(0).getName());
+            }
+
         }
+        //赋值客户名称
+        customerService.attributeAssign(records, DocumentsVo::getBuyCorporationId, (item, customer) -> {
+            item.setBuyCorporationName(customer.getName());
+        });
         return page;
     }
 

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

@@ -7,9 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fjhx.account.controller.utils.DateUtils;
 import com.fjhx.account.entity.account.vo.AccountPaymentVo;
+import com.fjhx.area.utils.AreaUtil;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.customer.entity.customer.dto.CustomerDto;
 import com.fjhx.customer.entity.customer.dto.CustomerSelectDto;
+import com.fjhx.sale.entity.contract.po.Contract;
+import com.fjhx.sale.entity.contract.vo.ContractPdfInfoVo;
 import com.fjhx.sale.entity.contract.vo.ContractVo;
 import com.fjhx.sale.entity.quotation.po.QuotationPay;
 import com.fjhx.sale.entity.quotation.po.QuotationProduct;
@@ -85,6 +88,8 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         SaleQuotation SaleQuotation = this.getById(id);
         SaleQuotationVo result = BeanUtil.toBean(SaleQuotation, SaleQuotationVo.class);
         if (ObjectUtil.isNotEmpty(result)) {
+            //赋值买方公司地址
+            setArea(result);
             //查询报价-商品表的详情
             List<QuotationProduct> quotationProductList = quotationProductService.list(Wrappers.<QuotationProduct>lambdaQuery()
                     .eq(QuotationProduct::getSaleQuotationId, result.getId()));
@@ -276,5 +281,22 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         return saleQuotationVoPage;
     }
 
+    /**
+     * 赋值买卖公司地址
+     */
+    private void setArea(SaleQuotationVo saleQuotationVo) {
+
+        List<String> areaIdList = Arrays.asList(
+                saleQuotationVo.getBuyCountryId(),
+                saleQuotationVo.getBuyProvinceId(),
+                saleQuotationVo.getBuyCityId()
+        );
+        Map<String, String> areaMap = AreaUtil.getAreaMapByIds(areaIdList);
+        saleQuotationVo.setBuyCountryName(areaMap.get(saleQuotationVo.getBuyCountryId()));
+        saleQuotationVo.setBuyProvinceName(areaMap.get(saleQuotationVo.getBuyProvinceId()));
+        saleQuotationVo.setBuyCityName(areaMap.get(saleQuotationVo.getBuyCityId()));
+        saleQuotationVo.setBuyDetailedAddress(saleQuotationVo.getBuyAddress());
+    }
+
 
 }