Browse Source

1.产品属性新增材料海关编号2客户产品信息中增加产品海关编码3发货单和对账单信息中增加海关编码的显示和导出4.客户产品的海关编号首次录入可以从创建订单时候输入

klzhangweiya 1 year ago
parent
commit
e1e47a4fbc
42 changed files with 697 additions and 67 deletions
  1. 13 2
      src_0nline/ShwasherSys/ShwasherSys.Application/Common/CommonAppService.cs
  2. 4 0
      src_0nline/ShwasherSys/ShwasherSys.Application/Common/Dto/OrderSendExcelDto.cs
  3. 76 1
      src_0nline/ShwasherSys/ShwasherSys.Application/Common/QueryAppService.cs
  4. 9 4
      src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/CustomerDefaultProductsApplicationService.cs
  5. 2 0
      src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductCreateDto.cs
  6. 1 0
      src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductDto.cs
  7. 2 0
      src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductUpdateDto.cs
  8. 31 17
      src_0nline/ShwasherSys/ShwasherSys.Application/Invoice/OrderStickBillsApplicationService.cs
  9. 2 0
      src_0nline/ShwasherSys/ShwasherSys.Application/Order/Dto/OrderItemCreateDto.cs
  10. 5 0
      src_0nline/ShwasherSys/ShwasherSys.Application/Order/Dto/OrderItemUpdateDto.cs
  11. 5 1
      src_0nline/ShwasherSys/ShwasherSys.Application/Order/OrderItemsApplicationService.cs
  12. 12 4
      src_0nline/ShwasherSys/ShwasherSys.Application/OrderSendInfo/OrderSendBillsApplicationService.cs
  13. 3 0
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductDto.cs
  14. 4 0
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyCreateDto.cs
  15. 5 1
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyDto.cs
  16. 6 1
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyUpdateDto.cs
  17. 2 0
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/IProductPropertysApplicationService.cs
  18. 13 0
      src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/ProductPropertysApplicationService.cs
  19. 3 1
      src_0nline/ShwasherSys/ShwasherSys.Core/CustomerInfo/CustomerDefaultProduct.cs
  20. 5 1
      src_0nline/ShwasherSys/ShwasherSys.Core/ProductInfo/ProductProperty.cs
  21. 29 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.Designer.cs
  22. 18 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.cs
  23. 120 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.resx
  24. 29 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.Designer.cs
  25. 18 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.cs
  26. 120 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.resx
  27. 14 0
      src_0nline/ShwasherSys/ShwasherSys.EntityFramework/ShwasherSys.EntityFramework.csproj
  28. 20 5
      src_0nline/ShwasherSys/ShwasherSys.Web/Controllers/InvoiceInfoController.cs
  29. 8 0
      src_0nline/ShwasherSys/ShwasherSys.Web/Controllers/SendGoodsController.cs
  30. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134507.xlsx
  31. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134723.xlsx
  32. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134940.xlsx
  33. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/OrderSendBill/送货单-250210132457.xlsx
  34. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/OrderSendBill/送货单-250210133931.xlsx
  35. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Resources/InvoiceTemplate/对账单导出模板.xlsx
  36. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Resources/OrderSendTemplate/外销送货单模板 - 副本.xlsx
  37. BIN
      src_0nline/ShwasherSys/ShwasherSys.Web/Resources/OrderSendTemplate/外销送货单模板.xlsx
  38. 7 2
      src_0nline/ShwasherSys/ShwasherSys.Web/Views/CustomerInfo/CustomerDetail.cshtml
  39. 18 2
      src_0nline/ShwasherSys/ShwasherSys.Web/Views/InvoiceInfo/StatementBillDetail.cshtml
  40. 29 23
      src_0nline/ShwasherSys/ShwasherSys.Web/Views/OrderInfo/OrderMg.cshtml
  41. 47 2
      src_0nline/ShwasherSys/ShwasherSys.Web/Views/ProductInfo/ProductProperty.cshtml
  42. 17 0
      src_0nline/ShwasherSys/ShwasherSys.Web/Views/SendGoods/OrderSendBillDetail.cshtml

+ 13 - 2
src_0nline/ShwasherSys/ShwasherSys.Application/Common/CommonAppService.cs

@@ -99,6 +99,7 @@ namespace ShwasherSys.Common
         public IRepository<DeviceMgPlan> DeviceMgPlanRepository { get; }
         public IRepository<OrderBookStore,long> OrderBookStoreRepository { get; }
         protected IRepository<BusinessLog> BusinessLogRepository { get; }
+        protected IRepository<ProductProperty> ProductPropertyRepository { get; }
         protected IRepository<WxUser> WxUserRepository { get; }
 
 
@@ -107,7 +108,7 @@ namespace ShwasherSys.Common
         public  static  string WxLoginReqUrl = "https://api.weixin.qq.com/sns/jscode2session";
 
 
-        public CommonAppService(ICacheManager cacheManager,  IRepository<ShortMsgDetail> shortMsgDetailRepository, IRepository<ShortMessage> shortMsgRepository, IRepository<SysUser, long> sysUserRepository, IUnitOfWorkManager unitOfWorkManager, IRepository<SysAttachFile> sysAttachFileRepository, IRepository<OrderHeader, string> orderHeaderRepository, IRepository<ViewOrderSend> viewOrderSendRepository, ISqlExecuter sqlExecuter, IEmailSender emailSender, IRepository<CurrentProductStoreHouse> currentProductStoreHouseRepository, IRepository<CurrentSemiStoreHouse> currentSemiStoreHouseRepository, IRepository<StoreHouseLocation> storeHouseLocationRepository, IRepository<CustomerDisabledProduct> cdpRepository, IRepository<ProductionOrder> productionOrderRepository, ISmtpEmailSenderConfiguration smtpEmailSenderConfiguration, IRepository<Customer, string> customerRepository, IRepository<CustomerDisabledProduct> customerDisabledProductRepository, IRepository<SemiEnterStore> semiEnterStoreRepository, IRepository<Department, string> departmentRepository, IRepository<SemiProducts, string> semiProductRepository, IRepository<Product, string> productRepository, IRepository<ProductMapper> productMapperRepository, EmailMsgSendHandler emailMsgSendHandler, IStatesAppService statesAppService, IRepository<Employee> employeeRepository,IRepository<ViewPackageApply> viewPackageApplyRepository, IRepository<SemiProducts, string> semiProductsRepository, IRepository<DeviceMgPlan> deviceMgPlanRepository, IRepository<OrderBookStore, long> orderBookStorerepository, IRepository<BusinessLog> businessLogRepository,IRepository<WxUser> wxUserRepository)
+        public CommonAppService(ICacheManager cacheManager,  IRepository<ShortMsgDetail> shortMsgDetailRepository, IRepository<ShortMessage> shortMsgRepository, IRepository<SysUser, long> sysUserRepository, IUnitOfWorkManager unitOfWorkManager, IRepository<SysAttachFile> sysAttachFileRepository, IRepository<OrderHeader, string> orderHeaderRepository, IRepository<ViewOrderSend> viewOrderSendRepository, ISqlExecuter sqlExecuter, IEmailSender emailSender, IRepository<CurrentProductStoreHouse> currentProductStoreHouseRepository, IRepository<CurrentSemiStoreHouse> currentSemiStoreHouseRepository, IRepository<StoreHouseLocation> storeHouseLocationRepository, IRepository<CustomerDisabledProduct> cdpRepository, IRepository<ProductionOrder> productionOrderRepository, ISmtpEmailSenderConfiguration smtpEmailSenderConfiguration, IRepository<Customer, string> customerRepository, IRepository<CustomerDisabledProduct> customerDisabledProductRepository, IRepository<SemiEnterStore> semiEnterStoreRepository, IRepository<Department, string> departmentRepository, IRepository<SemiProducts, string> semiProductRepository, IRepository<Product, string> productRepository, IRepository<ProductMapper> productMapperRepository, EmailMsgSendHandler emailMsgSendHandler, IStatesAppService statesAppService, IRepository<Employee> employeeRepository,IRepository<ViewPackageApply> viewPackageApplyRepository, IRepository<SemiProducts, string> semiProductsRepository, IRepository<DeviceMgPlan> deviceMgPlanRepository, IRepository<OrderBookStore, long> orderBookStorerepository, IRepository<BusinessLog> businessLogRepository,IRepository<WxUser> wxUserRepository, IRepository<ProductProperty> productPropertyRepository)
         {
             ShortMsgDetailRepository = shortMsgDetailRepository;
             ShortMsgRepository = shortMsgRepository;
@@ -141,6 +142,7 @@ namespace ShwasherSys.Common
             OrderBookStoreRepository = orderBookStorerepository;
             BusinessLogRepository = businessLogRepository;
             WxUserRepository = wxUserRepository;
+            ProductPropertyRepository = productPropertyRepository;
         }
 
         public string KeepClock()
@@ -601,7 +603,16 @@ namespace ShwasherSys.Common
                 productNo = productMapper.ProductNo;
             }
             var pEntity = ProductRepository.Get(productNo);
-            return ObjectMapper.Map<ProductDto>(pEntity);
+            var po = ObjectMapper.Map<ProductDto>(pEntity);
+            var materialType = ProductProperty.ProductMaterial + "";
+            //查询下产品的材料海关编码(绑定在产品属性中的)
+            if (!string.IsNullOrEmpty(pEntity.MaterialNo))
+            {
+                var pp = await ProductPropertyRepository.FirstOrDefaultAsync(i =>
+                    i.PropertyType == materialType && i.PropertyNo == pEntity.MaterialNo);
+                po.MaterialHsCode = pp?.HsCode;
+            }
+            return po;
         }
         /// <summary>
         /// 根据对照表搜到新的半成品编码

+ 4 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/Common/Dto/OrderSendExcelDto.cs

@@ -44,6 +44,10 @@ namespace ShwasherSys.Common.Dto
 
 		public string Ext1 { get; set; }
 
+        public string MaterialHsCode { get; set; }
+
+        public string ProductHsCode { get; set; }
+
 	}
 
 	public class OrderSendMiniExcelDto

+ 76 - 1
src_0nline/ShwasherSys/ShwasherSys.Application/Common/QueryAppService.cs

@@ -162,6 +162,13 @@ namespace ShwasherSys.Common
 
         #endregion
 
+        #region 2025
+
+        Task<List<CustomerDefaultProduct>> GetCustomerDefaultProductByCustomerId(string customerId);  
+
+        Task<List<ProductProperty>> GetProductProperty(string productPropertyType);
+        #endregion
+
     }
     [AbpAuthorize,DisableAuditing]
     public class QueryAppService : ApplicationService, IQueryAppService
@@ -264,7 +271,7 @@ namespace ShwasherSys.Common
         protected IRepository<ViewCurrentSemiStoreHouse> ViewCurrentSemiStoreHouseRepository { get; }
         protected IRepository<DeviceMgPlan> DeviceMgPlanRepository { get; }
 
-		/// <summary>
+        /// <summary>
 		/// 查询快递名称
 		/// </summary>
 		/// <param name="id"></param>
@@ -1510,5 +1517,73 @@ namespace ShwasherSys.Common
         }
         #endregion
 
+
+        #region 2025
+        /// <summary>
+        /// 获取客户默认的产品信息
+        /// </summary>
+        /// <param name="customerId"></param>
+        /// <returns></returns>
+        public async Task<List<CustomerDefaultProduct>> GetCustomerDefaultProductByCustomerId(string customerId)
+        {
+            var allListAsync = await CustomerDefaultProductRepository.GetAllListAsync(i=>i.CustomerId == customerId);
+            return allListAsync;
+        }
+        /// <summary>
+        /// 获取产品属性
+        /// </summary>
+        /// <param name="productPropertyType"></param>
+        /// <returns></returns>
+        public async Task<List<ProductProperty>> GetProductProperty(string productPropertyType)
+        {
+            var types = new string[]{"1","2","3","4","5"};
+            if (productPropertyType == "" || !types.Contains(productPropertyType))
+            {
+                return await ProductPropertyRepository.GetAllListAsync();
+            }
+            return await ProductPropertyRepository.GetAllListAsync(i=>i.PropertyType == productPropertyType);
+        }
+
+        
+        #endregion
+
+    }
+
+    public class CommonQueryService
+    {
+        /// <summary>
+        /// 获取产品海关编码
+        /// </summary>
+        /// <param name="customerId"></param>
+        /// <param name="productNo"></param>
+        /// <param name="customerDefaultProducts"></param>
+        /// <returns></returns>
+        public static string GetProductHsCode(string customerId, string productNo,
+            List<CustomerDefaultProduct> customerDefaultProducts)
+        {
+            var customerDefaultProduct = customerDefaultProducts.FirstOrDefault(i => i.CustomerId == customerId && i.ProductNo == productNo);
+            return customerDefaultProduct == null ? "" : customerDefaultProduct.ProductHsCode;
+        }
+        /// <summary>
+        /// 根据产品编号获取产品HS码   
+        /// </summary>
+        /// <param name="productNo"></param>
+        /// <param name="productProperties"></param>
+        /// <returns></returns>
+        public static string GetMaterialHsCode(string productNo,
+            List<ProductProperty> productProperties)
+        {
+            string materialNo = "";
+            //新的产品编码标准,旧编码不处理
+            if (productNo.StartsWith("s") && productNo.Length == 14)
+            {
+                // 提取第6到7个字符(索引5和6)
+                materialNo = productNo.Substring(5, 2);
+            }
+
+            var type = ProductProperty.ProductMaterial + "";
+            var property = productProperties.FirstOrDefault(i => i.PropertyType == type && i.PropertyNo == materialNo);
+            return property != null ? property.HsCode : "";
+        }
     }
 }

+ 9 - 4
src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/CustomerDefaultProductsApplicationService.cs

@@ -82,7 +82,8 @@ namespace ShwasherSys.CustomerInfo
                     SurfaceColor = p.SurfaceColor,
                     Sequence = d.Sequence,
                     TimeLastMod = d.TimeLastMod,
-                        PartNo=d.PartNo
+                    PartNo=d.PartNo,
+                    ProductHsCode=d.ProductHsCode
                 };
             loCustomerDefaultProductDto = loCustomerDefaultProductDto.OrderBy(i => i.Sequence);
             //query = ApplySorting(query, input);
@@ -140,11 +141,15 @@ namespace ShwasherSys.CustomerInfo
 
         public override async Task<CustomerDefaultProductDto> Update(CustomerDefaultProductUpdateDto input)
         {
-            var loExistProducts =await  Repository.FirstOrDefaultAsync(i => i.CustomerId == input.CustomerId  &&i.PartNo==input.PartNo);
-            if (loExistProducts != null && loExistProducts.Id != input.Id)
+            if (!string.IsNullOrWhiteSpace(input.PartNo))
             {
-                throw new UserFriendlyException($"零件号重复!该客户维护的产品{loExistProducts.ProductNo },已经使用了零件号{loExistProducts.PartNo}!");
+                var loExistProducts = await Repository.FirstOrDefaultAsync(i => i.CustomerId == input.CustomerId && i.PartNo == input.PartNo);
+                if (loExistProducts != null && loExistProducts.Id != input.Id)
+                {
+                    throw new UserFriendlyException($"零件号重复!该客户维护的产品{loExistProducts.ProductNo},已经使用了零件号{loExistProducts.PartNo}!");
+                }
             }
+            
             return await  base.Update(input);
         }
         /*public string GetDefualtProductByOrderItemNo(int orderItemNo)

+ 2 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductCreateDto.cs

@@ -17,5 +17,7 @@ namespace ShwasherSys.CustomerInfo.Dto
 		public int Sequence  { get; set; }
 		public DateTime? TimeLastMod  { get; set; }
         public string PartNo { get; set; }
+
+        public string ProductHsCode { get; set; }
     }
 }

+ 1 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductDto.cs

@@ -23,6 +23,7 @@ namespace ShwasherSys.CustomerInfo.Dto
         public string SurfaceColor { get; set; }
 
         public string Material { get; set; }
+        public string ProductHsCode { get; set; }
 
     }
 }

+ 2 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/CustomerInfo/Dto/CustomerDefaultProductUpdateDto.cs

@@ -19,5 +19,7 @@ namespace ShwasherSys.CustomerInfo.Dto
 
         public string PartNo { get; set; }
 
+        public string ProductHsCode { get; set; }
+
     }
 }

+ 31 - 17
src_0nline/ShwasherSys/ShwasherSys.Application/Invoice/OrderStickBillsApplicationService.cs

@@ -26,6 +26,7 @@ using ShwasherSys.Invoice.Dto;
 using ShwasherSys.Lambda;
 using ShwasherSys.OrderSendInfo;
 using ShwasherSys.OrderSendInfo.Dto;
+using ShwasherSys.ProductInfo;
 
 namespace ShwasherSys.Invoice
 {
@@ -41,7 +42,9 @@ namespace ShwasherSys.Invoice
         protected IRepository<BusinessLog> BusinessLogRepository { get; }
         protected IRepository<ViewStickBill,string> ViewStickBillRepository { get; }
         protected IRepository<ViewStatementBill> ViewStatementBillRepository { get; }
-        public OrderStickBillAppService(IRepository<OrderStickBill, string> repository, IRepository<ViewCustomerStick> viewCustomerStickRepository, ISqlExecuter sqlExecute, IRepository<Customer, string> customerRepository, IRepository<OrderSend> orderSendRepository, IRepository<BusinessLog> businessLogRepository, IRepository<ViewStickBill, string> viewStickBillRepository,IRepository<ViewOrderSendStickBill> viewOrderSendStickBillRepository, IRepository<OrderSendBill, string> orderSendBillRepository, IRepository<ViewStatementBill> viewStatementBillRepository) : base(repository)
+
+        protected IQueryAppService QueryAppService { get; }
+        public OrderStickBillAppService(IRepository<OrderStickBill, string> repository, IRepository<ViewCustomerStick> viewCustomerStickRepository, ISqlExecuter sqlExecute, IRepository<Customer, string> customerRepository, IRepository<OrderSend> orderSendRepository, IRepository<BusinessLog> businessLogRepository, IRepository<ViewStickBill, string> viewStickBillRepository,IRepository<ViewOrderSendStickBill> viewOrderSendStickBillRepository, IRepository<OrderSendBill, string> orderSendBillRepository, IRepository<ViewStatementBill> viewStatementBillRepository,IQueryAppService queryAppService) : base(repository)
         {
             ViewCustomerStickRepository = viewCustomerStickRepository;
             SqlExecute = sqlExecute;
@@ -53,6 +56,7 @@ namespace ShwasherSys.Invoice
             OrderSendBillRepository = orderSendBillRepository;
             ViewStatementBillRepository = viewStatementBillRepository;
             KeyIsAuto = false;
+            QueryAppService = queryAppService;
         }
 
 		protected override string GetPermissionName { get; set; } = PermissionNames.PagesInvoiceInfoInvoiceMg;
@@ -419,6 +423,10 @@ namespace ShwasherSys.Invoice
             var bill = ObjectMapper.Map<OrderSendBillDto>(
                 OrderSendBillRepository.Get(orderSends.First().OrderSendBillNo));
             var customerInfo = await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
+
+            var customerDefaultProducts = await QueryAppService.GetCustomerDefaultProductByCustomerId(customerInfo.Id);
+            var productProperties = await QueryAppService.GetProductProperty(ProductProperty.ProductMaterial + "");
+
             string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/InvoiceTemplate/对账单导出模板.xlsx";
             var savePath = "Download/Excel/InvoiceBill";
             var work = ExcelHelper.CreateWorkBook07(path);
@@ -450,34 +458,40 @@ namespace ShwasherSys.Invoice
                 var totalNoTaxprice = $"{(send.SendQuantity ?? 0) * send.AfterTaxPrice:N3}";
                 var sendDate = $"{send.SendDate:yyyy-MM-dd}";
                 currencyId = send.CurrencyId;
+                string productHsCode =
+                    CommonQueryService.GetProductHsCode(send.CustomerId, send.ProductNo, customerDefaultProducts);
+                string materialHsCode =
+                    CommonQueryService.GetMaterialHsCode(send.ProductNo, productProperties);
                 sheet1.GenerateCell(8 + index, 1).SetValue<int>(index + 1);
                 sheet1.GenerateCell(8 + index, 2).SetValue(send.StockNo ?? send.OrderNo);
                 sheet1.GenerateCell(8 + index, 3).SetValue(send.OrderSendBillNo ?? "");
                 sheet1.GenerateCell(8 + index, 4).SetValue(sendDate);
                 sheet1.GenerateCell(8 + index, 5).SetValue(send.PartNo ?? "");
-                sheet1.GenerateCell(8 + index, 6).SetValue(send.Model ?? "");
-                sheet1.GenerateCell(8 + index, 7).SetValue(send.Material ?? "");
-                sheet1.GenerateCell(8 + index, 8).SetValue(send.ProductName ?? "");
-                sheet1.GenerateCell(8 + index, 9).SetValue(send.Rigidity ?? "");
-                sheet1.GenerateCell(8 + index, 10).SetValue(send.SurfaceColor ?? "");
-                sheet1.GenerateCell(8 + index, 11).SetValue<decimal>(sendQuantity);
-                sheet1.GenerateCell(8 + index, 12).SetValue(send.OrderUnitName??"");
+                sheet1.GenerateCell(8 + index, 6).SetValue(productHsCode);
+                sheet1.GenerateCell(8 + index, 7).SetValue(send.Model ?? "");
+                sheet1.GenerateCell(8 + index, 8).SetValue(send.Material ?? "");
+                sheet1.GenerateCell(8 + index, 9).SetValue(materialHsCode);
+                sheet1.GenerateCell(8 + index, 10).SetValue(send.ProductName ?? "");
+                sheet1.GenerateCell(8 + index, 11).SetValue(send.Rigidity ?? "");
+                sheet1.GenerateCell(8 + index, 12).SetValue(send.SurfaceColor ?? "");
+                sheet1.GenerateCell(8 + index, 13).SetValue<decimal>(sendQuantity);
+                sheet1.GenerateCell(8 + index, 14).SetValue(send.OrderUnitName??"");
                 if (isCanViewPrice)
                 {
-                    sheet1.GenerateCell(8 + index, 13).SetValue<decimal>(price);
-                    sheet1.GenerateCell(8 + index, 14).SetValue<decimal>(noTaxprice);
-                    sheet1.GenerateCell(8 + index, 15).SetValue<decimal>(logisticsFee);
-                    sheet1.GenerateCell(8 + index, 16).SetValue<decimal>(moldFee);
-                    sheet1.GenerateCell(8 + index, 17).SetValue<decimal>(totalprice);
-                    sheet1.GenerateCell(8 + index, 18).SetValue<decimal>(totalNoTaxprice);
+                    sheet1.GenerateCell(8 + index, 15).SetValue<decimal>(price);
+                    sheet1.GenerateCell(8 + index, 16).SetValue<decimal>(noTaxprice);
+                    sheet1.GenerateCell(8 + index, 17).SetValue<decimal>(logisticsFee);
+                    sheet1.GenerateCell(8 + index, 18).SetValue<decimal>(moldFee);
+                    sheet1.GenerateCell(8 + index, 19).SetValue<decimal>(totalprice);
+                    sheet1.GenerateCell(8 + index, 20).SetValue<decimal>(totalNoTaxprice);
                 }
                 ldAccontTotal += send.totalprice;
                 ldNoTaxTotal += (send.SendQuantity ?? 0) * send.AfterTaxPrice;
                 index++;
             }
-            sheet1.GenerateCell(8 + index, 16).SetValue($"总金额({currencyId})");
-            sheet1.GenerateCell(8 + index, 17).SetValue<decimal>(ldAccontTotal);
-            sheet1.GenerateCell(8 + index, 18).SetValue<decimal>(ldNoTaxTotal);
+            sheet1.GenerateCell(8 + index, 18).SetValue($"总金额({currencyId})");
+            sheet1.GenerateCell(8 + index, 19).SetValue<decimal>(ldAccontTotal);
+            sheet1.GenerateCell(8 + index, 20).SetValue<decimal>(ldNoTaxTotal);
             var fileName = $"对账单-{Clock.Now:yyMMddHHmmss}.xlsx";
             var result = work?.SaveWorkBook($"{AppDomain.CurrentDomain.BaseDirectory}{savePath}", fileName);
             if (!result.IsNullOrEmpty())

+ 2 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/Order/Dto/OrderItemCreateDto.cs

@@ -72,5 +72,7 @@ namespace ShwasherSys.Order.Dto
         /// </summary>
         public decimal MoldFeeAfterTax { get; set; } = 0;
 
+        public string ProductHsCode { get; set; }
+
     }
 }

+ 5 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/Order/Dto/OrderItemUpdateDto.cs

@@ -72,5 +72,10 @@ namespace ShwasherSys.Order.Dto
         /// 模具费(不含税)
         /// </summary>
         public decimal MoldFeeAfterTax { get; set; } = 0;
+
+        /// <summary>
+        /// 海关编码
+        /// </summary>
+        public string ProductHsCode { get; set; }
     }
 }

+ 5 - 1
src_0nline/ShwasherSys/ShwasherSys.Application/Order/OrderItemsApplicationService.cs

@@ -375,7 +375,8 @@ namespace ShwasherSys.Order
 		            CustomerId = orderHeader.CustomerId,
 		            ProductNo = input.ProductNo,
 		            PartNo = input.PartNo,
-		            Sequence = 1,
+                    ProductHsCode = input.ProductHsCode,
+                    Sequence = 1,
 		            TimeLastMod = Clock.Now
 	            };
             }
@@ -386,6 +387,7 @@ namespace ShwasherSys.Order
 		            throw new UserFriendlyException($"零件号重复!该客户维护的产品{exist.ProductNo },已经使用了零件号{exist.PartNo}!");
 	            }
 	            customerDefaultProduct.PartNo = input.PartNo;
+                customerDefaultProduct.ProductHsCode = input.ProductHsCode;
 	            customerDefaultProduct.Sequence = customerDefaultProduct.Sequence + 1;
 	            customerDefaultProduct.TimeLastMod = Clock.Now;
             }
@@ -488,6 +490,7 @@ namespace ShwasherSys.Order
 		            CustomerId = orderHeader.CustomerId,
 		            ProductNo = input.ProductNo,
 		            PartNo = input.PartNo,
+                    ProductHsCode = input.ProductHsCode,
 		            Sequence = 1,
 		            TimeLastMod = Clock.Now
 	            };
@@ -499,6 +502,7 @@ namespace ShwasherSys.Order
 		            throw new UserFriendlyException($"零件号重复!该客户维护的产品{exist.ProductNo },已经使用了零件号{exist.PartNo}!");
 	            }
 	            customerDefaultProduct.PartNo = input.PartNo;
+                customerDefaultProduct.ProductHsCode = input.ProductHsCode;
 	            customerDefaultProduct.Sequence = customerDefaultProduct.Sequence + 1;
 	            customerDefaultProduct.TimeLastMod = Clock.Now;
             }

+ 12 - 4
src_0nline/ShwasherSys/ShwasherSys.Application/OrderSendInfo/OrderSendBillsApplicationService.cs

@@ -29,6 +29,7 @@ using ShwasherSys.EntityFramework;
 using ShwasherSys.Lambda;
 using ShwasherSys.Order;
 using ShwasherSys.OrderSendInfo.Dto;
+using ShwasherSys.ProductInfo;
 using ShwasherSys.ProductStoreInfo;
 
 namespace ShwasherSys.OrderSendInfo
@@ -486,7 +487,7 @@ namespace ShwasherSys.OrderSendInfo
 	        var orderSends =
 		        (await ViewOrderSendRepository.GetAllListAsync(i => i.OrderSendBillNo == input.Id)).OrderBy(i => i.SendBillSort).ThenByDescending(i => i.SendDate).ToList();
 	        var customerInfo = await CustomerRepository.FirstOrDefaultAsync(bill.CustomerId);
-	        var miniValue = ConvertToMiniExcelDto(bill,customerInfo,orderSends);
+	        var miniValue =await ConvertToMiniExcelDto(bill,customerInfo,orderSends);
 
 	        string path = AppDomain.CurrentDomain.BaseDirectory + "Resources/OrderSendTemplate/送货单模板.xlsx";
 	        var fileName = $"送货单-{Clock.Now:yyMMddHHmmss}.xlsx";
@@ -525,7 +526,7 @@ namespace ShwasherSys.OrderSendInfo
 
 		}
 
-        private OrderSendMiniExcelDto ConvertToMiniExcelDto(OrderSendBill bill,Customer customerInfo,List<ViewOrderSend> orderSends)
+        private async Task<OrderSendMiniExcelDto> ConvertToMiniExcelDto(OrderSendBill bill,Customer customerInfo,List<ViewOrderSend> orderSends)
         {
 	        OrderSendMiniExcelDto miniValue = new OrderSendMiniExcelDto()
 	        {
@@ -537,7 +538,10 @@ namespace ShwasherSys.OrderSendInfo
 		        ContactTels = bill.ContactTels,
 		        ContactMan = bill.ContactMan
 	        };
-	        miniValue.SendDate = bill.SendDate;
+            var customerDefaultProducts = await QueryAppService.GetCustomerDefaultProductByCustomerId(customerInfo.Id);
+            var productProperties =await QueryAppService.GetProductProperty(ProductProperty.ProductMaterial+"");
+
+            miniValue.SendDate = bill.SendDate;
 	        int index = 0;
 	        decimal allPackageCount = 0;
 	        decimal allSendQuantity = 0;
@@ -571,7 +575,11 @@ namespace ShwasherSys.OrderSendInfo
 		        item.Remark = send.Remark;
 		        item.Price = send.Price;
 		        item.AfterTaxPrice = send.AfterTaxPrice;
-		        allTotalPrice += send.TotalPrice;
+                item.ProductHsCode =
+                    CommonQueryService.GetProductHsCode(send.CustomerId, send.ProductNo, customerDefaultProducts);
+                item.MaterialHsCode =
+                    CommonQueryService.GetMaterialHsCode(send.ProductNo,productProperties);
+                allTotalPrice += send.TotalPrice;
 		        orderSendItem.Add(item);
 		        index++;
 	        }

+ 3 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductDto.cs

@@ -39,5 +39,8 @@ namespace ShwasherSys.ProductInfo.Dto
         public string SpecialNo { get; set; }
       
         public string PrevProductNo { get; set; }
+
+        //产品的材料海关编号
+        public string MaterialHsCode { get; set; }
     }
 }

+ 4 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyCreateDto.cs

@@ -19,6 +19,10 @@ namespace ShwasherSys.ProductInfo.Dto
 		public string PropertyNo  { get; set; }
 		public string PropertyValue  { get; set; }
 		public string DisplayValue  { get; set; }
+        /// <summary>
+        /// 海关HS编码
+        /// </summary>
+        public string HsCode { get; set; }
 		public string ContentInfo  { get; set; }
     }
 }

+ 5 - 1
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyDto.cs

@@ -17,6 +17,10 @@ namespace ShwasherSys.ProductInfo.Dto
 		public string PropertyNo  { get; set; }
 		public string PropertyValue  { get; set; }
 		public string DisplayValue  { get; set; }
-		public string ContentInfo  { get; set; }
+        /// <summary>
+        /// 海关HS编码
+        /// </summary>
+        public string HsCode { get; set; }
+        public string ContentInfo  { get; set; }
     }
 }

+ 6 - 1
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/Dto/ProductPropertyUpdateDto.cs

@@ -20,6 +20,11 @@ namespace ShwasherSys.ProductInfo.Dto
 		public string PropertyNo  { get; set; }
 		public string PropertyValue  { get; set; }
 		public string DisplayValue  { get; set; }
-		public string ContentInfo  { get; set; }
+
+        /// <summary>
+        /// 海关HS编码
+        /// </summary>
+        public string HsCode { get; set; }
+        public string ContentInfo  { get; set; }
     }
 }

+ 2 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/IProductPropertysApplicationService.cs

@@ -20,6 +20,8 @@ namespace ShwasherSys.ProductInfo
 
         Task<bool> ImportExcel(FileUploadInfoDto input);
 
+        Task UpdateExtend(ProductPropertyUpdateDto input);
+
 
     }
 }

+ 13 - 0
src_0nline/ShwasherSys/ShwasherSys.Application/ProductInfo/ProductPropertysApplicationService.cs

@@ -204,6 +204,19 @@ namespace ShwasherSys.ProductInfo
             await UpdateEntity(input);
         }
 
+        [AbpAuthorize(PermissionNames.PagesProductInfoProductPropertyUpdate)]
+        public async Task UpdateExtend(ProductPropertyUpdateDto input)
+        {
+            var entity = await Repository.GetAsync(input.Id);
+            if (entity == null)
+            {
+                CheckErrors("未查询到相应的属性!");
+            }
+            var dto = MapToEntityDto(entity);
+            dto.HsCode = input.HsCode;
+            await UpdateEntity(input);
+        }
+
         [AbpAuthorize(PermissionNames.PagesProductInfoProductPropertyDelete)]
         public override async Task Delete(EntityDto<int> input)
         {

+ 3 - 1
src_0nline/ShwasherSys/ShwasherSys.Core/CustomerInfo/CustomerDefaultProduct.cs

@@ -16,7 +16,7 @@ namespace ShwasherSys.CustomerInfo
         public const int ProductNoMaxLength = 30;
         public const int CustomerProductNameMaxLength = 30;
         public const int PartNoMaxLength = 30;
-
+        public const int ProductHsCodeMaxLength = 30;
 
         [StringLength(CustomerIdMaxLength)]
         public string CustomerId { get; set; }
@@ -35,5 +35,7 @@ namespace ShwasherSys.CustomerInfo
 
         [StringLength(PartNoMaxLength)]
         public string PartNo { get; set; }
+        [StringLength(ProductHsCodeMaxLength)]
+        public string ProductHsCode { get; set; }
     }
 }

+ 5 - 1
src_0nline/ShwasherSys/ShwasherSys.Core/ProductInfo/ProductProperty.cs

@@ -17,6 +17,7 @@ namespace ShwasherSys.ProductInfo
         public const int PropertyValueMaxLength = 50;
         public const int DisplayValueMaxLength = 150;
         public const int ContentInfoMaxLength = 250;
+        public const int HsCodeMaxLength = 32;
 
         public static int ProductModel =1;
         public static int ProductMaterial = 2;
@@ -24,11 +25,12 @@ namespace ShwasherSys.ProductInfo
         public static int ProductSurfaceColor = 4;
         public static int ProductSpecial = 5;
 
-        public  static int ProductModelLength = 4;
+        public static int ProductModelLength = 4;
         public static int ProductMaterialLength = 2;
         public static int ProductSurfaceColorLength = 3;
         public static int ProductRigidityLength = 2;
         public static int ProductSpecialLength = 2;
+        
         /// <summary>
         /// 属性类别(规格1,材质2,硬度3,表色4,特殊处理(倒角,高度,反面,粗糙度等等) 5)
         /// </summary>
@@ -46,6 +48,8 @@ namespace ShwasherSys.ProductInfo
         public string DisplayValue { get; set; }
         [StringLength(ContentInfoMaxLength)]
         public string ContentInfo { get; set; }
+        [StringLength(HsCodeMaxLength)]
+        public string HsCode { get; set; }
 
     }
 }

+ 29 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace ShwasherSys.Migrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class addColumnHsCodeForProductProperty : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(addColumnHsCodeForProductProperty));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "202502070314007_addColumnHsCodeForProductProperty"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 18 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.cs

@@ -0,0 +1,18 @@
+namespace ShwasherSys.Migrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class addColumnHsCodeForProductProperty : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.ProductProperties", "HsCode", c => c.String(maxLength: 32));
+        }
+        
+        public override void Down()
+        {
+            DropColumn("dbo.ProductProperties", "HsCode");
+        }
+    }
+}

File diff suppressed because it is too large
+ 120 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070314007_addColumnHsCodeForProductProperty.resx


+ 29 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace ShwasherSys.Migrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class productHsCodeForCustomerDefaultProduct : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(productHsCodeForCustomerDefaultProduct));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "202502070347445_productHsCodeForCustomerDefaultProduct"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 18 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.cs

@@ -0,0 +1,18 @@
+namespace ShwasherSys.Migrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class productHsCodeForCustomerDefaultProduct : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.CustomerDefaultProduct", "ProductHsCode", c => c.String(maxLength: 30));
+        }
+        
+        public override void Down()
+        {
+            DropColumn("dbo.CustomerDefaultProduct", "ProductHsCode");
+        }
+    }
+}

File diff suppressed because it is too large
+ 120 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/Migrations/202502070347445_productHsCodeForCustomerDefaultProduct.resx


+ 14 - 0
src_0nline/ShwasherSys/ShwasherSys.EntityFramework/ShwasherSys.EntityFramework.csproj

@@ -302,6 +302,14 @@
     <Compile Include="Migrations\202501200142576_add-wxuser-table.Designer.cs">
       <DependentUpon>202501200142576_add-wxuser-table.cs</DependentUpon>
     </Compile>
+    <Compile Include="Migrations\202502070314007_addColumnHsCodeForProductProperty.cs" />
+    <Compile Include="Migrations\202502070314007_addColumnHsCodeForProductProperty.Designer.cs">
+      <DependentUpon>202502070314007_addColumnHsCodeForProductProperty.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Migrations\202502070347445_productHsCodeForCustomerDefaultProduct.cs" />
+    <Compile Include="Migrations\202502070347445_productHsCodeForCustomerDefaultProduct.Designer.cs">
+      <DependentUpon>202502070347445_productHsCodeForCustomerDefaultProduct.cs</DependentUpon>
+    </Compile>
     <Compile Include="Migrations\Configuration.cs" />
     <Compile Include="Migrations\SeedData\DefaultAppGuidsCreator.cs" />
     <Compile Include="Migrations\SeedData\DefaultFunctionsCreator.cs" />
@@ -350,6 +358,12 @@
     <EmbeddedResource Include="Migrations\202501200142576_add-wxuser-table.resx">
       <DependentUpon>202501200142576_add-wxuser-table.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Migrations\202502070314007_addColumnHsCodeForProductProperty.resx">
+      <DependentUpon>202502070314007_addColumnHsCodeForProductProperty.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Migrations\202502070347445_productHsCodeForCustomerDefaultProduct.resx">
+      <DependentUpon>202502070347445_productHsCodeForCustomerDefaultProduct.cs</DependentUpon>
+    </EmbeddedResource>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

+ 20 - 5
src_0nline/ShwasherSys/ShwasherSys.Web/Controllers/InvoiceInfoController.cs

@@ -13,10 +13,12 @@ using Abp.Web.Mvc.Authorization;
 using IwbZero.Auditing;
 using ShwasherSys.Authorization.Permissions;
 using ShwasherSys.BaseSysInfo.States;
+using ShwasherSys.Common;
 using ShwasherSys.CustomerInfo;
 using ShwasherSys.Invoice;
 using ShwasherSys.OrderSendInfo;
 using ShwasherSys.OrderSendInfo.Dto;
+using ShwasherSys.ProductInfo;
 
 namespace ShwasherSys.Controllers
 {
@@ -32,7 +34,8 @@ namespace ShwasherSys.Controllers
         protected IStatementBillAppService StatementBillAppService;
         protected IRepository<StatementBill> StatementBillRepository;
         protected IRepository<OrderStickBill,string> OrderStickBillRepository;
-        public InvoiceInfoController(IStatesAppService statesAppService, IOrderSendBillAppService orderSendBillAppService, IRepository<OrderSend> orderSendRepository, IRepository<Customer, string> customerRepository, IRepository<ViewOrderSend> viewOrderSendRepository, IRepository<ViewOrderSendStickBill> viewOrderSendStickBillRepository, IRepository<OrderSendBill, string> orderSendBillRepository, IStatementBillAppService statementBillAppService, IRepository<StatementBill> statementBillRepository,IRepository<OrderStickBill, string> orderStickBillRepository)
+        protected IQueryAppService QueryAppService;
+        public InvoiceInfoController(IStatesAppService statesAppService, IOrderSendBillAppService orderSendBillAppService, IRepository<OrderSend> orderSendRepository, IRepository<Customer, string> customerRepository, IRepository<ViewOrderSend> viewOrderSendRepository, IRepository<ViewOrderSendStickBill> viewOrderSendStickBillRepository, IRepository<OrderSendBill, string> orderSendBillRepository, IStatementBillAppService statementBillAppService, IRepository<StatementBill> statementBillRepository,IRepository<OrderStickBill, string> orderStickBillRepository, IQueryAppService queryAppService)
         {
             OrderSendBillAppService = orderSendBillAppService;
             OrderSendRepository = orderSendRepository;
@@ -44,6 +47,7 @@ namespace ShwasherSys.Controllers
             StatesAppService = statesAppService;
             StatementBillRepository = statementBillRepository;
             OrderStickBillRepository = orderStickBillRepository;
+            QueryAppService = queryAppService;
         }
         [AbpMvcAuthorize(PermissionNames.PagesInvoiceInfoInvoiceCreate), AuditLog("发票创建页面")]
         public ActionResult InvoiceCreate()
@@ -99,19 +103,30 @@ namespace ShwasherSys.Controllers
             var viewOrderSendStickBills =await ViewOrderSendStickBillRepository.GetAll().Where(i => i.StatementBillNo == id).OrderBy(i => i.SendDate).ThenBy((i => i.StatementBillSort)).ThenBy(i=>i.ProductName).ToListAsync();
             ViewBag.OrderSends = viewOrderSendStickBills;
             //var bill = await OrderSendBillAppService.Get(new EntityDto<string>(viewOrderSendStickBills.First().OrderSendBillNo));
+            Customer customer = null;
             if (viewOrderSendStickBills.Any())
             {
                 var bill = ObjectMapper.Map<OrderSendBillDto>(
                     OrderSendBillRepository.Get(viewOrderSendStickBills.First().OrderSendBillNo));
                 ViewBag.SendBill = bill;
-                ViewBag.CustomerInfo = CustomerRepository.Get(bill.CustomerId);
+                customer = CustomerRepository.Get(bill.CustomerId);
             }
             else
             {
-                ViewBag.CustomerInfo = CustomerRepository.Get(StatementBillRepository.FirstOrDefault(i=>i.StatementBillNo==id)?.CustomerId);
+                customer = CustomerRepository.Get(StatementBillRepository.FirstOrDefault(i=>i.StatementBillNo==id)?.CustomerId);
+            }
+
+            ViewBag.CustomerInfo = customer;
+            if (customer != null)
+            {
+                var customerDefaultProducts = await QueryAppService.GetCustomerDefaultProductByCustomerId(customer.Id);
+                ViewBag.CustomerDefaultProducts = customerDefaultProducts;
+
+                var materialProductProperties = await QueryAppService.GetProductProperty(ProductProperty.ProductMaterial + "");
+                ViewBag.MaterialProductProperties = materialProductProperties;
             }
-            
-            
+          
+
             return View();
         }
     }

+ 8 - 0
src_0nline/ShwasherSys/ShwasherSys.Web/Controllers/SendGoodsController.cs

@@ -16,6 +16,7 @@ using ShwasherSys.BasicInfo;
 using ShwasherSys.Common;
 using ShwasherSys.CustomerInfo;
 using ShwasherSys.OrderSendInfo;
+using ShwasherSys.ProductInfo;
 
 namespace ShwasherSys.Controllers
 {
@@ -67,9 +68,16 @@ namespace ShwasherSys.Controllers
             var bill = await OrderSendBillAppService.Get(new EntityDto<string>(id));
             ViewBag.SendBill = bill;
             ViewBag.OrderSends = ViewOrderSendRepository.GetAll().Where(i => i.OrderSendBillNo == id).OrderBy(i=>i.SendBillSort).ThenByDescending(i => i.SendDate).ToList();
+           
             ViewBag.CustomerInfo = CustomerRepository.Get(bill.CustomerId);
             var templateInfo = await QueryAppService.QueryTemplate(bill.CustomerId, 2);
             ViewBag.TemplateInfo = templateInfo;
+
+            var customerDefaultProducts = await QueryAppService.GetCustomerDefaultProductByCustomerId(bill.CustomerId);
+            ViewBag.CustomerDefaultProducts = customerDefaultProducts;
+
+            var materialProductProperties = await QueryAppService.GetProductProperty(ProductProperty.ProductMaterial+"");
+            ViewBag.MaterialProductProperties = materialProductProperties;
             return View();
         }
         [AbpMvcAuthorize(PermissionNames.PagesSendGoodsOrderSendQueryMg), AuditLog("客户发货统计页面")]

BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134507.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134723.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/InvoiceBill/对账单-250210134940.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/OrderSendBill/送货单-250210132457.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Download/Excel/OrderSendBill/送货单-250210133931.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Resources/InvoiceTemplate/对账单导出模板.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Resources/OrderSendTemplate/外销送货单模板 - 副本.xlsx


BIN
src_0nline/ShwasherSys/ShwasherSys.Web/Resources/OrderSendTemplate/外销送货单模板.xlsx


+ 7 - 2
src_0nline/ShwasherSys/ShwasherSys.Web/Views/CustomerInfo/CustomerDetail.cshtml

@@ -218,6 +218,7 @@
                                         <th data-align="center" data-field="surfaceColor">表色</th>
                                         <th data-align="center" data-field="rigidity">硬度</th>
                                         <th data-align="center" data-field="customerProductName">客户定义名称</th>
+                                        <th data-align="center" data-field="productHsCode">产品海关编号</th>
                                         <th data-align="center" data-field="sequence">序号</th>
                                         <th data-align="center" data-formatter="ActionsFormatter"></th>
                                     </tr>
@@ -363,6 +364,7 @@
                             new InputViewModel("productNo", hide:true),
                             new InputViewModel("partNo", displayName: "产品零件号").SetNotRequired(),
                             new InputViewModel("customerProductName", displayName: "客户产品命名").SetNotRequired(),
+                            new InputViewModel("productHsCode", displayName: "产品海关编号").SetNotRequired(),
                             new InputViewModel("sequence", displayName: "排序")
 
                         };
@@ -489,6 +491,8 @@
                     r.partNo +
                     '\',\'' +
                     r.productNo +
+                    '\',\'' +
+					r.productHsCode +
                     '\')"><i class="iconfont icon-edit"></i>设置客户命名及零件号</span>';
 
             }
@@ -500,7 +504,7 @@
             return str;
         }
 
-        function SetCustomerDefaultName(id, customerId, customerProductName, sequence, partNo, productNo) {
+        function SetCustomerDefaultName(id, customerId, customerProductName, sequence, partNo, productNo,productHsCode) {
 
             OpenModal("/api/services/app/CustomerDefaultProduct/Update",
                 {
@@ -512,7 +516,8 @@
                         customerProductName: customerProductName == "null" ? "" : customerProductName,
                         sequence: sequence,
                         partNo: partNo == "null" ? "" : partNo,
-                        productNo: productNo
+                        productNo: productNo,
+						productHsCode: productHsCode == "null" ? "" : productHsCode
                     }, success: function(res) {
                         $('#modalSetDefaultName').modal("hide");
                         $('#tableDefaultProduct').bootstrapTable("refresh", { silent: true });

+ 18 - 2
src_0nline/ShwasherSys/ShwasherSys.Web/Views/InvoiceInfo/StatementBillDetail.cshtml

@@ -2,10 +2,12 @@
 @using IwbZero.Setting
 @using NPOI.SS.Formula.Functions
 @using ShwasherSys.Authorization.Permissions
+@using ShwasherSys.Common
 @using ShwasherSys.CustomerInfo
 @using ShwasherSys.Invoice
 @using ShwasherSys.OrderSendInfo
 @using ShwasherSys.OrderSendInfo.Dto
+@using ShwasherSys.ProductInfo
 
 @{
     Layout = null;
@@ -19,7 +21,8 @@
     string sendTel = SettingManager.GetSettingValue("SENDTELEPHONE");*/
     string tddate = "日期: " + DateTime.Now.Year + " 年 " + DateTime.Now.Month + " 月 " + DateTime.Now.Day + " 日 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
     bool isCanViewPrice = PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderMgQueryOrderPrice);
-
+    List<CustomerDefaultProduct> customerDefaultProducts = ViewBag.CustomerDefaultProducts;
+    List<ProductProperty> productProperties = ViewBag.MaterialProductProperties;
 }
 <html>
 <head>
@@ -193,7 +196,11 @@
                                     零件号
                                 </strong>
                             </td>
-
+                            <td style="text-align: center; font-size: 14px;">
+                                <strong>
+                                    HS Product
+                                </strong>
+                            </td>
                             <td style="text-align: center; font-size: 14px;">
                                 <strong>
                                     规格
@@ -204,6 +211,11 @@
                                     材质
                                 </strong>
                             </td>
+                            <td style="text-align: center; font-size: 14px;">
+                                <strong>
+                                    HS raw material
+                                </strong>
+                            </td>
                             <td style="text-align: center; font-size: 14px;">
                                 <strong>
                                     产品名
@@ -280,6 +292,8 @@
                                 var totalNoTaxprice = string.Format("{0:N3}", (orderSend.SendQuantity ?? 0) * orderSend.AfterTaxPrice);
                                 var sendDate = string.Format("{0:yyyy-MM-dd}", orderSend.SendDate);
                                 currencyId = orderSend.CurrencyId;
+                                string mHsCode = CommonQueryService.GetMaterialHsCode(orderSend.ProductNo, productProperties);
+                                string productHsCode = CommonQueryService.GetProductHsCode(orderSend.CustomerId, orderSend.ProductNo, customerDefaultProducts);
                                 string tmp = "";
                                                 <tr class="trColor">
                                                     @if (index == orderSends.Count)
