|
@@ -231,7 +231,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
/// <param name="currentUserCode"></param>
|
|
/// <param name="currentUserCode"></param>
|
|
|
/// <param name="sUser"></param>
|
|
/// <param name="sUser"></param>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public static ServiceResultEntity AddTruckBarCodes(string[] barcodes, string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
|
|
|
|
+ public static ServiceResultEntity AddTruckBarCodes(string barCodes, string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
{
|
|
{
|
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
|
sre.Data = new DataSet();
|
|
sre.Data = new DataSet();
|
|
@@ -259,11 +259,12 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
else if (dt.Rows[0]["STATUS"].ToString().Equals("0"))
|
|
else if (dt.Rows[0]["STATUS"].ToString().Equals("0"))
|
|
|
{
|
|
{
|
|
|
int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
|
|
int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
|
|
|
- for (int i = 0; i < barcodes.Length; i++)
|
|
|
|
|
|
|
+ string[] barcodeStr = barCodes.Split(',');
|
|
|
|
|
+ for (int i = 0; i < barcodeStr.Length; i++)
|
|
|
{
|
|
{
|
|
|
//获取产品条码当前工序
|
|
//获取产品条码当前工序
|
|
|
sqlStr = $@"
|
|
sqlStr = $@"
|
|
|
- select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcodes[i]}'
|
|
|
|
|
|
|
+ select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcodeStr[i]}'
|
|
|
";
|
|
";
|
|
|
string procedureid = conn.GetSqlResultToStr(sqlStr);
|
|
string procedureid = conn.GetSqlResultToStr(sqlStr);
|
|
|
|
|
|
|
@@ -284,7 +285,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
UPDATEUSERID )
|
|
UPDATEUSERID )
|
|
|
SELECT
|
|
SELECT
|
|
|
'{entruckingCode}',
|
|
'{entruckingCode}',
|
|
|
- '{barcodes[i]}',
|
|
|
|
|
|
|
+ '{barcodeStr[i]}',
|
|
|
'{batch}',
|
|
'{batch}',
|
|
|
1,
|
|
1,
|
|
|
{procedureid},
|
|
{procedureid},
|
|
@@ -298,8 +299,15 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
FROM TP_MST_USER WHERE USERCODE = '{currentUserCode}'
|
|
FROM TP_MST_USER WHERE USERCODE = '{currentUserCode}'
|
|
|
";
|
|
";
|
|
|
execute = conn.ExecuteNonQuery(sqlStr);
|
|
execute = conn.ExecuteNonQuery(sqlStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ //修改装具状态
|
|
|
|
|
+ if (execute > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlStr = $@"UPDATE TP_PM_ENTRUCKING SET STATUS = 1,BATCH = '{batch}' WHERE ENTRUCKINGCODE = '{entruckingCode}' ";
|
|
|
|
|
+ execute = conn.ExecuteNonQuery(sqlStr);
|
|
|
if (execute > 0)
|
|
if (execute > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ conn.Commit();
|
|
|
sre.Status = Constant.ServiceResultStatus.Success;
|
|
sre.Status = Constant.ServiceResultStatus.Success;
|
|
|
sre.Message = "操作完成!";
|
|
sre.Message = "操作完成!";
|
|
|
}
|
|
}
|
|
@@ -309,13 +317,16 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
sre.Message = "操作失败,没有更新任何数据!";
|
|
sre.Message = "操作失败,没有更新任何数据!";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sre.Status = Constant.ServiceResultStatus.NoModifyData;
|
|
|
|
|
+ sre.Message = "操作失败,没有更新任何数据!";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
|
sre.Message = "装具不可用!";
|
|
sre.Message = "装具不可用!";
|
|
|
}
|
|
}
|
|
|
- conn.Commit();
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
@@ -483,19 +494,28 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
AND T.STATUS = '1'
|
|
AND T.STATUS = '1'
|
|
|
";
|
|
";
|
|
|
int execute = conn.ExecuteNonQuery(sqlStr);
|
|
int execute = conn.ExecuteNonQuery(sqlStr);
|
|
|
- dt = conn.GetSqlResultToDt(sqlStr);
|
|
|
|
|
- sre.Data.Tables.Add(dt);
|
|
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
|
|
- {
|
|
|
|
|
- sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
|
|
|
- sre.Message = "装具上无产品!";
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- sre.Status = Constant.ServiceResultStatus.Success;
|
|
|
|
|
- sre.Message = "操作成功!";
|
|
|
|
|
|
|
+ //修改装具状态
|
|
|
|
|
+ if (execute > 0) {
|
|
|
|
|
+ sqlStr = $@"UPDATE TP_PM_ENTRUCKING SET STATUS = '0' WHERE ENTRUCKINGCODE = '{entruckingCode}' ";
|
|
|
|
|
+ execute = conn.ExecuteNonQuery(sqlStr);
|
|
|
|
|
+ if (execute > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ conn.Commit();
|
|
|
|
|
+ sre.Status = Constant.ServiceResultStatus.Success;
|
|
|
|
|
+ sre.Message = "操作完成!";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sre.Status = Constant.ServiceResultStatus.NoModifyData;
|
|
|
|
|
+ sre.Message = "操作失败,没有更新任何数据!";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sre.Status = Constant.ServiceResultStatus.NoModifyData;
|
|
|
|
|
+ sre.Message = "操作失败,没有更新任何数据!";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
@@ -523,7 +543,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
/// <param name="currentUserCode"></param>
|
|
/// <param name="currentUserCode"></param>
|
|
|
/// <param name="sUser"></param>
|
|
/// <param name="sUser"></param>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public static ServiceResultEntity AddTruckBarCode(string barcode, string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
|
|
|
|
+ public static ServiceResultEntity AddTruckBarCode(string barCode, string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
{
|
|
{
|
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
|
sre.Data = new DataSet();
|
|
sre.Data = new DataSet();
|
|
@@ -553,7 +573,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
|
|
int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
|
|
|
//获取产品条码当前工序
|
|
//获取产品条码当前工序
|
|
|
sqlStr = $@"
|
|
sqlStr = $@"
|
|
|
- select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcode}'
|
|
|
|
|
|
|
+ select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barCode}'
|
|
|
";
|
|
";
|
|
|
string procedureid = conn.GetSqlResultToStr(sqlStr);
|
|
string procedureid = conn.GetSqlResultToStr(sqlStr);
|
|
|
|
|
|
|
@@ -574,7 +594,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
UPDATEUSERID )
|
|
UPDATEUSERID )
|
|
|
SELECT
|
|
SELECT
|
|
|
'{entruckingCode}',
|
|
'{entruckingCode}',
|
|
|
- '{barcode}',
|
|
|
|
|
|
|
+ '{barCode}',
|
|
|
'{batch}',
|
|
'{batch}',
|
|
|
1,
|
|
1,
|
|
|
{procedureid},
|
|
{procedureid},
|
|
@@ -626,7 +646,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
/// <param name="entruckingCode"></param>
|
|
/// <param name="entruckingCode"></param>
|
|
|
/// <param name="sUser"></param>
|
|
/// <param name="sUser"></param>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public static ServiceResultEntity UnbindTruckBarCode(string barcode,string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
|
|
|
|
+ public static ServiceResultEntity UnbindTruckBarCode(string barCode, string entruckingCode, string currentUserCode, SUserInfo sUser)
|
|
|
{
|
|
{
|
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
ServiceResultEntity sre = new ServiceResultEntity();
|
|
|
sre.Data = new DataSet();
|
|
sre.Data = new DataSet();
|
|
@@ -689,7 +709,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
INNER JOIN TP_MST_USER CU ON CU.USERCODE = '{currentUserCode}' AND CU.VALUEFLAG = '1'
|
|
INNER JOIN TP_MST_USER CU ON CU.USERCODE = '{currentUserCode}' AND CU.VALUEFLAG = '1'
|
|
|
WHERE
|
|
WHERE
|
|
|
TD.ENTRUCKINGCODE = '{entruckingCode}'
|
|
TD.ENTRUCKINGCODE = '{entruckingCode}'
|
|
|
- AND TD.BARCODE = '{barcode}'
|
|
|
|
|
|
|
+ AND TD.BARCODE = '{barCode}'
|
|
|
AND T.STATUS = '1'
|
|
AND T.STATUS = '1'
|
|
|
";
|
|
";
|
|
|
int execute = conn.ExecuteNonQuery(sqlStr);
|
|
int execute = conn.ExecuteNonQuery(sqlStr);
|
|
@@ -709,7 +729,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
sre.Status = Constant.ServiceResultStatus.NoSearchResults;
|
|
|
- sre.Message = "装具未使用";
|
|
|
|
|
|
|
+ sre.Message = "装具未使用,不可进行拆减";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|