From 1739eb7838984e9a55fbbb5d4705f55908749375 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 01 九月 2023 09:00:06 +0800
Subject: [PATCH] 器具主档:增加制造厂商字段HMadeSupID,计算 保养/校正日期

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   42 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index f41f42d..55727f9 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1009,7 +1009,7 @@
                 int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
                 int HNowSupID = mainList[0].HNowSupID;
                 int HNowSupTypeID = mainList[0].HNowSupTypeID;
-
+                int HMadeSupID = mainList[0].HMadeSupID;
 
 
                 //涓昏〃
@@ -1022,7 +1022,7 @@
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                 ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
-                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode" +
+                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -1032,7 +1032,7 @@
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                 "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
                 "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
-                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'" +
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                 ") ");
 
 
@@ -1150,6 +1150,7 @@
                 int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
                 int HNowSupID = mainList[0].HNowSupID;
                 int HNowSupTypeID = mainList[0].HNowSupTypeID;
+                int HMadeSupID = mainList[0].HMadeSupID;
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
@@ -1202,6 +1203,7 @@
                 ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
                 ",HProdWeight=" + HProdWeight.ToString() +
                 ",HBarCode='" + HBarCode.ToString() + "'" +
+                ",HMadeSupID=" + HMadeSupID +
                 " where HInterID=" + HInterID.ToString());
 
                 //淇敼瀛愰」鐩唬鐮�
@@ -1228,6 +1230,40 @@
         }
 
 
+        /// <summary>
+        /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_Mould_Edit/calculateHNextMainDate")]
+        [HttpGet]
+        public object calculateHNextMainDate(long HInterID)
+        {
+            try
+            {
+                string sql = @"select top(1) a.HInterID, b.HEndDate 淇濆吇璁板綍缁撴潫鏃ユ湡
+                            from Gy_MouldFileMain AS a LEFT OUTER JOIN
+                            Sc_MouldMaintainBillMain AS b on a.HInterID = b.HMouldID
+                            where a.HInterID = " + HInterID +
+                            " order by b.HEndDate desc";
+
+                ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainBillMain");
+
+                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 = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
 
         /// <summary>
         /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶

--
Gitblit v1.9.1