@@ -299,8 +313,10 @@
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.OrderSendBillNo</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@sendDate</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.PartNo</td>
+                                                    <td style="font-family: 黑体; font-size: 13px; @tmp">@productHsCode</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Model</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Material</td>
+                                                    <td style="font-family: 黑体; font-size: 13px; @tmp">@mHsCode</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.ProductName</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Rigidity</td>
                                                     <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.SurfaceColor</td>

+ 29 - 23
src_0nline/ShwasherSys/ShwasherSys.Web/Views/OrderInfo/OrderMg.cshtml

@@ -398,18 +398,28 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
 									</div>
 								</div>
 							</div>
-							<div class="form-group-sm row">
-								<label class="iwb-label col-md-2 control-label" for="wareHouse">送货仓库</label>
-								<div class="col-md-4">
-									<input class="form-control" id="wareHouse" name="wareHouse" placeholder="请输入..." value="" style="" type="text">
-								</div>
-								<label class="iwb-label col-md-2 control-label iwb-label-required" for="emergencyLevel">紧急程度</label>
-								<div class="col-md-4">
-
-									@*<input class="form-control" id="emergencyLevel" name="emergencyLevel" placeholder="请输入..." value="" style="" type="text">*@
-									@Html.DropDownList("emergencyLevel", emergencyLevelList, htmlAttributes: new { @class = "form-control Required", placeholder = "请选择", style = "width: 100%" })
-								</div>
-							</div>
+                            <div class="form-group-sm row">
+                                <label class="iwb-label col-md-2 control-label" for="wareHouse">送货仓库</label>
+                                <div class="col-md-4">
+                                    <input class="form-control" id="wareHouse" name="wareHouse" placeholder="请输入..." value="" style="" type="text">
+                                </div>
+                                <label class="iwb-label col-md-2 control-label iwb-label-required" for="emergencyLevel">紧急程度</label>
+                                <div class="col-md-4">
+
+                                    @*<input class="form-control" id="emergencyLevel" name="emergencyLevel" placeholder="请输入..." value="" style="" type="text">*@
+                                    @Html.DropDownList("emergencyLevel", emergencyLevelList, htmlAttributes: new { @class = "form-control Required", placeholder = "请选择", style = "width: 100%" })
+                                </div>
+                            </div>
+                            <div class="form-group-sm row">
+                                <label class="iwb-label col-md-2 control-label " for="productHsCode">产品海关号</label>
+                                <div class="col-md-4">
+                                    <input class="form-control" id="productHsCode" name="productHsCode" placeholder="请输入..." value="" style="" type="text"/>
+                                </div>
+                                <label class="iwb-label col-md-2 control-label " for="mHsCode">材料海关号</label>
+                                <div class="col-md-4">
+                                    <input class="form-control" id="mHsCode" name="mHsCode" disabled="disabled" placeholder="请输入..." value="" style="" type="text"/>
+                                </div>
+                            </div>
 							<div class="form-group-sm row">
 								<label class="iwb-label col-md-2 control-label" for="wareHouse">客户标准名称</label>
 								<div class="col-md-4">
@@ -421,13 +431,7 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
 
 								</div>
 							</div>
-							@*<div class="form-group-sm row">
-									<label class="iwb-label col-md-2 control-label " for="orderItemDesc">描述</label>
-									<div class="col-md-10">
-										<textarea class="form-control" id="orderItemDesc" name="orderItemDesc" placeholder="请输入..." value="" style=""></textarea>
-									</div>
-
-								</div>*@
+							
 						</form>
 					</div>
 
@@ -907,6 +911,7 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
                         $("#Material").val(res.material);
                         $("#SurfaceColor").val(res.surfaceColor);
                         $("#Rigidity").val(res.rigidity);
+						$("#mHsCode").val(res.materialHsCode);
                         $("#IsStandard").val(res.isStandard === "Y" ? "是" : "否");
                         RefreshDefaultPartNo(res.partNo);
                     }
@@ -930,8 +935,9 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
                 dataType: "json",
                 success: function(res) {
                     //console.log(res);
-                    if (res && res.partNo) {
-                        $("#partNo").val(res.partNo);
+                    if (res) {
+                        $("#partNo").val(res.partNo || "");
+						$("#productHsCode").val(res.productHsCode || "");//新增的客户产品海关编码
                     }
                 }
             });
@@ -1000,7 +1006,7 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
             BtnCreate({
                 modal: $("#modal_OrderItemEdit"),
                 url: "/api/services/app/OrderItems/Create",
-                readonly: "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model",
+                readonly: "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model,mHsCode",
                 data: {
                     orderNo: checkedOrderNo,
                     productNo: firstProductNo,
@@ -1034,7 +1040,7 @@ new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("qu
                     savebtn: null,
                     form: null,
                     disabled:
-                        "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model,SendDate,currencyId,toCnyRate,price,afterTaxPrice,quantity",
+                        "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model,SendDate,currencyId,toCnyRate,price,afterTaxPrice,quantity,mHsCode",
                     url: "/api/services/app/OrderItems/Update",
                     select2: true,
                     select2tree: false,

+ 47 - 2
src_0nline/ShwasherSys/ShwasherSys.Web/Views/ProductInfo/ProductProperty.cshtml

@@ -46,8 +46,8 @@
                 <th data-align="center" data-field="propertyNo">编码</th>
                 <th data-align="center" data-field="propertyValue">属性值</th>
                 <th data-align="center" data-field="displayValue">显示值</th>
+                <th data-align="center" data-field="hsCode" data-formatter="HsCodeFormatter">海关编码</th>
                 <th data-align="center" data-field="contentInfo">内容描述</th>
-
             </tr>
         </thead>
     </table>
@@ -68,6 +68,7 @@
                             new InputViewModel("propertyType",InputTypes.List, displayName: "属性类别").SetSelectOptions(productPropertyTypeList),
                             new InputViewModel("propertyValue", displayName: "属性值"),
                             new InputViewModel("displayValue", displayName: "显示值").SetNotRequired(),
+                            new InputViewModel("hsCode", displayName: "海关编码").SetNotRequired(),
                             new InputViewModel("contentInfo",InputTypes.Textarea, "内容描述").SetNotRequired(),
 
                         };
@@ -86,6 +87,27 @@
                 }, "upload-form"), "upload-modal");
         }
         @Html.Partial("New/Modals/_Modal",uploadModal)
