Browse Source

皓月需求

master
Robin_PC\robin 3 months ago
parent
commit
3d566f56c5
5 changed files with 16 additions and 10 deletions
  1. +3
    -2
      CowOutputClient/OperateWindow.xaml.cs
  2. +2
    -0
      CowOutputClient/app.config
  3. +7
    -6
      WeighBusiness/BL/ProductTeamBL.cs
  4. +2
    -1
      WeighBusiness/BO/CreateTables/CreateProductTeam.cs
  5. +2
    -1
      WeighBusiness/BO/ProductTeam.cs

+ 3
- 2
CowOutputClient/OperateWindow.xaml.cs View File

@ -34,7 +34,8 @@ namespace CowOutputClient
DateTime mProduceDate; DateTime mProduceDate;
DateTime mProduceStartDate; DateTime mProduceStartDate;
string accountingUnit_ID = ConfigurationManager.AppSettings["AccountingUnit_ID"]; string accountingUnit_ID = ConfigurationManager.AppSettings["AccountingUnit_ID"];
string domain_ID = ConfigurationManager.AppSettings["Domain_ID"];
string domain_ID = ConfigurationManager.AppSettings["Domain_ID"];
string clientNode = ConfigurationManager.AppSettings["ClientNode"];
ButcherDetailData mButcherDetailData; ButcherDetailData mButcherDetailData;
bool IsLoad = true; bool IsLoad = true;
decimal? tare = null; decimal? tare = null;
@ -333,7 +334,7 @@ namespace CowOutputClient
thread1.ReadParam += this.OnRead; thread1.ReadParam += this.OnRead;
thread1.Start(); thread1.Start();
wpfUser = WpfUserBL.Load(UserBL.CurrentUser.ERP_User_ID); wpfUser = WpfUserBL.Load(UserBL.CurrentUser.ERP_User_ID);
mTeam = ProductTeamBL.GetProductTeam(wpfUser.Employee_ID);
mTeam = ProductTeamBL.GetProductTeam(clientNode);
BindBaseData(); BindBaseData();
//IsLoad = false; //IsLoad = false;
} }


+ 2
- 0
CowOutputClient/app.config View File

@ -7,6 +7,8 @@
<add key="UrlPath" value="http://localhost:2000/MainSystem/" /> <add key="UrlPath" value="http://localhost:2000/MainSystem/" />
<!-- 版块ID --> <!-- 版块ID -->
<add key="Domain_ID" value="1" /> <add key="Domain_ID" value="1" />
<!-- 客户端标识 -->
<add key="ClientNode" value="0002" />
<!-- 会计单位ID --> <!-- 会计单位ID -->
<add key="AccountingUnit_ID" value="13" /> <add key="AccountingUnit_ID" value="13" />
<!-- 存货ID --> <!-- 存货ID -->


+ 7
- 6
WeighBusiness/BL/ProductTeamBL.cs View File

@ -40,8 +40,8 @@ namespace WeighBusiness.BL
if (teams.Count() > 0) { if (teams.Count() > 0) {
foreach (var team in teams) { foreach (var team in teams) {
string insertSql = InsertUtil.GetInsertSql(TableNames., string insertSql = InsertUtil.GetInsertSql(TableNames.,
new string[] { "ProductTeam_ID", "Name", "ProduceType", "Employee_ID", "RowVersion" },
new string[] { team.ProductTeam_ID.ToString(), team.Name, team.ProduceType, team.Employee_ID == null ? "null" : team.Employee_ID.Value.ToString(), team.RowVersion.ToString() });
new string[] { "ProductTeam_ID", "Name", "ProduceType", "Employee_ID", "RowVersion", "ClientNode" },
new string[] { team.ProductTeam_ID.ToString(), team.Name, team.ProduceType, team.Employee_ID == null ? "null" : team.Employee_ID.Value.ToString(), team.RowVersion.ToString(), team.ClientNode });
she.ExecuteNonQuery(insertSql, out success, out errorMessage); she.ExecuteNonQuery(insertSql, out success, out errorMessage);
if (!success && !string.IsNullOrEmpty(errorMessage)) { if (!success && !string.IsNullOrEmpty(errorMessage)) {
she.Rollback(); she.Rollback();
@ -94,9 +94,9 @@ namespace WeighBusiness.BL
public static void SyncProductTeam() public static void SyncProductTeam()
{ {
var domain_ID = ConfigurationManager.AppSettings["Domain_ID"]; var domain_ID = ConfigurationManager.AppSettings["Domain_ID"];
var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductTeamRowVersion";
var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductTeamRowVersion2";
if (domain_ID != null && !string.IsNullOrEmpty(domain_ID)) { if (domain_ID != null && !string.IsNullOrEmpty(domain_ID)) {
var productTeamRowVersions = RpcFacade.Call<List<Tuple<long?, int?, string, string, long?>>>(method, long.Parse(domain_ID));
var productTeamRowVersions = RpcFacade.Call<List<Tuple<long?, int?, string, string, long?, string>>>(method, long.Parse(domain_ID));
var oldProductTeamRowVersions = GetProductTeamRowVersion(); var oldProductTeamRowVersions = GetProductTeamRowVersion();
var needInsertProductTeamID = new List<long?>(); var needInsertProductTeamID = new List<long?>();
@ -150,6 +150,7 @@ namespace WeighBusiness.BL
team.Name = result.Item3; team.Name = result.Item3;
team.ProduceType = result.Item4; team.ProduceType = result.Item4;
team.Employee_ID = result.Item5; team.Employee_ID = result.Item5;
team.ClientNode = result.Item6;
list.Add(team); list.Add(team);
} }
@ -187,9 +188,9 @@ namespace WeighBusiness.BL
return errorMessage; return errorMessage;
} }
public static ProductTeam GetProductTeam(long? employeeId)
public static ProductTeam GetProductTeam(string clientNode)
{ {
var table = SqlHelperEx.DoQuery("select ProductTeam_ID,Name,ProduceType from {0} where Employee_ID = {1}".FormatWith(TableNames., employeeId == null ? "null" : employeeId.Value.ToString()));
var table = SqlHelperEx.DoQuery("select ProductTeam_ID,Name,ProduceType from {0} where ClientNode = {1}".FormatWith(TableNames., clientNode == null ? "null" : string.Format("'{0}'", clientNode)));
if (table.Rows.Count > 0) { if (table.Rows.Count > 0) {
foreach (DataRow row in table.Rows) { foreach (DataRow row in table.Rows) {
var team = new ProductTeam(); var team = new ProductTeam();


+ 2
- 1
WeighBusiness/BO/CreateTables/CreateProductTeam.cs View File

@ -18,7 +18,8 @@ namespace WeighBusiness.BO.CreateTables
{ {
cth.AddField(new FieldInfo() { FieldName = "ProductTeam_ID", FieldType = FBType.Integer }); cth.AddField(new FieldInfo() { FieldName = "ProductTeam_ID", FieldType = FBType.Integer });
cth.AddField(new FieldInfo() { FieldName = "Name", FieldType = FBType.Varchar, FieldTypeParams = "(100)" }); cth.AddField(new FieldInfo() { FieldName = "Name", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "ProduceType", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "ProduceType", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "ClientNode", FieldType = FBType.Varchar, FieldTypeParams = "(50)" });
cth.AddField(new FieldInfo() { FieldName = "Employee_ID", FieldType = FBType.Integer }); cth.AddField(new FieldInfo() { FieldName = "Employee_ID", FieldType = FBType.Integer });
cth.AddField(new FieldInfo() { FieldName = "RowVersion", FieldType = FBType.Integer }); cth.AddField(new FieldInfo() { FieldName = "RowVersion", FieldType = FBType.Integer });
base.AddFields(cth); base.AddFields(cth);


+ 2
- 1
WeighBusiness/BO/ProductTeam.cs View File

@ -16,7 +16,8 @@ namespace WeighBusiness.BO
public long ProductTeam_ID { get; set; } public long ProductTeam_ID { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string ProduceType { get; set; }
public string ProduceType { get; set; }
public string ClientNode { get; set; }
public long? Employee_ID { get; set; } public long? Employee_ID { get; set; }
public int RowVersion { get; set; } public int RowVersion { get; set; }


Loading…
Cancel
Save