Example #1
0
 public Model.GeneralReturns ZTsendGoods(Model.M_ZTsendGoods.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.out_barcode) || string.IsNullOrEmpty(S.scan_site) || string.IsNullOrEmpty(S.scan_emp) || string.IsNullOrEmpty(S.next_site) || string.IsNullOrEmpty(S.packno))
     {
         genRet.MsgText = "参数不全,请核实";
         return(genRet);
     }
     if (new DAL.Dal_ZTsendGoods().IsSendGoods(S.out_barcode))
     {
         genRet.MsgText = "发货单号已经发件不能重复扫描";
     }
     else
     {
         if (S.out_barcode.IndexOf("-") > 0)
         {
             S.out_barcode = S.out_barcode.Substring(0, S.out_barcode.IndexOf("-"));
         }
         pmw_order orderInfo = new DAL.Dal_ZTsendGoods().SendCompany(S.out_barcode);
         if (orderInfo != null)
         {
             if (orderInfo.sent_kd_com == S.next_site)
             {
                 genRet.MsgText = "不是往该自提点";
             }
             else
             {
                 genRet.State   = new DAL.Dal_ZTsendGoods().SendWareHouse(S);
                 genRet.MsgText = genRet.State?"":"发货出库失败";
             }
         }
         else
         {
             genRet.MsgText = "获取数据失败";
         }
     }
     return(genRet);
 }
Example #2
0
 /// <summary>
 /// 发货出库
 /// </summary>
 /// <param name="S"></param>
 /// <returns></returns>
 public bool SendWareHouse(Model.M_ZTsendGoods.Request S)
 {
     return(Common.Config.StartSqlSugar <bool>((db) =>
     {
         return db.Ado.UseTran(() =>
         {
             db.Insertable <pmw_track_fj>(new pmw_track_fj
             {
                 billcode = S.out_barcode,
                 scan_time = DateTime.Now,
                 scan_type = "发件",
                 scan_emp = S.scan_emp,
                 next_site = S.next_site,
                 scan_site = S.scan_site,
                 packno = S.packno
             })
             .ExecuteCommand();
             db.Updateable <pmw_billcode>(new
             {
                 is_senttohk = 1,
                 senttohk_time = DateTime.Now,
                 senttohk_emp = S.scan_emp
             })
             .Where(a => a.packed_billcode == S.out_barcode)
             .ExecuteCommand();
             db.Updateable <pmw_order>(new
             {
                 is_senttohk = 1,
                 senttohk_time = DateTime.Now,
                 senttohk_emp = S.scan_emp
             })
             .Where(a => a.sent_kd_billcode == S.out_barcode)
             .ExecuteCommand();
         }).IsSuccess;
     }));
 }
Example #3
0
 private Model.GeneralReturns ZTsendGoods(Model.M_ZTsendGoods.Request S)
 {
     return(new BLL.Bll_ZTsendGoods().ZTsendGoods(S));
 }