+        <div class="modal fade" id="modal_extend" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
+            <div class="modal-dialog  modal-dialog-centered" role="document">
+                <div class="modal-content">
+                    @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("产品标准扩展"))
+                    @{
+                        var inputs2 = new List<InputViewModel>
+                        {
+                            new InputViewModel("id", hide: true),
+                            new InputViewModel("propertyNo", hide: true),
+                            new InputViewModel("propertyType",InputTypes.List, displayName: "属性类别").SetSelectOptions(productPropertyTypeList),
+                            new InputViewModel("propertyValue",displayName: "属性值").SetNotRequired(),
+                            new InputViewModel("displayValue", displayName: "显示值").SetNotRequired(),
+                            new InputViewModel("hsCode", displayName: "海关编码")
+                        };
+                    }
+                    @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs2))
+                    @Html.Partial("Modals/_ModalFooter", "0")
+
+                </div>
+            </div>
+        </div>
     </section>
 
 }
@@ -119,7 +141,25 @@
             }
 
         });
-
+        function f_modifyExtent(id, propertyNo, propertyType, propertyValue, hsCode, contentInfo, displayValue) {
+			data = { id: id, propertyNo: propertyNo, propertyType: propertyType, propertyValue: propertyValue || '', hsCode: hsCode, contentInfo: contentInfo || '', displayValue: displayValue || '' }
+			console.log(data)
+			
+			OpenModal(window.appUrl + "ProductProperty/UpdateExtend", {
+				modal: $("#modal_extend"), modaltitle: "",
+				disabled: 'propertyType,propertyValue,displayValue,contentInfo',
+                data: data,
+                save: function () {
+					$.iwbAjax1({
+						url: window.appUrl + "ProductProperty/UpdateExtend",
+						modal: "modal_extend",
+						success: function () {
+							RefreshTable();
+						}
+					});
+				}
+			});
+        }
         function PropertyTypeFormatter(v) {
             var name = $('#hid-propertyType option[value="' + v + '"]').text();
             if (v) {
@@ -129,6 +169,11 @@
 
             }
         }
