Browse Source

完善代码

yuansh 3 tháng trước cách đây
mục cha
commit
9cad987d66
36 tập tin đã thay đổi với 580 bổ sung38 xóa
  1. 1 0
      jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 58 0
      srm-module-code/src/main/java/org/jeecg/modules/baseCode/controller/BaseExchangeRateController.java
  3. 7 7
      srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspCustomerProfile.java
  4. 10 0
      srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspIntermediator.java
  5. 8 8
      srm-module-code/src/main/java/org/jeecg/modules/cuspCode/vo/CuspCustomerProfilePage.java
  6. 103 6
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurInquiryFormController.java
  7. 138 4
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurPurchaseQuotationController.java
  8. 10 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryFormProduct.java
  9. 7 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurQuotationSelectionProduct.java
  10. 3 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurPurchaseQuotationProductMapper.xml
  11. 3 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurQuotationSelectionProductMapper.xml
  12. 32 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurShippingFeeServiceImpl.java
  13. 7 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionAlert.java
  14. 10 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/SupplierQuotationDetails.java
  15. 16 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleDeliveryController.java
  16. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProduct.java
  17. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProductHis.java
  18. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDelivery.java
  19. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProduct.java
  20. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProductHis.java
  21. 3 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java
  22. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationHis.java
  23. 8 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProduct.java
  24. 8 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProductHis.java
  25. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleContractProductMapper.xml
  26. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleOrderProductMapper.xml
  27. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductMapper.xml
  28. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java
  29. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleContractAlert.java
  30. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryAlert.java
  31. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryPage.java
  32. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderAlert.java
  33. 8 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationAlert.java
  34. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationHisPage.java
  35. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java
  36. 74 8
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreSaleOutServiceImpl.java

+ 1 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -832,5 +832,6 @@ public class DateUtils extends PropertyEditorSupport {
 
     public static void main(String[] args) {
         System.out.println(nowYear());
+        System.out.println(getYear());
     }
 }

+ 58 - 0
srm-module-code/src/main/java/org/jeecg/modules/baseCode/controller/BaseExchangeRateController.java

@@ -1,10 +1,15 @@
 package org.jeecg.modules.baseCode.controller;
 
+import java.math.BigDecimal;
 import java.util.Arrays;
+import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.baseCode.entity.BaseExchangeRate;
 import org.jeecg.modules.baseCode.service.IBaseExchangeRateService;
 
@@ -102,6 +107,59 @@ public class BaseExchangeRateController extends JeecgController<BaseExchangeRate
 		baseExchangeRateService.removeById(id);
 		return Result.OK("删除成功!");
 	}
+
+	 /**
+	  * 获取对美元汇率
+	  * @param year
+	  * @param month
+	  * @param currency
+	  * @return
+	  */
+	@GetMapping(value =  "/getRateByUsd")
+	public Result<Double> getRateByUsd(
+			String year
+			,String month
+			,String currency) {
+
+		if(StringUtils.isBlank(currency)){
+			return Result.error("请填写币种");
+		}
+		if(StringUtils.isBlank(year)){
+			year = DateUtils.nowYear();
+		}
+		QueryWrapper<BaseExchangeRate> exchangeRateQuery =new QueryWrapper<BaseExchangeRate>();
+		exchangeRateQuery.eq("del_flag", 0);
+		exchangeRateQuery.eq("year", year);
+		if(StringUtils.isNotBlank(month)){
+			exchangeRateQuery.eq("month", month);
+		}
+		exchangeRateQuery.eq("currency", currency);
+		exchangeRateQuery.orderByDesc("month");
+
+		Double exchangeRate = 1.0;
+
+		List<BaseExchangeRate> list = baseExchangeRateService.list(exchangeRateQuery);
+		if(list.size() > 0){
+			exchangeRate = list.get(0).getExchangeRate();
+		}else{
+
+			QueryWrapper<BaseExchangeRate> exchangeRateQuery2 = new QueryWrapper<BaseExchangeRate>();
+			exchangeRateQuery2.eq("del_flag", "0");
+			exchangeRateQuery2.eq("year", year);
+			exchangeRateQuery2.eq("month", "");
+			exchangeRateQuery2.eq("currency", currency);
+			exchangeRateQuery2.orderByDesc("month");
+			List<BaseExchangeRate> list2 = baseExchangeRateService.list(exchangeRateQuery2);
+
+			if (list2.size() > 0) {
+				exchangeRate = list2.get(0).getExchangeRate();
+			} else {
+
+				return Result.error("请维护本年度当前币种对美元汇率");
+			}
+		}
+		return Result.OK(exchangeRate);
+	}
 	
 	/**
 	 *  批量删除

+ 7 - 7
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspCustomerProfile.java

@@ -71,7 +71,7 @@ public class CuspCustomerProfile implements Serializable {
     @ApiModelProperty(value = "简称")
     private String abbreviation;
 	/**曾用名*/
-//	@Excel(name = "曾用名", width = 15)
+	@Excel(name = "曾用名(nameUsedBefore)", width = 15)
     @ApiModelProperty(value = "曾用名")
     private String nameUsedBefore;
 	/**税号*/
