/// <summary>
 /// 创建
 /// </summary>
 public void Create(List<RemainderLCLCreateInput> mCreateObjs)
 {
     try
     {
         // 
         foreach (var item in mCreateObjs)
         {
             Entities.RemainderLCL m = new Entities.RemainderLCL();
             m.LCLId = Guid.NewGuid().ToString();
             m.LCLCode = "PDH" + m.LCLId;
             m.LCLTime = DateTime.Now;
             m.CreateUserId = AbpSession.UserId.ToString();
             m.CreateTime = DateTime.Now;
             m.Remark = "";
             // 
             if (item.LCLMxCreateInput.Count > 0)
             { 
                 JIT_RemainderLCL.InsertAsync(m);
                 foreach (var tmp in item.LCLMxCreateInput)
                 {
                     Entities.RemainderLCLMx Mx = new Entities.RemainderLCLMx()
                     {
                         LCLMxId = Guid.NewGuid().ToString(),
                         RemainderLCLId = m.LCLId,
                         ICMOInspectBillId = tmp.ICMOInspectBillId,
                         SpelledQty = tmp.SpelledQty,
                         LCLMxTime = DateTime.Now
                     };
                     JIT_RemainderLCLMx.InsertAsync(Mx);
                 }
             }
         }
     }
     catch (Exception e)
     {
         EX(-1, "创建失败", "请稍后再试!" + e.Message);
     }
 }
        /// <summary>
        /// 返回余数
        /// </summary>
        public async Task <PagedResultDto <DIME2Barcode.Entities.VW_YSQty> > GetAllYSQty(
            PagedAndSortedResultRequestDto input)
        {
            var query = JIT_ICMODispBill.GetAll().Join(JIT_ICMOSchedule.GetAll(), Z => Z.FMOInterID, Y => Y.FMOInterID,
                                                       (Z, Y) => new
            {
                Z.FID,
                Z.FBillNo,
                Z.FBiller,
                Z.FDate,
                Z.FStatus,
                Z.employee,
                Y.FItemName,
                Y.FItemID
            }).Join(JIT_t_ICItem.GetAll(), Y => Y.FItemID, X => X.FItemID, (X, Y) => new
            {
                X.FID,
                X.FBillNo,
                X.FBiller,
                X.FDate,
                X.FStatus,
                X.employee,
                X.FItemName,
                Y.F_102
            })
                        .Join(JIT_ICMOInspectBill.GetAll(), A => A.FID, B => B.ICMODispBillID,
                              (A, B) => new
            {
                A.FID,
                A.FBillNo,
                A.FBiller,
                A.FDate,
                FBillNo2 = B.FBillNo,
                B.BatchNum,
                B.FYSQty,
                B.FInspector,
                B.FInspectTime,
                A.employee.FName,
                //
                A.FStatus,
                A.FItemName,
                A.F_102
            })
                        .Join(JIT_Employee.GetAll(), B => B.FInspector.ToInt(), C => C.FUserId, (B, C) => new
            {
                B.FID,
                B.FBillNo,
                B.FBiller,
                B.FDate,
                B.FBillNo2,
                B.BatchNum,
                FYSQty     = B.FYSQty - JIT_RemainderLCLMx.GetAll().Where(w => w.ICMOInspectBillId == B.FID).Sum(s => s.SpelledQty),
                FInspector = C.FName,
                B.FInspectTime,
                B.FName,
                B.FStatus,
                B.FItemName,
                B.F_102
            })
                        .Where(A => A.FStatus >= PublicEnum.ICMODispBillState.已检验.EnumToInt() && A.FYSQty > 0);
            var data = await query.PageBy(input).ToListAsync();

            var list = data.MapTo <List <DIME2Barcode.Entities.VW_YSQty> >();

            return(new PagedResultDto <DIME2Barcode.Entities.VW_YSQty>(query.Count(), list));
        }
Exemplo n.º 3
0
 /// <summary>
 /// 余数拼箱明细
 /// </summary>
 public async Task <List <Entities.RemainderLCLMx> > GetAll(string RemainderLCLId)
 {
     return(await JIT_RemainderLCLMx.GetAll().Where(w => w.RemainderLCLId.Equals(RemainderLCLId)).ToListAsync());
 }