From bae6f41fd7ab5f4c572e196a0646f61ec6fb03f2 Mon Sep 17 00:00:00 2001
From: 杨乐 <yang.le.192@qq.com>
Date: 星期三, 26 一月 2022 16:25:36 +0800
Subject: [PATCH] 条码主档 采购管理  权限编辑

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   68 +++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 0dc8c6b..d1a9256 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -283,7 +283,7 @@
             try
             {
                 //鍒犻櫎鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;
@@ -353,7 +353,7 @@
         {
             try
             {
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, true, user))
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -457,10 +457,20 @@
         /// </summary>
         [Route("Gy_BarCodeBillList/GetBarCodeBillList")]
         [HttpGet]
-        public object GetBarCodeBillList(string sWhere)
+        public object GetBarCodeBillList(string sWhere,string user)
         {
             try
             {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_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_IF_BarCodeBillList " + sWhere + "order by 鏃ユ湡 desc", "h_v_IF_BarCodeBillList");
@@ -517,7 +527,7 @@
             string msg4 = sArray[2].ToString();//褰撳墠浜�
 
             oCN.BeginTran();
-            if (!DBUtility.ClsPub.Security_Log(msg3, 1, true, msg4))
+            if (!DBUtility.ClsPub.Security_Log(msg3, 1, false, msg4))
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
@@ -591,6 +601,13 @@
                 long HPrintQty = mainList[0].HPrintQty;
                 string HMouldOWNER = mainList[0].HMouldOWNER;
                 string HSaveLife = mainList[0].HSaveLife;
+                int HCaveQty = mainList[0].HCaveQty;
+                int HMouldDotCheckRuleInterID= mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID= mainList[0].HMouldMaintainRuleInterID;
+                int HNowSupID = mainList[0].HNowSupID;
+                int HNowSupTypeID = mainList[0].HNowSupTypeID;
+
+
 
                 //涓昏〃
                 oCN.RunProc("Insert Into Gy_MouldFileMain   " +
@@ -600,9 +617,9 @@
                 ",HSubjoin,HSubjoin2,HPICNo,HWorkMaterModel" +
                 ",HMaterID,HMaterNumber,HMouldType,HUnitID" +
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
-                ",HPrintQty,HMouldStatus,HWhID,HRoutingID" +
-                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
-                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife" +
+                ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
+                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
+                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -610,9 +627,9 @@
                 ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
                 "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
-                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
-                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
-                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "'," + "','" + HSaveLife + "'," +
+                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +","+ HCaveQty+
+                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID+"','"+ HNowSupTypeID+"'"+
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
                 ") ");
 
 
@@ -668,7 +685,7 @@
             string msg4 = sArray[2].ToString();//褰撳墠浜�
             try
             {
-                if (!DBUtility.ClsPub.Security_Log(msg3, 1, true, msg4))
+                if (!DBUtility.ClsPub.Security_Log(msg3, 1, false, msg4))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -724,8 +741,11 @@
                 long HPrintQty = mainList[0].HPrintQty;
                 string HMouldOWNER = mainList[0].HMouldOWNER;
                 string HSaveLife = mainList[0].HSaveLife;
-
-
+                int HCaveQty = mainList[0].HCaveQty;
+                int HMouldDotCheckRuleInterID = mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
+                int HNowSupID = mainList[0].HNowSupID;
+                int HNowSupTypeID = mainList[0].HNowSupTypeID;
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
@@ -767,10 +787,15 @@
                 ",HSPGroupID=" + HSPGroupID.ToString() +
                 ",HSPID=" + HSPID.ToString() +
                 ",HDesignLife=" + HDesignLife.ToString() +
+                ",HCaveQty="+ HCaveQty.ToString()+
                 ",HUseLife=" + HUseLife.ToString() +
                 ",HLeaveLife=" + HLeaveLife.ToString() +
                 ",HProdQty=" + HProdQty.ToString() +
+                ",HMouldDotCheckRuleInterID="+ HMouldDotCheckRuleInterID.ToString()+
+                ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
                 ",HMouldOWNER='" + HMouldOWNER + "'" +
+                ",HNowSupID="+HNowSupID.ToString()+
+                ",HNowSupTypeID="+HNowSupTypeID.ToString()+
                 ",HProdWeight=" + HProdWeight.ToString() +
                 " where HInterID=" + HInterID.ToString());
 
@@ -840,7 +865,7 @@
             DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
             try
             {
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, user))
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -888,7 +913,7 @@
         /// <returns></returns>
         [Route("Gy_Material/InitializeProdInBill")]
         [HttpGet]
-        public object InitializeProdInBill(long hmainid, string user)
+        public object InitializeProdInBill(long hmainid, string user,string userID)
         {
             DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
             try
@@ -905,14 +930,22 @@
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3801','3801'," + HInterID + ",'" + HBillNo + "',' getdate()'" +
+                " values('3801','3801'," + HInterID + ",'" + HBillNo + "',getdate()" +
                 ", '" + user + "',getdate()" +
                 ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() +  ",' ',0"  +
 
                 ") ";
+                string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
+                HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
+                HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
+                HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID+ ",1,'',getdate(),0,'',0,0,'','',"+
+                "0,0,"+dr["HInterID"].ToString()+",0,0,0,"+ dr["HUnitID"].ToString()+",0,"+ dr["HProdQty"].ToString() +","+ dr["HProdQty"].ToString()+",0,"+
+                "0,"+ dr["HDesignLife"].ToString()+","+ dr["HLeaveLife"].ToString() + ","+dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString()+",0,0"
+                + ",0,0,"+ userID + ",0,0,'')");
                 //涓昏〃
                 oCN.RunProc(sql);
+                oCN.RunProc(sql1);
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -929,6 +962,7 @@
                 objJsonResult.data = null;
             }
             return objJsonResult;
+        
         }
 
         #region [妯″叿妗f瀹℃牳銆佸弽瀹℃牳]
@@ -948,7 +982,7 @@
             try
             {
                 //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;

--
Gitblit v1.9.1