提交所有文件3

This commit is contained in:
2026-09-21 11:37:39 +08:00
parent 5222c98e0e
commit f216ceb835
33 changed files with 944 additions and 177 deletions
+92 -45
View File
@@ -203,7 +203,7 @@ namespace GThinking.N_XLXSBJ
{
string sXLXHID = sGetCellText(dtSheet1.Rows[i], 0);
string sXLGGID = sGetCellText(dtSheet1.Rows[i], 1);
string sXLBZID = sGetCellText(dtSheet1.Rows[i], 2);
string sXLBZRaw = sGetCellText(dtSheet1.Rows[i], 2);
string sDYDJID = sGetCellText(dtSheet1.Rows[i], 3);
string sWJ = sGetCellText(dtSheet1.Rows[i], 4);
string sLB = sGetCellText(dtSheet1.Rows[i], 5);
@@ -238,9 +238,20 @@ namespace GThinking.N_XLXSBJ
{
sXLGGID = sXLGGID.Replace("x", "X").Replace("X", "*").Replace("×", "*");
}
sXLBZID = XLBJDUtils.GetBZXLZBZID(sXLBZID, sDefaultXLBZID, dicDRMXBZ);
if (sXLBZID.Equals(""))
sXLBZID = " ";
string sXLBZID = XLBJDUtils.GetBZXLZBZID(sXLBZRaw, sDefaultXLBZID, dicDRMXBZ);
//标准为GA时,同步生成G、Q标准的记录,其他信息一致
List<string> listXLBZID = new List<string>();
listXLBZID.Add(sXLBZID);
if (sXLBZRaw.ToUpper().Equals("GA"))
{
string sGBZID = XLBJDUtils.GetBZXLZBZID("G", sDefaultXLBZID, dicDRMXBZ);
string sQBZID = XLBJDUtils.GetBZXLZBZID("Q", sDefaultXLBZID, dicDRMXBZ);
if (!sGBZID.Equals("") && !listXLBZID.Contains(sGBZID))
listXLBZID.Add(sGBZID);
if (!sQBZID.Equals("") && !listXLBZID.Contains(sQBZID))
listXLBZID.Add(sQBZID);
}
//规则1:所有产品,包装要求按扎为单位的,均不考虑计算装盘数据
//if (sDW.Contains("扎"))
@@ -312,49 +323,85 @@ namespace GThinking.N_XLXSBJ
}
Mac.MacLog.TraceFormat("DR4");
if (!CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSJGBYZZ1 where XLXSJGBYZZ1_JGBID='{0}' and XLXSJGBYZZ1_XLXHID='{1}' and XLXSJGBYZZ1_XLGGID='{2}' and XLXSJGBYZZ1_DYDJID='{3}' and XLXSJGBYZZ1_XLBZID='{4}' and XLXSJGBYZZ1_YZID='{5}'",
sJGBID, sXLXHID, sXLGGID, sDYDJID, sXLBZID, sYZID)))
foreach (string sCurXLBZID in listXLBZID)
{
sSQL.Clear();
sSQL.Add("insert into XLXSJGBYZZ1(XLXSJGBYZZ1_JGBID,XLXSJGBYZZ1_XLXHID,XLXSJGBYZZ1_XLGGID,XLXSJGBYZZ1_DYDJID,XLXSJGBYZZ1_XLBZID,XLXSJGBYZZ1_YZID,XLXSJGBYZZ1_YZZ,XLXSJGBYZZ1_TJDH,XLXSJGBYZZ1_WHR,XLXSJGBYZZ1_WHRID,XLXSJGBYZZ1_WHSJ)");
sSQL.Add(" values(:XLXSJGBYZZ1_JGBID,:XLXSJGBYZZ1_XLXHID,:XLXSJGBYZZ1_XLGGID,:XLXSJGBYZZ1_DYDJID,:XLXSJGBYZZ1_XLBZID,:XLXSJGBYZZ1_YZID,:XLXSJGBYZZ1_YZZ,:XLXSJGBYZZ1_TJDH,:XLXSJGBYZZ1_WHR,:XLXSJGBYZZ1_WHRID,:XLXSJGBYZZ1_WHSJ)");
sSQL.ParamByName("XLXSJGBYZZ1_JGBID").Value = sJGBID;
sSQL.ParamByName("XLXSJGBYZZ1_XLXHID").Value = sXLXHID;
sSQL.ParamByName("XLXSJGBYZZ1_XLGGID").Value = sXLGGID;
sSQL.ParamByName("XLXSJGBYZZ1_DYDJID").Value = sDYDJID;
sSQL.ParamByName("XLXSJGBYZZ1_XLBZID").Value = sXLBZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZID").Value = sYZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZZ").Value = dAmount;
sSQL.ParamByName("XLXSJGBYZZ1_TJDH").Value = " ";
sSQL.ParamByName("XLXSJGBYZZ1_WHR").Value = tSession.UserName;
sSQL.ParamByName("XLXSJGBYZZ1_WHRID").Value = tSession.UserId;
sSQL.ParamByName("XLXSJGBYZZ1_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
string sBZID = sCurXLBZID.Equals("") ? " " : sCurXLBZID;
if (!CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from BJCPXX where BJCPXX_XLXHID='{0}' and BJCPXX_XLGGID='{1}' and BJCPXX_XLBZID='{2}' and BJCPXX_DYDJID='{3}'", sXLXHID, sXLGGID.Replace("*", "×"), sBZID, sDYDJID)))
{
sSQL.Clear();
sSQL.Add("insert into BJCPXX(BJCPXX_XLXHID,BJCPXX_XLGGID,BJCPXX_XLBZID,BJCPXX_DYDJID,BJCPXX_WJ,BJCPXX_WHR,BJCPXX_WHRID,BJCPXX_WHSJ)");
sSQL.Add(" values(:BJCPXX_XLXHID,:BJCPXX_XLGGID,:BJCPXX_XLBZID,:BJCPXX_DYDJID,:BJCPXX_WJ,:BJCPXX_WHR,:BJCPXX_WHRID,:BJCPXX_WHSJ)");
sSQL.ParamByName("BJCPXX_XLXHID").Value = sXLXHID;
sSQL.ParamByName("BJCPXX_XLGGID").Value = sXLGGID.Replace("*", "×");
sSQL.ParamByName("BJCPXX_XLBZID").Value = sBZID;
sSQL.ParamByName("BJCPXX_DYDJID").Value = sDYDJID;
sSQL.ParamByName("BJCPXX_WJ").Value = CMISproConvert.StrToFloat(sWJ);
sSQL.ParamByName("BJCPXX_WHR").Value = tSession.UserName;
sSQL.ParamByName("BJCPXX_WHRID").Value = tSession.UserId;
sSQL.ParamByName("BJCPXX_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
}
else
{
sSQL.Clear();
sSQL.Add("update BJCPXX set BJCPXX_WJ=:BJCPXX_WJ,BJCPXX_WHR=:BJCPXX_WHR,BJCPXX_WHRID=:BJCPXX_WHRID,BJCPXX_WHSJ=:BJCPXX_WHSJ ");
sSQL.Add(" where BJCPXX_XLXHID=:BJCPXX_XLXHID and BJCPXX_XLGGID=:BJCPXX_XLGGID and BJCPXX_XLBZID=:BJCPXX_XLBZID and BJCPXX_DYDJID=:BJCPXX_DYDJID ");
sSQL.ParamByName("BJCPXX_XLXHID").Value = sXLXHID;
sSQL.ParamByName("BJCPXX_XLGGID").Value = sXLGGID.Replace("*", "×");
sSQL.ParamByName("BJCPXX_XLBZID").Value = sBZID;
sSQL.ParamByName("BJCPXX_DYDJID").Value = sDYDJID;
sSQL.ParamByName("BJCPXX_WJ").Value = CMISproConvert.StrToFloat(sWJ);
sSQL.ParamByName("BJCPXX_WHR").Value = tSession.UserName;
sSQL.ParamByName("BJCPXX_WHRID").Value = tSession.UserId;
sSQL.ParamByName("BJCPXX_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
}
if (!CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSJGBYZZ1 where XLXSJGBYZZ1_JGBID='{0}' and XLXSJGBYZZ1_XLXHID='{1}' and XLXSJGBYZZ1_XLGGID='{2}' and XLXSJGBYZZ1_DYDJID='{3}' and XLXSJGBYZZ1_XLBZID='{4}' and XLXSJGBYZZ1_YZID='{5}'",
sJGBID, sXLXHID, sXLGGID, sDYDJID, sBZID, sYZID)))
{
sSQL.Clear();
sSQL.Add("insert into XLXSJGBYZZ1(XLXSJGBYZZ1_JGBID,XLXSJGBYZZ1_XLXHID,XLXSJGBYZZ1_XLGGID,XLXSJGBYZZ1_DYDJID,XLXSJGBYZZ1_XLBZID,XLXSJGBYZZ1_YZID,XLXSJGBYZZ1_YZZ,XLXSJGBYZZ1_TJDH,XLXSJGBYZZ1_WHR,XLXSJGBYZZ1_WHRID,XLXSJGBYZZ1_WHSJ)");
sSQL.Add(" values(:XLXSJGBYZZ1_JGBID,:XLXSJGBYZZ1_XLXHID,:XLXSJGBYZZ1_XLGGID,:XLXSJGBYZZ1_DYDJID,:XLXSJGBYZZ1_XLBZID,:XLXSJGBYZZ1_YZID,:XLXSJGBYZZ1_YZZ,:XLXSJGBYZZ1_TJDH,:XLXSJGBYZZ1_WHR,:XLXSJGBYZZ1_WHRID,:XLXSJGBYZZ1_WHSJ)");
sSQL.ParamByName("XLXSJGBYZZ1_JGBID").Value = sJGBID;
sSQL.ParamByName("XLXSJGBYZZ1_XLXHID").Value = sXLXHID;
sSQL.ParamByName("XLXSJGBYZZ1_XLGGID").Value = sXLGGID;
sSQL.ParamByName("XLXSJGBYZZ1_DYDJID").Value = sDYDJID;
sSQL.ParamByName("XLXSJGBYZZ1_XLBZID").Value = sBZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZID").Value = sYZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZZ").Value = dAmount;
sSQL.ParamByName("XLXSJGBYZZ1_TJDH").Value = " ";
sSQL.ParamByName("XLXSJGBYZZ1_WHR").Value = tSession.UserName;
sSQL.ParamByName("XLXSJGBYZZ1_WHRID").Value = tSession.UserId;
sSQL.ParamByName("XLXSJGBYZZ1_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
}
else
{
sSQL.Clear();
sSQL.Add("update XLXSJGBYZZ1 set XLXSJGBYZZ1_YZZ=:XLXSJGBYZZ1_YZZ,XLXSJGBYZZ1_TJDH=:XLXSJGBYZZ1_TJDH,XLXSJGBYZZ1_WHR=:XLXSJGBYZZ1_WHR,XLXSJGBYZZ1_WHRID=:XLXSJGBYZZ1_WHRID,XLXSJGBYZZ1_WHSJ=:XLXSJGBYZZ1_WHSJ");
sSQL.Add(" where XLXSJGBYZZ1_JGBID=:XLXSJGBYZZ1_JGBID");
sSQL.Add(" and XLXSJGBYZZ1_XLXHID=:XLXSJGBYZZ1_XLXHID");
sSQL.Add(" and XLXSJGBYZZ1_XLGGID=:XLXSJGBYZZ1_XLGGID");
sSQL.Add(" and XLXSJGBYZZ1_DYDJID=:XLXSJGBYZZ1_DYDJID");
sSQL.Add(" and XLXSJGBYZZ1_XLBZID=:XLXSJGBYZZ1_XLBZID");
sSQL.Add(" and XLXSJGBYZZ1_YZID=:XLXSJGBYZZ1_YZID");
sSQL.ParamByName("XLXSJGBYZZ1_JGBID").Value = sJGBID;
sSQL.ParamByName("XLXSJGBYZZ1_XLXHID").Value = sXLXHID;
sSQL.ParamByName("XLXSJGBYZZ1_XLGGID").Value = sXLGGID;
sSQL.ParamByName("XLXSJGBYZZ1_DYDJID").Value = sDYDJID;
sSQL.ParamByName("XLXSJGBYZZ1_XLBZID").Value = sBZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZID").Value = sYZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZZ").Value = dAmount;
sSQL.ParamByName("XLXSJGBYZZ1_TJDH").Value = " ";
sSQL.ParamByName("XLXSJGBYZZ1_WHR").Value = tSession.UserName;
sSQL.ParamByName("XLXSJGBYZZ1_WHRID").Value = tSession.UserId;
sSQL.ParamByName("XLXSJGBYZZ1_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
}
iInsertCount++;
}
else
{
sSQL.Clear();
sSQL.Add("update XLXSJGBYZZ1 set XLXSJGBYZZ1_YZZ=:XLXSJGBYZZ1_YZZ,XLXSJGBYZZ1_TJDH=:XLXSJGBYZZ1_TJDH,XLXSJGBYZZ1_WHR=:XLXSJGBYZZ1_WHR,XLXSJGBYZZ1_WHRID=:XLXSJGBYZZ1_WHRID,XLXSJGBYZZ1_WHSJ=:XLXSJGBYZZ1_WHSJ");
sSQL.Add(" where XLXSJGBYZZ1_JGBID=:XLXSJGBYZZ1_JGBID");
sSQL.Add(" and XLXSJGBYZZ1_XLXHID=:XLXSJGBYZZ1_XLXHID");
sSQL.Add(" and XLXSJGBYZZ1_XLGGID=:XLXSJGBYZZ1_XLGGID");
sSQL.Add(" and XLXSJGBYZZ1_DYDJID=:XLXSJGBYZZ1_DYDJID");
sSQL.Add(" and XLXSJGBYZZ1_XLBZID=:XLXSJGBYZZ1_XLBZID");
sSQL.Add(" and XLXSJGBYZZ1_YZID=:XLXSJGBYZZ1_YZID");
sSQL.ParamByName("XLXSJGBYZZ1_JGBID").Value = sJGBID;
sSQL.ParamByName("XLXSJGBYZZ1_XLXHID").Value = sXLXHID;
sSQL.ParamByName("XLXSJGBYZZ1_XLGGID").Value = sXLGGID;
sSQL.ParamByName("XLXSJGBYZZ1_DYDJID").Value = sDYDJID;
sSQL.ParamByName("XLXSJGBYZZ1_XLBZID").Value = sXLBZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZID").Value = sYZID;
sSQL.ParamByName("XLXSJGBYZZ1_YZZ").Value = dAmount;
sSQL.ParamByName("XLXSJGBYZZ1_TJDH").Value = " ";
sSQL.ParamByName("XLXSJGBYZZ1_WHR").Value = tSession.UserName;
sSQL.ParamByName("XLXSJGBYZZ1_WHRID").Value = tSession.UserId;
sSQL.ParamByName("XLXSJGBYZZ1_WHSJ").Value = DateTime.Now;
dberp.ExecSQL(sSQL);
}
iInsertCount++;
}
if (iInsertCount == 0)
{