From dbedc3b6b40a3c8ec3caf5639fd083ba7a3fadce Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期三, 16 十一月 2022 20:30:57 +0800
Subject: [PATCH] 条码生成模块增加选源单工序汇报单生成条码,新增生产入库、销售出库扫描源单方法,新增扫描物料条码方法,返回单据列表信息方法
---
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | 195 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 173 insertions(+), 22 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
index c273dd4..3f88755 100644
--- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -34,42 +34,139 @@
{
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
- if (!DBUtility.ClsPub.Security_Log("Cg_POOrderBillQuery", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
- objJsonResult.data = null;
- return objJsonResult;
- }
- string sql = "select * from h_v_IF_POOrderBillList where 1 = 1 ";
+ //if (!DBUtility.ClsPub.Security_Log("Cg_POOrderBillQuery", 1, false, user))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //string sql = "select * from h_v_IF_POOrderBillList where 1 = 1 ";
- if (sWhere=="" || sWhere == null)
- {
- ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
- }
- else
- {
- ds = oCN.RunProcReturn(sql + sWhere, "h_v_IF_POOrderBillList");
- }
+ //if (sWhere=="" || sWhere == null)
+ //{
+ // ds = oCN.RunProcReturn(sql+ " order by hmainid desc", "h_v_IF_POOrderBillList");
+ //}
+ //else
+ //{
+ // ds = oCN.RunProcReturn(sql + sWhere+ " order by hmainid desc", "h_v_IF_POOrderBillList");
+ //}
- if (ds.Tables[0].Rows.Count != 0 || ds != null)
+ //鍒ゆ柇鏄惁鏈夐噰璐粡鐞嗘潈闄愶紙瀹夌憺锛�
+ bool isCgjl = Security_Log("Cg_POOrderBill_PurchasManager", 1, true, user);
+ if (!isCgjl)
{
+ sWhere += $" and HEmpID in (select HEmpID from Gy_Czygl where Czymc='{user}' and HEmpID >0 )";
+ }
+ string sql = "select * from h_v_IF_POOrderBillList where 1 = 1 " + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ [Route("Cg_POOrderBill/list3")]
+ [HttpGet]
+ public object list3(string sWhere, string user)
+ {
+ try
+ {
+ List<string> optionList = new List<string>();
+ string sql = "select top 1 * from h_v_IF_POOrderBillList where 1 = 1 ";
+ ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
+ if (ds != null)
+ {
+ foreach (DataColumn item in ds.Tables[0].Columns)
+ {
+ optionList.Add(@"{ field: 'hmainid', title: '" + item.ToString() + "', sort: true, hide: false }");
+ }
+ string option = string.Join(",", optionList);
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
+ objJsonResult.data = optionList.ToArray();
return objJsonResult;
}
else
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳暟鎹�";
+ objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒";
objJsonResult.data = null;
return objJsonResult;
}
-
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ [Route("Cg_POOrderBill/list2")]
+ [HttpGet]
+ public object list2(string sWhere, string user)
+ {
+ try
+ {
+ List<OptionListModel> optionList = new List<OptionListModel>();
+ string sql = "select top 1 * from h_v_IF_POOrderBillList where 1 = 1 ";
+ ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList");
+ if (ds != null)
+ {
+ foreach (DataColumn item in ds.Tables[0].Columns)
+ {
+ optionList.Add(new OptionListModel
+ {
+ field = item.ToString(),
+ title = item.ToString(),
+ sort = true,
+ hide = false,
+ });
+ }
+ string option = string.Join(",", optionList);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = optionList;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
}
catch (Exception e)
{
@@ -197,6 +294,59 @@
}
+ /// <summary>
+ /// 閲囪喘璁㈠崟閲嶆柊鍚屾
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Cg_POOrderBill/Resynchronize")]
+ [HttpGet]
+ public object Resynchronize(string HBillNo, string HBillType)
+ {
+ try
+ {
+ oCN.BeginTran();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ DataSet DS = oCn.RunProcReturn("exec h_p_WMS_ERPSourceBillToLocal '" + HBillNo + "','" + HBillType + "'", "h_p_WMS_ERPSourceBillToLocal");
+ if (DS == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍚屾澶辫触";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HBack"]) == "2")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "ERP涓笉瀛樺湪璇ュ崟鎹彿";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍗曟嵁鍚屾鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
[Route("POOrderBack")]
[HttpGet]
/// <summary>
@@ -275,7 +425,7 @@
else
fidList.Add(dr["FID"].ToString() + dr["HINTERID"].ToString());
- DataRow[] drs = dt.Select("FID = " + dr["FID"].ToString() + " and HINTERID = "+dr["HINTERID"].ToString());
+ DataRow[] drs = dt.Select("FID = " + dr["FID"].ToString() + " and HINTERID = " + dr["HINTERID"].ToString());
JObject model = new JObject();
model.Add("FBILLTYPEID", new JObject() { ["Fnumber"] = "SLD01_SYS" }); //鍗曟嵁绫诲瀷
@@ -511,4 +661,5 @@
//
}
+
}
\ No newline at end of file
--
Gitblit v1.9.1