From 4bf3ca7fc8e3cceba62d6617724cac3cbc919746 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 15 八月 2022 21:53:14 +0800
Subject: [PATCH] 工资系统部署测试
---
WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs | 185 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 140 insertions(+), 45 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
index f7fba1e..6ccf188 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
@@ -14,6 +14,7 @@
public class Cj_StationEntrustOutBillController : ApiController
{
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -23,36 +24,47 @@
#region 杩斿洖濮斿宸ュ簭鎺ユ敹鍗曞垪琛�
[Route("Cj_StationEntrustOutBill/list")]
[HttpGet]
- public object list(string sWhere)
+ public object list(string sWhere,string user)
{
try
{
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustOutBillList " + sWhere+ " order by 鎺ユ敹鏃堕棿 desc", "h_v_MES_StationEntrustOutBillList");
+ ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustOutBillList order by hmainid desc", "h_v_MES_StationEntrustOutBillList");
}
else
{
string sql1 = "select * from h_v_MES_StationEntrustOutBillList where 1 = 1 ";
- string sql = sql1 + sWhere;
+ string sql = sql1 + sWhere+ " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_MES_StationEntrustOutBillList");
}
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+
+ //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+ //{
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ //}
+ //else
+ //{
+ //objJsonResult.code = "0";
+ //objJsonResult.count = 0;
+ //objJsonResult.Message = "鏃犳暟鎹�";
+ //objJsonResult.data = null;
+ //return objJsonResult;
+ //}
}
catch (Exception e)
{
@@ -72,11 +84,26 @@
{
var _value = oMain["oMain"].ToString();
string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
try
{
//閮ㄩ棬鍩虹璧勬枡鍙嶅簭鍒楀寲
- msg1 = "[" + msg1.ToString() + "]";
- List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
+ string msg2 = "[" + sArray[0].ToString() + "]";
+ string user = sArray[1].ToString();
+
+ //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+ if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg2);
+ long HMainInterID = 0;
+ HMainInterID = list[0].HMainInterID;
string eventType = list[0].eventType;
long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
int HYear = 2021;
@@ -239,7 +266,7 @@
",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" +
",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" +
- ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" +
+ ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID,HMainInterID" +
") " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HInnerBillNo + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -247,7 +274,7 @@
",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
"," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
"," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPrice_BHS + "," + HMoney_BHS + "," + HBadCount +
- "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID +
+ "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID + "," + HMainInterID +
") ");
}
else if ("Modify".Equals(eventType))
@@ -305,18 +332,30 @@
objJsonResult.data = null;
return objJsonResult;
}
- if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
- {
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
- objJsonResult.data = null;
- return objJsonResult;
- }
+ //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+ //{
+ // oCN.RollBack();
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",1");
oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID.ToString() + ",1");
oCN.Commit();
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
+ {
+ if (oSystemParameter.omodel.MES_StationEntrustOutBill_SaveAutoAddnew == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ objJsonResult.Verify = "Y";
+ }
+ else
+ {
+ objJsonResult.Verify = "N";
+ }
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
@@ -390,7 +429,7 @@
{
//缂栬緫鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Delete", 1, true, HDeleteMan))
+ if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Delete", 1, false, HDeleteMan))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -504,7 +543,7 @@
}
//鍒ゆ柇鏉冮檺
- if (!ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, true, CurUserName))
+ if (!ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, false, CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -568,16 +607,16 @@
{
try
{
- //string ModRightNameCheck = "MES_StationEntrustOutBill_Check";
- ////瀹℃牳鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
+ string ModRightNameCheck = "MES_StationEntrustOutBill_Check";
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
if (HInterID == 0)
{
objJsonResult.code = "0";
@@ -684,6 +723,17 @@
{
try
{
+ string ModRightNameCheck = "MES_StationEntrustOutBill_Check";
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒鏃犳潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
if (HInterID == 0)
{
objJsonResult.code = "0";
@@ -810,6 +860,51 @@
}
}
#endregion
- //
+
+ //鎵归噺
+ #region 鎵归噺濮斿鎺ユ敹妯″潡杩斿洖鏄庣粏淇℃伅鍒楄〃
+ [Route("Cj_StationEntrustOutBill/get_BarCodeDetail")]
+ [HttpGet]
+ public object get_BarCodeDetail(string HMainInterID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn(
+ "select a.HBillNo,a.HInterID,a.HQty,a.HProcExchBillNo,a.HICMOBillNo" +
+ ",b.HNumber HMaterNumber,b.HName HMaterName,b.HModel HMaterModel,c.HName HSourceName,d.HName HGroupName" +
+ ",e.HName HEmpName,a.HMaker,a.HMakeDate " +
+ " from Sc_StationOutBillMain a " +
+ " left join Gy_Material b on a.HMaterID = b.HItemID " +
+ " left join Gy_Source c on a.HSourceID = c.HItemID " +
+ " left join Gy_Group d on a.HGroupID = d.HItemID " +
+ " left join Gy_Employee e on a.HEmpID = e.HItemID " +
+ " where HMainInterID = " + HMainInterID + " order by a.HMakeDate desc", "Sc_StationOutBillMain");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犺繑鍥炶褰曪紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1