| | |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new(); |
| | | try |
| | | { |
| | | int line = saveModel.MainData["row"].ObjToInt(); |
| | | int column = saveModel.MainData["column"].ObjToInt(); |
| | | int layer = saveModel.MainData["layer"].ObjToInt(); |
| | | int locationType = saveModel.MainData["locationType"].ObjToInt(); |
| | | //int status = saveModel.MainData["locationStatus"].ObjToInt(); |
| | | //string roadwayNo = saveModel.MainData["roadwayNo"].ToString(); |
| | | |
| | | string locationCode = line.ToString().PadLeft(3, '0') + '-' + column.ToString().PadLeft(3, '0') + '-' + layer.ToString().PadLeft(3, '0'); |
| | | var location = BaseDal.QueryFirst(x => x.LocationCode == locationCode); |
| | | if (location != null) throw new Exception($"{locationCode}åºä½å·²åå¨,è¯·æ ¸æ¥"); |
| | | |
| | | DtLocationInfo locationInfo = new DtLocationInfo |
| | | { |
| | | Row = line, |
| | | Column = column, |
| | | Layer = layer, |
| | | LocationCode = line.ToString().PadLeft(3, '0') + '-' + column.ToString().PadLeft(3, '0') + '-' + layer.ToString().PadLeft(3, '0'), |
| | | LocationName = ConvertToFormattedString(line, column, layer), |
| | | LocationType = locationType, |
| | | Remark = "", |
| | | Depth = 0, |
| | | RoadwayNo = locationType == 1 ? "CTU" : "AGV", |
| | | LocationStatus = LocationEnum.Free.ObjToInt(), |
| | | AreaId = 0, |
| | | Creater = App.User.UserName, |
| | | EnalbeStatus = 2, //é»è®¤ç¦ç¨ |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | |
| | | if (BaseDal.AddData(locationInfo) > 0) |
| | | { |
| | | return content.OK("æ·»å æå!"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æ·»å 失败"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error($"æ·»å 失败:{ex.Message}"); |
| | | } |
| | | |
| | | } |
| | | |
| | | #region åå§ååºä½ |
| | | public async Task<WebResponseContent> initializeLocation(int locationID) |
| | | { |
| | |
| | | return layers; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å
鍿¹æ³ |
| | | |