| | |
| | | try |
| | | { |
| | | //è·åå½åèåç¼åææçº¸å·ä¿¡æ¯ |
| | | List<Dt_OutLineView> outLineViews = BaseDal.QueryData(); |
| | | List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | BaseDal.AddData(outLineViewsAdd); |
| | | //List<Dt_OutLineView> outLineViews = BaseDal.QueryData(); |
| | | //List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | //BaseDal.AddData(outLineViewsAdd); |
| | | List<Dt_OutLineView> outLineViews = BaseDal.QueryData(x => x.TaskNum != null); |
| | | int? outLineCount = outLineViews?.Select(x => x.PalletCode).Distinct().Count(); |
| | | if (outLineViews == null || outLineViews.Count <= 0 || outLineCount <= 2) |
| | | { |
| | | List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | BaseDal.AddData(outLineViewsAdd); |
| | | } |
| | | else |
| | | { |
| | | string? code = outLineViews.FirstOrDefault()?.PalletCode; |
| | | List<Dt_OutLineView> outLineViewsUpdate = outLineViews.Where(x => x.PalletCode == code).ToList(); |
| | | outLineViewsUpdate.ForEach(x => |
| | | { |
| | | x.TaskNum = null; |
| | | }); |
| | | List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | BaseDal.UpdateData(outLineViewsUpdate); |
| | | BaseDal.AddData(outLineViewsAdd); |
| | | } |
| | | content.OK("æå"); |
| | | } |
| | | catch (Exception ex) |