| | |
| | | { |
| | | return content.Error("æªæ¾å°è´§ä½ä¿¡æ¯!"); |
| | | } |
| | | DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationId == location.Id); |
| | | DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == location.LocationCode); |
| | | if(stock == null) |
| | | { |
| | | location.LocationStatus= (int)LocationEnum.Free; |
| | |
| | | return new WebResponseContent().Error(); |
| | | } |
| | | |
| | | public WebResponseContent CreateLocation(string AreaName,int x, int y,int areaId,string Floor) |
| | | { |
| | | string[] chineseNumbers = new string[] { "é¶", "ä¸", "äº", "ä¸", "å", "äº", "å
", "ä¸", "å
«", "ä¹" }; |
| | | var locationList = new List<DtLocationInfo>(); |
| | | var LocationName= _AreaInfoRepository.QueryFirst(a => a.AreaID == areaId).AreaName; |
| | | for (int line = 1; line <= x; line++) |
| | | { |
| | | for (int column = 1; column <= y; column++) |
| | | { |
| | | locationList.Add(new DtLocationInfo() |
| | | { |
| | | Row = line, |
| | | Column = column, |
| | | Layer = 0, |
| | | LocationCode = AreaName+'-'+line.ToString() + '-' + column.ToString(), |
| | | LocationName = LocationName, |
| | | Floor = Floor, |
| | | LocationType = 1, |
| | | Remark = "", |
| | | Depth = column, |
| | | RoadwayNo = "AGV", |
| | | LocationStatus = LocationEnum.Free.ObjToInt(), |
| | | AreaId = areaId, |
| | | Creater = "System", |
| | | EnalbeStatus = 1, |
| | | }); |
| | | } |
| | | } |
| | | var isResult = BaseDal.AddData(locationList) > 0; |
| | | if (isResult) |
| | | return new WebResponseContent().OK(); |
| | | else |
| | | return new WebResponseContent().Error(); |
| | | } |
| | | |
| | | #endregion å建åå§è´§ä½æ°æ® |
| | | |
| | | #region å¯ç¨ç¦ç¨è´§ä½ |