|
|
@@ -269,20 +269,22 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
|
|
|
string goods = null;
|
|
|
string goodstypes = form["goodstypecodeMaster"].ToString();
|
|
|
DataTable goodstype = null;
|
|
|
- if (goodstypes == "1") {
|
|
|
+ if (goodstypes == "001") {
|
|
|
goodstype = conn.ExecuteDatatable(@"SELECT GOODSID,GOODSCODE FROM TP_MST_GOODS ", new CDAParameter(null,null));
|
|
|
}
|
|
|
- if (goodstypes == "2") {
|
|
|
+ if (goodstypes == "001001") {
|
|
|
goodstype = conn.ExecuteDatatable(@"SELECT GOODSID,GOODSCODE FROM TP_MST_GOODS WHERE GOODSTYPEID IN
|
|
|
(SELECT GOODSTYPEID from TP_MST_GOODSTYPE WHERE SUBSTR( GOODSTYPECODE, 0, 6 ) = '001001') ", new CDAParameter(null,null));
|
|
|
}
|
|
|
- if (goodstypes == "5") {
|
|
|
+ if (goodstypes == "001002") {
|
|
|
goodstype = conn.ExecuteDatatable(@"SELECT GOODSID,GOODSCODE FROM TP_MST_GOODS WHERE GOODSTYPEID IN
|
|
|
(SELECT GOODSTYPEID from TP_MST_GOODSTYPE WHERE SUBSTR( GOODSTYPECODE, 0, 6 ) = '001002') ", new CDAParameter(null,null));
|
|
|
}
|
|
|
- if (goodstypes != "1"&&goodstypes != "2"&&goodstypes != "5")
|
|
|
+ if (goodstypes != "001"&&goodstypes != "001001"&&goodstypes != "001002")
|
|
|
{
|
|
|
- goodstype = conn.ExecuteDatatable(@"SELECT GOODSID,GOODSCODE FROM TP_MST_GOODS WHERE GOODSTYPEID=@GOODSTYPEID@", new CDAParameter("GOODSTYPEID", goodstypes));
|
|
|
+ goodstype = conn.ExecuteDatatable(@"SELECT G.GOODSID,G.GOODSCODE FROM TP_MST_GOODS G
|
|
|
+ LEFT JOIN tp_mst_goodstype GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
+ WHERE GT.GOODSTYPECODE=@GOODSTYPECODE@", new CDAParameter("GOODSTYPECODE", goodstypes));
|
|
|
}
|
|
|
if ( form["GOODSCODE"]!= null && form["GOODSCODE"] != "") {
|
|
|
goods = form["GOODSCODE"].ToString();
|
|
|
@@ -372,7 +374,7 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
|
|
|
new CDAParameter("GOODSID", goodsTable.Rows[i]["GOODSID"])
|
|
|
);
|
|
|
|
|
|
- //多个
|
|
|
+ //多个
|
|
|
int result2 = conn.ExecuteNonQuery(@"
|
|
|
update TP_PM_FQCITEMS t set t.valueflag = '0' ,t.UPDATEUSERID = @UPDATEUSERID@,
|
|
|
t.UPDATETIME = sysdate
|
|
|
@@ -383,7 +385,7 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
|
|
|
new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
new CDAParameter("GOODSID", goodsTable.Rows[i]["GOODSID"])
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else
|
|
|
@@ -411,71 +413,74 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int result = conn.ExecuteNonQuery(@"
|
|
|
- INSERT INTO TP_PM_FQCITEMS (
|
|
|
- INSPECTTYPE,
|
|
|
- INSPECTNAME,
|
|
|
- GOODSID,
|
|
|
- GOODSCODE,
|
|
|
- INSPECTVERSION,
|
|
|
- REMARKS,
|
|
|
- ACCOUNTID,
|
|
|
- CREATEUSERID,
|
|
|
- UPDATEUSERID
|
|
|
- ) VALUES (
|
|
|
- @INSPECTTYPE@,
|
|
|
- @INSPECTNAME@,
|
|
|
- @GOODSID@,
|
|
|
- @GOODSCODE@,
|
|
|
- @INSPECTVERSION@,
|
|
|
- @REMARKS@,
|
|
|
- @ACCOUNTID@,
|
|
|
- @CREATEUSERID@,
|
|
|
- @UPDATEUSERID@
|
|
|
- )
|
|
|
- ",
|
|
|
- new CDAParameter("INSPECTTYPE", form["INSPECTTYPE"].ToString()),
|
|
|
- new CDAParameter("INSPECTNAME", form["INSPECTNAME"].ToString()),
|
|
|
- new CDAParameter("GOODSID", 0),
|
|
|
- new CDAParameter("GOODSCODE", goods.ToString()),
|
|
|
- new CDAParameter("INSPECTVERSION", form["INSPECTVERSION"].ToString()),
|
|
|
- new CDAParameter("REMARKS", form["REMARKS"]),
|
|
|
- new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
|
|
|
- new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
- new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
|
|
|
- );
|
|
|
- object id =conn.ExecuteScalar(@"SELECT SEQ_PM_FQCITEMS_ID.currval from dual");
|
|
|
- if (form["goodstypecodeMaster"].ToString() != "" && form["goodstypecodeMaster"] != null) {
|
|
|
- for (int i = 0; i < goodstype.Rows.Count; i++) {
|
|
|
- int flag = conn.ExecuteNonQuery(@"
|
|
|
- INSERT INTO TP_PM_FQCITEMSGOODS ( ITEMSID, GOODSID, GOODSCODE, ACCOUNTID, CREATEUSERID, UPDATEUSERID, REMARKS )
|
|
|
- VALUES ( @ITEMSID@, @GOODSID@, @GOODSCODE@, @ACCOUNTID@, @CREATEUSERID@, @UPDATEUSERID@, @REMARKS@ )",
|
|
|
- //new CDAParameter("ITEMSID",primaryKey),
|
|
|
- new CDAParameter("ITEMSID",id),
|
|
|
- new CDAParameter("GOODSID", goodstype.Rows[i]["GOODSID"].ToString()),
|
|
|
- new CDAParameter("GOODSCODE", goodstype.Rows[i]["GOODSCODE"].ToString()),
|
|
|
- new CDAParameter("REMARKS", form["REMARKS"]),
|
|
|
- new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
|
|
|
- new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
- new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- goodscode = form["GOODSCODE"].ToString().Split(',');
|
|
|
- for (int i = 0; i < goodscode.Length; i++) {
|
|
|
- // 查询ID
|
|
|
- int flag = conn.ExecuteNonQuery(@"
|
|
|
- INSERT INTO TP_PM_FQCITEMSGOODS ( ITEMSID, GOODSID, GOODSCODE, ACCOUNTID, CREATEUSERID, UPDATEUSERID, REMARKS )
|
|
|
- VALUES ( @ITEMSID@, (SELECT GOODSID FROM TP_MST_GOODS WHERE GOODSCODE=@GOODSCODE@), @GOODSCODE@, @ACCOUNTID@, @CREATEUSERID@, @UPDATEUSERID@, @REMARKS@ )",
|
|
|
- //new CDAParameter("ITEMSID",primaryKey),
|
|
|
- new CDAParameter("ITEMSID", id),
|
|
|
- new CDAParameter("GOODSCODE", goodscode[i]),
|
|
|
+ if (!string.IsNullOrWhiteSpace(goods))
|
|
|
+ {
|
|
|
+ int result = conn.ExecuteNonQuery(@"
|
|
|
+ INSERT INTO TP_PM_FQCITEMS (
|
|
|
+ INSPECTTYPE,
|
|
|
+ INSPECTNAME,
|
|
|
+ GOODSID,
|
|
|
+ GOODSCODE,
|
|
|
+ INSPECTVERSION,
|
|
|
+ REMARKS,
|
|
|
+ ACCOUNTID,
|
|
|
+ CREATEUSERID,
|
|
|
+ UPDATEUSERID
|
|
|
+ ) VALUES (
|
|
|
+ @INSPECTTYPE@,
|
|
|
+ @INSPECTNAME@,
|
|
|
+ @GOODSID@,
|
|
|
+ @GOODSCODE@,
|
|
|
+ @INSPECTVERSION@,
|
|
|
+ @REMARKS@,
|
|
|
+ @ACCOUNTID@,
|
|
|
+ @CREATEUSERID@,
|
|
|
+ @UPDATEUSERID@
|
|
|
+ )
|
|
|
+ ",
|
|
|
+ new CDAParameter("INSPECTTYPE", form["INSPECTTYPE"].ToString()),
|
|
|
+ new CDAParameter("INSPECTNAME", form["INSPECTNAME"].ToString()),
|
|
|
+ new CDAParameter("GOODSID", 0),
|
|
|
+ new CDAParameter("GOODSCODE", goods.ToString()),
|
|
|
+ new CDAParameter("INSPECTVERSION", form["INSPECTVERSION"].ToString()),
|
|
|
new CDAParameter("REMARKS", form["REMARKS"]),
|
|
|
new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
|
|
|
new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
|
|
|
- );
|
|
|
+ );
|
|
|
+ object id =conn.ExecuteScalar(@"SELECT SEQ_PM_FQCITEMS_ID.currval from dual");
|
|
|
+ if (form["goodstypecodeMaster"].ToString() != "" && form["goodstypecodeMaster"] != null) {
|
|
|
+ for (int i = 0; i < goodstype.Rows.Count; i++) {
|
|
|
+ int flag = conn.ExecuteNonQuery(@"
|
|
|
+ INSERT INTO TP_PM_FQCITEMSGOODS ( ITEMSID, GOODSID, GOODSCODE, ACCOUNTID, CREATEUSERID, UPDATEUSERID, REMARKS )
|
|
|
+ VALUES ( @ITEMSID@, @GOODSID@, @GOODSCODE@, @ACCOUNTID@, @CREATEUSERID@, @UPDATEUSERID@, @REMARKS@ )",
|
|
|
+ //new CDAParameter("ITEMSID",primaryKey),
|
|
|
+ new CDAParameter("ITEMSID",id),
|
|
|
+ new CDAParameter("GOODSID", goodstype.Rows[i]["GOODSID"].ToString()),
|
|
|
+ new CDAParameter("GOODSCODE", goodstype.Rows[i]["GOODSCODE"].ToString()),
|
|
|
+ new CDAParameter("REMARKS", form["REMARKS"]),
|
|
|
+ new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
|
|
|
+ new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
+ new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ goodscode = form["GOODSCODE"].ToString().Split(',');
|
|
|
+ for (int i = 0; i < goodscode.Length; i++) {
|
|
|
+ // 查询ID
|
|
|
+ int flag = conn.ExecuteNonQuery(@"
|
|
|
+ INSERT INTO TP_PM_FQCITEMSGOODS ( ITEMSID, GOODSID, GOODSCODE, ACCOUNTID, CREATEUSERID, UPDATEUSERID, REMARKS )
|
|
|
+ VALUES ( @ITEMSID@, (SELECT GOODSID FROM TP_MST_GOODS WHERE GOODSCODE=@GOODSCODE@), @GOODSCODE@, @ACCOUNTID@, @CREATEUSERID@, @UPDATEUSERID@, @REMARKS@ )",
|
|
|
+ //new CDAParameter("ITEMSID",primaryKey),
|
|
|
+ new CDAParameter("ITEMSID", id),
|
|
|
+ new CDAParameter("GOODSCODE", goodscode[i]),
|
|
|
+ new CDAParameter("REMARKS", form["REMARKS"]),
|
|
|
+ new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
|
|
|
+ new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
|
|
|
+ new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
conn.Commit();
|