yuansh hace 3 meses
padre
commit
5416449e13
Se han modificado 51 ficheros con 288 adiciones y 102 borrados
  1. 8 1
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderProductB2b.java
  2. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderProductB2b.java
  3. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/baseCode/entity/BaseShipArchiveAccessories.java
  4. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspSupplierProfileCatalog.java
  5. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionContractProduct.java
  6. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionOrderProduct.java
  7. 74 4
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurOrderController.java
  8. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurDeliveryNoteArrival.java
  9. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryFormProduct.java
  10. 6 4
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrderProduct.java
  11. 8 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrderProductHis.java
  12. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPurchaseQuotationProduct.java
  13. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurQuotationSelectionProduct.java
  14. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurQuotationSelectionProductMapper.xml
  15. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurDeliveryNoteAlert.java
  16. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurInquiryFormAlert.java
  17. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurOrderAlert.java
  18. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionAlert.java
  19. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/SupplierQuotationDetails.java
  20. 13 4
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java
  21. 77 11
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java
  22. 6 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProduct.java
  23. 5 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContractProductHis.java
  24. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDeliveryDetails.java
  25. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInquiryFormProduct.java
  26. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInvoice.java
  27. 2 2
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInvoiceProduct.java
  28. 3 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProduct.java
  29. 5 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderProductHis.java
  30. 4 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProduct.java
  31. 5 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProductHis.java
  32. 4 4
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleContractProductHisMapper.xml
  33. 4 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleContractProductMapper.xml
  34. 3 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleOrderProductHisMapper.xml
  35. 4 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleOrderProductMapper.xml
  36. 3 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductHisMapper.xml
  37. 3 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductMapper.xml
  38. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInvoiceServiceImpl.java
  39. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleContractAlert.java
  40. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryAlert.java
  41. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInquiryFormAlert.java
  42. 4 2
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInvoicePage.java
  43. 8 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderAlert.java
  44. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationAlert.java
  45. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreCheckDetails.java
  46. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOnhand.java
  47. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOtherOutDetails.java
  48. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StorePurchaseInDetails.java
  49. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StorePurchaseOtherDetails.java
  50. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreSaleOutDetails.java
  51. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/vo/StorePurchaseInAlert.java

+ 8 - 1
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderProductB2b.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;
@@ -91,7 +93,7 @@ public class PurOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -150,4 +152,9 @@ public class PurOrderProductB2b implements Serializable {
 	@Excel(name = "参照来源", width = 15)
     @ApiModelProperty(value = "参照来源")
     private String sourceType;
+    //采购报价折扣
+    private BigDecimal discount;
+
+    //采购报价单价(原价) 折前单价
+    private BigDecimal taxPriceOriginal;
 }

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderProductB2b.java

@@ -87,7 +87,7 @@ public class SaleOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/baseCode/entity/BaseShipArchiveAccessories.java

@@ -74,7 +74,7 @@ public class BaseShipArchiveAccessories implements Serializable {
     @ApiModelProperty(value = "配件类型")
     private String accessoryType;
 	/**规格*/
-//	@Excel(name = "规格", width = 15)
+//	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/entity/CuspSupplierProfileCatalog.java

@@ -88,7 +88,7 @@ public class CuspSupplierProfileCatalog implements Serializable {
     @ApiModelProperty(value = "英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionContractProduct.java

@@ -80,7 +80,7 @@ public class PlatCommissionContractProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionOrderProduct.java

@@ -80,7 +80,7 @@ public class PlatCommissionOrderProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -761,6 +761,66 @@ public class PurOrderController {
     @GetMapping(value = "/queryPurOrderProductByMainId")
     public Result<List<PurOrderProduct>> queryPurOrderProductListByMainId(@RequestParam(name = "id", required = true) String id) {
         List<PurOrderProduct> purOrderProductList = purOrderProductService.selectByMainId(id);
+
+        //对于历史数据没有折扣和折前单价的数据,执行此方法获取折扣和折前单价
+        if(purOrderProductList.size()>0 && purOrderProductList.get(0).getTaxPriceOriginal()==null
+                && StringUtils.isNotBlank(purOrderProductList.get(0).getSourceId())
+        ){
+            // 获取销售订单行
+            List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
+            if (oConvertUtils.listIsNotEmpty(purOrderProductList)){
+                LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
+                productWrapper.in(SaleOrderProduct::getId, purOrderProductList.stream().map(PurOrderProduct::getSourceId).collect(Collectors.toList()));
+                saleOrderProductList = saleOrderProductService.list(productWrapper);
+            }
+            // 获取报价单行
+            List<SaleQuotationProduct> saleQuotationProductList = new ArrayList<>();
+            if (oConvertUtils.listIsNotEmpty(saleOrderProductList)){
+                LambdaQueryWrapper<SaleQuotationProduct> productWrapper = new LambdaQueryWrapper<>();
+                productWrapper.in(SaleQuotationProduct::getId, saleOrderProductList.stream().map(SaleOrderProduct::getSourceId).collect(Collectors.toList()));
+                saleQuotationProductList = saleQuotationProductService.list(productWrapper);
+            }
+            // 获取报价选定单行
+            List<PurQuotationSelectionProduct> purQuotationSelectionProductList = new ArrayList<>();
+            if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)){
+                LambdaQueryWrapper<PurQuotationSelectionProduct> productWrapper = new LambdaQueryWrapper<>();
+                productWrapper.in(PurQuotationSelectionProduct::getId, saleQuotationProductList.stream().map(SaleQuotationProduct::getSourceId).collect(Collectors.toList()));
+                purQuotationSelectionProductList = purQuotationSelectionProductService.list(productWrapper);
+            }
+
+            for (PurOrderProduct product : purOrderProductList){
+
+                SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e -> e.getId().equals(product.getSourceId())).findFirst().orElse(null);
+                if (saleOrderProduct != null) {
+
+                    SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(saleOrderProduct.getSourceId())).findFirst().orElse(null);
+                    if (saleOrderProduct != null) {
+                        PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
+                        if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
+                            product.setDiscount(quotationSelectionProduct.getDiscount());
+                            product.setTaxPriceOriginal(quotationSelectionProduct.getTaxPrice());
+                        }else{
+
+                            BigDecimal dic = product.getDiscount() == null ? BigDecimal.ZERO : product.getDiscount();
+                            BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+
+                            BigDecimal getSalePrice = product.getTaxPrice() == null ? BigDecimal.ZERO : product.getTaxPrice();
+                            BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);
+
+                            product.setTaxPriceOriginal(setTaxPrice);
+                        }
+
+//
+//                        if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
+//                            product.setTaxPriceOriginal(quotationSelectionProduct.getTaxPriceOriginal());
+//                        }
+                    }
+
+                }
+
+            }
+        }
+
         return Result.OK(purOrderProductList);
     }
 
@@ -934,7 +994,7 @@ public class PurOrderController {
                     productWrapper.in(SaleQuotationProduct::getId, saleOrderProductList.stream().map(SaleOrderProduct::getSourceId).collect(Collectors.toList()));
                     saleQuotationProductList = saleQuotationProductService.list(productWrapper);
                 }
-                // 获取报价单行
+                // 获取报价选定单行
                 List<PurQuotationSelectionProduct> purQuotationSelectionProductList = new ArrayList<>();
                 if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)){
                     LambdaQueryWrapper<PurQuotationSelectionProduct> productWrapper = new LambdaQueryWrapper<>();
@@ -978,9 +1038,19 @@ public class PurOrderController {
                             if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
                                 product.setDiscountText(quotationSelectionProduct.getDiscount().intValue() + "%");
                             }
-                            if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
-                                product.setTaxPrice(quotationSelectionProduct.getTaxPriceOriginal());
-                            }
+
+                            BigDecimal dic = quotationSelectionProduct.getDiscount() ==null?BigDecimal.ZERO:quotationSelectionProduct.getDiscount();
+                            BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+
+                            BigDecimal getSalePrice = product.getTaxPrice() == null ? BigDecimal.ZERO : product.getTaxPrice();
+                            BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);//折前价
+//                            BigDecimal quantity = product.getQuantity() == null ? BigDecimal.ZERO : product.getQuantity();
+
+                            product.setTaxPrice(setTaxPrice);
+
+//                            if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
+//                                product.setTaxPrice(quotationSelectionProduct.getTaxPriceOriginal());
+//                            }
                         }
 
                     }

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurDeliveryNoteArrival.java

