修改字段名称

This commit is contained in:
admin
2021-01-19 11:10:39 +08:00
parent 7f130871c6
commit 7bf0fe9125
12 changed files with 96 additions and 35 deletions

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model.Request namespace NX.ERP.Model.Request
{ {
public class Materiel public class Materiel: BaseModel
{ {
private string _code; private string _code;
private string _name; private string _name;

View File

@@ -14,7 +14,7 @@ namespace NX.ERP.Model.Request
public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; } public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; }
public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; } public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; }
public int? Level { get => _level; set => _level = value; } public int? MaterialTypeGrade { get => _level; set => _level = value; }
public int? IsEnd { get => _isEnd; set => _isEnd = value; } public int? MaterialTypeIsend { get => _isEnd; set => _isEnd = value; }
} }
} }

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace NX.ERP.Model namespace NX.ERP.Model
{ {
public class Materiel public class Materiel: BaseModel
{ {
private string _code; private string _code;
private string _name; private string _name;

View File

@@ -9,12 +9,12 @@ namespace NX.ERP.Model
{ {
private string materielTypeCode; private string materielTypeCode;
private string materielTypeName; private string materielTypeName;
private int _level; private int? _level;
private bool _isEnd; private int? _isEnd;
public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; } public string MaterielTypeCode { get => materielTypeCode; set => materielTypeCode = value; }
public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; } public string MaterielTypeName { get => materielTypeName; set => materielTypeName = value; }
public int Level { get => _level; set => _level = value; } public int? MaterialTypeGrade { get => _level; set => _level = value; }
public bool IsEnd { get => _isEnd; set => _isEnd = value; } public int? MaterialTypeIsend { get => _isEnd; set => _isEnd = value; }
} }
} }

View File

@@ -10,7 +10,14 @@ namespace NX.ERP.Model
private string _WarehouseCode; private string _WarehouseCode;
private string _WarehouseName; private string _WarehouseName;
public string WarehouseCode { get => _WarehouseCode; set => _WarehouseCode = value; } public string WarehouseCode { get => _WarehouseCode; set => _WarehouseCode = value; }
public string WarehouseName { get => _WarehouseName; set => _WarehouseName = value; } public string WarehouseName { get => _WarehouseName; set => _WarehouseName = value; }
public string WarehouseAdmin { get; set; }
public string Contacts { get; set; }
public string Telephone { get; set; }
} }
} }

View File