+        function HsCodeFormatter(v, r) {
+			let val = v ? `<i class="iconfont icon-edit"></i>${v}` :'<i class="iconfont icon-add"></i>'
+			var str = `<span class="table-action label " onclick="f_modifyExtent(${r.id},'${r.propertyNo}','${r.propertyType}','${r.propertyValue}','${v || ''}','${r.contentInfo || ''}','${r.displayValue || ''}')">${val}</span>`;
+			return str;
+		}
     </script>
 
 

+ 17 - 0
src_0nline/ShwasherSys/ShwasherSys.Web/Views/SendGoods/OrderSendBillDetail.cshtml

@@ -4,6 +4,7 @@
 @using ShwasherSys.CustomerInfo
 @using ShwasherSys.OrderSendInfo
 @using ShwasherSys.OrderSendInfo.Dto
+@using ShwasherSys.ProductInfo
 
 @{
     Layout = null;
@@ -22,6 +23,8 @@
     {
         tmpKey = templateInfo.TempKey;
     }
+    List<CustomerDefaultProduct> customerDefaultProducts = ViewBag.CustomerDefaultProducts;
+    List<ProductProperty> productProperties = ViewBag.MaterialProductProperties;
 }
 <html> 
 <head>
@@ -187,6 +190,16 @@
                 数量
             </strong>
         </td>
+        <td style="width:  20px ; text-align: center;border: thin solid #000000;" rowspan="2">
+            <strong>
+                产品海关编号
+            </strong>
+        </td>
+        <td style="width:  20px ; text-align: center;border: thin solid #000000;" rowspan="2">
+            <strong>
+                材料海关编号
+            </strong>
+        </td>
         <td style="text-align: center;width:  115px ;border: thin solid #000000;" colspan="4">
             <strong>
                 (箱数*千件数+零头数=发货数)
@@ -222,6 +235,8 @@
             quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
             decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(orderSend.SendQuantity / quantityPerPack));
             var sysl = sendQuantity - quantityPerPack * packageCount;
+            string mHsCode = CommonQueryService.GetMaterialHsCode(orderSend.ProductNo, productProperties);
+            string productHsCode = CommonQueryService.GetProductHsCode(orderSend.CustomerId, orderSend.ProductNo, customerDefaultProducts);
             <tr class="trColor">
                 <td style="border: thin solid #000000;">@index</td>
                 @if (string.IsNullOrEmpty(orderSend.StockNo))
@@ -240,6 +255,8 @@
                 <td style="border: thin solid #000000;">@orderSend.Rigidity</td>
                 <td style="border: thin solid #000000;">千件</td>
                 <td style="border: thin solid #000000;">@sendQuantity</td>
+                <td style="border: thin solid #000000;">@productHsCode</td>
+                <td style="border: thin solid #000000;">@mHsCode</td>
                 <td style="border: thin solid #000000;">@packageCount</td>
                 <td style="border: thin solid #000000;">@quantityPerPack</td>
                 <td style="border: thin solid #000000;">@sysl</td>

Some files were not shown because too many files changed in this diff