@@ -95,7 +95,7 @@ public class PurDeliveryNoteArrival implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -94,7 +94,7 @@ public class PurInquiryFormProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 6 - 4
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrderProduct.java

@@ -95,7 +95,7 @@ public class PurOrderProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/
@@ -162,10 +162,12 @@ public class PurOrderProduct implements Serializable {
     @TableField(exist = false)
     private String unit;
 
+    //采购报价折扣
+    private BigDecimal discount;
+
+    //采购报价单价(原价) 折前单价
+    private BigDecimal taxPriceOriginal;
     // 折扣
     @TableField(exist = false)
     private String discountText;
-    // 折前单价
-    @TableField(exist = false)
-    private BigDecimal taxPriceOriginal;
 }

+ 8 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrderProductHis.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;
@@ -95,7 +97,7 @@ public class PurOrderProductHis implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -162,4 +164,9 @@ public class PurOrderProductHis implements Serializable {
 	@Excel(name = "历史表头主键(采购订单)", width = 15)
     @ApiModelProperty(value = "历史表头主键(采购订单)")
     private String hisHeadId;
+    //采购报价折扣
+    private BigDecimal discount;
+
+    //采购报价单价(原价) 折前单价
+    private BigDecimal taxPriceOriginal;
 }

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPurchaseQuotationProduct.java

@@ -89,7 +89,7 @@ public class PurPurchaseQuotationProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -83,7 +83,7 @@ public class PurQuotationSelectionProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -52,6 +52,8 @@
 					  , b.tax_price_usd
 					  , b.tax_amount_usd
 					  , b.exchange_rate_usd
+					  , b.discount
+					  , b.tax_price_original
 
 				 from pur_quotation_selection a
 						  left join pur_quotation_selection_product b on a.id = b.head_id

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

@@ -203,7 +203,7 @@ public class PurDeliveryNoteAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/

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