@@ -105,6 +105,7 @@ namespace U8AppMain
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22); this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem2.Text = "采购入库单"; this.toolStripMenuItem2.Text = "采购入库单";
this.toolStripMenuItem2.Visible = false;
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
// //
// 材料出库单ToolStripMenuItem // 材料出库单ToolStripMenuItem
@@ -112,6 +113,7 @@ namespace U8AppMain
this.材料出库单ToolStripMenuItem.Name = "材料出库单ToolStripMenuItem"; this.材料出库单ToolStripMenuItem.Name = "材料出库单ToolStripMenuItem";
this.材料出库单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.材料出库单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.材料出库单ToolStripMenuItem.Text = "材料出库单"; this.材料出库单ToolStripMenuItem.Text = "材料出库单";
this.材料出库单ToolStripMenuItem.Visible = false;
this.材料出库单ToolStripMenuItem.Click += new System.EventHandler(this.材料出库单ToolStripMenuItem_Click); this.材料出库单ToolStripMenuItem.Click += new System.EventHandler(this.材料出库单ToolStripMenuItem_Click);
// //
// 其他入库ToolStripMenuItem // 其他入库ToolStripMenuItem
@@ -119,6 +121,7 @@ namespace U8AppMain
this.其他入库ToolStripMenuItem.Name = "其他入库ToolStripMenuItem"; this.其他入库ToolStripMenuItem.Name = "其他入库ToolStripMenuItem";
this.其他入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.其他入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.其他入库ToolStripMenuItem.Text = "其他入库"; this.其他入库ToolStripMenuItem.Text = "其他入库";
this.其他入库ToolStripMenuItem.Visible = false;
this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click); this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click);
// //
// 其他出库ToolStripMenuItem // 其他出库ToolStripMenuItem
@@ -126,6 +129,7 @@ namespace U8AppMain
this.其他出库ToolStripMenuItem.Name = "其他出库ToolStripMenuItem"; this.其他出库ToolStripMenuItem.Name = "其他出库ToolStripMenuItem";
this.其他出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.其他出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.其他出库ToolStripMenuItem.Text = "其他出库"; this.其他出库ToolStripMenuItem.Text = "其他出库";
this.其他出库ToolStripMenuItem.Visible = false;
this.其他出库ToolStripMenuItem.Click += new System.EventHandler(this.其他出库ToolStripMenuItem_Click); this.其他出库ToolStripMenuItem.Click += new System.EventHandler(this.其他出库ToolStripMenuItem_Click);
// //
// 销售出库ToolStripMenuItem // 销售出库ToolStripMenuItem
@@ -133,6 +137,7 @@ namespace U8AppMain
this.销售出库ToolStripMenuItem.Name = "销售出库ToolStripMenuItem"; this.销售出库ToolStripMenuItem.Name = "销售出库ToolStripMenuItem";
this.销售出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.销售出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.销售出库ToolStripMenuItem.Text = "销售出库"; this.销售出库ToolStripMenuItem.Text = "销售出库";
this.销售出库ToolStripMenuItem.Visible = false;
this.销售出库ToolStripMenuItem.Click += new System.EventHandler(this.销售出库ToolStripMenuItem_Click); this.销售出库ToolStripMenuItem.Click += new System.EventHandler(this.销售出库ToolStripMenuItem_Click);
// //
// 成品入库ToolStripMenuItem // 成品入库ToolStripMenuItem
@@ -140,6 +145,7 @@ namespace U8AppMain
this.成品入库ToolStripMenuItem.Name = "成品入库ToolStripMenuItem"; this.成品入库ToolStripMenuItem.Name = "成品入库ToolStripMenuItem";
this.成品入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.成品入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.成品入库ToolStripMenuItem.Text = "成品入库"; this.成品入库ToolStripMenuItem.Text = "成品入库";
this.成品入库ToolStripMenuItem.Visible = false;
this.成品入库ToolStripMenuItem.Click += new System.EventHandler(this.成品入库ToolStripMenuItem_Click); this.成品入库ToolStripMenuItem.Click += new System.EventHandler(this.成品入库ToolStripMenuItem_Click);
// //
// 导入ToolStripMenuItem // 导入ToolStripMenuItem
@@ -180,11 +186,12 @@ namespace U8AppMain
this.打印ToolStripMenuItem.Name = "打印ToolStripMenuItem"; this.打印ToolStripMenuItem.Name = "打印ToolStripMenuItem";
this.打印ToolStripMenuItem.Size = new System.Drawing.Size(45, 19); this.打印ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
this.打印ToolStripMenuItem.Text = "打印"; this.打印ToolStripMenuItem.Text = "打印";
this.打印ToolStripMenuItem.Visible = false;
// //
// 打印ToolStripMenuItem1 // 打印ToolStripMenuItem1
// //
this.打印ToolStripMenuItem1.Name = "打印ToolStripMenuItem1"; this.打印ToolStripMenuItem1.Name = "打印ToolStripMenuItem1";
this.打印ToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); this.打印ToolStripMenuItem1.Size = new System.Drawing.Size(100, 22);
this.打印ToolStripMenuItem1.Text = "打印"; this.打印ToolStripMenuItem1.Text = "打印";
this.打印ToolStripMenuItem1.Visible = false; this.打印ToolStripMenuItem1.Visible = false;
this.打印ToolStripMenuItem1.Click += new System.EventHandler(this.打印ToolStripMenuItem1_Click); this.打印ToolStripMenuItem1.Click += new System.EventHandler(this.打印ToolStripMenuItem1_Click);
@@ -205,7 +212,7 @@ namespace U8AppMain
// //
this.splitContainer1.Panel2.Controls.Add(this.richTextBox1); this.splitContainer1.Panel2.Controls.Add(this.richTextBox1);
this.splitContainer1.Size = new System.Drawing.Size(1200, 722); this.splitContainer1.Size = new System.Drawing.Size(1200, 722);
this.splitContainer1.SplitterDistance = 450; this.splitContainer1.SplitterDistance = 556;
this.splitContainer1.TabIndex = 0; this.splitContainer1.TabIndex = 0;
// //
// dataGridView1 // dataGridView1
@@ -224,8 +231,9 @@ namespace U8AppMain
this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true; this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1200, 450); this.dataGridView1.Size = new System.Drawing.Size(1200, 556);
this.dataGridView1.TabIndex = 0; this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
// //
// richTextBox1 // richTextBox1
// //
@@ -236,7 +244,7 @@ namespace U8AppMain
this.richTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.richTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true; this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(1200, 268); this.richTextBox1.Size = new System.Drawing.Size(1200, 162);
this.richTextBox1.TabIndex = 0; this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = ""; this.richTextBox1.Text = "";
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged); this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
@@ -253,6 +261,7 @@ namespace U8AppMain
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "FrmMain"; this.Name = "FrmMain";
this.Text = "U8导入"; this.Text = "U8导入";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false);

