From 54067e250489b5f290d98ea1425802b72862aab8 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 09 七月 2025 13:31:57 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/MateOutController.cs | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 108 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs
index 6c21da1..b21e366 100644
--- a/WebAPI/Controllers/MateOutController.cs
+++ b/WebAPI/Controllers/MateOutController.cs
@@ -2736,6 +2736,114 @@
}
#endregion
+ #region 宸ュ巶鏃ュ巻淇濆瓨锛堟壒閲忥級
+ [Route("MaterOutEntryReport/Sc_ShopCalendarSaveList")]
+ [HttpPost]
+ public object Sc_ShopCalendarSaveList([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMainList(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ 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;
+ }
+ }
+ public class ClsHSourceList
+ {
+ public long HItemID { get; set; }
+ }
+ public class ClsHWorkHourList
+ {
+ public DateTime date { get; set; }
+ public string week { get; set; }
+ public double workHours { get; set; }
+ }
+ public json AddBillMainList(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();//璧勬簮鍒楄〃
+ string msg3 = sArray[1].ToString();//鏁版嵁鍒楄〃
+ string user = sArray[2].ToString();
+
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_PlanShifts_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ List<ClsHSourceList> HSourceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsHSourceList>>(msg2);
+ List<ClsHWorkHourList> HWorkHourList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsHWorkHourList>>(msg3);
+ //閬嶅巻鏇存柊鏁版嵁
+ foreach (ClsHSourceList HSource in HSourceList)
+ {
+ long HSourceID = HSource.HItemID;
+ foreach (ClsHWorkHourList HWorkHour in HWorkHourList)
+ {
+ DateTime date = HWorkHour.date;
+ double workHours = HWorkHour.workHours;
+ ds = oCN.RunProcReturn("select * from Gy_PlanShifts where HDate='" + date + "' and HSourceID=" + HSourceID, "Gy_PlanShifts");
+ string sql = "";
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ sql = $"update Gy_PlanShifts set HOverTimes='" + workHours + "' where HDate ='" + date + "' and HSourceID=" + HSourceID;
+ }
+ else
+ {
+ sql = $"insert into Gy_PlanShifts(HDate,HSourceID,HShiftsID,HOverTimes,HClassCount," +
+ "HRemark,HUseFlag)values" +
+ $"('{date}','{HSourceID}',0,'{workHours}','1'" +
+ $",'','鏈娴�')";
+ }
+ oCN.RunProc(sql);
+ }
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 宸ュ巶鏃ュ巻鎵规敼涓婄彮宸ユ椂
[Route("Gy_PlanShifts/BulkWorkTime")]
[HttpGet]
--
Gitblit v1.9.1