@@ -166,7 +166,7 @@ public class PurInquiryFormAlert {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/

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

@@ -245,7 +245,7 @@ public class PurOrderAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/

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

@@ -129,7 +129,7 @@ public class PurQuotationSelectionAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/
@@ -214,6 +214,12 @@ public class PurQuotationSelectionAlert implements Serializable {
     private java.math.BigDecimal taxAmountUsd;
     @ApiModelProperty(value = "美元汇率")
     private java.math.BigDecimal exchangeRateUsd;
+
+    //折前单价
+    private java.math.BigDecimal taxPriceOriginal;
+    //折扣
+    private java.math.BigDecimal discount;
+
     //质量等级
     private String qualityGradeHead;
 }

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

@@ -178,7 +178,7 @@ public class SupplierQuotationDetails {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/

+ 13 - 4
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java

@@ -4,6 +4,7 @@ import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
@@ -680,8 +681,7 @@ public class SaleInvoiceController {
 
             String dept = sysUser.getOrgCode();
             String userName =  sysUser.getUsername();
-
-            if(!userName.equals("admin") && !"A02A05".equals(dept)){
+            if(!userName.equals("admin") && !userName.equals("jack") && !userName.equals("max") && !"A02A05".equals(dept)){
                 throw new JeecgBootException("请勾选要导出的数据");
             }
 
@@ -899,8 +899,17 @@ public class SaleInvoiceController {
                             if (oConvertUtils.isNotEmpty(saleQuotationProduct.getDiscount())) {
                                 o.setDiscountText(saleQuotationProduct.getDiscount().intValue() + "%");
                             }
-                            if (oConvertUtils.isNotEmpty(saleQuotationProduct.getPurchasePrice())) {
-                                o.setTaxPrice(saleQuotationProduct.getPurchasePrice());
+                            if (oConvertUtils.isNotEmpty(saleQuotationProduct.getSalePrice())) {
+
+
+                                BigDecimal dic = saleQuotationProduct.getDiscount() ==null?BigDecimal.ZERO:saleQuotationProduct.getDiscount();
+                                BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+
+                                BigDecimal getSalePrice = saleQuotationProduct.getSalePrice() == null ? BigDecimal.ZERO : saleQuotationProduct.getSalePrice();
+                                BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);
+                                o.setTaxPrice(setTaxPrice);
+
+//                                o.setTaxPrice(saleQuotationProduct.getSalePrice());
                             }
 //                            if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0) {
 //                                o.setDiscountText(saleOrderProduct.getDiscount().intValue() + "%");

+ 77 - 11
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java

@@ -4,6 +4,7 @@ import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
@@ -34,8 +35,11 @@ import org.jeecg.modules.cuspCode.service.ICuspCustomerProfileManService;
 import org.jeecg.modules.cuspCode.service.ICuspCustomerProfileService;
 import org.jeecg.modules.purCode.entity.PurCommissionRequest;
 import org.jeecg.modules.purCode.entity.PurOrder;
+import org.jeecg.modules.purCode.entity.PurOrderProduct;
+import org.jeecg.modules.purCode.entity.PurQuotationSelectionProduct;
 import org.jeecg.modules.purCode.service.IPurCommissionRequestService;
 import org.jeecg.modules.purCode.service.IPurOrderService;
+import org.jeecg.modules.purCode.service.IPurQuotationSelectionProductService;
 import org.jeecg.modules.saleCode.entity.*;
 import org.jeecg.modules.saleCode.service.*;
 import org.jeecg.modules.saleCode.vo.SaleOrderAlert;
@@ -127,6 +131,8 @@ public class SaleOrderController {
     private ISaleQuotationService saleQuotationService;
     @Autowired
     private ISaleQuotationProductService saleQuotationProductService;
+    @Autowired
+    private IPurQuotationSelectionProductService purQuotationSelectionProductService;
 
     @Value(value = "${jeecg.path.upload}")
     private String uploadpath;
@@ -156,6 +162,7 @@ public class SaleOrderController {
 
     /**
      * 销售订单弹框明细-佣金付款使用
+     *
      * @param saleOrder
      * @param pageNo
      * @param pageSize
@@ -196,6 +203,7 @@ public class SaleOrderController {
         QueryWrapper<SaleOrderAlert> queryWrapper = QueryGenerator.initQueryWrapper(saleInquiryForm, req.getParameterMap());
         Page<SaleOrderAlert> page = new Page<SaleOrderAlert>(pageNo, pageSize);
         IPage<SaleOrderAlert> pageList = saleOrderProductService.selectSaleOrderDetailAlert(page, queryWrapper);
+
         return Result.OK(pageList);
     }
 
@@ -221,6 +229,43 @@ public class SaleOrderController {
         queryWrapper.isNotNull("supplier_id");
         queryWrapper.apply("quantity > IFNULL(purchase_quantity, 0)");
         IPage<SaleOrderAlert> pageList = saleOrderProductService.selectSaleOrderDetailAlert(page, queryWrapper);
+
+        List<SaleOrderAlert> saleOrderProductList = pageList.getRecords();
+
+        // 获取报价单行
+        List<SaleQuotationProduct> saleQuotationProductList = new ArrayList<>();
+        if (oConvertUtils.listIsNotEmpty(saleOrderProductList)) {
+            LambdaQueryWrapper<SaleQuotationProduct> productWrapper = new LambdaQueryWrapper<>();
+            productWrapper.in(SaleQuotationProduct::getId, saleOrderProductList.stream().map(SaleOrderAlert::getSourceId).collect(Collectors.toList()));
+            saleQuotationProductList = saleQuotationProductService.list(productWrapper);
+        }
+        // 获取报价选定单行
+        List<PurQuotationSelectionProduct> purQuotationSelectionProductList = new ArrayList<>();
+        if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)) {
+            LambdaQueryWrapper<PurQuotationSelectionProduct> productWrapper = new LambdaQueryWrapper<>();
+            productWrapper.in(PurQuotationSelectionProduct::getId, saleQuotationProductList.stream().map(SaleQuotationProduct::getSourceId).collect(Collectors.toList()));
+            purQuotationSelectionProductList = purQuotationSelectionProductService.list(productWrapper);
+        }
+
+        for (SaleOrderAlert product : pageList.getRecords()) {
+
+            SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(product.getSourceId())).findFirst().orElse(null);
+            if (saleQuotationProduct != null) {
+                PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
+                if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
+                    product.setDiscount(quotationSelectionProduct.getDiscount());
+                }else{
+                    product.setDiscount(new BigDecimal("0"));
+                    product.setTaxPriceOriginal(product.getTaxPriceGys());
+                }
+                if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
+                    product.setTaxPriceOriginal(quotationSelectionProduct.getTaxPriceOriginal());
+                }
+            }
+
+
+        }
+
         return Result.OK(pageList);
     }
 
@@ -361,7 +406,7 @@ public class SaleOrderController {
 
         List<SaleOrderShip> saleOrderShipListOld = saleOrderShipService.selectByMainId(saleOrder.getId());
         List<SaleOrderShipHis> saleOrderShipHisList = new ArrayList<>();
-        if (saleOrderShipListOld !=null && saleOrderShipListOld.size() > 0) {
+        if (saleOrderShipListOld != null && saleOrderShipListOld.size() > 0) {
             for (SaleOrderShip o : saleOrderShipListOld) {
                 SaleOrderShipHis his = new SaleOrderShipHis();
                 BeanUtils.copyProperties(o, his);
@@ -374,7 +419,7 @@ public class SaleOrderController {
 
         List<SaleOrderProduct> saleOrderProductListOld = saleOrderProductService.selectByMainId(saleOrder.getId());
         List<SaleOrderProductHis> saleOrderProductList = new ArrayList<>();
-        if (saleOrderProductListOld !=null && saleOrderProductListOld.size() > 0) {
+        if (saleOrderProductListOld != null && saleOrderProductListOld.size() > 0) {
 
             for (SaleOrderProduct o : saleOrderProductListOld) {
                 SaleOrderProductHis his = new SaleOrderProductHis();
@@ -751,7 +796,7 @@ public class SaleOrderController {
     @AutoLog(value = "销售订单-批量关闭")
     @ApiOperation(value = "销售订单-批量关闭", notes = "销售订单-批量关闭")
     @GetMapping(value = "/submitClose")
-    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
+    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids, String closeReason) {
 
         QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -983,10 +1028,10 @@ public class SaleOrderController {
         List<SaleOrderProduct> productList = saleOrderProductService.selectByMainId(saleOrder.getId());
         List<SaleOrderShip> saleOrderShipList = saleOrderShipService.selectByMainId(saleOrder.getId());
         QueryWrapper<SaleQuotation> saleQuotationWrapper = new QueryWrapper<>();
-        saleQuotationWrapper.eq("bill_code",sourceCode);
+        saleQuotationWrapper.eq("bill_code", sourceCode);
         List<SaleQuotation> listSaleQuotation = saleQuotationService.list(saleQuotationWrapper);
         List<SaleQuotationProduct> saleQuotationProduct = new ArrayList<>();
-        if(listSaleQuotation.size() > 0){
+        if (listSaleQuotation.size() > 0) {
             saleQuotationProduct = saleQuotationProductService.selectByMainId(listSaleQuotation.get(0).getId());
         }
         BaseTemplates templates = null;
@@ -1032,7 +1077,7 @@ public class SaleOrderController {
                 String agreementTerms = saleOrder.getAgreementTerms();
                 if (StringUtils.isNotBlank(agreementTerms)) {
                     String info = sysDictService.queryAgreementTermsByName(agreementTerms);
-                    if(StringUtils.isNotBlank(info)){
+                    if (StringUtils.isNotBlank(info)) {
                         saleOrder.setAgreementTerms(info);
                     }
                 }
@@ -1073,13 +1118,25 @@ public class SaleOrderController {
                             }
                         }
                     }
-                    if(saleQuotationProduct.size() > 0){
+                    if (saleQuotationProduct.size() > 0) {
 
-                        for(SaleQuotationProduct a:saleQuotationProduct){
+                        for (SaleQuotationProduct a : saleQuotationProduct) {
                             String saleId = a.getId();
-                            if(StringUtils.isNotBlank(o.getSourceId()) && o.getSourceId().equals(saleId)){
-                                o.setDiscountText(a.getDiscount().setScale(2).toString());
-                                o.setTaxPrice(a.getPurchasePrice().setScale(2));
+                            if (StringUtils.isNotBlank(o.getSourceId()) && o.getSourceId().equals(saleId)) {
+                                if (a.getDiscount() != null) {
+                                    o.setDiscountText(a.getDiscount().setScale(2).toString());
+                                }
+                                if (a.getSalePrice() != null) {
+
+                                    BigDecimal dic = a.getDiscount() == null ? BigDecimal.ZERO : a.getDiscount();
+                                    BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+
+                                    BigDecimal getSalePrice = a.getSalePrice() == null ? BigDecimal.ZERO : a.getSalePrice();
+                                    BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);
+
+                                    o.setTaxPrice(setTaxPrice);
+                                }
+
                             }
                         }
                     }
@@ -1169,4 +1226,13 @@ public class SaleOrderController {
         return response.getOutputStream();
     }
 
+
+    public static void main(String[] args) {
+
+        BigDecimal getSalePrice = new BigDecimal("90");
+        BigDecimal dis = new BigDecimal("10");
+
+        System.out.println((new BigDecimal("100").subtract(dis)).divide(new BigDecimal("100")));
+        System.out.println(getSalePrice.divide(new BigDecimal("0.9")).setScale(2, RoundingMode.HALF_UP));
+    }
 }

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

@@ -1,10 +1,8 @@
 package org.jeecg.modules.saleCode.entity;
 
 import java.io.Serializable;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import org.jeecg.common.constant.ProvinceCityArea;
 import org.jeecg.common.util.SpringContextUtils;
 import lombok.Data;
@@ -91,7 +89,7 @@ public class SaleContractProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -155,4 +153,7 @@ public class SaleContractProduct implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
+
 }

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

@@ -1,10 +1,8 @@
 package org.jeecg.modules.saleCode.entity;
 
 import java.io.Serializable;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import org.jeecg.common.constant.ProvinceCityArea;
 import org.jeecg.common.util.SpringContextUtils;
 import lombok.Data;
@@ -99,7 +97,7 @@ public class SaleContractProductHis implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -163,4 +161,6 @@ public class SaleContractProductHis implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
 }

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

@@ -87,7 +87,7 @@ public class SaleDeliveryDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -89,7 +89,7 @@ public class SaleInquiryFormProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

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

@@ -36,6 +36,8 @@ public class SaleInvoice implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //组织 ,由销售订单带入
+    private String organize;
 
     //发货通知单中的组织
     @TableField(exist = false)

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

@@ -78,7 +78,7 @@ public class SaleInvoiceProduct implements Serializable {
     @ApiModelProperty(value = "产品分类")
     private String productClass;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+//	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -130,7 +130,7 @@ public class SaleInvoiceProduct implements Serializable {
     @ApiModelProperty(value = "备注(notes)")
     private String notes;
 	/**参照来源*/
-	@Excel(name = "参照来源", width = 15)
+//	@Excel(name = "参照来源", width = 15)
     @ApiModelProperty(value = "参照来源")
     private String sourceType;
 	/**参照来源id*/

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

@@ -89,7 +89,7 @@ public class SaleOrderProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -167,6 +167,8 @@ public class SaleOrderProduct implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
 
     // 导出用
     @TableField(exist = false)

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

@@ -1,10 +1,8 @@
 package org.jeecg.modules.saleCode.entity;
 
 import java.io.Serializable;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import org.jeecg.common.constant.ProvinceCityArea;
 import org.jeecg.common.util.SpringContextUtils;
 import lombok.Data;
@@ -91,7 +89,7 @@ public class SaleOrderProductHis implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -176,4 +174,6 @@ public class SaleOrderProductHis implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
 }

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

@@ -89,7 +89,7 @@ public class SaleQuotationProduct implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -185,6 +185,9 @@ public class SaleQuotationProduct implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
     @TableField(exist = false)
     private Integer rowNumber;
     @TableField(exist = false)

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

@@ -1,10 +1,8 @@
 package org.jeecg.modules.saleCode.entity;
 
 import java.io.Serializable;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import org.jeecg.common.constant.ProvinceCityArea;
 import org.jeecg.common.util.SpringContextUtils;
 import lombok.Data;
@@ -99,7 +97,7 @@ public class SaleQuotationProductHis implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/
@@ -194,4 +192,6 @@ public class SaleQuotationProductHis implements Serializable {
     private String currencyGys;//供应商币种
     private BigDecimal exchangeRateGys;//美元汇率
     private BigDecimal taxPriceGys;//供应商采购单价
+    @TableField(exist = false)
+    private BigDecimal preDiscountPrice;//折前单价(计算)
 }

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

@@ -9,8 +9,8 @@
 			 head_id = #{mainId} 	</delete>
 	
 	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleContractProductHis">
-		SELECT * 
-		FROM  sale_contract_product_his
-		WHERE
-			 head_id = #{mainId} 	</select>
+		SELECT a.*, ROUND(a.tax_price / ((100 - IFNULL(a.discount, 0)) / 100), 2) as pre_discount_price
+		FROM sale_contract_product_his a
+		WHERE a.head_id = #{mainId}
+	</select>
 </mapper>

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

@@ -9,9 +9,10 @@
 
     <select id="selectByMainId" parameterType="java.lang.String"
             resultType="org.jeecg.modules.saleCode.entity.SaleContractProduct">
-        SELECT *
-        FROM sale_contract_product
-        WHERE head_id = #{mainId}    </select>
+        SELECT a.*, ROUND(a.tax_price / ((100 - IFNULL(a.discount, 0)) / 100), 2) as pre_discount_price
+        FROM sale_contract_product a
+        WHERE a.head_id = #{mainId}
+    </select>
 
 
     <select id="selectContractDetailAlert" parameterType="java.lang.String"

+ 3 - 3
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleOrderProductHisMapper.xml

@@ -9,8 +9,8 @@
 			 head_id = #{mainId} 	</delete>
 	
 	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleOrderProductHis">
-		SELECT * 
-		FROM  sale_order_product_his
+		SELECT a.* , ROUND(a.tax_price / ((100 - IFNULL(a.discount, 0)) / 100), 2) as pre_discount_price
+		FROM  sale_order_product_his a
 		WHERE
-			 head_id = #{mainId} 	</select>
+			a.head_id = #{mainId} 	</select>
 </mapper>

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

@@ -9,10 +9,10 @@
 			 head_id = #{mainId} 	</delete>
 	
 	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleOrderProduct">
-		SELECT * 
-		FROM  sale_order_product
+		SELECT a.* , ROUND(a.tax_price / ((100 - IFNULL(a.discount, 0)) / 100), 2) as pre_discount_price
+		FROM  sale_order_product a
 		WHERE
-			 head_id = #{mainId} 	</select>
+			a.head_id = #{mainId} 	</select>
 
 
 	<select id="selectSaleOrderDetailAlert" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.vo.SaleOrderAlert">
@@ -39,6 +39,7 @@
 					 , b.factory
 					 , b.quality_grade
 					 , b.quantity
+					 , b.source_id
 					 , b.product_class
 
 					 ,b.tax_price

+ 3 - 3
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductHisMapper.xml

@@ -9,8 +9,8 @@
 			 head_id = #{mainId} 	</delete>
 	
 	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleQuotationProductHis">
-		SELECT * 
-		FROM  sale_quotation_product_his
+		SELECT a.* , ROUND(a.sale_price/((100 - IFNULL(a.discount,0))/100),2) as pre_discount_price
+		FROM  sale_quotation_product_his a
 		WHERE
-			 head_id = #{mainId} 	</select>
+			 a.head_id = #{mainId} 	</select>
 </mapper>

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

@@ -9,10 +9,10 @@
 			 head_id = #{mainId} 	</delete>
 	
 	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleQuotationProduct">
-		SELECT * 
-		FROM  sale_quotation_product
+		SELECT a.*, ROUND(a.sale_price/((100 - IFNULL(a.discount,0))/100),2) as pre_discount_price
+		FROM  sale_quotation_product a
 		WHERE
-			 head_id = #{mainId} 	</select>
+			a.head_id = #{mainId} 	</select>
 
 
 	<select id="saleQuotationDetailsAlert" resultType="org.jeecg.modules.saleCode.vo.SaleQuotationAlert">

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

@@ -110,6 +110,7 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 					if (saleOrder != null){
 						// 客户订单号
 						saleInvoice.setOrderNumber(saleOrder.getCustomerOrder());
+						saleInvoice.setOrganize(saleOrder.getOrganize());
 					}
 				}
 			}
@@ -174,6 +175,7 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 					if (saleOrder != null){
 						// 客户订单号
 						saleInvoice.setOrderNumber(saleOrder.getCustomerOrder());
+						saleInvoice.setOrganize(saleOrder.getOrganize());
 					}
 				}
 			}

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

@@ -182,7 +182,7 @@ public class SaleContractAlert {
 	@ApiModelProperty(value = "产品英文名")
 	private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
 	@ApiModelProperty(value = "规格")
 	private String specifications;
 	/**型号*/

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

@@ -212,7 +212,7 @@ public class SaleDeliveryAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/

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

@@ -177,7 +177,7 @@ public class SaleInquiryFormAlert {
 	@ApiModelProperty(value = "产品英文名")
 	private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
 	@ApiModelProperty(value = "规格")
 	private String specifications;
 	/**型号*/

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

@@ -38,6 +38,8 @@ public class SaleInvoicePage {
 	//关闭原因
 	private String closeReason;
 
+	//组织 ,由销售订单带入
+	private String organize;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@@ -73,7 +75,7 @@ public class SaleInvoicePage {
 	@ApiModelProperty(value = "单据编码")
     private String invoiceCode;
 	/**项目(project)*/
-	@Excel(name = "项目(project)", width = 15)
+//	@Excel(name = "项目(project)", width = 15)
 	@ApiModelProperty(value = "项目(project)")
     private String project;
 	/**项目名称*/
@@ -81,7 +83,7 @@ public class SaleInvoicePage {
 	@ApiModelProperty(value = "项目名称")
     private String projectName;
 	/**客户(customer)*/
-	@Excel(name = "客户(customer)", width = 15)
+//	@Excel(name = "客户(customer)", width = 15)
 	@ApiModelProperty(value = "客户(customer)")
     private String customer;
 	/**客户名称*/

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

@@ -270,7 +270,7 @@ public class SaleOrderAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/
@@ -305,10 +305,6 @@ public class SaleOrderAlert implements Serializable {
     @Excel(name = "税率(tax rate)", width = 15)
     @ApiModelProperty(value = "税率(tax rate)")
     private java.math.BigDecimal taxRate;
-    /**折扣(discount)*/
-    @Excel(name = "折扣(discount)", width = 15)
-    @ApiModelProperty(value = "折扣(discount)")
-    private java.math.BigDecimal discount;
     /**含税单价(tax price)*/
     @Excel(name = "含税单价(tax price)", width = 15)
     @ApiModelProperty(value = "含税单价(tax price)")
@@ -331,6 +327,8 @@ public class SaleOrderAlert implements Serializable {
     @Excel(name = "备注(notes)", width = 15)
     @ApiModelProperty(value = "备注(notes)")
     private String childNotes;
+    //来源
+    private String sourceId;
     //供应商
     private String supplierId;
     private String supplierName;
@@ -342,4 +340,9 @@ public class SaleOrderAlert implements Serializable {
     private java.math.BigDecimal deliveryQuantity;
     @ApiModelProperty(value = "已采购数量(采购单参照数量)")
     private java.math.BigDecimal purchaseQuantity;
+
+    //采购原价
+    private java.math.BigDecimal taxPriceOriginal;
+//    采购折扣
+    private java.math.BigDecimal discount;
 }

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

@@ -219,7 +219,7 @@ public class SaleQuotationAlert {
 	@ApiModelProperty(value = "产品英文名")
 	private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
 	@ApiModelProperty(value = "规格")
 	private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreCheckDetails.java

@@ -83,7 +83,7 @@ public class StoreCheckDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOnhand.java

@@ -122,7 +122,7 @@ public class StoreOnhand implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**机型*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOtherOutDetails.java

@@ -83,7 +83,7 @@ public class StoreOtherOutDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StorePurchaseInDetails.java

@@ -89,7 +89,7 @@ public class StorePurchaseInDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StorePurchaseOtherDetails.java

@@ -85,7 +85,7 @@ public class StorePurchaseOtherDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreSaleOutDetails.java

@@ -89,7 +89,7 @@ public class StoreSaleOutDetails implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
 	/**规格*/
-	@Excel(name = "规格", width = 15)
+	//	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
 	/**型号*/

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/storeCode/vo/StorePurchaseInAlert.java

@@ -173,7 +173,7 @@ public class StorePurchaseInAlert implements Serializable {
     @ApiModelProperty(value = "产品英文名")
     private String englishName;
     /**规格*/
-    @Excel(name = "规格", width = 15)
+    //	@Excel(name = "规格", width = 15)
     @ApiModelProperty(value = "规格")
     private String specifications;
     /**型号*/