View File

@@ -73,7 +73,7 @@ namespace U8AppMain
} }
//private string url = ConfigurationManager.AppSettings.Get("url"); //private string url = ConfigurationManager.AppSettings.Get("url");
// private string connStr = ConfigurationManager.AppSettings.Get("connStr"); // private string connStr = ConfigurationManager.AppSettings.Get("connStr");
private DataTable dataTable; private DataTable dataTable;
@@ -167,9 +167,23 @@ namespace U8AppMain
{ {
return; return;
} }
var bomLookup = new Dictionary<string, Purchase.ufinterface>(); var bomLookup = new Dictionary<string, Purchase.ufinterface>();
try try
{ {
//获取相关物料的信息
var list = new List<string>();
foreach (DataRow row in this.dataTable.Rows)
{
list.Add(row["存货编码"].ToString().Trim());
}
var InvInfo = new NX.ERP.U8.MaterielDAL().GetList(list).ToDictionary((m) => { return m.MaterielCode; });
//构造数据
foreach (DataRow row in this.dataTable.Rows) foreach (DataRow row in this.dataTable.Rows)
{ {
var purchase = new Purchase.ufinterface(); var purchase = new Purchase.ufinterface();
@@ -190,7 +204,8 @@ namespace U8AppMain
{ {
bomLookup.Add(strKey, purchase); bomLookup.Add(strKey, purchase);
} }
body.inventorycode = row["存货编码"].ToString(); body.inventorycode = row["存货编码"].ToString().Trim();
body.taxrate = InvInfo[body.inventorycode].TaxRate;
body.requiredate = purchase.purchaseapp.header.date; body.requiredate = purchase.purchaseapp.header.date;
body.quantity = decimal.Parse(row["数量"].ToString()); body.quantity = decimal.Parse(row["数量"].ToString());
purchase.purchaseapp.body.Add(body); purchase.purchaseapp.body.Add(body);
@@ -441,6 +456,27 @@ namespace U8AppMain
}); ; }); ;
} }
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void FrmMain_Load(object sender, EventArgs e)
{
try
{
NX.ERP.U8.U8LoginContext.Instance.Login();
this.Text =$"[{NX.ERP.U8.U8LoginContext.Instance.AccID}]{NX.ERP.U8.U8LoginContext.Instance.AccName}";
}
catch (Exception)
{
this.Close();
}
}
}
} }

View File

@@ -16,7 +16,7 @@ namespace U8AppMain.Purchase
//public decimal price { get; set; } //public decimal price { get; set; }
//public decimal taxrate { get; set; } public decimal taxrate { get; set; }
//public decimal taxprice { get; set; } //public decimal taxprice { get; set; }

View File

