| | |
| | | #endregion å¯ç¨ç¦ç¨è´§ä½ |
| | | |
| | | #region 大å±åºä½ç¶æè·å |
| | | public WebResponseContent LocationStatus() |
| | | public WebResponseContent LocationStatuskt() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | // è·åææåºä½æ°æ® |
| | | List<DtLocationInfo> locations = BaseDal.QueryData(); |
| | | |
| | | // æLocationStatusåç»ç»è®¡ |
| | | var statusGroups = locations |
| | | .GroupBy(l => l.LocationStatus) |
| | | .Select(g => new |
| | | // å®ä¹ææå¯è½çç¶æåå
¶å¯¹åºçæ¾ç¤ºææ¬ |
| | | var allStatuses = new Dictionary<int, string> |
| | | { |
| | | Status = g.Key==0?"空货ä½": g.Key == 1 ? "éå®": g.Key == 2 ? "æè´§": "æè´§ç¦ç¨", |
| | | Count = g.Count(), |
| | | { 0, "空货ä½" }, |
| | | { 1, "éå®" }, |
| | | { 2, "æè´§" }, |
| | | { 3, "æè´§ç¦ç¨" } |
| | | }; |
| | | |
| | | // æLocationStatusåç»ç»è®¡ |
| | | var statusGroups = allStatuses |
| | | .GroupJoin(locations.GroupBy(l => l.LocationStatus), |
| | | status => status.Key, |
| | | group => group.Key, |
| | | (status, groups) => new |
| | | { |
| | | Status = status.Value, |
| | | Count = groups.SelectMany(g => g).Any() ? groups.First().Count() : 0 |
| | | }) |
| | | .ToList(); |
| | | |