| | |
| | | using AutoMapper; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Const; |
| | | using WIDESEAWCS_Core.DB; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IShuttleCar; |
| | | using WIDESEAWCS_IShuttleCarInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | { |
| | | return BaseDal.QueryFirst(x => x.ShuttleCarCode != ShuttleCarCode); |
| | | } |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | WebResponseContent responseContent = new WebResponseContent().OK(); |
| | | try |
| | | { |
| | | Dt_ShuttleCar shuttleCar = BaseDal.QueryFirst(x => x.ShuttleCarId == saveModel.MainData["shuttleCarId"].ObjToInt()); |
| | | var Position = saveModel.MainData["shuttleCarPosition"].ToString(); |
| | | if (BaseDal.QueryData(x => x.ShuttleCarPosition == Position && x.ShuttleCarId != shuttleCar.ShuttleCarId).Any()) |
| | | throw new Exception($"ä½ç½®ã{Position}ãå·²åå¨ç©¿æ¢è½¦"); |
| | | SqlSugarClient WMSsugarClient = new SqlSugarClient(new ConnectionConfig |
| | | { |
| | | ConfigId = MainDb.CurrentDbConnId, |
| | | ConnectionString = AppSettings.Get("WMSConnectionString").DecryptDES(AppSecret.DB), |
| | | IsAutoCloseConnection = true, |
| | | DbType = DbType.SqlServer, |
| | | }); |
| | | |
| | | var getLocation = WMSsugarClient.Queryable("Dt_LocationInfo", "x").Where("LocationCode", "=", Position).Any(); |
| | | if (!getLocation) throw new Exception($"æªæ¾å°ä½ç½®ã{Position}ã"); |
| | | shuttleCar.ShuttleCarPosition = Position; |
| | | shuttleCar.ShuttleCarPosition1 = Position; |
| | | BaseDal.UpdateData(shuttleCar); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | responseContent.Error(ex.Message); |
| | | } |
| | | return responseContent; |
| | | } |
| | | } |
| | | } |