|
|
@ -16,7 +16,7 @@ namespace ICS.CreateIssueIN |
|
|
|
{ |
|
|
|
public class CreateIssue |
|
|
|
{ |
|
|
|
private static string ORGCode = ConfigurationManager.AppSettings["orgCode"].ToString(); |
|
|
|
//private static string ORGCode = ConfigurationManager.AppSettings["orgCode"].ToString();
|
|
|
|
public OperationResult CreateIssue1(List<IssueData> modellist) |
|
|
|
{ |
|
|
|
OperationResult result = new OperationResult(); |
|
|
@ -28,7 +28,8 @@ namespace ICS.CreateIssueIN |
|
|
|
beginstrlog.AppendLine("*****************************************************"); |
|
|
|
foreach (var model in modellist) |
|
|
|
{ |
|
|
|
beginstrlog.AppendLine("生产订单:" + model.MOCODE); |
|
|
|
beginstrlog.AppendLine("生产订单:" + model.MOCODE); |
|
|
|
beginstrlog.AppendLine("组织:" + model.OrgCode); |
|
|
|
|
|
|
|
foreach (var item in model.linelist) |
|
|
|
{ |
|
|
@ -51,7 +52,7 @@ namespace ICS.CreateIssueIN |
|
|
|
|
|
|
|
|
|
|
|
StringBuilder str = new StringBuilder(); |
|
|
|
|
|
|
|
string ORGCode = modellist[0].OrgCode; |
|
|
|
string OrgID = ""; |
|
|
|
|
|
|
|
OrgID = Appconfig.IsExistsCode(ORGCode, "Base_Organization"); |
|
|
@ -149,13 +150,11 @@ namespace ICS.CreateIssueIN |
|
|
|
foreach (IssueDatas line in model.linelist) |
|
|
|
{ |
|
|
|
|
|
|
|
string ORGID = Appconfig.IsExistsCode(line.ORGCODE, "Base_Organization"); |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(ORGID)) |
|
|
|
{ |
|
|
|
throw new Exception("组织编码:" + line.ORGCODE + "在U9中不存在。"); |
|
|
|
} |
|
|
|
|
|
|
|
//string ORGID = Appconfig.IsExistsCode(line.ORGCODE, "Base_Organization");
|
|
|
|
//if (string.IsNullOrEmpty(ORGID))
|
|
|
|
//{
|
|
|
|
// throw new Exception("组织编码:" + line.ORGCODE + "在U9中不存在。");
|
|
|
|
//}
|
|
|
|
|
|
|
|
pick.m_aCDType = 0; |
|
|
|
|
|
|
@ -171,9 +170,9 @@ namespace ICS.CreateIssueIN |
|
|
|
|
|
|
|
// 料品
|
|
|
|
string itemid = ""; |
|
|
|
orgsql = @"select id from CBO_ItemMaster where code=='{0}'"; |
|
|
|
orgsql = @"select id from CBO_ItemMaster where code='{0}'"; |
|
|
|
orgsql = string.Format(orgsql, line.ITEM); |
|
|
|
orgdt = DBhlper.Query(orgsql, Appconfig.GetU9ConnStr()); |
|
|
|
orgdt = DBhlper.Query(orgsql, Appconfig.GetU9ConnStr()); |
|
|
|
if (orgdt.Rows.Count != 0) |
|
|
|
itemid = orgdt.Rows[0]["ID"].ToString(); |
|
|
|
else |
|
|
@ -198,13 +197,13 @@ namespace ICS.CreateIssueIN |
|
|
|
// 应发数量
|
|
|
|
pick.m_issueQty = Convert.ToDecimal(line.ActualReqQty); |
|
|
|
//存储地点
|
|
|
|
if (Appconfig.GetWhCodeByBinid(line.WH, ORGID) != "") |
|
|
|
{ |
|
|
|
UFIDAU9CBOPubControllerCommonArchiveDataDTOData ww = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData(); |
|
|
|
mo.m_iD = Convert.ToInt64(Appconfig.GetWhCodeByBinid(line.WH, ORGID)); |
|
|
|
mo.m_code = line.WH; |
|
|
|
pick.m_issueWh = ww; |
|
|
|
} |
|
|
|
//if (Appconfig.GetWhCodeByBinid(line.WH, ORGID) != "")
|
|
|
|
//{
|
|
|
|
// UFIDAU9CBOPubControllerCommonArchiveDataDTOData ww = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
|
|
|
|
// mo.m_iD = Convert.ToInt64(Appconfig.GetWhCodeByBinid(line.WH, ORGID));
|
|
|
|
// mo.m_code = line.WH;
|
|
|
|
// pick.m_issueWh = ww;
|
|
|
|
//}
|
|
|
|
// 批号
|
|
|
|
//弹性栏位:
|
|
|
|
//pickListDTO.DescFlexField = new DescFlexSegmentsData();
|
|
|
@ -213,21 +212,21 @@ namespace ICS.CreateIssueIN |
|
|
|
//pickListDTO.MOPickList = moPickList.ID;
|
|
|
|
// 货主组织
|
|
|
|
UFIDAU9CBOPubControllerCommonArchiveDataDTOData org = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData(); |
|
|
|
mo.m_iD = Convert.ToInt64(ORGID); |
|
|
|
mo.m_code = line.ORGCODE; |
|
|
|
mo.m_iD =long.Parse( OrgID); |
|
|
|
mo.m_code = ORGCode;// line.ORGCODE;
|
|
|
|
pick.m_ownerOrg = org; |
|
|
|
//库位
|
|
|
|
//子料项目号
|
|
|
|
if (!string.IsNullOrEmpty(line.Project)) |
|
|
|
{ |
|
|
|
if (Appconfig.GetProjectid(line.Project, ORGID) != "") |
|
|
|
{ |
|
|
|
UFIDAU9CBOPubControllerCommonArchiveDataDTOData project = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData(); |
|
|
|
mo.m_iD = Convert.ToInt64(Appconfig.GetProjectid(line.Project, ORGID)); |
|
|
|
mo.m_code = line.Project; |
|
|
|
pick.m_project = project; |
|
|
|
} |
|
|
|
} |
|
|
|
//if (!string.IsNullOrEmpty(line.Project))
|
|
|
|
//{
|
|
|
|
// if (Appconfig.GetProjectid(line.Project, ORGID) != "")
|
|
|
|
// {
|
|
|
|
// UFIDAU9CBOPubControllerCommonArchiveDataDTOData project = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
|
|
|
|
// mo.m_iD = Convert.ToInt64(Appconfig.GetProjectid(line.Project, ORGID));
|
|
|
|
// mo.m_code = line.Project;
|
|
|
|
// pick.m_project = project;
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
pick.m_issueDocLineID = 1; |
|
|
|
picklst.Add(pick); |
|
|
|
} |
|
|
@ -341,7 +340,7 @@ namespace ICS.CreateIssueIN |
|
|
|
|
|
|
|
public class IssueData { |
|
|
|
public string MOCODE { get; set; } |
|
|
|
public string DOCNO { get; set; } |
|
|
|
public string OrgCode { get; set; } |
|
|
|
public string memo { get; set; } |
|
|
|
|
|
|
|
public List<IssueDatas> linelist { get; set; } |
|
|
|