@@ -91,23 +91,23 @@ public class CuspCustomerProfile implements Serializable {
     @ApiModelProperty(value = "联系电话")
     private String phone;
 	/**邮箱*/
-//	@Excel(name = "邮箱", width = 15)
+	@Excel(name = "邮箱", width = 15)
     @ApiModelProperty(value = "邮箱")
     private String email;
 	/**注册地址*/
-//	@Excel(name = "注册地址", width = 15)
+	@Excel(name = "注册地址", width = 15)
     @ApiModelProperty(value = "注册地址")
     private String registerAddress;
 	/**办公地址*/
-//	@Excel(name = "办公地址", width = 15)
+	@Excel(name = "办公地址", width = 15)
     @ApiModelProperty(value = "办公地址")
     private String officeAddress;
 	/**发票地址*/
-//	@Excel(name = "发票地址", width = 15)
+	@Excel(name = "发票地址", width = 15)
     @ApiModelProperty(value = "发票地址")
     private String invoiceAddress;
 	/**币种*/
-//	@Excel(name = "币种", width = 15)
+	@Excel(name = "币种", width = 15)
     @ApiModelProperty(value = "币种")
     private String currency;
 	/**国家*/
@@ -144,7 +144,7 @@ public class CuspCustomerProfile implements Serializable {
     @ApiModelProperty(value = "优先级")
     private String priority;
 	/**备注*/
-//	@Excel(name = "备注", width = 15)
+	@Excel(name = "备注(notes)", width = 15)
     @ApiModelProperty(value = "备注")
     private String notes;
 	/**文件*/

+ 10 - 0
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspIntermediator.java

@@ -108,4 +108,14 @@ public class CuspIntermediator implements Serializable {
 //	@Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private String notes;
+
+
+    @ApiModelProperty(value = "收款人")
+    private String recipient;
+    @ApiModelProperty(value = "开户行")
+    private String openingBank;
+    @ApiModelProperty(value = "银行代码")
+    private String bankCode;
+    @ApiModelProperty(value = "银行账号")
+    private String bankAccount;
 }

+ 8 - 8
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/vo/CuspCustomerProfilePage.java

@@ -42,7 +42,7 @@ public class CuspCustomerProfilePage {
 	@ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(status)", width = 15)
+//	@Excel(name = "状态(status)", width = 15)
 	@ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
@@ -62,7 +62,7 @@ public class CuspCustomerProfilePage {
 	@ApiModelProperty(value = "简称")
     private String abbreviation;
 	/**曾用名*/
-//	@Excel(name = "曾用名", width = 15)
+	@Excel(name = "曾用名(nameUsedBefore)", width = 15)
 	@ApiModelProperty(value = "曾用名")
     private String nameUsedBefore;
 	/**税号*/
@@ -82,23 +82,23 @@ public class CuspCustomerProfilePage {
 	@ApiModelProperty(value = "联系电话")
     private String phone;
 	/**邮箱*/
-//	@Excel(name = "邮箱", width = 15)
+	@Excel(name = "邮箱(email)", width = 15)
 	@ApiModelProperty(value = "邮箱")
     private String email;
 	/**注册地址*/
-//	@Excel(name = "注册地址", width = 15)
+	@Excel(name = "注册地址(registerAddress)", width = 15)
 	@ApiModelProperty(value = "注册地址")
     private String registerAddress;
 	/**办公地址*/
-//	@Excel(name = "办公地址", width = 15)
+	@Excel(name = "办公地址(officeAddress)", width = 15)
 	@ApiModelProperty(value = "办公地址")
     private String officeAddress;
 	/**发票地址*/
-//	@Excel(name = "发票地址", width = 15)
+	@Excel(name = "发票地址(invoiceAddress)", width = 15)
 	@ApiModelProperty(value = "发票地址")
     private String invoiceAddress;
 	/**币种*/
-//	@Excel(name = "币种", width = 15)
+	@Excel(name = "币种(currency)", width = 15)
 	@ApiModelProperty(value = "币种")
     private String currency;
 	/**国家*/
@@ -134,7 +134,7 @@ public class CuspCustomerProfilePage {
 	@ApiModelProperty(value = "优先级")
     private String priority;
 	/**备注*/
-//	@Excel(name = "备注", width = 15)
+	@Excel(name = "备注(notes)", width = 15)
 	@ApiModelProperty(value = "备注")
     private String notes;
 	/**文件*/

+ 103 - 6
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurInquiryFormController.java

@@ -4,17 +4,15 @@ import java.io.UnsupportedEncodingException;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.modules.baseCode.entity.BaseExchangeRate;
+import org.jeecg.modules.baseCode.service.IBaseExchangeRateService;
 import org.jeecg.modules.baseCode.service.ISerialPatternService;
 import org.jeecg.modules.purCode.service.IPurPurchaseQuotationProductService;
 import org.jeecg.modules.purCode.vo.SupplierQuotationDetails;
@@ -75,6 +73,8 @@ public class PurInquiryFormController {
     private ISerialPatternService serialPatternService;
     @Autowired
     private IPurPurchaseQuotationProductService purPurchaseInquiryProductService;
+    @Autowired
+    private IBaseExchangeRateService baseExchangeRateService;
 
     /**
      * 分页列表查询
@@ -263,15 +263,55 @@ public class PurInquiryFormController {
 
 			IPage<SupplierQuotationDetails> pageList = purPurchaseInquiryProductService.supplierQuotationDetails(page2, querySupplierQuotationDetails);
 
-			for(PurInquiryFormProduct a:purInquiryFormProductList){
+
+            Map<String,BigDecimal> mapRate = new HashMap<>();
+
+            for (SupplierQuotationDetails o : pageList.getRecords()) {
+
+                String currency = o.getCurrency();//币种
+                Date billDate = o.getBillDate();//单据日期
+
+                BigDecimal taxPrice = o.getTaxPrice();
+                BigDecimal taxAmount = o.getTaxAmount();
+                BigDecimal rate = BigDecimal.ONE;
+
+                if (StringUtils.isNotBlank(currency)) {
+
+                    if(mapRate.containsKey(currency)){
+                        rate = mapRate.get(currency);
+                    }else{
+                        rate = this.getRateByUsd(billDate, currency);
+                        mapRate.put(currency, rate);
+                    }
+
+                    o.setTaxPriceUsd(taxPrice.multiply(rate));
+                    o.setTaxAmountUsd(taxAmount.multiply(rate));
+                    o.setExchangeRateUsd(rate);
+
+                } else {
+                    //如果币种为空 这默认币种为美元
+                    o.setTaxPriceUsd(taxPrice.multiply(rate));
+                    o.setTaxAmountUsd(taxAmount.multiply(rate));
+                    o.setExchangeRateUsd(BigDecimal.ONE);
+                }
+
+            }
+
+            for(PurInquiryFormProduct a:purInquiryFormProductList){
 
 				String productId = a.getProductId();
+                BigDecimal taxPriceUsd = a.getTaxPriceUsd();
 
 				for(SupplierQuotationDetails o:pageList.getRecords()){
 
 					String productIdo = o.getProductId();
 					if(productId.equals(productIdo)){
 
+					    BigDecimal getTaxPriceUsd = o.getTaxPriceUsd();
+					    if(taxPriceUsd !=null && taxPriceUsd.compareTo(getTaxPriceUsd) < 0){
+					        continue;
+                        }
+
 						a.setSelectionSupplier(o.getQuotationSuppiler());
 						if(StringUtils.isNotBlank(o.getPaymentTerms())){
 
@@ -291,6 +331,10 @@ public class PurInquiryFormController {
 						a.setSourceId2(o.getId());
 						a.setCurrency(o.getCurrency());
 						a.setDeliveryDayChild(o.getDeliveryDayChild());
+
+						a.setTaxPriceUsd(o.getTaxPriceUsd());
+						a.setTaxAmountUsd(o.getTaxAmountUsd());
+						a.setExchangeRateUsd(o.getExchangeRateUsd());
 					}
 
 				}
@@ -307,6 +351,59 @@ public class PurInquiryFormController {
         }
     }
 
+
+    /**
+     * 获取币种
+     *
+     * @param currency
+     * @return
+     */
+    public BigDecimal getRateByUsd(Date yearMonth, String currency) {
+
+        String year = String.valueOf(yearMonth.getYear() + 1900);
+        String month = String.valueOf(yearMonth.getMonth() + 1);
+
+        QueryWrapper<BaseExchangeRate> exchangeRateQuery = new QueryWrapper<BaseExchangeRate>();
+        exchangeRateQuery.eq("del_flag", 0);
+        exchangeRateQuery.eq("year", year);
+        if (StringUtils.isNotBlank(month)) {
+            exchangeRateQuery.eq("month", month);
+        }
+        exchangeRateQuery.eq("currency", currency);
+        exchangeRateQuery.orderByDesc("month");
+
+        Double exchangeRate = 1.0;
+
+        List<BaseExchangeRate> list = baseExchangeRateService.list(exchangeRateQuery);
+        if (list.size() > 0) {
+
+            exchangeRate = list.get(0).getExchangeRate();
+        } else {
+
+            QueryWrapper<BaseExchangeRate> exchangeRateQuery2 = new QueryWrapper<BaseExchangeRate>();
+            exchangeRateQuery2.eq("del_flag", "0");
+            exchangeRateQuery2.eq("year", year);
+            exchangeRateQuery2.eq("month", "");
+            exchangeRateQuery2.eq("currency", currency);
+            exchangeRateQuery2.orderByDesc("month");
+            List<BaseExchangeRate> list2 = baseExchangeRateService.list(exchangeRateQuery2);
+
+            if (list2.size() > 0) {
+                exchangeRate = list2.get(0).getExchangeRate();
+            } else {
+
+                return BigDecimal.ONE;
+            }
+
+        }
+
+        BigDecimal bd = BigDecimal.valueOf(exchangeRate);
+
+        return bd;
+
+    }
+
+
     /**
      * 批量删除
      *

+ 138 - 4
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurPurchaseQuotationController.java

@@ -1,16 +1,17 @@
 package org.jeecg.modules.purCode.controller;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.baseCode.entity.BaseExchangeRate;
+import org.jeecg.modules.baseCode.service.IBaseExchangeRateService;
 import org.jeecg.modules.baseCode.service.ISerialPatternService;
 import org.jeecg.modules.purCode.entity.*;
 import org.jeecg.modules.purCode.service.*;
@@ -71,6 +72,9 @@ public class PurPurchaseQuotationController {
     private IPurQuotationSelectionService purQuotationSelectionService;
     @Autowired
     private IPurOrderService purOrderService;
+    @Autowired
+    private IBaseExchangeRateService baseExchangeRateService;
+
 
     /**
      * 分页列表查询
@@ -128,9 +132,108 @@ public class PurPurchaseQuotationController {
 
         queryWrapper.orderByDesc("product_code");
         IPage<SupplierQuotationDetails> pageList = purPurchaseInquiryProductService.supplierQuotationDetails(page, queryWrapper);
+
+        Map<String,BigDecimal> map = new HashMap<>();
+
+        for (SupplierQuotationDetails o : pageList.getRecords()) {
+
+            String currency = o.getCurrency();//币种
+            Date billDate = o.getBillDate();//单据日期
+
+            BigDecimal taxPrice = o.getTaxPrice();
+            BigDecimal taxAmount = o.getTaxAmount();
+            BigDecimal rate = BigDecimal.ONE;
+
+            if (StringUtils.isNotBlank(currency)) {
+
+                if(map.containsKey(currency)){
+                    rate = map.get(currency);
+                }else{
+                    rate = this.getRateByUsd(billDate, currency);
+                    map.put(currency, rate);
+                }
+
+                o.setTaxPriceUsd(taxPrice.multiply(rate));
+                o.setTaxAmountUsd(taxAmount.multiply(rate));
+                o.setExchangeRateUsd(rate);
+
+            } else {
+                //如果币种为空 这默认币种为美元
+                o.setTaxPriceUsd(taxPrice.multiply(rate));
+                o.setTaxAmountUsd(taxAmount.multiply(rate));
+                o.setExchangeRateUsd(BigDecimal.ONE);
+            }
+
+        }
+
         return Result.OK(pageList);
     }
 
+    public static void main(String[] args) {
+        // 获取当前日期
+        Date date = new Date();
+        int year = date.getYear() + 1900;
+        int month = date.getMonth() + 1;  // 注意:Date 中的月份是从 0 开始计数的,需要加1
+        int day = date.getDate();
+
+        System.out.println("年:" + year);
+        System.out.println("月:" + month);
+        System.out.println("日:" + day);
+    }
+
+
+    /**
+     * 获取币种
+     *
+     * @param currency
+     * @return
+     */
+    public BigDecimal getRateByUsd(Date yearMonth, String currency) {
+
+        String year = String.valueOf(yearMonth.getYear() + 1900);
+        String month = String.valueOf(yearMonth.getMonth() + 1);
+
+        QueryWrapper<BaseExchangeRate> exchangeRateQuery = new QueryWrapper<BaseExchangeRate>();
+        exchangeRateQuery.eq("del_flag", 0);
+        exchangeRateQuery.eq("year", year);
+        if (StringUtils.isNotBlank(month)) {
+            exchangeRateQuery.eq("month", month);
+        }
+        exchangeRateQuery.eq("currency", currency);
+        exchangeRateQuery.orderByDesc("month");
+
+        Double exchangeRate = 1.0;
+
+        List<BaseExchangeRate> list = baseExchangeRateService.list(exchangeRateQuery);
+        if (list.size() > 0) {
+
+            exchangeRate = list.get(0).getExchangeRate();
+        } else {
+
+            QueryWrapper<BaseExchangeRate> exchangeRateQuery2 = new QueryWrapper<BaseExchangeRate>();
+            exchangeRateQuery2.eq("del_flag", "0");
+            exchangeRateQuery2.eq("year", year);
+            exchangeRateQuery2.eq("month", "");
+            exchangeRateQuery2.eq("currency", currency);
+            exchangeRateQuery2.orderByDesc("month");
+            List<BaseExchangeRate> list2 = baseExchangeRateService.list(exchangeRateQuery2);
+
+            if (list2.size() > 0) {
+                exchangeRate = list2.get(0).getExchangeRate();
+            } else {
+
+                return BigDecimal.ONE;
+            }
+
+        }
+
+        BigDecimal bd = BigDecimal.valueOf(exchangeRate);
+
+        return bd;
+
+    }
+
+
     /**
      * 供应商报价明细弹框
      *
@@ -186,6 +289,37 @@ public class PurPurchaseQuotationController {
         }
 
         IPage<SupplierQuotationDetails> pageList = purPurchaseInquiryProductService.supplierQuotationTotal(page, queryWrapper);
+
+        Map<String,BigDecimal> map = new HashMap<>();
+
+        for (SupplierQuotationDetails o : pageList.getRecords()) {
+
+            String currency = o.getCurrency();//币种
+            Date billDate = o.getBillDate();//单据日期
+
+            BigDecimal taxAmount = o.getTaxAmount();
+            BigDecimal rate = BigDecimal.ONE;
+
+            if (StringUtils.isNotBlank(currency)) {
+
+                if(map.containsKey(currency)){
+                    rate = map.get(currency);
+                }else{
+                    rate = this.getRateByUsd(billDate, currency);
+                    map.put(currency, rate);
+                }
+
+                o.setTaxAmountUsd(taxAmount.multiply(rate));
+                o.setExchangeRateUsd(rate);
+
+            } else {
+                //如果币种为空 这默认币种为美元
+                o.setTaxAmountUsd(taxAmount.multiply(rate));
+                o.setExchangeRateUsd(BigDecimal.ONE);
+            }
+
+        }
+
         return Result.OK(pageList);
     }
 

+ 10 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryFormProduct.java

@@ -162,4 +162,14 @@ public class PurInquiryFormProduct implements Serializable {
     @TableField(exist = false)
     private BigDecimal taxAmount;//金额
 
+    @ApiModelProperty(value = "美元单价")
+    @TableField(exist = false)
+    private java.math.BigDecimal taxPriceUsd;
+    @ApiModelProperty(value = "美元金额")
+    @TableField(exist = false)
+    private java.math.BigDecimal taxAmountUsd;
+    @ApiModelProperty(value = "美元汇率")
+    @TableField(exist = false)
+    private java.math.BigDecimal exchangeRateUsd;
+
 }

+ 7 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurQuotationSelectionProduct.java

@@ -164,4 +164,11 @@ public class PurQuotationSelectionProduct implements Serializable {
 
     @Excel(name = "交期", width = 15)
     private String deliveryDayChild;//交期(天数)
+
+    @ApiModelProperty(value = "美元单价")
+    private java.math.BigDecimal taxPriceUsd;
+    @ApiModelProperty(value = "美元金额")
+    private java.math.BigDecimal taxAmountUsd;
+    @ApiModelProperty(value = "美元汇率")
+    private java.math.BigDecimal exchangeRateUsd;
 }

+ 3 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurPurchaseQuotationProductMapper.xml

@@ -66,6 +66,8 @@
 						a.suppiler_name ,
 						a.quotation_deadline ,
 						a.currency,
+						a.source_code,
+						a.status,
 						sum(b.tax_amount) taxAmount
 				 from pur_purchase_quotation a
 						  left join pur_purchase_quotation_product b on a.id = b.head_id
@@ -78,7 +80,7 @@
 						  a.project_name ,
 						  a.suppiler_name ,
 						  a.quotation_deadline,
-						  a.quotation_project,a.currency
+						  a.quotation_project,a.currency,a.status,a.source_code
 
 			 ) a
 			${ew.customSqlSegment}

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurQuotationSelectionProductMapper.xml

@@ -49,6 +49,9 @@
 					  , b.tax_price
 					  , b.notes childNotes
 					  , b.delivery_day_child
+					  , b.tax_price_usd
+					  , b.tax_amount_usd
+					  , b.exchange_rate_usd
 
 				 from pur_quotation_selection a
 						  left join pur_quotation_selection_product b on a.id = b.head_id

+ 32 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurShippingFeeServiceImpl.java

@@ -7,6 +7,8 @@ import org.jeecg.modules.purCode.mapper.PurShippingFeeNoticeMapper;
 import org.jeecg.modules.purCode.mapper.PurShippingFeeProdeuctMapper;
 import org.jeecg.modules.purCode.mapper.PurShippingFeeMapper;
 import org.jeecg.modules.purCode.service.IPurShippingFeeService;
+import org.jeecg.modules.saleCode.entity.SaleDelivery;
+import org.jeecg.modules.saleCode.service.ISaleDeliveryService;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +32,8 @@ public class PurShippingFeeServiceImpl extends ServiceImpl<PurShippingFeeMapper,
 	private PurShippingFeeNoticeMapper purShippingFeeNoticeMapper;
 	@Autowired
 	private PurShippingFeeProdeuctMapper purShippingFeeProdeuctMapper;
+	@Autowired
+	private ISaleDeliveryService saleDeliveryService;
 	
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -41,6 +45,14 @@ public class PurShippingFeeServiceImpl extends ServiceImpl<PurShippingFeeMapper,
 				entity.setId(null);
 				entity.setHeadId(purShippingFee.getId());
 				purShippingFeeNoticeMapper.insert(entity);
+
+				String sourceId = entity.getSourceId();
+				SaleDelivery saleDelivery = saleDeliveryService.getById(sourceId);
+				if(saleDelivery != null){
+					saleDelivery.setCarriageUsed("是");
+					saleDeliveryService.updateById(saleDelivery);
+				}
+
 			}
 		}
 		if(purShippingFeeProdeuctList!=null && purShippingFeeProdeuctList.size()>0) {
@@ -57,7 +69,19 @@ public class PurShippingFeeServiceImpl extends ServiceImpl<PurShippingFeeMapper,
 	@Transactional(rollbackFor = Exception.class)
 	public void updateMain(PurShippingFee purShippingFee,List<PurShippingFeeNotice> purShippingFeeNoticeList,List<PurShippingFeeProdeuct> purShippingFeeProdeuctList) {
 		purShippingFeeMapper.updateById(purShippingFee);
-		
+
+		List<PurShippingFeeNotice> list = purShippingFeeNoticeMapper.selectByMainId(purShippingFee.getId());
+		if(list.size() > 0){
+			for(PurShippingFeeNotice o:list){
+				String sourceId = o.getSourceId();
+				SaleDelivery saleDelivery = saleDeliveryService.getById(sourceId);
+				if(saleDelivery != null){
+					saleDelivery.setCarriageUsed("否");
+					saleDeliveryService.updateById(saleDelivery);
+				}
+			}
+		}
+
 		//1.先删除子表数据
 		purShippingFeeNoticeMapper.deleteByMainId(purShippingFee.getId());
 		purShippingFeeProdeuctMapper.deleteByMainId(purShippingFee.getId());
@@ -69,6 +93,13 @@ public class PurShippingFeeServiceImpl extends ServiceImpl<PurShippingFeeMapper,
 				entity.setId(null);
 				entity.setHeadId(purShippingFee.getId());
 				purShippingFeeNoticeMapper.insert(entity);
+
+				String sourceId = entity.getSourceId();
+				SaleDelivery saleDelivery = saleDeliveryService.getById(sourceId);
+				if(saleDelivery != null){
+					saleDelivery.setCarriageUsed("是");
+					saleDeliveryService.updateById(saleDelivery);
+				}
 			}
 		}
 		if(purShippingFeeProdeuctList!=null && purShippingFeeProdeuctList.size()>0) {

+ 7 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionAlert.java

@@ -205,4 +205,11 @@ public class PurQuotationSelectionAlert implements Serializable {
     private String currency;
     @Excel(name = "交期", width = 15)
     private String deliveryDayChild;//交期(天数)
+
+    @ApiModelProperty(value = "美元单价")
+    private java.math.BigDecimal taxPriceUsd;
+    @ApiModelProperty(value = "美元金额")
+    private java.math.BigDecimal taxAmountUsd;
+    @ApiModelProperty(value = "美元汇率")
+    private java.math.BigDecimal exchangeRateUsd;
 }

+ 10 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/SupplierQuotationDetails.java

@@ -226,7 +226,7 @@ public class SupplierQuotationDetails {
     /**含税金额*/
     @Excel(name = "含税金额", width = 15)
     @ApiModelProperty(value = "含税金额")
-    private String taxAmount;
+    private java.math.BigDecimal taxAmount;
     /**备注*/
     @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
@@ -246,4 +246,13 @@ public class SupplierQuotationDetails {
     @Excel(name = "交期天数", width = 15)
     @ApiModelProperty(value = "交期天数")
     private String deliveryDayChild;
+
+
+
+    @ApiModelProperty(value = "美元单价")
+    private java.math.BigDecimal taxPriceUsd;
+    @ApiModelProperty(value = "美元金额")
+    private java.math.BigDecimal taxAmountUsd;
+    @ApiModelProperty(value = "美元汇率")
+    private java.math.BigDecimal exchangeRateUsd;
 }

+ 16 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleDeliveryController.java

@@ -111,6 +111,22 @@ public class SaleDeliveryController {
         return Result.OK(pageList);
     }
 
+
+    @ApiOperation(value = "发货通知单弹框明细(运费采购订单)", notes = "发货通知单弹框明细")
+    @GetMapping(value = "/selectSaleDeliveryAlertFee")
+    public Result<IPage<SaleDeliveryAlert>> selectSaleDeliveryAlertFee(SaleDeliveryAlert saleInquiryForm,
+                                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                    HttpServletRequest req) {
+
+        saleInquiryForm.setOtherFee("是");
+        saleInquiryForm.setCarriageUsed("否");
+        QueryWrapper<SaleDeliveryAlert> queryWrapper = QueryGenerator.initQueryWrapper(saleInquiryForm, req.getParameterMap());
+        Page<SaleDeliveryAlert> page = new Page<SaleDeliveryAlert>(pageNo, pageSize);
+        IPage<SaleDeliveryAlert> pageList = saleDeliveryDetailsService.selectSaleDeliveryAlert(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
     /**
      * 添加
      *

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProduct.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -148,4 +150,7 @@ public class SaleContractProduct implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProductHis.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -156,4 +158,7 @@ public class SaleContractProductHis implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDelivery.java

@@ -190,4 +190,8 @@ public class SaleDelivery implements Serializable {
     @Excel(name = "开票地址(Invoice Address)", width = 15)
     @ApiModelProperty(value = "开票地址(Invoice Address)")
     private String invoiceAddress;
+    //是否有第三方运费
+    private String otherFee;
+    //是否已被运费参照
+    private String carriageUsed;
 }

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProduct.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -157,4 +159,7 @@ public class SaleOrderProduct implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProductHis.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -164,4 +166,7 @@ public class SaleOrderProductHis implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 3 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java

@@ -136,7 +136,7 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "贸易方式(delivery terms)")
     private String deliveryTerms;
 	/**交期(delivery time)*/
-	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd")
+//	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "交期(delivery time)")
@@ -192,4 +192,6 @@ public class SaleQuotation implements Serializable {
 
     @Excel(name = "汇率(exchangeRate)", width = 15)
     private BigDecimal exchangeRate;
+    @ApiModelProperty(value = "交期")
+    private String deliveryDayHead;
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationHis.java

@@ -189,4 +189,6 @@ public class SaleQuotationHis implements Serializable {
     private String sourceCode;
     @Excel(name = "汇率(exchangeRate)", width = 15)
     private BigDecimal exchangeRate;
+    @ApiModelProperty(value = "交期")
+    private String deliveryDayHead;
 }

+ 8 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProduct.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -174,4 +176,10 @@ public class SaleQuotationProduct implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    @ApiModelProperty(value = "交期")
+    private String deliveryDayChild;
+
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 8 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProductHis.java

@@ -11,6 +11,8 @@ import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -182,4 +184,10 @@ public class SaleQuotationProductHis implements Serializable {
     //来源单据供应商
     private String supplierId;
     private String supplierName;
+    @ApiModelProperty(value = "交期")
+    private String deliveryDayChild;
+
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleContractProductMapper.xml

@@ -24,6 +24,11 @@
 
                    , b.delivery_time delivery_time
                    , a.*
+
+                   , b.currency_gys
+                   , b.exchange_rate_gys
+                   , b.tax_price_gys
+
                    , b.product_id
                    , b.product_class
                    , b.product_code

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleOrderProductMapper.xml

@@ -22,6 +22,10 @@
 					 , a.model         head_model
 					 , b.model         child_model
 
+					 , b.currency_gys
+					 , b.exchange_rate_gys
+					 , b.tax_price_gys
+
 					 , b.delivery_time child_delivery_time
 					 , a.*
 					 , b.product_id

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductMapper.xml

@@ -24,7 +24,12 @@
 					  , b.model         child_model
 					  , a.delivery_time head_delivery_time
 					  , b.delivery_time child_delivery_time
+					  , b.delivery_day_child
 					  , a.*
+					  , b.currency_gys
+					  , b.exchange_rate_gys
+					  , b.tax_price_gys
+
 					  , b.product_id
 					  , b.product_class
 					  , b.product_code

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java

@@ -37,6 +37,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
 		saleDeliveryMapper.insert(saleDelivery);
 		if(saleDeliveryShipList!=null && saleDeliveryShipList.size()>0) {
 			for(SaleDeliveryShip entity:saleDeliveryShipList) {
+				entity.setId(null);
 				//外键设置
 				entity.setHeadId(saleDelivery.getId());
 				saleDeliveryShipMapper.insert(entity);
@@ -44,6 +45,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
 		}
 		if(saleDeliveryDetailsList!=null && saleDeliveryDetailsList.size()>0) {
 			for(SaleDeliveryDetails entity:saleDeliveryDetailsList) {
+				entity.setId(null);
 				//外键设置
 				entity.setHeadId(saleDelivery.getId());
 				saleDeliveryDetailsMapper.insert(entity);
@@ -63,6 +65,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
 		//2.子表数据重新插入
 		if(saleDeliveryShipList!=null && saleDeliveryShipList.size()>0) {
 			for(SaleDeliveryShip entity:saleDeliveryShipList) {
+				entity.setId(null);
 				//外键设置
 				entity.setHeadId(saleDelivery.getId());
 				saleDeliveryShipMapper.insert(entity);
@@ -70,6 +73,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
 		}
 		if(saleDeliveryDetailsList!=null && saleDeliveryDetailsList.size()>0) {
 			for(SaleDeliveryDetails entity:saleDeliveryDetailsList) {
+				entity.setId(null);
 				//外键设置
 				entity.setHeadId(saleDelivery.getId());
 				saleDeliveryDetailsMapper.insert(entity);

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleContractAlert.java

@@ -12,6 +12,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 import org.jeecgframework.poi.excel.annotation.ExcelCollection;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -26,6 +27,10 @@ import java.util.List;
 public class SaleContractAlert {
 
 
+	private String currencyGys;//供应商币种
+	private BigDecimal exchangeRateGys;//美元汇率
+	private BigDecimal taxPriceGys;//供应商采购单价
+
 	private String headId;
 	private String childId;
 	/**创建人*/

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryAlert.java

@@ -272,4 +272,9 @@ public class SaleDeliveryAlert implements Serializable {
     @Excel(name = "备注(notes)", width = 15)
     @ApiModelProperty(value = "备注(notes)")
     private String childNotes;
+
+    //是否有第三方运费
+    private String otherFee;
+    //是否已被运费参照
+    private String carriageUsed;
 }

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryPage.java

@@ -184,6 +184,10 @@ public class SaleDeliveryPage {
 	@ApiModelProperty(value = "开票地址(Invoice Address)")
 	private String invoiceAddress;
 
+	//是否有第三方运费
+	private String otherFee;
+	//是否已被运费参照
+	private String carriageUsed;
 	@ExcelCollection(name="发货通知单 - 船明细")
 	@ApiModelProperty(value = "发货通知单 - 船明细")
 	private List<SaleDeliveryShip> saleDeliveryShipList;

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderAlert.java

@@ -13,6 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -323,4 +324,7 @@ public class SaleOrderAlert implements Serializable {
     //供应商
     private String supplierId;
     private String supplierName;
+    private String currencyGys;//供应商币种
+    private BigDecimal exchangeRateGys;//美元汇率
+    private BigDecimal taxPriceGys;//供应商采购单价
 }

+ 8 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationAlert.java

@@ -179,9 +179,13 @@ public class SaleQuotationAlert {
 
 	@Excel(name = "汇率(exchangeRate)", width = 15)
 	private BigDecimal exchangeRate;
+	@ApiModelProperty(value = "交期")
+	private String deliveryDayHead;
+	@ApiModelProperty(value = "交期")
+	private String deliveryDayChild;
 
 	/**交期*/
-	@Excel(name = "交期", width = 20, format = "yyyy-MM-dd")
+//	@Excel(name = "交期", width = 20, format = "yyyy-MM-dd")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
 	@DateTimeFormat(pattern="yyyy-MM-dd")
 	@ApiModelProperty(value = "交期")
@@ -295,5 +299,8 @@ public class SaleQuotationAlert {
 	private String supplierId;
 	private String supplierName;
 
+	private String currencyGys;//供应商币种
+	private BigDecimal exchangeRateGys;//美元汇率
+	private BigDecimal taxPriceGys;//供应商采购单价
 
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationHisPage.java

@@ -186,6 +186,8 @@ public class SaleQuotationHisPage {
 	@Excel(name = "邮箱发送", width = 15)
 	@ApiModelProperty(value = "邮箱发送")
     private String send;
+	@ApiModelProperty(value = "交期")
+	private String deliveryDayHead;
 
 	@Excel(name = "汇率(exchangeRate)", width = 15)
 	private BigDecimal exchangeRate;

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java

@@ -183,6 +183,8 @@ public class SaleQuotationPage {
     private String send;
 	@Excel(name = "汇率(exchangeRate)", width = 15)
 	private BigDecimal exchangeRate;
+	@ApiModelProperty(value = "交期")
+	private String deliveryDayHead;
 
 	private String sourceCode;
 	@ExcelCollection(name="销售报价单-船明细")

+ 74 - 8
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreSaleOutServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.modules.storeCode.entity.StoreOnhand;
 import org.jeecg.modules.storeCode.entity.StoreSaleOut;
 import org.jeecg.modules.storeCode.entity.StoreSaleOutShip;
 import org.jeecg.modules.storeCode.entity.StoreSaleOutDetails;
@@ -54,8 +55,40 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
                 storeSaleOutShipMapper.insert(entity);
             }
         }
+
+        String project = storeSaleOut.getProject();
+        String warehouse = storeSaleOut.getWarehouse();
+        String goodsAllocation = storeSaleOut.getGoodsAllocation();
+
         if (storeSaleOutDetailsList != null && storeSaleOutDetailsList.size() > 0) {
             for (StoreSaleOutDetails entity : storeSaleOutDetailsList) {
+
+                BigDecimal stockOutQuantity = entity.getStockOutQuantity();
+
+                if (stockOutQuantity == null) {
+                    continue;
+                }
+                String productId = entity.getProductId();
+                // 项目、仓库、货位、产品编码
+
+                QueryWrapper<StoreOnhand> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("project", project);
+                queryWrapper.eq("warehouse", warehouse);
+                queryWrapper.eq("goods_allocation", goodsAllocation);
+                queryWrapper.eq("product_id", productId);
+                queryWrapper.eq("del_flag", 0);
+
+                List<StoreOnhand> list = storeOnhandService.list(queryWrapper);
+
+                if (list.size() > 0) {
+
+                    BigDecimal quantity = list.get(0).getQuantity();
+                    if (quantity.compareTo(stockOutQuantity) >= 0) {
+                        entity.setInventorySelection(list.get(0).getBatchCode());
+                        entity.setBatchId(list.get(0).getId());
+                    }
+                }
+
                 //外键设置
                 entity.setId(null);
                 entity.setHeadId(storeSaleOut.getId());
@@ -69,6 +102,10 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
     public void updateMain(StoreSaleOut storeSaleOut, List<StoreSaleOutShip> storeSaleOutShipList, List<StoreSaleOutDetails> storeSaleOutDetailsList) {
         storeSaleOutMapper.updateById(storeSaleOut);
 
+        String project = storeSaleOut.getProject();
+        String warehouse = storeSaleOut.getWarehouse();
+        String goodsAllocation = storeSaleOut.getGoodsAllocation();
+
         //1.先删除子表数据
         storeSaleOutShipMapper.deleteByMainId(storeSaleOut.getId());
         storeSaleOutDetailsMapper.deleteByMainId(storeSaleOut.getId());
@@ -84,6 +121,35 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
         }
         if (storeSaleOutDetailsList != null && storeSaleOutDetailsList.size() > 0) {
             for (StoreSaleOutDetails entity : storeSaleOutDetailsList) {
+
+                BigDecimal stockOutQuantity = entity.getStockOutQuantity();
+
+                if (stockOutQuantity == null) {
+                    continue;
+                }
+                String productId = entity.getProductId();
+                // 项目、仓库、货位、产品编码
+
+                QueryWrapper<StoreOnhand> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("project", project);
+                queryWrapper.eq("warehouse", warehouse);
+                queryWrapper.eq("goods_allocation", goodsAllocation);
+                queryWrapper.eq("product_id", productId);
+                queryWrapper.eq("del_flag", 0);
+
+                List<StoreOnhand> list = storeOnhandService.list(queryWrapper);
+
+                if (list.size() > 0) {
+
+                    BigDecimal quantity = list.get(0).getQuantity();
+                    if (quantity.compareTo(stockOutQuantity) >= 0) {
+                        entity.setInventorySelection(list.get(0).getBatchCode());
+                        entity.setBatchId(list.get(0).getId());
+                    }
+                }
+
+
+
                 //外键设置
                 entity.setId(null);
                 entity.setHeadId(storeSaleOut.getId());
@@ -183,7 +249,7 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
                 throw new JeecgBootException(result);
 //                return Result.error(result);
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             throw new JeecgBootException(e.getMessage());
 //            return Result.error(e.getMessage());
         }
@@ -237,7 +303,7 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
                 throw new JeecgBootException(result);
 //                return Result.error(result);
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             throw new JeecgBootException(e.getMessage());
 //            return Result.error(e.getMessage());
         }
@@ -267,11 +333,11 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
                     //出库数量
                     BigDecimal stockOutQuantity = ent.getStockOutQuantity();
 
-                    if(StringUtils.isBlank(sourceId)){
-                        throw new JeecgBootException(code+ "产品:" + productCode + "库存选择为空!");
+                    if (StringUtils.isBlank(sourceId)) {
+                        throw new JeecgBootException(code + "产品:" + productCode + "库存选择为空!");
                     }
-                    if(isNullOrEmpty(stockOutQuantity)){
-                        throw new JeecgBootException(code+ "产品:" + productCode + "出库数量不能为空或为0!");
+                    if (isNullOrEmpty(stockOutQuantity)) {
+                        throw new JeecgBootException(code + "产品:" + productCode + "出库数量不能为空或为0!");
                     }
 
                     if (type) {
@@ -295,9 +361,9 @@ public class StoreSaleOutServiceImpl extends ServiceImpl<StoreSaleOutMapper, Sto
 
 
     public boolean isNullOrEmpty(BigDecimal quantity) {
-        if(quantity == null || quantity.compareTo(BigDecimal.ZERO) == 0){
+        if (quantity == null || quantity.compareTo(BigDecimal.ZERO) == 0) {
             return true;
-        }else{
+        } else {
             return false;
         }
     }