diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
new file mode 100644
index 0000000..4655299
--- /dev/null
+++ b/.vs/VSWorkspaceState.json
@@ -0,0 +1,7 @@
+{
+ "ExpandedNodes": [
+ ""
+ ],
+ "SelectedNode": "\\SCP.sln",
+ "PreviewInSolutionExplorer": false
+}
\ No newline at end of file
diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite
index 00279bb..efe54c9 100644
Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ
diff --git a/.vs/新建文件夹 (2)/v16/.suo b/.vs/新建文件夹 (2)/v16/.suo
new file mode 100644
index 0000000..1a151b7
Binary files /dev/null and b/.vs/新建文件夹 (2)/v16/.suo differ
diff --git a/北京北汽/Common/CK.SCP.Common.csproj b/北京北汽/Common/CK.SCP.Common.csproj
index add89b3..e8af561 100644
--- a/北京北汽/Common/CK.SCP.Common.csproj
+++ b/北京北汽/Common/CK.SCP.Common.csproj
@@ -11,7 +11,6 @@
CK.SCP.Common
v4.5.2
512
-
true
diff --git a/北京北汽/Common/app.config b/北京北汽/Common/app.config
index 5573142..b5d2fd5 100644
--- a/北京北汽/Common/app.config
+++ b/北京北汽/Common/app.config
@@ -1,11 +1,11 @@
-
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/北京北汽/Controller/CK.SCP.Controller.csproj b/北京北汽/Controller/CK.SCP.Controller.csproj
index 38c2f8f..fecd84b 100644
--- a/北京北汽/Controller/CK.SCP.Controller.csproj
+++ b/北京北汽/Controller/CK.SCP.Controller.csproj
@@ -11,7 +11,6 @@
CK.SCP.Controller
v4.5.2
512
-
true
@@ -54,6 +53,9 @@
+
+ ..\SCP\bin\Z.EntityFramework.Extensions.dll
+
@@ -72,6 +74,7 @@
+
diff --git a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs
index 768ac29..08fbb4c 100644
--- a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs
@@ -157,7 +157,14 @@ namespace CK.SCP.Controller
throw e;
}
}
-
+ public static TB_ASK Getask(string ASK)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ var site=db.TB_ASK.FirstOrDefault(p=>p.AskBillNum==ASK);
+ return site;
+ }
+ }
///
/// 要货看板减产数量
///
@@ -1234,7 +1241,8 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_ASN _t = new TB_ASN();
- _t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
+ string str1 = "N" + p_ask.VendId;
+ _t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode_BJBQ(str1);
_t.AskBillNum = p_ask.AskBillNum;
_t.PoBillNum = p_ask.PoBillNum;
_t.ReceivedPort = p_ask.ReceivedPort;
@@ -1301,6 +1309,11 @@ namespace CK.SCP.Controller
{
_tDetail.Batch = "000000";
}
+ String str2 = itm.PartCode.Substring(0, 5);
+ if(str2== "SPABJ"&&_t.Site== "BJBMPT")
+ {
+ _tDetail.Batch = "000000";
+ }
db.TB_ASN_DETAIL.Add(_tDetail);
var _order_detail = db.TB_ASK_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
_order_detail.ShippedQty = (decimal)itm.ShippedQty;
@@ -2214,7 +2227,7 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_state == AskState.Confirm)
- {
+ {
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
int count = _ls.Count(p => p.State == (int)AskState.Release);
if (count == _ls.Count && _ls.Count > 0)
@@ -2354,7 +2367,7 @@ namespace CK.SCP.Controller
}
if (p_state == AskState.CompleteForce)
- {
+ {
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
int count = _ls.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
@@ -2602,7 +2615,7 @@ namespace CK.SCP.Controller
return _ret;
}
- public static ResultObject Save_TB_ASK_STATE_BJBQ(List p_list, AskState p_state)
+ public static ResultObject Save_TB_ASK_STATE_BMPT(List p_list, AskState p_state,string site)
{
ResultObject _ret = new ResultObject();
try
@@ -2751,7 +2764,7 @@ namespace CK.SCP.Controller
}
if (p_state == AskState.CompleteForce)
{
- var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
+ var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false&&p.Site==site).ToList();
int count = _ls.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
{
@@ -2764,12 +2777,12 @@ namespace CK.SCP.Controller
}
// p.State = (int)AskState.CompleteForce;
#region 修改发货单
- var _asnList = db.TB_ASN.Where(itm => itm.IsDeleted == false && itm.AskBillNum == p.AskBillNum && itm.State == 0).ToList();
+ var _asnList = db.TB_ASN.Where(itm => itm.IsDeleted == false && itm.AskBillNum == p.AskBillNum && itm.State == 0 && p.Site == site).ToList();
_asnList.ForEach(itm =>
{
itm.State = (int)AsnState.Reject;
itm.IsDeleted = true;
- var _asnDetailList = db.TB_ASN_DETAIL.Where(asn => asn.IsDeleted == false && asn.AsnBillNum == itm.AsnBillNum).ToList();
+ var _asnDetailList = db.TB_ASN_DETAIL.Where(asn => asn.IsDeleted == false && asn.AsnBillNum == itm.AsnBillNum && asn.Site == site).ToList();
_asnDetailList.ForEach(ad =>
{
itm.State = (int)AsnState.Reject;
@@ -2780,13 +2793,13 @@ namespace CK.SCP.Controller
});
db.TB_ASN.AddOrUpdate(_asnList.ToArray());
#endregion
- var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum && itm.IsDeleted == false).ToList();
+ var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum && itm.IsDeleted == false && itm.Site == site).ToList();
_list.ForEach(itm =>
{
itm.AskQty = 0;
- var asn = db.V_TB_ASN_DETAIL.Where(ask => ask.AskBillNum == itm.AskBillNum && ask.IsDeleted == false && (ask.State == (int)AsnState.Ship || ask.State == (int)AsnState.Receive))
- .GroupBy(ask => new { ask.AskBillNum, ask.PoLine, ask.PartCode })
- .Select(ask => new { AsSum = ask.Sum(itm1 => itm1.Qty), PoLine = ask.Key.PoLine, AskBillNum = ask.Key.AskBillNum, PartCode = ask.Key.PartCode }).ToList();
+ var asn = db.V_TB_ASN_DETAIL.Where(ask => ask.AskBillNum == itm.AskBillNum && ask.IsDeleted == false && ask.Site == site && (ask.State == (int)AsnState.Ship || ask.State == (int)AsnState.Receive))
+ .GroupBy(ask => new { ask.AskBillNum, ask.PoLine, ask.PartCode,ask.Site })
+ .Select(ask => new { AsSum = ask.Sum(itm1 => itm1.Qty), PoLine = ask.Key.PoLine, AskBillNum = ask.Key.AskBillNum, PartCode = ask.Key.PartCode, Site=ask.Key.Site}).ToList();
asn.ForEach(itm1 =>
{
@@ -2801,7 +2814,7 @@ namespace CK.SCP.Controller
db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray());
}
);
- db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray());
+ db.TB_ASK.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
@@ -3075,9 +3088,9 @@ namespace CK.SCP.Controller
}
if (p_state == AskState.Release)
{
- var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
+ var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)&&p.State== (int)AskState.New).ToList();
int count = _ls.Count(p => p.State == (int)AskState.New);
- if (count == _ls.Count && _ls.Count > 0)
+ if (count > 0)
{
_ls.ForEach(p =>
{
@@ -3115,7 +3128,7 @@ namespace CK.SCP.Controller
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
- _ret.Message = "选择的记录,有不是新建状态记录!";
+ _ret.Message = "选择的记录,都不是新建状态记录!";
}
}
if (p_state == AskState.Reject)
diff --git a/北京北汽/Controller/SCP_ASN_CONTROLLER.cs b/北京北汽/Controller/SCP_ASN_CONTROLLER.cs
index ec0c424..c486305 100644
--- a/北京北汽/Controller/SCP_ASN_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_ASN_CONTROLLER.cs
@@ -725,7 +725,7 @@ namespace CK.SCP.Controller
_print.MaterialPlanner = _asn.Buyer;
_print.CAAIPhone = "";
_print.CAAIFax = "";
-
+
using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance())
{
@@ -741,7 +741,7 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
- var ask = db.TB_ASK.SingleOrDefault(t => t.AskBillNum == _asn.AskBillNum);
+ var ask = db.TB_ASK.SingleOrDefault(t => t.AskBillNum == _asn.AskBillNum&&t.Site==_asn.Site);
_print.EnglishAddress = ask.Extend1;
var phone1 = db.TB_ADDRESS.Count(t => t.Address == ask.Extend1);
if (phone1 > 0)
@@ -749,7 +749,7 @@ namespace CK.SCP.Controller
var phone = db.TB_ADDRESS.SingleOrDefault(t => t.Address == ask.Extend1);
_print.CAAIPhone = phone.NamePone;
}
-
+ _print.CAAIFax = ask.Remark;
}
}
var dt = ConvertHelper.ToDataTable(new List { _print });
diff --git a/北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs b/北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs
index 239c1cd..bcd8c08 100644
--- a/北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs
@@ -188,6 +188,13 @@ namespace CK.SCP.Controller
return db.TB_ASN.Where(p => p.AsnBillNum==asn).FirstOrDefault();
}
}
+ public static List GetBacode(string asn)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TS_BARCODE.Where(p => p.BillNum == asn).ToList();
+ }
+ }
public static void Get_TS_BARCODE_List(TS_BARCODE p_entity, Action>> p_action)
{
ResultObject> _ret = new ResultObject>();
diff --git a/北京北汽/Controller/SCP_BILLCODE_CONTROLLER.cs b/北京北汽/Controller/SCP_BILLCODE_CONTROLLER.cs
index 508c4b8..cf23a48 100644
--- a/北京北汽/Controller/SCP_BILLCODE_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_BILLCODE_CONTROLLER.cs
@@ -42,6 +42,12 @@ namespace CK.SCP.Controller
return GetTablePK("N", "TB_ASN", "AsnBillNum", "yyMMdd", 4);
+ }
+ public static string MakeASNCode_BJBQ(string str)
+ {
+
+ return GetTablePK(str, "TB_ASN", "AsnBillNum", "yyMMdd", 4);
+
}
public static string MakePalletCode()
{
diff --git a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs b/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
index 74df8c3..4ef0196 100644
--- a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
@@ -401,19 +401,13 @@ namespace CK.SCP.Controller
case "TED_RECEIPT_MSTR":
if (_task.Creator == "QAD")
{
- TimeSpan nowDt = DateTime.Now.TimeOfDay;
- TimeSpan workstartDT = DateTime.Parse("1:00").TimeOfDay;
- TimeSpan workendDT = DateTime.Parse("4:00").TimeOfDay;
- if (nowDt < workstartDT || nowDt > workendDT)
- {
- result = UpdateRecive(db, scpdb, _task);
- Update_TEA_TASK_SUB(db, _task);
- EntitiesFactory.SaveDb(scpdb);
- EntitiesFactory.SaveDb(db);
- EntitiesFactory.SaveDb(dc);
- scope.Complete();
- result.Message = _task.TaskID.ToString();
- }
+ result = UpdateRecive(db, scpdb, _task);
+ Update_TEA_TASK_SUB(db, _task);
+ EntitiesFactory.SaveDb(scpdb);
+ EntitiesFactory.SaveDb(db);
+ EntitiesFactory.SaveDb(dc);
+ scope.Complete();
+ result.Message = _task.TaskID.ToString();
}
else
{
@@ -446,10 +440,7 @@ namespace CK.SCP.Controller
EntitiesFactory.SaveDb(authdb);
scope.Complete();
UpdateSupplierExtend(_supplierlist);
- break;
- //case "TES_SUPPLIER_PART":
- // result = UpdateSupplierPart(dc, db, scpdb, _task);
- // break;
+ break;
case "TES_PART_MSTR":
result = UpdatePart(db, scpdb, _task);
result.Message = _task.TaskID.ToString();
@@ -528,8 +519,8 @@ namespace CK.SCP.Controller
{
ScpEntities scpdb = EntitiesFactory.CreateScpInstance();
ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
- var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "CQBMPT").OrderBy(p => p.UID).ToList();
- var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "CQBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
+ var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "BJBMPT").OrderBy(p => p.UID).ToList();
+ var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "BJBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
var apiii = _list1.Count();
if (apiii > 0) {
@@ -1080,7 +1071,8 @@ namespace CK.SCP.Controller
_entity.Domain = _po.Domain;
_entity.Site = _po.Site;
_entity.Scheduleweeks = 2;
- _entity.DueDate = detail.PutTime;
+ _entity.DueDate = detail.PutTime;
+ _entity.PoType = detail.ModType;
db.TED_POD_DET.Add(_entity);
_ls.Add(_entity);
detail.State = (int)BillState.Finish;
@@ -2033,72 +2025,69 @@ namespace CK.SCP.Controller
///
public static ResultObject UpdateSupplier(List p_list, ScpEntities scpdb, AppBoxContext authdb, TEA_TASK_SUB p_entity)
{
+ Dictionary _dic = new Dictionary();
+ _dic.Add("BJBMPT", "BJ01");
+ _dic.Add("CQBMPT", "CQ01");
+ _dic.Add("ZZBMPT", "ZZ01");
+ _dic.Add("HFBMPT", "HF01");
ResultObject _ret = new ResultObject();
try
- {
-
+ {
var _venderlist = new List();
foreach (var supplier in p_list)
- {
- var _supplier = scpdb.TA_VENDER.SingleOrDefault(p => p.VendId == supplier.SupplierCode );
- if (_supplier == null)
+ {
+ foreach (var item in _dic)
{
- _supplier = new TA_VENDER
- {
- VendId = supplier.SupplierCode.ToUpper(),
- VendAbbCode = "0",
- State = 1,
- };
- }
- _supplier.VendName = string.IsNullOrEmpty(supplier.SupplierName) ? supplier.SupplierName : supplier.SupplierName;//供应商名称
- //_supplier.VendType = supplier.SupplierType.ToUpper().ToString();//供应商类型
- //_supplier.Country = supplier.Country;//国家
- //_supplier.City = supplier.City;//城市
- //_supplier.Currency = supplier.Currency.ToUpper();//币总
- //_supplier.Address = supplier.Address1 + supplier.Address2 + supplier.Address3;//地址
- //_supplier.ZipCode = supplier.ZipCode.ToString();//邮编
- //_supplier.Contacter = supplier.ContactName;//联系人
- //_supplier.Phone = supplier.Telephone.ToString();//电话
- //_supplier.Fax = supplier.Fax.ToString();//传真
- _supplier.SubSite = string.IsNullOrEmpty(supplier.Site)?"BJ01" : supplier.Site;//域
- _supplier.Site = string.IsNullOrEmpty(supplier.Domain)?"BJBMPT": supplier.Domain;//域
- //_supplier.Tax = Convert.ToDecimal(supplier.TaxInCity);//税率
-
- _supplier.Remark = supplier.TaskID.ToString();//任务ID
-
- var vendname = string.Format("{0}@{1}",_supplier.VendId.ToUpper(), _supplier.Site.ToUpper());
- var _first = authdb.Users.Where(p => p.Name == vendname).FirstOrDefault();
- var _vend = authdb.Roles.Where(p => p.Name == "供应商").FirstOrDefault();
- var _factory = authdb.TA_FACTORY.Where(p => p.ErpDomain == _supplier.Site.ToUpper()).FirstOrDefault();
- if (_first == null && _vend != null && _factory != null)
- {
- User _entity = new User();
- _entity.Name = vendname;
- _entity.Remark = _supplier.Site.ToUpper();
- _entity.Password = PasswordUtil.CreateDbPassword("99999999");
- _entity.ChineseName = _supplier.VendName;
- _entity.Email = _supplier.VendId + "@163.com";
- _entity.Gender = "男";
- _entity.Enabled = true;
- _entity.Roles = new List();
- Role t = authdb.Set().Local.Where(x => x.ID == _vend.ID).FirstOrDefault();
- if (t == null)
+ var _supplier = scpdb.TA_VENDER.FirstOrDefault(p => p.VendId == supplier.SupplierCode && p.Site == item.Key);
+ if (_supplier == null)
{
- t = new Role { ID = _vend.ID };
- authdb.Set().Attach(t);
+ _supplier = new TA_VENDER
+ {
+ VendId = supplier.SupplierCode.ToUpper(),
+ VendAbbCode = "0",
+ State = 1,
+ };
}
- _entity.Roles.Add(t);
- _entity.TA_FACTORY = new List();
- TA_FACTORY f = authdb.Set().Local.Where(x => x.ID == _factory.ID).FirstOrDefault();
- if (f == null)
+ _supplier.VendName = string.IsNullOrEmpty(supplier.SupplierName) ? supplier.SupplierName : supplier.SupplierName;
+
+ _supplier.SubSite = item.Value;//地点
+ _supplier.Site = item.Key;//域
+ _supplier.Remark = supplier.TaskID.ToString();//任务ID
+
+ var vendname = string.Format("{0}@{1}", _supplier.VendId.ToUpper(), _supplier.Site.ToUpper());
+ var _first = authdb.Users.Where(p => p.Name == vendname).FirstOrDefault();
+ var _vend = authdb.Roles.Where(p => p.Name == "供应商").FirstOrDefault();
+ var _factory = authdb.TA_FACTORY.Where(p => p.ErpDomain == _supplier.Site.ToUpper()).FirstOrDefault();
+ if (_first == null && _vend != null && _factory != null)
{
- f = new TA_FACTORY { ID = _factory.ID };
- authdb.Set().Attach(f);
+ User _entity = new User();
+ _entity.Name = vendname;
+ _entity.Remark = _supplier.Site.ToUpper();
+ _entity.Password = PasswordUtil.CreateDbPassword("99999999");
+ _entity.ChineseName = _supplier.VendName;
+ _entity.Email = _supplier.VendId + "@163.com";
+ _entity.Gender = "男";
+ _entity.Enabled = true;
+ _entity.Roles = new List();
+ Role t = authdb.Set().Local.Where(x => x.ID == _vend.ID).FirstOrDefault();
+ if (t == null)
+ {
+ t = new Role { ID = _vend.ID };
+ authdb.Set().Attach(t);
+ }
+ _entity.Roles.Add(t);
+ _entity.TA_FACTORY = new List();
+ TA_FACTORY f = authdb.Set().Local.Where(x => x.ID == _factory.ID).FirstOrDefault();
+ if (f == null)
+ {
+ f = new TA_FACTORY { ID = _factory.ID };
+ authdb.Set().Attach(f);
+ }
+ _entity.TA_FACTORY.Add(f);
+ authdb.Users.Add(_entity);
}
- _entity.TA_FACTORY.Add(f);
- authdb.Users.Add(_entity);
+ _venderlist.Add(_supplier);
}
- _venderlist.Add(_supplier);
}
scpdb.TA_VENDER.AddOrUpdate(_venderlist.ToArray());
_ret.State = ReturnStatus.Succeed;
@@ -2223,11 +2212,14 @@ namespace CK.SCP.Controller
ResultObject _ret = new ResultObject();
try
{
- var _partmstrlist = db.TES_PART_MSTR.Where(p => p.TaskID == p_entity.TaskID).ToList();
+ var _partmstrlist = db.TES_PART_MSTR.Where(p => p.TaskID == p_entity.TaskID&&p.CommandType!="D").ToList();
+ var _partmstrlistD = db.TES_PART_MSTR.Where(p => p.TaskID == p_entity.TaskID&&p.CommandType=="D").ToList();
var _partlist = new List();
+ var _partlistD = new List();
foreach (var part in _partmstrlist)
- {
+ {
var _part = scpdb.TA_PART.SingleOrDefault(p => p.PartCode == part.PartCode && p.Site == part.Domain );
+
if (_part == null)
{
_part = new TA_PART
@@ -2268,15 +2260,31 @@ namespace CK.SCP.Controller
}
_part.Qlevel = string.IsNullOrEmpty(part.Qgrade)?string.Empty: part.Qgrade;
_part.State = part.Status;
- _part.Site = part.Domain;
+ _part.Site = part.Domain;
// _part.SubSite = part.Site;
_part.Remark = part.TaskID.ToString();
_partlist.Add(_part);
}
-
+ if (_partmstrlistD.Count() > 0)
+ {
+ foreach (var depart in _partmstrlistD)
+ {
+ var _part = scpdb.TA_PART.FirstOrDefault(p => p.PartCode == depart.PartCode && p.Site == depart.Domain);
+ if (_part != null)
+ {
+ _partlistD.Add(_part);
+ }
+ }
+ }
+
var str= JsonHelper.GetJson>(_partlist);
scpdb.TA_PART.AddOrUpdate(_partlist.ToArray());
+ if (_partlistD.Count() > 0)
+ {
+ scpdb.TA_PART.DeleteRangeByKey(_partlistD.ToArray());
+ }
+
_ret.State = ReturnStatus.Succeed;
_ret.MessageList.Add(string.Format("更新表{0}任务ID{1}成功!", "TES_PART_MSTR", p_entity.TaskID));
}
@@ -2429,22 +2437,24 @@ namespace CK.SCP.Controller
_item.PoUnit = _price.Unit;//单位
}
- //_item.CreateUser = "scp";//_price.CreateUser;//创建人
- // _item.CreateTime = DateTime.Now;//_price.CreateTime;//创建时间
- // _item.GUID = Guid.NewGuid();//GUID
- // _item.PriceList = (_vend + _site.Substring(1, 1) + _site.Substring(3, 1)).Trim(); //价目表代码
-
- // }
- ////说明
- // _item.ProductLine = "";//产品类
-
+ if(_domain == "BJBMPT")
+ {
- // _item.AmountType = "P";//金额类型
- // _item.Amount = _price.Amt+_price.SharingPrice;//金额(零件单价—+分摊单价)
- // _item.TaskID = _taskguid;//任务编号
- // _item.Remark = _price.Remarks;//备注
- // _item.SupplierCode = _vend;//供应商
- // _item.VendAmount = _price.Amt;//供应商金额
+ var po = scpdb.V_TB_PO_DETAIL.Count(p => p.PartCode == _partCode&&p.Site== "BJBMPT"&&p.VendId== _vend.Trim());
+ if (po > 0)
+ {
+ var _list = scpdb.V_TB_PO_DETAIL.Where(p => p.PartCode == _partCode && p.Site == "BJBMPT" && p.VendId == _vend.Trim()).ToList();
+ foreach(var b in _list)
+ {
+ var PP = scpdb.TB_PO_DETAIL.FirstOrDefault(p => p.PartCode == b.PartCode && p.Site == "BJBMPT" && p.PoBillNum == b.PoBillNum);
+ PP.Price = _item.Price;
+ scpdb.TB_PO_DETAIL.AddOrUpdate(PP);
+ }
+
+
+ }
+
+ }
_teslist.Add(_item);
}
@@ -2471,6 +2481,84 @@ namespace CK.SCP.Controller
}
return _ret;
}
+
+ public static ResultObject UpdateTES_PURCHASE_PRICE_TemporaryPrice(List p_list, string domain, string site, string name, bool flag)
+ {
+
+ ResultObject _ret = new ResultObject();
+
+ try
+ {
+ ScpEntities scpdb = EntitiesFactory.CreateScpInstance();
+ ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
+ List _teslist = new List();
+ var _ls = scpdb.V_TB_PRICE_TemporaryPrice.Where(p => p_list.Contains(p.UID)).ToList();
+
+ foreach (var _price in _ls)
+ {
+ Guid _taskguid = Guid.NewGuid();
+ TS_UNI_API _item = new TS_UNI_API();
+
+
+ var _vend = _price.VendId.Trim();
+ var _partCode = _price.PartCode.Trim();
+ var _domain = _price.Site.Trim();
+ var _site = _price.SubSite.Trim();
+ _item.BillNum = (_vend + _site.Substring(1, 1) + _site.Substring(3, 1)).Trim();
+ _item.InterfaceType = "Price";
+
+ _item.Batch = "No";
+
+ _item.Qty = _price.Amt + _price.SharingPrice;
+ _item.Price = _price.Amt;
+ _item.State = 1;
+ _item.ValidDate = DateTime.Now;
+ _item.ErpLineNum = 1;
+ _item.PartCode = _partCode;//零件编号
+ _item.Domain = _domain;//域
+ _item.Site = _site;//地点
+ _item.Extend1 = _price.Remarks;
+ _item.CreateTime = Convert.ToDateTime(_price.StartTime);//开始时间
+ _item.PutTime = Convert.ToDateTime(_price.EndTime);//结束时间
+ _item.CreateOper = _price.Creator;
+ _item.Currency = _price.Curr;//货币
+ var _first = scpdb.TA_PART.Where(itm => itm.PartCode == _partCode).FirstOrDefault();
+ if (_first != null)
+ {
+ _item.PoUnit = _first.Unit;
+ }
+ else
+ {
+
+ _item.PoUnit = _price.Unit;//单位
+ }
+
+ _teslist.Add(_item);
+
+ }
+
+ scpdb.TS_UNI_API.AddOrUpdate(_teslist.ToArray());
+
+ if (scpdb.SaveChanges() != -1)
+ {
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = true;
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.Message = "数据更新失败!";
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.Message = e.InnerException.Message;
+ }
+ return _ret;
+ }
public static ResultObject WritePo(List p_order_list, string site, string p_creator, DateTime p_time, BillModType p_modtype, string subsite, string p_chineseName, string p_buyerPhone)
{
ResultObject _ret = new ResultObject();
@@ -2510,6 +2598,7 @@ namespace CK.SCP.Controller
_po.BuyerPhone = p_buyerPhone;
_po.Remark = _entity.备注;
_po.IsDeleted = false;
+ _po.State = (int)PoState.Open;
_po.CreateTime = DateTime.Now;
_po.CreateUser = p_creator;
_po.BeginTime = string.IsNullOrEmpty(_entity.订单创建时间) ? DateTime.Now : DateTime.Parse(_entity.订单创建时间);
@@ -2524,7 +2613,7 @@ namespace CK.SCP.Controller
TB_PO_DETAIL _PO_Detail = new TB_PO_DETAIL();
_PO_Detail.Currency = "CNY";
_PO_Detail.PoBillNum = _po.PoBillNum;
- _PO_Detail.PartCode = itm.零件号;
+ _PO_Detail.PartCode = itm.零件号.Trim();
var part = scpdb.TA_PART.FirstOrDefault(t => t.PartCode == itm.零件号 && t.Site == _po.Site);
_PO_Detail.PoLine =int.Parse(itm.行号);
_PO_Detail.PoUnit = part.Unit;
@@ -2536,6 +2625,7 @@ namespace CK.SCP.Controller
_PO_Detail.IsDeleted = false;
_PO_Detail.LocUnit = part.Unit;
_PO_Detail.UnConv = 1;
+ _PO_Detail.State= (int)PoState.Open;
_PO_Detail.Remark = itm.备注;
_PO_Detail.Price = string.IsNullOrEmpty(itm.单价) ? 0 : decimal.Parse(itm.单价);
_PO_Detail.Workorderlot = string.IsNullOrEmpty(itm.加工单号) ? 0 : int.Parse(itm.加工单号);
@@ -2555,17 +2645,17 @@ namespace CK.SCP.Controller
TS_UNI_API Ts = new TS_UNI_API();
Ts.InterfaceType = "PO";
Ts.TableName = "TS_UNI_API";
- Ts.Batch = _entity.供应商编号;
+ Ts.Batch = _entity.供应商编号.Trim().ToUpper();
Ts.BillType = 702;
Ts.SubBillType = 1;
Ts.BillNum = _entity.订单编号.Trim().ToUpper();
- Ts.PartCode = _PO_Detail.PartCode;
+ Ts.PartCode = _PO_Detail.PartCode.Trim();
Ts.Qty = decimal.Parse(_entity.数量);
Ts.State = 1;
Ts.CreateOper = _entity.联系人;
Ts.CreateTime = string.IsNullOrEmpty(_entity.订单创建时间) ? DateTime.Now : DateTime.Parse(_entity.订单创建时间);
Ts.PutTime = string.IsNullOrEmpty(_entity.要求到货日期) ? DateTime.Now : DateTime.Parse(_entity.要求到货日期);
- Ts.VendId = _entity.供应商编号;
+ Ts.VendId = _entity.供应商编号.Trim().ToUpper();
Ts.PoUnit = part.Unit;
Ts.LocUnit = part.Unit;
Ts.ValidDate = string.IsNullOrEmpty(_entity.订单截至日期) ? DateTime.Now.AddYears(10) : DateTime.Parse(_entity.订单截至日期);
@@ -2579,7 +2669,11 @@ namespace CK.SCP.Controller
Ts.Extend2 = _entity.备注;
Ts.CreateOper= _entity.采购员;
Ts.VendBatch= p_creator;
- Ts.ErpLineNum = _PO_Detail.PoLine;
+ Ts.ErpLineNum = _PO_Detail.PoLine;
+ if (_entity.订单类型.ToUpper() == "S")
+ {
+ Ts.ModType = _entity.订单类型.ToUpper();
+ }
scpdb.TB_PO_DETAIL.AddOrUpdate(_PO_Detail);
scpdb.TS_UNI_API.Add(Ts);
});
@@ -2699,17 +2793,17 @@ namespace CK.SCP.Controller
TS_UNI_API Ts = new TS_UNI_API();
Ts.InterfaceType = "PO";
Ts.TableName = "TS_UNI_API";
- Ts.Batch = _entity.供应商编号;
+ Ts.Batch = _entity.供应商编号.Trim().ToUpper();
Ts.BillType = 702;
Ts.SubBillType = 2;
Ts.BillNum = _po.PoBillNum.Trim().ToUpper();
- Ts.PartCode = _tDetail.PartCode;
+ Ts.PartCode = _tDetail.PartCode.Trim().ToUpper();
Ts.Qty = _tDetail.AskQty;
Ts.State = 1;
Ts.CreateOper = _entity.联系人;
Ts.CreateTime = string.IsNullOrEmpty(_entity.订单创建时间) ? DateTime.Now : DateTime.Parse(_entity.订单创建时间);
Ts.PutTime = string.IsNullOrEmpty(_entity.要求到货日期) ? DateTime.Now : DateTime.Parse(_entity.要求到货日期);
- Ts.VendId = _entity.供应商编号;
+ Ts.VendId = _entity.供应商编号.Trim().ToUpper();
Ts.PoUnit = part.Unit;
Ts.LocUnit = part.Unit;
Ts.ValidDate = string.IsNullOrEmpty(_entity.订单截至日期) ? DateTime.Now.AddYears(10) : DateTime.Parse(_entity.订单截至日期);
@@ -2723,7 +2817,15 @@ namespace CK.SCP.Controller
Ts.CreateOper = _entity.采购员;
Ts.VendBatch = p_creator;
Ts.ErpBillNum= _po.PoBillNum;
- Ts.ErpLineNum = _PO_Detail.PoLine;
+ Ts.ErpLineNum = _PO_Detail.PoLine;
+ if (!string.IsNullOrEmpty(_entity.订单类型))
+ {
+ if (_entity.订单类型.ToUpper() == "S")
+ {
+ Ts.ModType = _entity.订单类型.ToUpper();
+ }
+ }
+
scpdb.TB_ASK_DETAIL.Add(_tDetail);
scpdb.TB_PO_DETAIL.AddOrUpdate(_PO_Detail);
scpdb.TS_UNI_API.Add(Ts);
@@ -2804,6 +2906,7 @@ namespace CK.SCP.Controller
_po.Contacter = p_chineseName;// _entity.联系人;
_po.Buyer = p_chineseName;// _entity.联系人;
_po.Site = site.Trim().ToUpper();
+ _po.State= (int)PoState.Open;
_po.BuyerPhone = p_buyerPhone;
_po.Remark = _entity.备注;
_po.IsDeleted = false;
@@ -2853,21 +2956,21 @@ namespace CK.SCP.Controller
TS_UNI_API Ts = new TS_UNI_API();
Ts.InterfaceType = "PO";
Ts.TableName = "TS_UNI_API";
- Ts.Batch = _entity.供应商编号;
+ Ts.Batch = _entity.供应商编号.Trim();
Ts.BillType = 702;
Ts.SubBillType = 1;
Ts.BillNum = _entity.订单编号.Trim().ToUpper();
- Ts.PartCode = _PO_Detail.PartCode;
+ Ts.PartCode = _PO_Detail.PartCode.Trim();
Ts.Qty = decimal.Parse(_entity.数量);
Ts.State = 1;
Ts.CreateOper = _entity.联系人;
Ts.CreateTime = string.IsNullOrEmpty(_entity.订单创建时间) ? DateTime.Now : DateTime.Parse(_entity.订单创建时间);
Ts.PutTime = string.IsNullOrEmpty(_entity.要求到货日期) ? DateTime.Now : DateTime.Parse(_entity.要求到货日期);
- Ts.VendId = _entity.供应商编号;
+ Ts.VendId = _entity.供应商编号.Trim();
Ts.PoUnit = part.Unit;
Ts.LocUnit = part.Unit;
Ts.ValidDate = string.IsNullOrEmpty(_entity.订单截至日期) ? DateTime.Now.AddYears(10) : DateTime.Parse(_entity.订单截至日期);
- Ts.ErpBillNum = _entity.订单编号;
+ Ts.ErpBillNum = _entity.订单编号.Trim();
Ts.Buyer = _entity.采购员;
Ts.BuyerPhone = _entity.采购员电话;
Ts.Price = decimal.Parse(_entity.单价);
@@ -2920,7 +3023,7 @@ namespace CK.SCP.Controller
_PO_Detail.PartCode = itm.零件号.Trim().ToUpper();
var part = scpdb.TA_PART.FirstOrDefault(t => t.PartCode == itm.零件号 && t.Site == _po.Site);
_PO_Detail.PoLine = _number;
- _PO_Detail.PoBillNum = _po.PoBillNum;
+ _PO_Detail.PoBillNum = _po.PoBillNum.Trim();
_PO_Detail.State = (int)PoState.Open;
_PO_Detail.Site = site.Trim().ToUpper();
_PO_Detail.SubSite = subsite.Trim().ToUpper();
@@ -2954,17 +3057,17 @@ namespace CK.SCP.Controller
TS_UNI_API Ts = new TS_UNI_API();
Ts.InterfaceType = "PO";
Ts.TableName = "TS_UNI_API";
- Ts.Batch = _entity.供应商编号;
+ Ts.Batch = _entity.供应商编号.Trim();
Ts.BillType = 702;
Ts.SubBillType = 2;
Ts.BillNum = _po.PoBillNum.Trim().ToUpper();
- Ts.PartCode = _PO_Detail.PartCode;
+ Ts.PartCode = _PO_Detail.PartCode.Trim();
Ts.Qty = _PO_Detail.PlanQty;
Ts.State = 1;
Ts.CreateOper = _entity.联系人;
Ts.CreateTime = string.IsNullOrEmpty(_entity.订单创建时间) ? DateTime.Now : DateTime.Parse(_entity.订单创建时间);
Ts.PutTime = string.IsNullOrEmpty(_entity.要求到货日期) ? DateTime.Now : DateTime.Parse(_entity.要求到货日期);
- Ts.VendId = _entity.供应商编号;
+ Ts.VendId = _entity.供应商编号.Trim();
Ts.PoUnit = part.Unit;
Ts.LocUnit = part.Unit;
Ts.ValidDate = string.IsNullOrEmpty(_entity.订单截至日期) ? DateTime.Now.AddYears(10) : DateTime.Parse(_entity.订单截至日期);
@@ -2977,13 +3080,13 @@ namespace CK.SCP.Controller
Ts.Extend2 = _entity.备注;
Ts.CreateOper = _entity.采购员;
Ts.VendBatch = p_creator;
- Ts.ErpBillNum = _po.PoBillNum;
+ Ts.ErpBillNum = _po.PoBillNum.Trim();
Ts.ErpLineNum = _number;
scpdb.TB_PO_DETAIL.AddOrUpdate(_PO_Detail);
scpdb.TS_UNI_API.Add(Ts);
_number++;
});
- _polist = _polist + _po.PoBillNum + ",";
+ _polist = _polist + _po.PoBillNum.Trim() + ",";
}
#endregion
}
diff --git a/北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs b/北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs
index 999814b..9ec769f 100644
--- a/北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs
@@ -53,6 +53,8 @@ namespace CK.SCP.Controller
{
var po_detail = new SCP_PO_DETAIL_EXPORT();
po_detail.订单编号 = itm.PoBillNum;
+ po_detail.供应商编码 = itm.VendId;
+ po_detail.供应商名称 = itm.VendName;
po_detail.状态 = itm.State_DESC;
po_detail.行号 = itm.PoLine.ToString();
po_detail.零件名 = itm.PartDesc1;
@@ -190,7 +192,7 @@ namespace CK.SCP.Controller
_detailList.ForEach(itm =>
{
SCP_ASK_DETAIL_EXPORT _entity = new SCP_ASK_DETAIL_EXPORT();
- _entity.要货单号 = itm.AskBillNum;
+ _entity.要货单号 = itm.AskBillNum;
_entity.行号 = itm.PoLine.ToString();
_entity.零件名称 = itm.PartDesc1;
_entity.零件号 = itm.PartCode;
@@ -200,6 +202,7 @@ namespace CK.SCP.Controller
_entity.价格 = itm.Price.ToString();
_entity.要货数量 = itm.AskQty.ToString();
_entity.说明 = string.IsNullOrEmpty(itm.Remark)?string.Empty:itm.Remark.ToString();
+ _entity.订货日期 = itm.BeginTime == null ? string.Empty : itm.BeginTime.Value.ToString("yyyyMMdd");
_exportDetailList.Add(_entity);
});
@@ -267,10 +270,7 @@ namespace CK.SCP.Controller
var _po = db.TB_PRICE.Where(p => p_lst.Contains(p.UID.ToString())).ToList();
- var _po1 = _po.Select(p => p_lst.Contains(p.UID.ToString())).ToList();
-
-
- //var _ls = polist.Where(itm => partlist.Contains(itm));
+
_po.ForEach(itm =>
{
diff --git a/北京北汽/Controller/SCP_LOGINNUMBER_CONTROLLER.cs b/北京北汽/Controller/SCP_LOGINNUMBER_CONTROLLER.cs
new file mode 100644
index 0000000..8a818b0
--- /dev/null
+++ b/北京北汽/Controller/SCP_LOGINNUMBER_CONTROLLER.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Infrastructure;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Utils;
+using System.Data.Entity.Core;
+using CK.SCP.Models.Enums;
+using CK.SCP.Models.AppBoxEntity;
+
+namespace CK.SCP.Controller
+{
+ public class SCP_LOGINNUMBER_CONTROLLER
+ {
+ public static TA_LOGINNUMBER GetlistUserNumber(string username)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_LOGINNUMBER.Where(p => p.Name == username).FirstOrDefault();
+ }
+ }
+ public static ResultObject Save_TA_LOGINNUMBER(string username, LoginNumer p_state,string date)
+ {
+ ResultObject _ret = new ResultObject();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance())
+ {
+ var user = _appdb.Users.FirstOrDefault(t => t.Name == username);
+
+ if (user == null)
+ {
+ _ret.MessageList.Add("用户名"+ username+"不存在,请输入正确用户名");
+ }
+ else
+ {
+ var login = db.TA_LOGINNUMBER.FirstOrDefault(p => p.Name == username);
+ if (p_state == LoginNumer.Sussess && login != null)
+ {
+ db.TA_LOGINNUMBER.Remove(login);
+ }
+
+ if (login != null && p_state == LoginNumer.Faile)
+ {
+ if (login.Number == 4&&login.Time==date)
+ {
+ login.Number = 5;
+ db.TA_LOGINNUMBER.AddOrUpdate(login);
+
+ user.Enabled = false;
+ _appdb.Users.AddOrUpdate(user);
+ _appdb.SaveChanges();
+
+ _ret.MessageList.Add("因您连续五次输入密码错误,该账号已经被设为未启用状态,请联系系统管理员");
+ }
+ else if(login.Number <4 && login.Time == date)
+ {
+ login.Number = login.Number + 1;
+ db.TA_LOGINNUMBER.AddOrUpdate(login);
+ }else if(login.Time != date)
+ {
+ login.Time = date;
+ login.Number = 1;
+ db.TA_LOGINNUMBER.AddOrUpdate(login);
+ }
+ }
+ else if (login == null && p_state == LoginNumer.Faile)
+ {
+ TA_LOGINNUMBER log = new TA_LOGINNUMBER();
+ log.Name = username;
+ log.Number = 1;
+ log.Time = DateTime.Now.ToShortDateString();
+ db.TA_LOGINNUMBER.AddOrUpdate(log);
+ }
+ }
+ }
+
+ if (db.SaveChanges() != -1)
+ {
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = true;
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ }
+ }
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_LOGINNUMBER_CONTROLLER), "Save_TA_LOGINNUMBER", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_LOGINNUMBER_CONTROLLER), "Save_TA_LOGINNUMBER", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_LOGINNUMBER_CONTROLLER), "Save_TA_LOGINNUMBER", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_LOGINNUMBER_CONTROLLER), "Save_TA_LOGINNUMBER", e.Message);
+ _ret.Result = false;
+ _ret.ErrorList.Add(e);
+ throw e;
+ }
+ return _ret;
+ }
+ }
+}
diff --git a/北京北汽/Controller/SCP_PO_CONTROLLER.cs b/北京北汽/Controller/SCP_PO_CONTROLLER.cs
index 8dea5f5..540b479 100644
--- a/北京北汽/Controller/SCP_PO_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_PO_CONTROLLER.cs
@@ -96,10 +96,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.BeginTime <= p_entity.EndTime);
}
- if (p_entity.UserInAddress.FirstOrDefault() != null && p_entity.UserInAddress.Count > 0)
- {
- q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
- }
+ //if (p_entity.UserInAddress.FirstOrDefault() != null && p_entity.UserInAddress.Count > 0)
+ //{
+ // q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
+ //}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
@@ -1053,7 +1053,7 @@ namespace CK.SCP.Controller
}
else
{
- if (p_excel.币种 != "CNY" && p_excel.币种 != "EUR" &&p_excel.币种 != "USD")
+ if (p_excel.币种 != "CNY" && p_excel.币种 != "EUR" && p_excel.币种 != "USD")
{
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】币种填写错误,只能是CNY或者EUR或者USD!", p_excel.供应商编号, p_excel.零件编码));
}
@@ -1071,7 +1071,7 @@ namespace CK.SCP.Controller
DateTime dd1 = st1.AddYears(10);
int b = int.Parse(p_excel.是否临时价格);
var Th = db.TB_PRICE.SingleOrDefault(p => p.UID.ToString() == p_excel.标识 && p.VendId == p_excel.供应商编号 && p.PartCode == p_excel.零件编码
- && p.Amt == st4 && p.SubSite == p_excel.地点 && p.EndTime == st6 && p.StartTime == st5&&p.Curr==p_excel.币种&&p.Unit==p_excel.单位
+ && p.Amt == st4 && p.SubSite == p_excel.地点 &&p.Curr==p_excel.币种&&p.Unit==p_excel.单位
);
if (Th == null)
{
@@ -1079,6 +1079,15 @@ namespace CK.SCP.Controller
}
else
{
+ if ((DateTime.Parse(Th.StartTime.ToString())).ToShortDateString()!=st3.ToShortDateString()|| (DateTime.Parse(Th.EndTime.ToString())).ToShortDateString() != st2.ToShortDateString())
+ {
+ ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号));
+ }
+ DateTime STA =DateTime.Parse(Th.StartTime.ToString());
+ if(DateTime.Parse(STA.ToShortDateString())!= st3)
+ {
+ ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号));
+ }
if (Th.State != (int)PriceState.FConfirm)
{
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】不是财务已审核的数据,不能导入!", p_excel.标识, p_excel.供应商编号));
@@ -1138,12 +1147,12 @@ namespace CK.SCP.Controller
}
else
{
- if(p_excel.币种 != "CNY" && p_excel.币种 != "EUR" && p_excel.币种 != "USD")
+ if (p_excel.币种 != "CNY"&& p_excel.币种 != "EUR" && p_excel.币种 != "USD")
{
- ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】币种填写错误,只能是CNY!", p_excel.供应商编号, p_excel.零件编码));
+ ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】币种填写错误,只能是CNY或者EUR或者USD!", p_excel.供应商编号, p_excel.零件编码));
}
var Site = db.TB_FACTORY.Where(p=>p.ErpSite== p_excel.域).FirstOrDefault();
- var _first = db.TA_PART.Where(p => p.PartCode == p_excel.零件编码 && p.State.ToUpper() != "SP"&&p.Site== p_excel.域).FirstOrDefault();
+ var _first = db.TA_PART.Where(p => p.PartCode == p_excel.零件编码 &&p.Site== p_excel.域).FirstOrDefault();
if (_first == null)
{
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.供应商编号, p_excel.零件编码));
@@ -1151,8 +1160,12 @@ namespace CK.SCP.Controller
else
{
p_excel.单位 = _first.Unit;
+ if (_first.State == "SP")
+ {
+ ErrorList.Add(string.Format("零件编号【{0}】状态为SP,无法导入!", p_excel.零件编码));
+ }
}
-
+
p_excel.供应商编号 = !string.IsNullOrEmpty(p_excel.供应商编号) ? p_excel.供应商编号.Trim() : string.Empty;
var _count = db.TA_VENDER.Where(p => p.VendId == p_excel.供应商编号&&p.Site== p_excel.域).Count();
@@ -1161,7 +1174,7 @@ namespace CK.SCP.Controller
ErrorList.Add(string.Format("未找到供应商编号为【{0}】无法导入!", p_excel.供应商编号));
}
-
+
DateTime st = DateTime.Parse(p_excel.开始时间);
DateTime et = DateTime.Parse(p_excel.结束时间);
DateTime st_st = Convert.ToDateTime(st.ToShortDateString());
@@ -1170,6 +1183,15 @@ namespace CK.SCP.Controller
var _SubSite = new SqlParameter("@SubSite", p_excel.地点);
var _VendId = new SqlParameter("@VendId", p_excel.供应商编号);
var _PartCode = new SqlParameter("@PartCode", p_excel.零件编码);
+ if (st > et)
+ {
+ ErrorList.Add(string.Format("供应商{0}零件编号{1}的结束时间需要大于开始时间!", p_excel.供应商编号, p_excel.零件编码));
+ }
+ //var price = db.TB_PRICE.Count(p => p.PartCode == p_excel.零件编码.Trim() && p.VendId == p_excel.供应商编号.Trim() && p.StartTime == st && p.EndTime == et && p.Site == p_excel.域&&p.State!=-1);
+ //if (price > 0)
+ //{
+ // ErrorList.Add(string.Format("供应商{0}零件编号{1}价格单已经存在!", p_excel.供应商编号, p_excel.零件编码));
+ //}
string check = "select * from tb_price where uid in\n" +
"(\n" +
" select max(uid) uid\n" +
@@ -1178,39 +1200,29 @@ namespace CK.SCP.Controller
" group by vendid,partcode,subsite,site\n" +
") ";
var _price = db.Database.SqlQuery(check, _Site, _SubSite, _VendId, _PartCode).FirstOrDefault();
+
if (_price != null)
{
- if (st_st < Convert.ToDateTime(_price.StartTime.Value.ToShortDateString()) || st_st > et_st || st_st == et_st)//更新价格时间判断
- {
- ErrorList.Add(string.Format("供应商{0}零件编号{1}开始时间结束时间不正确!", p_excel.供应商编号, p_excel.零件编码));
- }
- if (st_st > Convert.ToDateTime(_price.StartTime.Value.ToShortDateString()))//添加价格记录时间判断
- {
- if (st.ToShortDateString() != (_price.EndTime.Value.AddDays(1)).ToShortDateString())
- {
- ErrorList.Add(string.Format("供应商{0}零件编号{1}开始日期必须为{2}", p_excel.供应商编号, p_excel.零件编码, _price.EndTime.Value.AddDays(1).ToShortDateString().Replace("-", "/")));
- }
- if (_price.State != (int)PriceState.FConfirm)
- {
- ErrorList.Add(string.Format("供应商{0}零件编号{1},新添价格的上期价格不是审批状态", p_excel.供应商编号, p_excel.零件编码));
- }
+ ErrorList.Add(string.Format("供应商{0}零件编号{1}价格单已经存在,如要修改价格单信息请到价格单修改菜单进行操作!", p_excel.供应商编号, p_excel.零件编码));
+ //if (st_st < Convert.ToDateTime(_price.StartTime.Value.ToShortDateString()) || st_st > et_st || st_st == et_st)//更新价格时间判断
+ //{
+ // ErrorList.Add(string.Format("供应商{0}零件编号{1}开始时间结束时间不正确!", p_excel.供应商编号, p_excel.零件编码));
+ //}
+ //if (st_st > Convert.ToDateTime(_price.StartTime.Value.ToShortDateString()))//添加价格记录时间判断
+ //{
+ // if (st.ToShortDateString() != (_price.EndTime.Value.AddDays(1)).ToShortDateString())
+ // {
+ // ErrorList.Add(string.Format("供应商{0}零件编号{1}开始日期必须为{2}", p_excel.供应商编号, p_excel.零件编码, _price.EndTime.Value.AddDays(1).ToShortDateString().Replace("-", "/")));
+ // }
+ // if (_price.State != (int)PriceState.FConfirm)
+ // {
+ // ErrorList.Add(string.Format("供应商{0}零件编号{1},新添价格的上期价格不是审批状态", p_excel.供应商编号, p_excel.零件编码));
+ // }
- //if (_price.EndTime.ToString() == p_excel.结束时间)
- //{
- // ErrorList.Add(string.Format("供应商{0}零件编号{1}结束时间不正确,结束时间应大于现有最新结束时间!", p_excel.供应商编号, p_excel.零件编码));
- //}
- //if (et < _price.EndTime)
- //{
- // ErrorList.Add(string.Format("供应商{0}零件编号{1}结束日期和!", p_excel.供应商编号, p_excel.零件编码));
- //}
- }
+
+ //}
}
- //var _ls = db.TB_PRICE.Where(p => p.State != (int)PriceState.Reject && p.Site == p_excel.域 && p.SubSite == p_excel.地点 && p.VendId == p_excel.供应商编号 && p.PartCode == p_excel.零件编码 &&
- //p.EndTime > st && p.StartTime < et && (p.StartTime != st || p.EndTime != et)).ToList();
- //if (_ls.Count > 0)
- //{
- // ErrorList.Add(string.Format("供应商{0}零件编号{1}开始时间{2}结束时间{3}存在时间重复,请修改为开始时间:{4} 结束时间:{5}!", p_excel.供应商编号, p_excel.零件编码, p_excel.开始时间, p_excel.结束时间, Convert.ToDateTime(_ls[0].StartTime).ToString("yyyy/MM/dd"), Convert.ToDateTime(_ls[0].EndTime).ToString("yyyy/MM/dd")));
- //}
+
}
return ErrorList;
}
@@ -1352,7 +1364,10 @@ namespace CK.SCP.Controller
p_excel.单位 = checkcount[0].Unit;
p_excel.币种 = checkcount[0].Curr;
}
-
+ if (string.IsNullOrEmpty(p_excel.订单类型))
+ {
+ ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】订单类型为空,委外订单填 S,普通订单填 M!", p_excel.订单编号, p_excel.行号));
+ }
if (p_excel.数量 != "0")
{
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的要货数量应该为零!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
@@ -1385,26 +1400,26 @@ namespace CK.SCP.Controller
{
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】税率最大应为2位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
}
- if (!string.IsNullOrEmpty(p_excel.订单类型))
- {
- if (p_excel.订单类型.ToUpper() == "S")
- {
- if (string.IsNullOrEmpty(p_excel.加工单号) || !Regex.IsMatch(p_excel.加工单号, "^[0-9]{1,8}$"))
- {
- ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】加工单最大8位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
- }
- if (string.IsNullOrEmpty(p_excel.工序) || !Regex.IsMatch(p_excel.工序, "^[0-9]{1,6}$"))
- {
- ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】工序最大6位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
- }
- }
- else
- {
- ErrorList.Add(string.Format("{0}订单类型必须填写为S为转包订单,不填写为正常订单", p_excel.订单编号));
- }
- //注释结束
+ //if (!string.IsNullOrEmpty(p_excel.订单类型))
+ //{
+ // if (p_excel.订单类型.ToUpper() == "S")
+ // {
+ // if (string.IsNullOrEmpty(p_excel.加工单号) || !Regex.IsMatch(p_excel.加工单号, "^[0-9]{1,8}$"))
+ // {
+ // ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】加工单最大8位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
+ // }
+ // if (string.IsNullOrEmpty(p_excel.工序) || !Regex.IsMatch(p_excel.工序, "^[0-9]{1,6}$"))
+ // {
+ // ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】工序最大6位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
+ // }
+ // }
+ // else
+ // {
+ // ErrorList.Add(string.Format("{0}订单类型必须填写为S为转包订单,不填写为正常订单", p_excel.订单编号));
+ // }
+ // //注释结束
- }
+ //}
if (!string.IsNullOrEmpty(p_excel.库位) && p_excel.库位.Length > 8)
{
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】库位最大8位字符!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
@@ -1703,26 +1718,26 @@ namespace CK.SCP.Controller
{
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】税率最大应为2位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
}
- if (!string.IsNullOrEmpty(p_excel.订单类型))
- {
- if (p_excel.订单类型.ToUpper() == "S")
- {
- if (string.IsNullOrEmpty(p_excel.加工单号) || !Regex.IsMatch(p_excel.加工单号, "^[0-9]{1,8}$"))
- {
- ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】加工单最大8位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
- }
- if (string.IsNullOrEmpty(p_excel.工序) || !Regex.IsMatch(p_excel.工序, "^[0-9]{1,6}$"))
- {
- ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】工序最大6位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
- }
- }
- else
- {
- ErrorList.Add(string.Format("{0}订单类型必须填写为S为转包订单,不填写为正常订单", p_excel.订单编号));
- }
- //注释结束
+ //if (!string.IsNullOrEmpty(p_excel.订单类型))
+ //{
+ // if (p_excel.订单类型.ToUpper() == "S")
+ // {
+ // if (string.IsNullOrEmpty(p_excel.加工单号) || !Regex.IsMatch(p_excel.加工单号, "^[0-9]{1,8}$"))
+ // {
+ // ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】加工单最大8位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
+ // }
+ // if (string.IsNullOrEmpty(p_excel.工序) || !Regex.IsMatch(p_excel.工序, "^[0-9]{1,6}$"))
+ // {
+ // ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】工序最大6位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
+ // }
+ // }
+ // else
+ // {
+ // ErrorList.Add(string.Format("{0}订单类型必须填写为S为转包订单,不填写为正常订单", p_excel.订单编号));
+ // }
+ // //注释结束
- }
+ //}
if (!string.IsNullOrEmpty(p_excel.库位) && p_excel.库位.Length > 8)
{
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】库位最大8位字符!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
@@ -2108,6 +2123,236 @@ namespace CK.SCP.Controller
return _ret;
}
+
+
+ ///
+ /// 北汽模塑
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static ResultObject EXCEL_PO_TO_ASK_MOD_BJMS(List p_order_list, string p_creator, string str1, string p_buyer, DateTime p_time, BillModType p_modtype, bool IsAutoPublish = false)
+ {
+ ResultObject _ret = new ResultObject();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+
+ p_order_list.ForEach(p =>
+ {
+ if (string.IsNullOrEmpty(p.订单数))
+ {
+ p.订单数 = "0";
+ }
+ });
+
+ int number = 1;
+ List lineError = new List();
+ List ErrorList = new List();
+ var _lst = p_order_list.Where(p => p.订单数 != "0").ToList();
+ _lst.ForEach
+ (p =>
+ {
+ var _ls = CheckExcelMode(db, p);
+ if (_ls.Count > 0)
+ {
+ lineError.Add(number.ToString());
+ ErrorList.Add(string.Join("
", _ls.ToArray()));
+ }
+ number++;
+ });
+ if (lineError.Count > 0)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.MessageList.AddRange(ErrorList);
+ _ret.Result = false;
+ }
+ else
+ {
+ var VenderList = _lst.Select(p => p.供应商编码).Distinct();
+ var PartCodeList = _lst.Select(p => p.零件编码).Distinct();
+ var OrderList = _lst.GroupBy(p => new { p.订单编号, p.订货日期 }).ToList();
+ OrderList.ForEach((p) =>
+ {
+ var list = p.ToList();
+ if (list.Count > 0)
+ {
+ var _entity = list.FirstOrDefault();
+ TB_ASK _ask = new TB_ASK();
+ _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
+ _ask.VendId = _entity.供应商编码;
+ _ask.State = (int)AskState.New;
+ _ask.PoBillNum = _entity.订单编号;
+ _ask.ModType = (int)BillModType.Contract;
+ _ask.Site = _entity.域名;
+ _ask.SubSite = _entity.地点;
+ if (IsAutoPublish)
+ {
+ _ask.State = (int)AskState.Release;
+ }
+ else
+ {
+ _ask.State = (int)AskState.New;
+ }
+ _ask.BeginTime = DateTime.Parse(_entity.订货日期);
+ _ask.Buyer = p_buyer;
+ _ask.BuyerPhone = _entity.计划员电话;
+ _ask.ErpBillNum = _entity.订单编号;
+ _ask.EndTime = DateTime.Parse(_entity.到货日期);
+ _ask.CreateTime = DateTime.Now;
+ _ask.CreateUser = p_creator;
+ _ask.VendId = _entity.供应商编码;
+ _ask.GUID = Guid.NewGuid();
+ _ask.ReceivedPort = _entity.收货口;
+ _ask.IsDeleted = false;
+ _ask.Extend1 = str1;
+ _ask.Remark = _entity.备注;
+ db.TB_ASK.Add(_ask);
+ #region 供应商新任务代办接口
+ TB_PENING_ITEMS _item = new TB_PENING_ITEMS();
+ _item.ROLE_NAME = "供应商";
+ _item.ITEM_NO = _ask.AskBillNum;
+ _item.ITEM_CONTENT = "要货看盘有信息";
+ _item.ITEM_TYPE = (int)PENDING_MESSAGE_TYPE.NEW_ASK;
+ _item.VEND_ID = _ask.VendId;
+ _item.ITEM_STATE = (int)PENDING_STATE.WAITING;
+ _item.SENDER = _entity.计划员;
+ _item.SENDING_TIME = DateTime.Now;
+ db.TB_PENING_ITEMS.Add(_item);
+ #endregion
+ // int _number = 1;
+ List _ls = new List();
+ list.ForEach((itm) =>
+ {
+ var _number = _ls.Count(p1 => p1.PoBillNum == _ask.PoBillNum
+ && p1.PoLine == Int32.Parse(itm.行号) && p1.PartCode == itm.零件编码 && itm.域名 == p1.Remark);
+ if (_number > 0)
+ {
+ _ret.MessageList.Add(string.Format("已经存在订单为{0}行号为{1}零件编码为{2}", itm.订单编号, itm.行号, itm.零件编码));
+ }
+
+ TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL();
+ //_t_ASK_Detail.PoLine = _number;
+ _t_ASK_Detail.PoLine = Int32.Parse(itm.行号);
+ _t_ASK_Detail.Currency = itm.币种;
+ _t_ASK_Detail.AskBillNum = _ask.AskBillNum;
+ _t_ASK_Detail.PoBillNum = _ask.PoBillNum;
+ _t_ASK_Detail.PoUnit = itm.单位;
+ _t_ASK_Detail.CreateTime = DateTime.Now;
+ _t_ASK_Detail.CreateUser = _ask.CreateUser;
+ _t_ASK_Detail.PartCode = itm.零件编码;
+ _t_ASK_Detail.BeginTime = DateTime.Parse(itm.订货日期);
+ _t_ASK_Detail.EndTime = DateTime.Parse(itm.到货日期);
+ _t_ASK_Detail.TempQty = decimal.Parse(itm.订单数);
+ _t_ASK_Detail.AskQty = decimal.Parse(itm.订单数);
+ _t_ASK_Detail.IsDeleted = false;
+ _t_ASK_Detail.LocUnit = itm.单位;
+ _t_ASK_Detail.UnConv = 1;
+ _t_ASK_Detail.Site = _ask.Site;
+ _t_ASK_Detail.SubSite = _ask.SubSite;
+ _t_ASK_Detail.DockCode = itm.收货口;
+ _t_ASK_Detail.State = _ask.State;
+ _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.价格) ? 0 : decimal.Parse(itm.价格);
+ _t_ASK_Detail.GUID = Guid.NewGuid();
+ _t_ASK_Detail.Remark = _ask.Site;
+ db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
+ _ls.Add(_t_ASK_Detail);
+ // _number++;
+ });
+
+ }
+ else
+ {
+ _ret.MessageList.Add("ERP订单编号已存在,请重新导入!");
+
+ }
+ if (_ret.MessageList.Count == 0)
+ {
+ int state = db.SaveChanges();
+ if (state != -1)
+ {
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = true;
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ }
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ }
+ }
+ );
+ }
+ }
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message);
+ _ret.Result = false;
+ _ret.ErrorList.Add(e);
+ throw e;
+ }
+ return _ret;
+
+ }
///
/// 供应商零件导入
///
@@ -2475,7 +2720,10 @@ namespace CK.SCP.Controller
_lst.ForEach(p =>
{
var _price = new TB_PRICE();
+ string starttime = DateTime.Parse(p.开始时间).ToShortDateString();
+ string endtime = DateTime.Parse(p.结束时间).ToShortDateString();
DateTime st = DateTime.Parse(p.开始时间);
+
DateTime et = DateTime.Parse(p.结束时间);
#region 201909011修改
var _Site = new SqlParameter("@Site", p.域);
@@ -2498,8 +2746,8 @@ namespace CK.SCP.Controller
_price.State = _state;
_price.VendId = p.供应商编号.Trim();
_price.PartCode = p.零件编码.Trim();
- _price.StartTime = DateTime.Parse(p.开始时间);
- _price.EndTime = DateTime.Parse(p.结束时间);
+ _price.StartTime = DateTime.Parse(starttime);
+ _price.EndTime = DateTime.Parse(endtime);
_price.Curr = p.币种;
_price.Unit = p.单位;
_price.Amt = decimal.Parse(p.零件基础价格);
@@ -2796,6 +3044,8 @@ namespace CK.SCP.Controller
_lst.ForEach(p =>
{
+ string starttime = Convert.ToDateTime(p.最新开始时间).ToShortDateString();
+ string endtime = Convert.ToDateTime(p.最新结束时间).ToShortDateString();
var _vender = db.TB_PRICE.SingleOrDefault(t => t.VendId == p.供应商编号.ToUpper() && t.PartCode == p.零件编码 && t.UID.ToString() == p.标识 && t.SubSite == p.地点 && t.Site == p.域);
if (_vender == null)
{
@@ -2805,11 +3055,49 @@ namespace CK.SCP.Controller
if (DateTime.Parse(p.最新开始时间)< DateTime.Parse(p.结束时间) && DateTime.Parse(p.最新开始时间) >DateTime.Parse(p.开始时间))
{
- _vender.EndTime = Convert.ToDateTime(DateTime.Parse(p.最新开始时间).AddDays(-1));
+ _vender.EndTime = Convert.ToDateTime(DateTime.Parse(starttime).AddDays(-1));
_vender.Extend3 = "价格表修改";
+ var _PR = db.V_TB_PRICE.FirstOrDefault(t => t.VendId == p.供应商编号.ToUpper() && t.PartCode == p.零件编码 && t.UID.ToString() == p.标识 && t.SubSite == p.地点 && t.Site == p.域);
+ if (_PR != null)
+ {
+ TS_UNI_API TS = new TS_UNI_API();
+ TS.InterfaceType = "Price";
+ TS.BillNum = (_PR.VendId + _PR.SubSite.Substring(1, 1) + _PR.SubSite.Substring(3, 1)).Trim();
+ TS.PartCode = _PR.PartCode;
+ if (_PR.TemporaryPrice == 0)
+ {
+ TS.Batch = "No";
+ }
+ else
+ {
+ TS.Batch = "Yes";
+ }
+ TS.Qty = _PR.Amt + _PR.SharingPrice;
+ TS.Price = _PR.Amt;
+ TS.State = 1;
+ TS.ValidDate = DateTime.Now;
+ TS.ErpLineNum = 1;
+ TS.Domain = _PR.Site;//域
+ TS.Site = _PR.SubSite;//地点
+ TS.Extend1 = _PR.Remarks;
+ TS.CreateTime = Convert.ToDateTime(_PR.StartTime);//开始时间
+ TS.PutTime = Convert.ToDateTime(DateTime.Parse(starttime).AddDays(-1));//结束时间
+ TS.CreateOper = _PR.Creator;
+ TS.Currency = _PR.Curr;//货币
+ var _first = db.TA_PART.Where(itm => itm.PartCode == p.零件编码).FirstOrDefault();
+ if (_first != null)
+ {
+ TS.PoUnit = _first.Unit;
+ }
+ else
+ {
+ TS.PoUnit = _PR.Unit;//单位
+ }
+ db.TS_UNI_API.Add(TS);
+ }
+
db.TB_PRICE.AddOrUpdate(_vender);
- }
- // var sr = p.零件最新价格.ToString().Trim();
+ }
TB_PRICE tb = new TB_PRICE();
tb.State = 0;
tb.Extend3 = "价格表修改增加";
@@ -2821,8 +3109,8 @@ namespace CK.SCP.Controller
tb.Amt = Convert.ToDecimal(p.零件最新价格);
tb.Site = p.域;
tb.SubSite = p.地点;
- tb.StartTime = Convert.ToDateTime(p.最新开始时间);
- tb.EndTime = Convert.ToDateTime(p.最新结束时间);
+ tb.StartTime = Convert.ToDateTime(starttime);
+ tb.EndTime = Convert.ToDateTime(endtime);
tb.Creator = p_createuser;
tb.IsPost = 0;
tb.TemporaryPrice = Int32.Parse(p.是否临时价格);
@@ -2833,17 +3121,16 @@ namespace CK.SCP.Controller
if (_ret.MessageList.Count == 0)
{
- int state = db.SaveChanges();
- if (state != -1)
- {
+ db.BulkSaveChanges();
+
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
- }
- else
- {
- _ret.State = ReturnStatus.Failed;
- _ret.Result = false;
- }
+ //}
+ //else
+ //{
+ // _ret.State = ReturnStatus.Failed;
+ // _ret.Result = false;
+ //}
}
else
{
@@ -3383,7 +3670,7 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
- int number = 1;
+ //int number = 1;
List lineError = new List();
List ErrorList = new List();
@@ -3399,6 +3686,16 @@ namespace CK.SCP.Controller
//}
//注释结束
var _lst = p_order_list;
+ var PoList = _lst.Select(itm => itm.订单编号).Distinct().ToList();
+ foreach (var po in PoList)
+ {
+ var vendcount = _lst.Where(itm => itm.订单编号 == po).Select(itm => itm.供应商编号).Distinct().ToList();
+ if (vendcount.Count() > 1)
+ {
+ lineError.Add(string.Format("导入订单编号【{0}】对应两个供应商了,麻烦修改", po));
+ ErrorList = lineError;
+ }
+ }
p_order_list.ForEach(p =>
{
var _count1 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.行号 == p.行号);
@@ -3413,19 +3710,19 @@ namespace CK.SCP.Controller
lineError.Add(string.Format("导入订单编号【{0}】零件编码【{1}】有重复", p.订单编号, p.零件号));
ErrorList = lineError;
}
+
+
});
p_order_list.ForEach
(p =>
{
var _ls = CheckExcelMode_Po(db, p, p_modtype, site, subsite);
if (_ls.Count > 0)
- {
- lineError.Add(number.ToString());
+ {
ErrorList.Add(string.Join("
", _ls.ToArray()));
- }
- number++;
+ }
});
- if (lineError.Count > 0)
+ if (ErrorList.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
@@ -3520,11 +3817,19 @@ namespace CK.SCP.Controller
//}
//注释结束
var _lst = p_order_list;
+ var VenderList = _lst.Select(itm => itm.订单编号).Distinct().ToList();
+ var PartCodeList = _lst.Select(itm => itm.供应商编号).Distinct().ToList();
+ if (VenderList.Count != PartCodeList.Count)
+ {
+ lineError.Add(string.Format("存在多个供应商编号对应一个订单号"));
+ ErrorList = lineError;
+ }
p_order_list.ForEach(p =>
{
var _count1 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.行号 == p.行号);
var _count2 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.零件号 == p.零件号);
- //var _count3 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.供应商编号 == p.供应商编号);
+
+
if (_count1 > 1 && p_modtype == BillModType.Contract)
{
lineError.Add(string.Format("导入订单编号【{0}】行号【{1}】有重复", p.订单编号, p.行号));
@@ -3534,13 +3839,8 @@ namespace CK.SCP.Controller
{
lineError.Add(string.Format("导入订单编号【{0}】零件编码【{1}】有重复", p.订单编号, p.零件号));
ErrorList = lineError;
- }
-
- //if (_count3 > 1)
- //{
- // lineError.Add(string.Format("导入订单编号【{0}】供应商编号【{1}】有重复", p.订单编号, p.供应商编号));
- // ErrorList = lineError;
- //}
+ }
+
});
p_order_list.ForEach
(p =>
@@ -4348,7 +4648,17 @@ namespace CK.SCP.Controller
_tDetail.State = (int)p_order.State;
_tDetail.SubSite = itm.SubSite;
_tDetail.Site = itm.Site;
- _tDetail.Price = itm.Price;
+ if (itm.Site == "BJBMPT")
+ {
+ var price = db.TB_PRICE.Where(p => p.PartCode == itm.PartCode&&p.State>-1&&p.VendId== p_order.VendId).Max(p => p.UID);
+ var pri = db.TB_PRICE.FirstOrDefault(t=>t.UID==price);
+ _tDetail.Price = pri.Amt;
+ }
+ else
+ {
+ _tDetail.Price = itm.Price;
+ }
+
_tDetail.Remark = itm.Remark;
_tDetail.GUID = Guid.NewGuid();
_tDetail.Currency = itm.Currency;
diff --git a/北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs b/北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs
index 1ee004c..f458646 100644
--- a/北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs
@@ -1091,10 +1091,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p_entity.UIDList.Contains(p.UID));
}
- if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
- {
- q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
- }
+ //if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
+ //{
+ // q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
+ //}
if (p_entity.UserInSubSite != null && p_entity.UserInSubSite.Count > 0)
{
q = q.Where(p => p_entity.UserInSubSite.Contains(p.SubSite));
diff --git a/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs b/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs
index 3896726..b3c7840 100644
--- a/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs
@@ -10,6 +10,7 @@ using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using System.Data.Entity.Core;
using CK.SCP.Models.Enums;
+using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
namespace CK.SCP.Controller
{
@@ -122,8 +123,129 @@ namespace CK.SCP.Controller
}
return _ret;
}
-
+ public static ResultObject EXCEL_ADRESS_LIST_CQ(List p_order_list, string site, string p_creator)
+ {
+ ResultObject _ret = new ResultObject();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ int number = 1;
+ List lineError = new List();
+ List ErrorList = new List();
+ var _lst = p_order_list;
+
+
+ if (lineError.Count > 0)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.MessageList.AddRange(ErrorList);
+ _ret.Result = false;
+ }
+ else
+ {
+ _lst.ForEach(p =>
+ {
+
+ var _Sitelist = db.TB_ADDRESS.Count(t => t.Address == p.收货地址);
+ if (_Sitelist == 0)
+ {
+ TB_ADDRESS Price = new TB_ADDRESS();
+ Price.Address = p.收货地址;
+ Price.NamePone = p.收货人信息;
+
+ db.TB_ADDRESS.AddOrUpdate(Price);
+ }
+ else if (_Sitelist == 1)
+ {
+ var _PAlist = db.TB_ADDRESS.SingleOrDefault(t => t.Address == p.收货地址);
+ _PAlist.NamePone = p.收货人信息;
+ db.TB_ADDRESS.AddOrUpdate(_PAlist);
+ }
+
+ });
+ if (_ret.MessageList.Count == 0)
+ {
+ int state = db.SaveChanges();
+ if (state != -1)
+ {
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = true;
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ }
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ }
+ }
+ }
+
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message);
+ _ret.Result = false;
+ _ret.ErrorList.Add(e);
+ throw e;
+ }
+ return _ret;
+ }
public static ResultObject Save_TA_LANGUAGE(List p_entitys)
{
ResultObject _ret = new ResultObject();
diff --git a/北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs b/北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs
index b9b93c9..7f457db 100644
--- a/北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs
@@ -209,6 +209,224 @@ namespace CK.SCP.Controller
q = q.Where(p => p.SubSite == p_entity.SubSite);
}
+ if (p_entity.UIDList != null && p_entity.UIDList.Count > 0)
+ {
+ q = q.Where(p => p_entity.UIDList.Contains(p.UID));
+ }
+ if (p_entity.UserInSubSite != null && p_entity.UserInSubSite.Count > 0)
+ {
+ q = q.Where(p => p_entity.UserInSubSite.Contains(p.SubSite));
+ }
+ if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
+ {
+ q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
+ }
+
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = q;
+ p_action(_ret);
+ }
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(e);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", e.Message);
+ throw e;
+ }
+ }
+
+ public static void Get_TB_PRICEDC_List( V_TB_PRICE p_entity, Action>> p_action)
+ {
+
+ ResultObject> _ret = new ResultObject>();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ IQueryable q = db.V_TB_PRICE;
+
+ if (p_entity.UIDList != null && p_entity.UIDList.Count > 0)
+ {
+ q = q.Where(p => p_entity.UIDList.Contains(p.UID));
+ }
+
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = q;
+ p_action(_ret);
+ }
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.ErrorList.Add(e);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", e.Message);
+ throw e;
+ }
+ }
+
+ public static void Get_TB_PRICE_TemporaryPrice_CQ_List(bool p_flag, V_TB_PRICE_TemporaryPrice p_entity, Action>> p_action)
+ {
+
+ ResultObject> _ret = new ResultObject>();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ IQueryable q = db.V_TB_PRICE_TemporaryPrice;
+ if (p_flag)
+ {
+ q = q.Where(p => p.Amt == 0);
+ }
+
+
+
+ if (p_entity.UID != 0)
+ {
+ q = q.Where(p => p.UID == p_entity.UID);
+ }
+ if (!string.IsNullOrEmpty(p_entity.VendId))
+ {
+ q = q.Where(p => p.VendId.Contains(p_entity.VendId));
+ }
+ if (!string.IsNullOrEmpty(p_entity.PartCode))
+ {
+ q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
+ }
+ if (p_entity.Amt > 0)
+ {
+ q = q.Where(p => p.Amt == p_entity.Amt);
+ }
+ if (p_entity.TemporaryPrice > 0)
+ {
+ q = q.Where(p => p.TemporaryPrice == p_entity.TemporaryPrice);
+ }
+ if (p_entity.SharingPrice > 0)
+ {
+ q = q.Where(p => p.SharingPrice == p_entity.SharingPrice);
+ }
+ if (!string.IsNullOrEmpty(p_entity.Extend3))
+ {
+ q = q.Where(p => p.Extend3.Contains(p_entity.Extend3));
+ }
+ if (!string.IsNullOrEmpty(p_entity.Extend2))
+ {
+ q = q.Where(p => p.Extend2.Contains(p_entity.Extend2));
+ }
+
+
+ if (!string.IsNullOrEmpty(p_entity.Extend3))
+ {
+ q = q.Where(p => p.Extend3.Contains(p_entity.Extend3));
+ }
+ if (!string.IsNullOrEmpty(p_entity.PartName))
+ {
+ q = q.Where(p => p.PartName.Contains(p_entity.PartName));
+ }
+ if (!string.IsNullOrEmpty(p_entity.Creator))
+ {
+ q = q.Where(p => p.Creator == p_entity.Creator);
+ }
+ if (p_entity.StartTime != null)
+ {
+ q = q.Where(p => p.StartTime >= p_entity.StartTime);
+ }
+ if (p_entity.EndTime != null)
+ {
+ q = q.Where(p => p.EndTime <= p_entity.EndTime);
+ }
+ if (p_entity.State != 3)//3是查询所有
+ {
+ q = q.Where(p => p.State == p_entity.State);
+ }
+
+ if (!string.IsNullOrEmpty(p_entity.SubSite))
+ {
+ q = q.Where(p => p.SubSite == p_entity.SubSite);
+ }
+
//if (p_entity.UserInAddress.FirstOrDefault() != null && p_entity.UserInAddress.Count > 0)
//{
@@ -278,7 +496,6 @@ namespace CK.SCP.Controller
}
}
-
public static ResultObject Save_TB_PRICE(List p_entitys,PriceState p_state)
{
ResultObject _ret = new ResultObject();
@@ -394,7 +611,7 @@ namespace CK.SCP.Controller
_entity.TemporaryPrice = itm.TemporaryPrice;
_entity.Creator = itm.Creator;
_entity.EndTime = itm.EndTime;
- _entity.StartTime = DateTime.Now;
+ _entity.StartTime = itm.StartTime;
//_entity.UpdateTime = itm.UpdateTime;
//_entity.UpdateUser = itm.UpdateUser;
//_entity.UpdateInfo = itm.UpdateInfo;
@@ -489,6 +706,102 @@ namespace CK.SCP.Controller
}
return p_entitys;
}
+
+ public static ResultObject Save_TB_PRICE_TemporaryPrice(List p_list, string p_user)
+ {
+ ResultObject _ret = new ResultObject();
+ try
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+
+
+ var _ls = db.TB_PRICE.Where(p => p_list.Contains(p.UID)).ToList();
+ _ls.ForEach(p =>
+ {
+ p.TemporaryPrice=0;
+
+ }
+ );
+ db.TB_PRICE.AddOrUpdate(p => p.UID, _ls.ToArray());
+
+
+
+ if (_ret.MessageList.Count == 0)
+ {
+ if (db.SaveChanges() != -1)
+ {
+ _ret.State = ReturnStatus.Succeed;
+ _ret.Result = true;
+ }
+ else
+ {
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.Message = "数据更新失败!";
+ }
+ }
+ }
+ }
+ catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
+ {
+ var sb = new StringBuilder();
+
+ foreach (var error in dbEx.EntityValidationErrors.ToList())
+ {
+
+ error.ValidationErrors.ToList().ForEach(i =>
+ {
+ sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
+ });
+ }
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(dbEx);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", sb.ToString());
+ throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
+ }
+ catch (OptimisticConcurrencyException ex)//并发冲突异常
+ {
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
+ throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
+ }
+ catch (ScpException ex)
+ {
+
+
+ _ret.State = ReturnStatus.Failed;
+ _ret.Result = false;
+ _ret.ErrorList.Add(ex);
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
+
+ if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
+ {
+ var inner = (UpdateException)ex.InnerException;
+
+
+ throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
+ }
+ else
+ {
+ if (ex.InnerException != null) throw ex.InnerException;
+ }
+ }
+ catch (Exception e)
+ {
+ _ret.State = ReturnStatus.Failed;
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", e.Message);
+ _ret.Result = false;
+ _ret.ErrorList.Add(e);
+ throw e;
+ }
+
+ return _ret;
+ }
public static ResultObject Save_TB_PRICE_STATE(List p_list, string p_user, int State)
{
ResultObject _ret = new ResultObject();
diff --git a/北京北汽/Controller/SCP_TB_VENDER_CONTROLLER.cs b/北京北汽/Controller/SCP_TB_VENDER_CONTROLLER.cs
index 7298bf1..8d70310 100644
--- a/北京北汽/Controller/SCP_TB_VENDER_CONTROLLER.cs
+++ b/北京北汽/Controller/SCP_TB_VENDER_CONTROLLER.cs
@@ -30,6 +30,22 @@ namespace CK.SCP.Controller
return db.TA_VENDER.ToList();
}
}
+ public static TB_FACTORY GetFactory(string site)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+
+ return db.TB_FACTORY.Where(p=>p.ErpSite== site).FirstOrDefault();
+ }
+ }
+ public static List Getlist1(string site)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+
+ return db.TA_VENDER.Where(p=>p.Site== site).ToList();
+ }
+ }
public static List Getlist(List lsVenderID )
{
diff --git a/北京北汽/Controller/app.config b/北京北汽/Controller/app.config
index 36106a3..72f696a 100644
--- a/北京北汽/Controller/app.config
+++ b/北京北汽/Controller/app.config
@@ -1,32 +1,32 @@
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
@@ -36,4 +36,4 @@
-
+
\ No newline at end of file
diff --git a/北京北汽/Models/App.config b/北京北汽/Models/App.config
index f906a42..134d7fd 100644
--- a/北京北汽/Models/App.config
+++ b/北京北汽/Models/App.config
@@ -1,28 +1,28 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/北京北汽/Models/CK.SCP.Models.csproj b/北京北汽/Models/CK.SCP.Models.csproj
index a1527fa..6b7e46e 100644
--- a/北京北汽/Models/CK.SCP.Models.csproj
+++ b/北京北汽/Models/CK.SCP.Models.csproj
@@ -11,7 +11,6 @@
CK.SCP.Models
v4.5.2
512
-
true
@@ -348,6 +347,7 @@
+
@@ -444,6 +444,7 @@
+
diff --git a/北京北汽/Models/Enums/SCP_ENUM.cs.cs b/北京北汽/Models/Enums/SCP_ENUM.cs.cs
index 16e195c..361dba4 100644
--- a/北京北汽/Models/Enums/SCP_ENUM.cs.cs
+++ b/北京北汽/Models/Enums/SCP_ENUM.cs.cs
@@ -194,10 +194,18 @@ namespace CK.SCP.Models.Enums
FinanceReceive = 5,
[Description("财务退回")]
FinanceFail = 6,
+ [Description("财务手工收票")]
+ CustomReceive = 8,
[Description("发票作废")]
Reject = -1,
}
-
+ public enum LoginNumer
+ {
+ [Description("成功登录")]
+ Sussess = 0,
+ [Description("登录失败")]
+ Faile = 1,
+ }
public enum ConfigState
{
diff --git a/北京北汽/Models/ScpEntities.cs b/北京北汽/Models/ScpEntities.cs
index fa7943d..40bfcde 100644
--- a/北京北汽/Models/ScpEntities.cs
+++ b/北京北汽/Models/ScpEntities.cs
@@ -88,6 +88,7 @@ namespace CK.SCP.Models
public virtual DbSet V_TB_ASN { get; set; }
public virtual DbSet V_TB_ASN_DETAIL { get; set; }
public virtual DbSet TA_LANGUAGE { get; set; }
+ public virtual DbSet TA_LOGINNUMBER { get; set; }
public virtual DbSet TB_CONTRACT { get; set; }
public virtual DbSet TB_CONTRACT_DETAIL { get; set; }
public virtual DbSet TB_CONTRACT_DETAIL_PRICE { get; set; }
@@ -127,6 +128,7 @@ namespace CK.SCP.Models
public virtual DbSet V_TA_VEND_PART { get; set; }
public virtual DbSet TB_PRICE { get; set; }
public virtual DbSet V_TB_PRICE { get; set; }
+ public virtual DbSet V_TB_PRICE_TemporaryPrice { get; set; }
public virtual DbSet TB_FORECAST { get; set; }
public virtual DbSet V_TB_PRICE_DETAIL { get; set; }
diff --git a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs
index 723c6b5..d930460 100644
--- a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs
+++ b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs
@@ -19,7 +19,8 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string 价格 { get; set; } //"Price"
public string 要货数量 {get;set;} //"AskQty"
public string 说明 { get; set; } //"ReMark"
+ public string 供应商 { get; set; }
+ public string 订货日期 { get; set; }
-
}
}
diff --git a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs
index 4678110..4a77e1d 100644
--- a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs
+++ b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs
@@ -21,8 +21,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string 退货数 { get; set; } //RejectQty"
public string 到货日期 { get; set; } //EndTime"
public string 单位 {get;set; } //PoUnit"
+ public string 供应商名称 { get; set; }
+ public string 供应商编码 { get; set; }
-
}
public class SCP_PO_DETAIL_EXPORT_MODEL
{
@@ -46,7 +47,7 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string 收货口 { get; set; }
-
+ public string 备注 { get; set; }
diff --git a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs
index f97b2c9..f9f67b2 100644
--- a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs
+++ b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs
@@ -25,5 +25,7 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string 备注 { get; set; }
public string 税率 { get; set; }
public string 域 { get; set; }
+ public string 收货地址 { get; set; }
+ public string 收货人信息 { get; set; }
}
}
diff --git a/北京北汽/Models/ScpEntity/SCP_OTD_EXPORT.cs b/北京北汽/Models/ScpEntity/SCP_OTD_EXPORT.cs
index eb2833e..ec2fecb 100644
--- a/北京北汽/Models/ScpEntity/SCP_OTD_EXPORT.cs
+++ b/北京北汽/Models/ScpEntity/SCP_OTD_EXPORT.cs
@@ -6,6 +6,18 @@ using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
+ public class InvoiceCreateQueryParm
+ {
+ public string ReceiveID { set; get; }
+ public string VendId { set; get; }
+ public string Modify { set; get; }
+ public string IsAll { set; get; }
+ public string Tax { set; get; }
+ public string CJ { set; get; }
+ public string TZ { set; get; }
+
+
+ }
public class SCP_OTD_EXPORT
{
public string VendId { get; set; } //供应商编号
diff --git a/北京北汽/Models/ScpEntity/TA_LOGINNUMBER.cs b/北京北汽/Models/ScpEntity/TA_LOGINNUMBER.cs
new file mode 100644
index 0000000..4e7c2f8
--- /dev/null
+++ b/北京北汽/Models/ScpEntity/TA_LOGINNUMBER.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CK.SCP.Models.ScpEntity
+{
+ public partial class TA_LOGINNUMBER
+ {
+
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long UID { get; set; }
+ [Key]
+ public string Name { get; set; }
+
+ public string Time { get; set; }
+ public int Number { get; set; }
+
+ }
+}
diff --git a/北京北汽/Models/ScpEntity/V_TB_PRICE.cs b/北京北汽/Models/ScpEntity/V_TB_PRICE.cs
index b3cb147..3856f5e 100644
--- a/北京北汽/Models/ScpEntity/V_TB_PRICE.cs
+++ b/北京北汽/Models/ScpEntity/V_TB_PRICE.cs
@@ -57,6 +57,15 @@ namespace CK.SCP.Models.ScpEntity
public List UserInVendIds { set; get; }
[NotMapped]
public List UserInSubSite { set; get; }
+
+ [NotMapped]
+ public List UIDList { set; get; }
public string Flag { get; set; }
+ [NotMapped]
+ public string NewStartTime { get; set; }
+ [NotMapped]
+ public string NewEndTime { get; set; }
+ [NotMapped]
+ public string NewPrice { get; set; }
}
}
diff --git a/北京北汽/Models/ScpEntity/V_TB_PRICE_TemporaryPrice.cs b/北京北汽/Models/ScpEntity/V_TB_PRICE_TemporaryPrice.cs
new file mode 100644
index 0000000..020fb3a
--- /dev/null
+++ b/北京北汽/Models/ScpEntity/V_TB_PRICE_TemporaryPrice.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using ChangKeTec.Wms.Models;
+
+
+namespace CK.SCP.Models.ScpEntity
+{
+ public partial class V_TB_PRICE_TemporaryPrice
+ {
+ [Key]
+ public int UID { get; set; }
+ public string VendId { get; set; }
+ public string Site { get; set; }
+ public string SubSite { get; set; }
+ public string PartCode { get; set; }
+ public Nullable StartTime { get; set; }
+ public Nullable EndTime { get; set; }
+ public string Curr { get; set; }
+ public string Unit { get; set; }
+ [DecimalPrecision(18, 5)]
+ public decimal Amt { get; set; }
+ public string Remarks { get; set; }
+ ///
+ /// 状态(已用)
+ ///
+ public string Extend1 { get; set; }
+ ///
+ /// 是否是临时价格(0:否 1:是)
+ ///
+ public string Extend2 { get; set; }
+ ///
+ /// 供应商名称
+ ///
+ public string Extend3 { get; set; }
+ [DecimalPrecision(18, 5)]
+ public decimal SharingPrice { get; set; }
+ public int TemporaryPrice { get; set; }
+ public string PartName { get; set; }
+ ///
+ /// 状态
+ ///
+ public int State { get; set; }
+ ///
+ /// 是否传接口 1是
+ ///
+ public int IsPost { get; set; }
+ public string Creator { get; set; }
+ [NotMapped]
+ public List UserInAddress { set; get; }
+
+ [NotMapped]
+ public List UserInVendIds { set; get; }
+ [NotMapped]
+ public List UserInSubSite { set; get; }
+ public string Flag { get; set; }
+ }
+}
diff --git a/北京北汽/Models/WmsEntity/TableSchema1.cs b/北京北汽/Models/WmsEntity/TableSchema1.cs
index 5f28270..69c6b92 100644
--- a/北京北汽/Models/WmsEntity/TableSchema1.cs
+++ b/北京北汽/Models/WmsEntity/TableSchema1.cs
@@ -1 +1,9 @@
-
\ No newline at end of file
+//------------------------------------------------------------------------------
+//
+// 此代码已从模板生成。
+//
+// 手动更改此文件可能导致应用程序出现意外的行为。
+// 如果重新生成代码,将覆盖对此文件的手动更改。
+//
+//------------------------------------------------------------------------------
+
diff --git a/北京北汽/SCP/Business/PageBase.cs b/北京北汽/SCP/Business/PageBase.cs
index e0d55d7..6fa39bc 100644
--- a/北京北汽/SCP/Business/PageBase.cs
+++ b/北京北汽/SCP/Business/PageBase.cs
@@ -613,6 +613,10 @@ namespace SCP
_currentUser.VenderList = _userVerders;
_currentUser.ConfigList = new Dictionary();
if (_currentUser.FactoryList.Count > 0)
+ {
+ _currentUser.UsedDomain = string.IsNullOrEmpty(_currentUser.Remark) ? _currentUser.FactoryList.FirstOrDefault() : _currentUser.Remark.Trim();
+ }
+ if (_currentUser.FactoryList.Count > 0)
{
if (SCPDB.TA_FACTORY_CONFIG != null)
{
@@ -631,7 +635,7 @@ namespace SCP
}
}
}
- }
+ }
Session["CurrentUser"] = _currentUser;
}
return (User)Session["CurrentUser"];
diff --git a/北京北汽/SCP/CK.SCP.Controller/ASNController.cs b/北京北汽/SCP/CK.SCP.Controller/ASNController.cs
new file mode 100644
index 0000000..ec46575
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ASNController.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+namespace CK.SCP.Controller
+{
+ public class ASNController
+ {
+ public static TF_ASN GetDetaillistByuid(int uid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN.SingleOrDefault(p => p.UID == uid);
+ }
+ }
+
+ public static TF_ASN GetASNlist(string billnum, string vendid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN.SingleOrDefault(p => p.PoBillNum == billnum && p.VendId == vendid);
+ }
+ }
+ public static TF_ASN_DETAIL GetASNlistDetail(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN_DETAIL.SingleOrDefault(p => p.PoBillNum == billnum);
+ }
+ }
+ public static TF_ASN_DETAIL GetASNlistDetailByLine(string billnum, int linenum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN_DETAIL.SingleOrDefault(p => p.BillNum == billnum && p.PoLineNum == linenum);
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/BaseDocContoller.cs b/北京北汽/SCP/CK.SCP.Controller/BaseDocContoller.cs
new file mode 100644
index 0000000..0b66180
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/BaseDocContoller.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.Data.Entity.Core.Common.CommandTrees;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Data.Entity.Migrations;
+using System.Linq.Expressions;
+using CK.SCP.Models;
+
+
+namespace CK.SCP.Controller
+{
+ public static class EntitiesHelper
+ {
+
+ public static List GetModeList_genaral(Expression> select,
+ Expression> where, Expression> order, out int count)
+ where T : class
+ {
+ List list = null;
+ count = 0;
+ using (DbContext db = EntitiesFactory.CreateScpInstance())
+ {
+ count = db.Set().Where(where).Count();
+ list =
+ db.Set()
+ .Where(where)
+ .OrderBy(order)
+ .Select(select).ToList();
+ }
+ return list;
+ }
+
+ public static List GetPagedModelListAsc(Expression> select,
+ Expression> where, Expression> order, int pageIndex, int pageSize, out int total)
+ where T : class
+ {
+ List list = null;
+ total = 0;
+ using (DbContext db = EntitiesFactory.CreateScpInstance())
+ {
+ total = db.Set().Where(where).Count();
+ list =
+ db.Set()
+ .Where(where)
+ .OrderBy(order)
+ .Select(select)
+ .Skip((pageIndex - 1) * pageSize)
+ .Take(pageSize).ToList();
+ }
+ return list;
+ }
+
+ public static List GetPagedDataAsc(Expression> select,
+ Expression> where, Expression> order, int pageIndex, int pageSize, out int total)
+ where T : class
+ {
+ List list = null;
+ total = 0;
+ using (DbContext db = EntitiesFactory.CreateScpInstance())
+ {
+ total = db.Set().Where(where.Compile()).AsQueryable().Count();
+ list =
+ db.Set()
+ .Where(where.Compile()).AsQueryable()
+ .OrderBy(order)
+ .Select(select)
+ .Skip((pageIndex - 1) * pageSize)
+ .Take(pageSize).ToList();
+ }
+ return list;
+ }
+
+ //TODO 分页 原来 pageIndex-1
+ public static List GetPagedDataDesc(DbContext db, Expression> select,
+ Expression> where, Expression> order, int pageIndex, int pageSize, out int total)
+ where T : class
+ {
+ List list = null;
+ total = 0;
+
+ total = db.Set().Where(where).Count();
+ list =
+ db.Set()
+ .Where(where)
+ .OrderByDescending(order)
+ .Select(select)
+ .Skip((pageIndex) * pageSize)
+ .Take(pageSize).ToList();
+
+
+ return list;
+ }
+ public static List GetPagedList(DbContext db, Expression> order, int pageIndex, int pageSize, out int total)
+ where T : class
+ {
+ List list = null;
+ total = 0;
+
+ total = db.Set().Count();
+ list =
+ db.Set()
+ .OrderByDescending(order)
+ .Skip((pageIndex) * pageSize)
+ .Take(pageSize).ToList();
+
+
+ return list;
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/CK.SCP.Controller.csproj b/北京北汽/SCP/CK.SCP.Controller/CK.SCP.Controller.csproj
new file mode 100644
index 0000000..e0b9acd
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/CK.SCP.Controller.csproj
@@ -0,0 +1,99 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {0C706E36-C79D-467C-91CA-DDF39BC43113}
+ Library
+ Properties
+ CK.SCP.Controller
+ CK.SCP.Controller
+ v4.5.2
+ 512
+
+
+ true
+ full
+ false
+ ..\DLL\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll
+
+
+ ..\packages\EntityFramework.Extensions.0.0.2\lib\net40\EntityFramework.Extensions.dll
+
+
+ ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {dd7c0def-71e7-443f-b0b7-db2f5b12a506}
+ CK.SCP.Models
+
+
+ {74DCE5F2-A501-45F2-B4F9-494AA1867226}
+ Models
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.Controller/Class1.cs b/北京北汽/SCP/CK.SCP.Controller/Class1.cs
new file mode 100644
index 0000000..f33df14
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/Class1.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CK.SCP.Controller
+{
+ public class Class1
+ {
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/InfoController.cs b/北京北汽/SCP/CK.SCP.Controller/InfoController.cs
new file mode 100644
index 0000000..b9d0957
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/InfoController.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class InfoController
+ {
+ public static bool SaveInfo(TA_Info model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TA_Info.AddOrUpdate(model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+
+ public static bool UpdateInfo(TA_Info model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TA_Info.AddOrUpdate(p => p.ID, model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+ public static TA_Info GetlistByBillNo(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_Info.SingleOrDefault(p => p.ID == id);
+ }
+ }
+ public static V_Info GetInfoByBillNo(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_Info.SingleOrDefault(p => p.ID == id);
+ }
+ }
+
+ public static void DeleteById(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ var info = db.TA_Info.SingleOrDefault(p => p.ID == id);
+ if (info != null) db.TA_Info.Remove(info);
+ db.SaveChanges();
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/InvoiceController.cs b/北京北汽/SCP/CK.SCP.Controller/InvoiceController.cs
new file mode 100644
index 0000000..b3c3727
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/InvoiceController.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class InvoiceController
+ {
+ public static List GetDataByBillInvoice( string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoice.Where(p => p.BillNum == billnum).ToList();
+ }
+ }
+
+
+ public static V_BillInvoice GetDataByBillInvoiceDetailModel(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoice.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+
+ public static bool UpdateData(int state, TB_INVOICE model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ model.State = state;
+
+ db.TB_INVOICE.AddOrUpdate(p => p.UID, model);
+ EntitiesFactory.SaveDb(db);
+ }
+ return true;
+ }
+ public static bool UpdateDataRemark(string remark, TB_INVOICE model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+
+ model.Remark = remark;
+
+ db.TB_INVOICE.AddOrUpdate(p => p.UID, model);
+ EntitiesFactory.SaveDb(db);
+ }
+ return true;
+ }
+
+ public static bool UpdateDataReason(string remark, string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ TB_INVOICE model = new TB_INVOICE
+ {
+ Remark = remark,
+ BillNum = billnum
+ };
+ db.TB_INVOICE.AddOrUpdate(p => p.BillNum, model);
+ }
+ return true;
+ }
+ public static TB_INVOICE GetDataByBillInvoiceBillNum(string id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TB_INVOICE.SingleOrDefault(p => p.BillNum == id);
+ }
+ }
+
+ public static V_BillInvoice GetBillInvoiceByBillNum(string id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoice.SingleOrDefault(p => p.BillNum == id);
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/InvoiceDetailController.cs b/北京北汽/SCP/CK.SCP.Controller/InvoiceDetailController.cs
new file mode 100644
index 0000000..9f53b4d
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/InvoiceDetailController.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class InvoiceDetailController
+ {
+ public static List GetDataByBillInvoiceDetail(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoiceDetail.Where(p => p.BillNum == billnum).ToList();
+ }
+ }
+
+ public static V_BillInvoiceDetail GetDataByBillInvoiceDetailModel(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoiceDetail.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ public static V_BillInvoiceDetail GetDataByBillInvoiceDetailBillNum(string id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillInvoiceDetail.SingleOrDefault(p => p.BillNum == id);
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/OadOrderController.cs b/北京北汽/SCP/CK.SCP.Controller/OadOrderController.cs
new file mode 100644
index 0000000..b7fd682
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/OadOrderController.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+namespace CK.SCP.Controller
+{
+ public class OadOrderController
+ {
+// public List GetList()
+// {
+// using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+// {
+// // db.TB_QadOrder.Where(p=>p.BillNo==db.)
+// var query = db.TB_QadOrder.Join(db.TB_QadOrderDetail, a => a.BillNo, g => g.BillNo, (a, g) => new
+// {
+// a.BillNo,
+// a.SupplierCode,
+// a.StartDate,
+// a.Address,
+// a.ProductCode,
+// a.Qty,
+// }).ToList();
+//// return query;
+// // return db.V_BillInvoice.Where(p => p.BillNum == billnum).ToList();
+//
+// }
+// }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/POController.cs b/北京北汽/SCP/CK.SCP.Controller/POController.cs
new file mode 100644
index 0000000..481dde4
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/POController.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Entity.Migrations;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.Enums;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class POController
+ {
+ public static List Getlist()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_POAll.ToList();
+ }
+ }
+ public static bool UpdatePOState(TF_PO model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TF_PO.AddOrUpdate(p => p.UID, model);
+ EntitiesFactory.SaveDb(db);
+ }
+ return true;
+ }
+
+ public static TF_PO GetlistByID(int uid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO.SingleOrDefault(p => p.UID == uid);
+ }
+ }
+
+ public static TF_PO GetlistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ public static V_POAll GetPOAlllistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_POAll.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ public static void UpdateOrderByUID(int state, int uid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ TF_PO model = new TF_PO();
+ model.State = state;
+ model.UID = uid;
+ db.SaveChanges();
+ }
+ }
+
+ public static void UpdatePOOBybillno(TF_PO model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ model.State = (int)PlanState.Confirm;
+
+ db.TF_PO.AddOrUpdate(p => p.UID, model);
+ db.SaveChanges();
+ }
+ }
+ public static List GetlistByBillNum(V_POAll model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_POAll.Where(p => p.BillNum == model.BillNum).ToList();
+ }
+ }
+ public static TF_PO GetASNlist(string billnum, string vendid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO.SingleOrDefault(p => p.BillNum == billnum && p.VendId == vendid);
+ }
+ }
+ public static TF_PO GetPOModel(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO.SingleOrDefault(p => p.UID == id);
+ }
+ }
+ public static List GetASNlist()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO.ToList();
+ }
+ }
+ public static void DeletePO(TF_PO model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TF_PO.Remove(model);
+ db.SaveChanges();
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/PODetailController.cs b/北京北汽/SCP/CK.SCP.Controller/PODetailController.cs
new file mode 100644
index 0000000..68951d7
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/PODetailController.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class PODetailController
+ {
+ public static V_POAllDetail GetlistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_POAllDetail.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+
+ public static TA_VENDER GetlistBySupplierCode(string VendId)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VENDER.SingleOrDefault(p => p.VendId == VendId);
+ }
+ }
+
+ public static List GetDetaillistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO_DETAIL.Where(p => p.BillNum == billnum).ToList();
+ }
+ }
+
+ public static TF_PO_DETAIL GetDetaillistByuid(int uid)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO_DETAIL.SingleOrDefault(p => p.UID == uid);
+ }
+ }
+ public static List GetDetaillistBybillnos(string billno)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO_DETAIL.Where(p => p.BillNum == billno).ToList();
+ }
+ }
+ public static void Delete(TF_PO_DETAIL model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TF_PO_DETAIL.Remove(model);
+ }
+ }
+ public static TF_PO_DETAIL GetDetaillistBybillidandline(string bill, int linenum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_PO_DETAIL.SingleOrDefault(p => p.BillNum == bill && p.ErpLineNum == linenum);
+ }
+ }
+ }
+}
+
diff --git a/北京北汽/SCP/CK.SCP.Controller/PartController.cs b/北京北汽/SCP/CK.SCP.Controller/PartController.cs
new file mode 100644
index 0000000..518ddb6
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/PartController.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class PartController
+ {
+ public static List Getlist()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_PART.ToList();
+ }
+ }
+ public static List GetlistByPartCode(TA_PART model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_PART.Where(p=>p.PartCode==model.PartCode).ToList();
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/PlanMonthController.cs b/北京北汽/SCP/CK.SCP.Controller/PlanMonthController.cs
new file mode 100644
index 0000000..6ae3765
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/PlanMonthController.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class PlanMonthController
+ {
+ public static TB_PlanMonth GetPlanMonthById(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TB_PlanMonth.SingleOrDefault(p => p.ID == id);
+ }
+ }
+
+ public static bool UpdatePlanMonthById(TB_PlanMonth model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ model.IsSend = "是";
+ model.SendTime = DateTime.Now;
+ db.TB_PlanMonth.AddOrUpdate(model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+ public static TA_VENDER GetVend()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VENDER.OrderByDescending(p => p.Email).SingleOrDefault(p => p.Email != null);
+ }
+ }
+
+ public static List GetVendList()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VENDER.ToList();
+ }
+ }
+
+ public static bool SaveTbPlanMonth(TB_PlanMonth model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TB_PlanMonth.AddOrUpdate(model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/Properties/AssemblyInfo.cs b/北京北汽/SCP/CK.SCP.Controller/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ab041bf
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("CK.SCP.CK.SCP.Controller")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("CK.SCP.CK.SCP.Controller")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("0c706e36-c79d-467c-91ca-ddf39bc43113")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/北京北汽/SCP/CK.SCP.Controller/PublicDataController.cs b/北京北汽/SCP/CK.SCP.Controller/PublicDataController.cs
new file mode 100644
index 0000000..e0839fb
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/PublicDataController.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class PublicDataController
+ {
+ public static TB_PublicData GetlistByBillNo(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TB_PublicData.SingleOrDefault(p => p.ID == id);
+ }
+ }
+ public static bool SaveInfo(TB_PublicData model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TB_PublicData.AddOrUpdate(model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+
+
+ public static bool UpdateInfo(TB_PublicData model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TB_PublicData.AddOrUpdate(p => p.ID, model);
+ db.SaveChanges();
+ }
+ return true;
+ }
+
+ public static void DeleteById(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ var info = db.TB_PublicData.SingleOrDefault(p => p.ID == id);
+ if (info != null) db.TB_PublicData.Remove(info);
+ db.SaveChanges();
+ }
+ }
+ }
+
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/ReceiveController.cs b/北京北汽/SCP/CK.SCP.Controller/ReceiveController.cs
new file mode 100644
index 0000000..43ef80b
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ReceiveController.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class ReceiveController
+ {
+ public static V_Receive GetlistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_Receive.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/ReceiveDetailController.cs b/北京北汽/SCP/CK.SCP.Controller/ReceiveDetailController.cs
new file mode 100644
index 0000000..ce6ab9a
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ReceiveDetailController.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class ReceiveDetailController
+ {
+ public static V_ReceiveDetail GetlistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_ReceiveDetail.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+
+ public static bool UpdateReceive(V_ReceiveDetail model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.V_ReceiveDetail.AddOrUpdate(p => p.UID, model);
+ EntitiesFactory.SaveDb(db);
+ }
+ return true;
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/ResultObject.cs b/北京北汽/SCP/CK.SCP.Controller/ResultObject.cs
new file mode 100644
index 0000000..270f538
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ResultObject.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CK.SCP.Controller
+{
+///
+///返回结果类
+///
+///
+ public class ResultObject
+ {
+ public ResultObject()
+ {
+ ErrorList = new List();
+ }
+ ///
+ /// 返回结果
+ ///
+ public T Result { set; get; }
+ ///
+ /// 错误列表
+ ///
+ public List ErrorList { set; get; }
+ ///
+ /// 返回状态
+ ///
+ public ReturnStatus State
+ {private set; get; }
+ }
+ public enum ReturnStatus
+ {
+ [Description("失败")]
+ Failed,
+ [Description("成功")]
+ Succeed
+
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/ShipController.cs b/北京北汽/SCP/CK.SCP.Controller/ShipController.cs
new file mode 100644
index 0000000..87fed15
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ShipController.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+
+
+namespace CK.SCP.Controller
+{
+ public class ShipController
+ {
+ public static void DeleteById(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ var asn = db.TF_ASN.SingleOrDefault(p => p.UID == id);
+ if (asn != null) db.TF_ASN.Remove(asn);
+ db.SaveChanges();
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/ShipDetailController.cs b/北京北汽/SCP/CK.SCP.Controller/ShipDetailController.cs
new file mode 100644
index 0000000..40435df
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/ShipDetailController.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.Migrations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class ShipDetailController
+ {
+ public static V_BillShipDetail GetlistByBillNum(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillShipDetail.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+
+ public static V_BillShip GetBillShiplistByBillNo(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.V_BillShip.SingleOrDefault(p => p.Bill == billnum);
+ }
+ }
+
+ public static TF_ASN GetlistByBillNo(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ public static TF_ASN_DETAIL GetDeatillistByBillNo(string billnum)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TF_ASN_DETAIL.SingleOrDefault(p => p.BillNum == billnum);
+ }
+ }
+ public static bool UpdateShip(TF_ASN model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ db.TF_ASN.AddOrUpdate(p => p.UID, model);
+
+ EntitiesFactory.SaveDb(db);
+ }
+ return true;
+
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/SupplierController.cs b/北京北汽/SCP/CK.SCP.Controller/SupplierController.cs
new file mode 100644
index 0000000..558e4a0
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/SupplierController.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+
+namespace CK.SCP.Controller
+{
+ public class SupplierController
+ {
+ public static List GetlistByName(TA_VENDER model)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VENDER.Where(p => p.VendName == model.VendName).ToList();
+ }
+ }
+ public static List Getlist()
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VENDER.ToList();
+ }
+ }
+
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/SupplierPartController.cs b/北京北汽/SCP/CK.SCP.Controller/SupplierPartController.cs
new file mode 100644
index 0000000..773337f
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/SupplierPartController.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+
+namespace CK.SCP.Controller
+{
+ public class SupplierPartController
+ {
+// public static List Getlist()
+// {
+// using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+// {
+// return db.V_VenderPart.ToList();
+// }
+// }
+// public static List GetlistByPartCode(V_VenderPart model)
+// {
+// using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+// {
+// return db.V_VenderPart.Where(p => p.PartCode == model.PartCode).ToList();
+// }
+// }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/UniApiController.cs b/北京北汽/SCP/CK.SCP.Controller/UniApiController.cs
new file mode 100644
index 0000000..96a1117
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/UniApiController.cs
@@ -0,0 +1,253 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using CK.SCP.Models;
+using CK.SCP.Models.Enums;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Models.UniApiEntity;
+
+namespace CK.SCP.Controller
+{
+ public static class UniApiController
+ {
+
+ public static void RemoveList(ScpEntities db, List uniApiList)
+ {
+ db.TS_UNI_API.RemoveRange(uniApiList);
+ }
+ public static void AddHisList(ScpEntities db, List uniApiHisList)
+ {
+
+ db.TS_UNI_API_HIS.AddRange(uniApiHisList);
+ }
+
+ public static void AddApiData(ScpEntities wdb, TS_UNI_API apiData)
+ {
+ wdb.TS_UNI_API.Add(apiData);
+ }
+
+
+ public static void AddApiDataList(ScpEntities wdb, List apiDataList)
+ {
+ wdb.TS_UNI_API.AddRange(apiDataList);
+ }
+
+
+ public static WmsTableName GetTableName(UniApiType uniApiType)
+ {
+ WmsTableName tableName;
+ switch (uniApiType)
+ {
+ case UniApiType.PO:
+ tableName = WmsTableName.TS_UNI_API;//中间表的名字
+ break;
+ case UniApiType.Receive:
+ tableName = WmsTableName.TS_UNI_API;
+ break;
+ case UniApiType.BarCode:
+ tableName = WmsTableName.TS_UNI_API;
+ break;
+ case UniApiType.Invoice:
+ tableName = WmsTableName.TS_UNI_API;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(uniApiType), uniApiType, null);
+ }
+ return tableName;
+ }
+
+ //创建采购订单
+ public static TS_UNI_API CreateBy(TF_PO bill, TF_PO_DETAIL detail, UniApiType uniApiType)
+ {
+ var tableName = GetTableName(uniApiType);
+ var apiData = new TS_UNI_API
+ {
+ InterfaceType = uniApiType.ToString(),
+ TableName = tableName.ToString(),
+ BillNum = bill.BillNum,
+ PartCode = detail.PartCode,
+ Batch = "",
+ Qty = detail.BillQty,
+ PoUnit = detail.PoUnit,
+ LocUnit = detail.LocUnit,
+ State = detail.State,
+ CreateOper = bill.OperName,
+ CreateTime = bill.BillTime,
+ PutTime = ScpCache.GetServerTime(),
+ VendId = bill.VendId,
+ BillType = (int)BillType.PuchaseOrder,
+ SubBillType = 0,
+ ValidDate = detail.DueDate,
+ ErpBillNum = bill.ErpBillNum,
+ ErpLineNum = detail.ErpLineNum,
+ VendBatch = "",
+ SourceBillNum = "",
+ Price = detail.Price,
+ PackQty = detail.PackQty,
+ Currency = detail.Currency,
+ Attn = "",//TODO
+ Buyer = bill.Buyer,
+ BuyerPhone = bill.BuyerPhone,
+ ModType = bill.ModType,
+ Receiver = "",//TODO
+ UmConv = (decimal)detail.UmConv,
+ };
+ return apiData;
+ }
+
+ private static ScpEntities db = EntitiesFactory.CreateScpInstance();
+ public static TS_UNI_API CreateBy(TF_PO bill, List detail, UniApiType uniApiType)
+ {
+ var tableName = GetTableName(uniApiType);
+ TS_UNI_API asp = new TS_UNI_API();
+ foreach (var item in detail)
+ {
+ asp.InterfaceType = uniApiType.ToString();
+ asp.TableName = tableName.ToString();
+
+ asp.BillNum = bill.BillNum;
+ asp.Batch = string.Empty;
+ asp.CreateOper = bill.OperName;
+ asp.CreateTime = bill.BillTime;
+ asp.PutTime = ScpCache.GetServerTime();
+ asp.VendId = bill.VendId;
+ asp.BillType = (int)BillType.PO;
+ asp.SubBillType = 0;
+ asp.VendBatch = string.Empty;
+ asp.SourceBillNum = string.Empty;
+ asp.Attn = "";//TODO
+ asp.Buyer = bill.Buyer;
+ asp.BuyerPhone = bill.BuyerPhone;
+ asp.ModType = bill.ModType;
+ asp.Receiver = "";//TODO
+ asp.PartCode = item.PartCode;
+
+ asp.Qty = item.BillQty;
+ asp.PoUnit = item.PoUnit;
+ asp.LocUnit = item.LocUnit;
+ asp.State = item.State;
+
+ asp.ValidDate = item.DueDate;
+ asp.ErpBillNum = bill.BillNum;//暂时跟billnum 一样 后期可能会改 预留
+ asp.ErpLineNum = item.ErpLineNum;
+
+ asp.Price = item.Price;
+ asp.PackQty = item.PackQty;
+ asp.Currency = item.Currency;
+
+ asp.UmConv = (decimal)item.UmConv;
+
+ db.TS_UNI_API.Add(asp);
+ db.SaveChanges();
+ }
+
+ return asp;
+ }
+
+ //创建发货单
+ public static TS_UNI_API CreateBy(TF_ASN bill, TF_ASN_DETAIL detail, UniApiType uniApiType)
+ {
+ var tableName = GetTableName(uniApiType);
+ var apiData = new TS_UNI_API
+ {
+ InterfaceType = uniApiType.ToString(),
+ TableName = tableName.ToString(),
+ BillNum = bill.BillNum,
+ PartCode = detail.PartCode,
+ Batch = detail.Batch,
+ Qty = detail.BillQty,
+ PoUnit = detail.PoUnit,
+ LocUnit = detail.LocUnit,
+ State = detail.State,
+ CreateOper = bill.OperName,
+ CreateTime = bill.BillTime,
+ PutTime = ScpCache.GetServerTime(),
+ VendId = bill.VendId,
+ BillType = (int)BillType.PuchaseOrder,
+ SubBillType = 0,
+ ValidDate = detail.ProduceDate,
+ ErpBillNum = bill.PoBillNum,
+ ErpLineNum = detail.PoLineNum,
+ VendBatch = detail.VendBatch,
+ Price = detail.Price,
+ PackQty = detail.PackQty,
+ Currency = detail.Currency,
+ UmConv = (decimal) detail.UmConv,
+ };
+ return apiData;
+ }
+
+ //创建条码
+ public static TS_UNI_API CreateBy(TF_ASN bill, TS_BARCODE detail, UniApiType uniApiType)
+ {
+ var tableName = GetTableName(uniApiType);
+ var apiData = new TS_UNI_API
+ {
+ Barcode = detail.BarCode,
+ InterfaceType = uniApiType.ToString(),
+ TableName = tableName.ToString(),
+ BillNum = bill.BillNum,
+ PartCode = detail.PartCode,
+ Batch = detail.Batch,
+ Qty = detail.Qty,
+ PoUnit = detail.PoUnit,
+ LocUnit = detail.LocUnit,
+ State = detail.State,
+ CreateOper = bill.OperName,
+ CreateTime = bill.BillTime,
+ PutTime = ScpCache.GetServerTime(),
+ VendId = bill.VendId,
+ BillType = (int)BillType.PuchaseOrder,
+ SubBillType = 0,
+ ValidDate = detail.ProduceDate,
+ ErpBillNum = bill.PoBillNum,
+ ErpLineNum = detail.PoBillLine,
+ VendBatch = detail.VendBatch,
+ SourceBillNum = detail.FullBarCode,
+ PackQty = detail.PackQty,
+ };
+ return apiData;
+ }
+
+ //创建发票
+ public static TS_UNI_API CreateBy(TB_INVOICE bill, TB_INVOICE_DETAIL detail, UniApiType uniApiType)
+ {
+ var tableName = GetTableName(uniApiType);
+ var apiData = new TS_UNI_API
+ {
+ InterfaceType = uniApiType.ToString(),
+ TableName = tableName.ToString(),
+ BillNum = bill.BillNum,
+ PartCode = detail.PartCode,
+ Batch = "",
+ Qty = detail.Qty,
+ PoUnit = detail.PoUnit,
+ LocUnit = detail.LocUnit,
+ State = detail.State,
+ CreateOper = bill.OperName,
+ CreateTime = bill.BillTime,
+ PutTime = ScpCache.GetServerTime(),
+ VendId = bill.VendId,
+ BillType = (int)BillType.PuchaseOrder,
+ SubBillType = 0,
+ ValidDate = detail.ProduceDate,
+ ErpBillNum = detail.PoBillNum,
+ ErpLineNum = detail.PoLineNum,
+ VendBatch = "",
+ SourceBillNum = "",
+ Price = detail.Price,
+ PackQty = detail.PackQty,
+ Currency = detail.Currency,
+ Invoice = bill.InvoiceNum,
+ Tax = detail.Tax,
+ TaxAmt = detail.TaxAmt,
+ };
+ return apiData;
+ }
+
+ public static List GetNewInterfaceList(ScpEntities wdb)
+ {
+ return wdb.TS_UNI_API.Where(p => p.State == (int)BillState.New).OrderBy(p => p.UID).ToList();
+ }
+ }
+}
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.Controller/UserController.cs b/北京北汽/SCP/CK.SCP.Controller/UserController.cs
new file mode 100644
index 0000000..004fb3a
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/UserController.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace CK.SCP.Controller
+{
+ public class UserController
+ {
+
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/VEND_USERController.cs b/北京北汽/SCP/CK.SCP.Controller/VEND_USERController.cs
new file mode 100644
index 0000000..a8a73a4
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/VEND_USERController.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CK.SCP.Models;
+using CK.SCP.Models.ScpEntity;
+
+namespace CK.SCP.Controller
+{
+ public class VEND_USERController
+ {
+ public static TA_VEND_USER GetVendUserModel(int id)
+ {
+ using (ScpEntities db = EntitiesFactory.CreateScpInstance())
+ {
+ return db.TA_VEND_USER.SingleOrDefault(p => p.UID == id);
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.Controller/app.config b/北京北汽/SCP/CK.SCP.Controller/app.config
new file mode 100644
index 0000000..23349b1
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/app.config
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.Controller/packages.config b/北京北汽/SCP/CK.SCP.Controller/packages.config
new file mode 100644
index 0000000..33e13d6
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Controller/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/App.config b/北京北汽/SCP/CK.SCP.DCUNI/App.config
new file mode 100644
index 0000000..88fa402
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/CK.SCP.DCUNI.csproj b/北京北汽/SCP/CK.SCP.DCUNI/CK.SCP.DCUNI.csproj
new file mode 100644
index 0000000..00bb699
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/CK.SCP.DCUNI.csproj
@@ -0,0 +1,87 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {1EE718E2-C8BA-4DD5-80EC-A1DE0449A58D}
+ WinExe
+ Properties
+ CK.SCP.DCUNI
+ CK.SCP.DCUNI
+ v4.5.2
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Form1.Designer.cs b/北京北汽/SCP/CK.SCP.DCUNI/Form1.Designer.cs
new file mode 100644
index 0000000..c7504a6
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Form1.Designer.cs
@@ -0,0 +1,39 @@
+namespace CK.SCP.DCUNI
+{
+ partial class Form1
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Text = "Form1";
+ }
+
+ #endregion
+ }
+}
+
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Form1.cs b/北京北汽/SCP/CK.SCP.DCUNI/Form1.cs
new file mode 100644
index 0000000..ef267f7
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Form1.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CK.SCP.DCUNI
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Program.cs b/北京北汽/SCP/CK.SCP.DCUNI/Program.cs
new file mode 100644
index 0000000..ee396e0
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CK.SCP.DCUNI
+{
+ static class Program
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Properties/AssemblyInfo.cs b/北京北汽/SCP/CK.SCP.DCUNI/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8d2c91e
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("CK.SCP.DCUNI")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CK.SCP.DCUNI")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("1ee718e2-c8ba-4dd5-80ec-a1de0449a58d")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.Designer.cs b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..bd1b915
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: 4.0.30319.42000
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace CK.SCP.DCUNI.Properties
+{
+
+
+ ///
+ /// 强类型资源类,用于查找本地化字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// 返回此类使用的缓存 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CK.SCP.DCUNI.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 覆盖当前线程的 CurrentUICulture 属性
+ /// 使用此强类型的资源类的资源查找。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.resx b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.Designer.cs b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..47a6aac
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CK.SCP.DCUNI.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.settings b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.DCUNI/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/北京北汽/SCP/CK.SCP.Models/App.config b/北京北汽/SCP/CK.SCP.Models/App.config
new file mode 100644
index 0000000..d696498
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Models/App.config
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/北京北汽/SCP/CK.SCP.Models/AppBoxEntity/AppBoxContext.cs b/北京北汽/SCP/CK.SCP.Models/AppBoxEntity/AppBoxContext.cs
new file mode 100644
index 0000000..abe3209
--- /dev/null
+++ b/北京北汽/SCP/CK.SCP.Models/AppBoxEntity/AppBoxContext.cs
@@ -0,0 +1,94 @@
+using System.Data.Entity;
+
+namespace CK.SCP.Models.AppBoxEntity
+{
+ public class AppBoxContext : DbContext
+ {
+ public AppBoxContext() : base(EntitiesFactory.GetEfConnectionString(GlobalConfig.AppBoxDatabase))
+ {
+
+ }
+
+ public AppBoxContext(string strConn) : base(strConn)
+ {
+
+ }
+
+ public DbSet Configs { get; set; }
+ public DbSet Depts { get; set; }
+ public DbSet Users { get; set; }
+ public DbSet Roles { get; set; }
+ public DbSet Titles { get; set; }
+ public DbSet Onlines { get; set; }
+ public DbSet Logs { get; set; }
+ public DbSet Powers { get; set; }
+ public DbSet