@@ -37,7 +37,7 @@ namespace U8AppMain.Voucher
public bool Add(Vouch vouch) public bool Add(Vouch vouch)
{ {
string accid = NX.ERP.U8.U8LoginContext.Instance.cAcc_id; string accid = NX.ERP.U8.U8LoginContext.Instance.AccID;
var conn = new SqlConnection(this._connStr); var conn = new SqlConnection(this._connStr);

View File

@@ -13,7 +13,7 @@ namespace NX.ERP.U8
{ {
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{ {
var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName,bInvCEnd as IsEnd,iInvCGrade as Level from InventoryClass "; var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName,bInvCEnd as MaterialTypeIsend,iInvCGrade as MaterialTypeGrade from InventoryClass ";
if (!string.IsNullOrEmpty(strWhere)) if (!string.IsNullOrEmpty(strWhere))
{ {
sql += $" where {strWhere}"; sql += $" where {strWhere}";
@@ -36,21 +36,21 @@ namespace NX.ERP.U8
where.Add(" cInvCName like @MaterielTypeName "); where.Add(" cInvCName like @MaterielTypeName ");
} }
if (materielType.Level.HasValue) if (materielType.MaterialTypeGrade.HasValue)
{ {
where.Add(" iInvCGrade=@Level "); where.Add(" iInvCGrade=@Level ");
} }
if (materielType.IsEnd.HasValue) if (materielType.MaterialTypeIsend.HasValue)
{ {
where.Add(" bInvCEnd=@IsEnd "); where.Add(" bInvCEnd=@MaterialTypeIsend ");
} }
return this.GetList(string.Join(" and ", where.ToArray()), new return this.GetList(string.Join(" and ", where.ToArray()), new
{ {
MaterielTypeCode=$"%{materielType.MaterielTypeCode}%", MaterielTypeCode=$"%{materielType.MaterielTypeCode}%",
MaterielTypeName=$"%{materielType.MaterielTypeName}%", MaterielTypeName=$"%{materielType.MaterielTypeName}%",
materielType.Level, materielType.MaterialTypeGrade,
materielType.IsEnd materielType.MaterialTypeIsend
}); });
} }

View File

@@ -123,8 +123,23 @@ namespace NX.ERP.U8
{ {
this._accid = value; this._accid = value;
} }
get {
return this.ClsLogin.get_cAcc_Id();
}
} }
public string AccName
{
get
{
return this.ClsLogin.cAccName;
}
}
public string Serial { get; set; } public string Serial { get; set; }
public string EAIUrl public string EAIUrl
@@ -207,7 +222,9 @@ namespace NX.ERP.U8
{ {
if (!UiLogin.login("DP")) if (!UiLogin.login("DP"))
{ {
throw new Exception(UiLogin.ErrDescript); throw new Exception(UiLogin.ErrDescript);
} }
} }
else else

View File

@@ -17,16 +17,8 @@ using System.Web.Http.Filters;
namespace NX.ERP.WebAPi namespace NX.ERP.WebAPi
{ {
public class JsonContentNegotiator : IContentNegotiator public class JsonContentNegotiator : IContentNegotiator
{ {
private readonly JsonMediaTypeFormatter _jsonFormatter; private readonly JsonMediaTypeFormatter _jsonFormatter;
public JsonContentNegotiator(JsonMediaTypeFormatter formatter) public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
@@ -60,7 +52,7 @@ namespace NX.ERP.WebAPi
{ {
//忽略循环引用,如果设置为Error,则遇到循环引用的时候报错 //忽略循环引用,如果设置为Error,则遇到循环引用的时候报错
ReferenceLoopHandling = ReferenceLoopHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
NullValueHandling = NullValueHandling.Ignore, //NullValueHandling = NullValueHandling.Ignore,
//Formatting = Newtonsoft.Json.Formatting.Indented, //Formatting = Newtonsoft.Json.Formatting.Indented,
//小驼峰命名法 //小驼峰命名法
ContractResolver = new DefaultContractResolver() ContractResolver = new DefaultContractResolver()