| | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 出库统计 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost("getOutBoundWorkPieceInfoCountList")] |
| | | [DisableOpLog] |
| | | public async Task<List<OutBoundWorkPieceInfoCountOutput>> GetOutBoundWorkPieceInfoCountList([FromBody] OutBoundWorkPieceInfoCountInput input) |
| | | { |
| | | /* |
| | | //测试 |
| | | List<OutBoundWorkPieceInfoCountOutput> outBoundWorkPieceInfoCountOutputs = new List<OutBoundWorkPieceInfoCountOutput>(); |
| | | outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput() |
| | | { |
| | | Count = 10, |
| | | WorkPieceOutboundUserName = "AAA" |
| | | }); |
| | | outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput() |
| | | { |
| | | Count = 99, |
| | | WorkPieceOutboundUserName = "BBb" |
| | | }); |
| | | return outBoundWorkPieceInfoCountOutputs; |
| | | //*/ |
| | | |
| | | |
| | | //DateTimeOffset now = DateTimeOffset.Now; // 获取当前时间,包括时区偏移量 |
| | | DateTimeOffset now = input.Date; // 获取当前时间,包括时区偏移量 |
| | | DateTimeOffset startOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 0, 0, 0, now.Offset); // 当天开始时间 |
| | | DateTimeOffset endOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 23, 59, 59, now.Offset); // 当天结束时间 |
| | | List<WorkPieceOutbound> db_itemModelList = await _workPieceOutboundRep.Where(w => w.CreatedTime >= startOfDay |
| | | && w.CreatedTime <= endOfDay && w.IsDeleted == false).ToListAsync(); |
| | | //汇总分组 |
| | | var groupList = db_itemModelList.GroupBy(g => g.WorkPieceOutboundUserName).Select(s => new OutBoundWorkPieceInfoCountOutput() |
| | | { |
| | | WorkPieceOutboundUserName = s.Key, |
| | | Count = s.ToList().Count |
| | | }).ToList(); |
| | | return groupList; |
| | | //*/ |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |