From b88cbdbc97735732fe6406fbe5aa3228eaa1b551 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 20 十月 2025 13:13:44 +0800
Subject: [PATCH] 修改包装管理,包装可输入小数
---
Wms/WMS.BLL/SysServer/CustomerServer.cs | 43 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/Wms/WMS.BLL/SysServer/CustomerServer.cs b/Wms/WMS.BLL/SysServer/CustomerServer.cs
index 4105f4b..bd79575 100644
--- a/Wms/WMS.BLL/SysServer/CustomerServer.cs
+++ b/Wms/WMS.BLL/SysServer/CustomerServer.cs
@@ -4,8 +4,10 @@
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
+using Model.InterFaceModel;
using Model.ModelDto.SysDto;
using SqlSugar;
+using WMS.Entity.Context;
using WMS.Entity.LogEntity;
using WMS.Entity.SysEntity;
using WMS.IBLL.ILogServer;
@@ -16,6 +18,7 @@
{
public class CustomerServer : ICustomerServer
{
+ private static readonly SqlSugarScope Db = DataContext.Db;
public ICustomerRepository CustomerRst { get; set; }
private readonly IOperationSysServer _operation; //鎿嶄綔鏃ュ織
public CustomerServer(ICustomerRepository customerRst, IOperationSysServer operation)
@@ -23,7 +26,7 @@
CustomerRst = customerRst;
_operation = operation;
}
-
+
public async Task<List<CustomerDto>> GetCustomerList(string no, string name, int? type, string linkMan, string phone, int page, int limit, RefAsync<int> count)
{
@@ -41,7 +44,7 @@
.Includes(x => x.CreateUserInfo)
.Includes(x => x.UpdateUserInfo)
.ToListAsync();
- count = counts;
+ count.Value = counts;
return data.Select(m => new CustomerDto()
{
@@ -172,5 +175,41 @@
var num = await CustomerRst.RemoveAllAsync(list, userId);
return num > 0;
}
+
+ /// <summary>
+ /// SAP鏂板瀹㈡埛渚涘簲鍟嗘暟鎹�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ /// <exception cref="Exception"></exception>
+ public async Task<string> AddCustomerSap(SendCustomerVm model)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁閲嶅
+ var customer = Db.Queryable<SysCustomer>().First(m => m.IsDel == "0" && m.CustomerNo == model.customerNo.ToString());
+ if (customer != null)
+ {
+ throw new Exception("鐩稿悓缂栫爜鐨勫鎴峰凡瀛樺湪锛岃鍕块噸澶嶆坊鍔�");
+ }
+ var addCustomer = new SysCustomer()
+ {
+ CustomerNo = model.customerNo.ToString(),
+ CustomerName = model.customerName,
+ Type = int.Parse(model.CustomerType),
+ Address = model.Address,
+ LinkMan = model.contact,
+ Phone = model.contactMobile,
+
+ CreateUser = 0,
+ };
+ await Db.Insertable(addCustomer).ExecuteCommandAsync();
+ return "0";
+ }
+ catch (Exception e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
}
}
--
Gitblit v1.8.0