分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-27 0b5ccdca6263cf7a2cee460f30c76ef1efea2811
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/WCS/Partial/dt_equipmentinfoService.cs
@@ -20,6 +20,7 @@
using WIDESEA_Core.FreeDB;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Core.ManageUser;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
namespace WIDESEA_WCS.Services
{
@@ -49,6 +50,7 @@
        public WebResponseContent ChangEquipmentState(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            List<dt_equipmentinfo> equipmentinfos = new List<dt_equipmentinfo>();
            try
            {
                FreeDB freeDB = new FreeDB();
@@ -58,12 +60,15 @@
                    keys.Add(Guid.Parse(item.ToString()));
                }
                int res = freeDB.Update<dt_equipmentinfo>().Set(t => t.equipment_state == model.Extra.ToString()).Where(t => keys.Contains(t.equipment_id)).ExecuteAffrows();
                equipmentinfos = freeDB.Select<dt_equipmentinfo>().Where(x => keys.Contains(x.equipment_id)).ToList();
                content.OK();
                WriteLog.Write_Log("鍩虹淇℃伅淇敼", "updateEqState", UserContext.Current.UserName + "淇敼鎴愬姛," + res, model);
                //WriteLog.Write_Log("鍩虹淇℃伅淇敼", "updateEqState", UserContext.Current.UserName + "淇敼鎴愬姛," + res, model);
                WriteDBLog.Success($"{(model.Extra.ToString() == "Enable" ? "鍚敤璁惧" : "绂佺敤璁惧")}", new { 鏁版嵁 = equipmentinfos }, "PCS", UserContext.Current.UserTrueName);
            }
            catch (Exception ex)
            {
                WriteLog.Write_Log("鍩虹淇℃伅淇敼", "updateEqState", UserContext.Current.UserName + "淇敼寮傚父," + ex.Message, model);
                //WriteLog.Write_Log("鍩虹淇℃伅淇敼", "updateEqState", UserContext.Current.UserName + "淇敼寮傚父," + ex.Message, model);
                WriteDBLog.Error($"{(model.Extra.ToString() == "Enable" ? "鍚敤璁惧" : "绂佺敤璁惧")}", new { 鏁版嵁 = equipmentinfos }, "PCS", UserContext.Current.UserTrueName);
                content.Error(ex.Message);
            }
            return content;