示例#1
0
        public Model.GeneralReturns JPushSent(Model.JPushMode S)
        {
            Model.GeneralReturns gr = new Model.GeneralReturns();
            if (S.MsgType > 2)
            {
                gr.MsgText = "消息类型错误";
            }
            else
            {
                if (S.PhoneType > 2)
                {
                    gr.MsgText = "手机类型错误";
                }
                else
                {
                    gr.State = true;
                    if (S.Type <= 1)
                    {
                        gr.ReturnJson = SendPush(S.MsgType, S.MsgTitle, S.MsgText, S.Uid, S.TageType, S.PhoneType);
                    }
                    else
                    {
                        gr.ReturnJson = SendPushMsg(S.MsgType, S.MsgTitle, S.MsgText, S.Uid, S.TageType, S.PhoneType);
                    }
                }
            }

            return(gr);
        }
示例#2
0
 public Model.GeneralReturns PutawayInventory(Model.M_inplaceRequest S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.place_code) || string.IsNullOrEmpty(S.billcode) || string.IsNullOrEmpty(S.emp) || string.IsNullOrEmpty(S.wavehouse_name))
     {
         genRet.MsgText = "参数不全,请核实";
     }
     else if (!new DAL.Dal_inplace().inplaceRecord(S))
     {
         genRet.MsgText = "此单没有入库记录";
     }
     else if (new DAL.Dal_inplace().inplaceSendOut(S))
     {
         genRet.MsgText = "该单号已经发货不能操作";
     }
     else if (S.in_type == 0 && new DAL.Dal_inplace().Putaway(S))
     {
         genRet.MsgText = "单号已上架不能重复上架";
     }
     else if (!new DAL.Dal_inplace().WarehouseLocation(S))
     {
         genRet.MsgText = "库位号不存在";
     }
     else
     {
         genRet.State   = new DAL.Dal_inplace().ExecuteInplace(S);
         genRet.MsgText = genRet.State ? "" : "上架失败";
     }
     return(genRet);
 }
        public Model.GeneralReturns NumberOffShelf(Model.M_NumberOffShelf.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            if (string.IsNullOrEmpty(S.kd_billcode) || string.IsNullOrEmpty(S.scan_emp) || string.IsNullOrEmpty(S.out_barcode))
            {
                genRet.MsgText = "参数不全,请核实快递单号拣货";
                return(genRet);
            }
            if (!new DAL.Dal_NumberOffShelf().IsThereTask(S.kd_billcode, S.out_barcode))
            {
                genRet.MsgText = "请输入正确的单号";
                return(genRet);
            }
            if (new DAL.Dal_NumberOffShelf().IsBillcodeOut(S.kd_billcode))
            {
                genRet.MsgText = "已下架";
            }
            else
            {
                if (new DAL.Dal_NumberOffShelf().ExecuteBillCodeOut(S.kd_billcode, S.scan_emp))
                {
                    genRet.State = true;
                }
                else
                {
                    genRet.MsgText = "下架失败";
                }
            }

            return(genRet);
        }
示例#4
0
        public Model.GeneralReturns Picking(Model.M_Picking.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            if (string.IsNullOrEmpty(S.out_barcode) || string.IsNullOrEmpty(S.scan_site) || string.IsNullOrEmpty(S.scan_emp))
            {
                genRet.MsgText = "参数不全";
                return(genRet);
            }
            S.out_barcode = new DAL.Dal_Picking().GetOrderCode(S.out_barcode);
            if (new DAL.Dal_Picking().AlreadyOutOrder(S.out_barcode))
            {
                genRet.MsgText = "订单已下架";
                return(genRet);
            }
            if (new DAL.Dal_Picking().OrderNotOutBillcode(S.out_barcode))
            {
                genRet.MsgText = "快递单未完全下架";
                return(genRet);
            }
            if (new DAL.Dal_Picking().OutOrder(S.out_barcode, S.scan_emp))
            {
                genRet.State = true;
            }
            else
            {
                new DAL.Dal_Picking().OutOrderLoser(S.out_barcode);
                genRet.MsgText = "下架失败";
            }



            return(genRet);
        }
示例#5
0
        public Model.GeneralReturns PeerDeliverBill(Model.M_PeerDeliverBill.Request S)
        {
            Model.GeneralReturns gr = new Model.GeneralReturns();
            if (String.IsNullOrEmpty(S.billcode) || String.IsNullOrEmpty(S.KD_com) || String.IsNullOrEmpty(S.scan_emp) || String.IsNullOrEmpty(S.scan_site))
            {
                gr.MsgText = "缺少必要参数";
                return(gr);
            }

            if (new Regex("^[0-9]*$").IsMatch(S.billcode))
            {
                if (new DAL.Dal_PeerDeliverBill().PeerHandIn(S))
                {
                    gr.State = true;
                }
                else
                {
                    gr.MsgText = "无法交单";
                }
            }
            else
            {
                gr.MsgText = "请输入正确的单号";
            }

            return(gr);
        }
示例#6
0
 public Model.GeneralReturns kd_jd(Model.M_KD_jd.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.billcode) || string.IsNullOrEmpty(S.KD_com) || string.IsNullOrEmpty(S.scan_emp) || string.IsNullOrEmpty(S.scan_site))
     {
         genRet.MsgText = "缺少必要参数";
         return(genRet);
     }
     if (new DAL.Dal_KD_jd().IsHandBill(S.billcode))
     {
         genRet.MsgText = "已交单";
     }
     else
     {
         if (new DAL.Dal_KD_jd().DeliveryBillCode(S))
         {
             pmw_bill_tips billInfo = new DAL.Dal_KD_jd().billTips(S.billcode);
             if (billInfo != null)
             {
                 string billTipsStr = billInfo.billcode + ":" + billInfo.bill_type + "备注:" + billInfo.memo;
                 if (!String.IsNullOrEmpty(billTipsStr))
                 {
                     genRet.MsgText = billTipsStr;
                 }
             }
             genRet.State = true;
         }
         else
         {
             genRet.MsgText = "交单失败";
         }
     }
     return(genRet);
 }
示例#7
0
        public Model.GeneralReturns CheckOrderInfo(Model.M_CheckOrderInfo.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            if (String.IsNullOrEmpty(S.billcode))
            {
                genRet.MsgText = "缺少参数";
                return(genRet);
            }
            pmw_billcode billCodeInfo = new DAL.Dal_CheckOrderInfo().GetOrderIdentify(S.billcode);

            if (billCodeInfo != null && !string.IsNullOrEmpty(billCodeInfo.order_code))
            {
                Model.M_CheckOrderInfo che = new Model.M_CheckOrderInfo();
                che.coir = new DAL.Dal_CheckOrderInfo().CheckOrderInfo(billCodeInfo.order_code);
                if (che.coir.Count > 0)
                {
                    if (new DAL.Dal_CheckOrderInfo().GetOrderBillcodeCount(billCodeInfo.order_code) >= che.coir.Count)
                    {
                        che.cysList       = new DAL.Dal_CheckOrderInfo().GetCysList(che.coir[0].country_id);
                        genRet.ReturnJson = Common.DataHandling.ObjToJson(che);
                        genRet.State      = true;
                    }
                    else
                    {
                        genRet.MsgText = "未捡完货,不能打包";
                    }
                }
                else
                {
                    if (new DAL.Dal_CheckOrderInfo().IsLockOrder(S.billcode))
                    {
                        genRet.MsgText = "快递单号已被锁";
                    }
                    else
                    {
                        if (new DAL.Dal_CheckOrderInfo().IsOrderAudit(billCodeInfo.order_code))
                        {
                            genRet.MsgText = "未审单";
                        }
                        else
                        {
                            if (new DAL.Dal_CheckOrderInfo().IsOutBillcodeCount(billCodeInfo.order_code))
                            {
                                genRet.MsgText = "无法获取快递单信息";
                            }
                            else
                            {
                                genRet.MsgText = "没有需要打包的快递单号";
                            }
                        }
                    }
                }
            }
            else
            {
                genRet.MsgText = "请输入正确的快递单号";
            }
            return(genRet);
        }
        public Model.GeneralReturns GetOrderDetail(Model.M_OffShelf.OffShelfRequest S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            if (string.IsNullOrEmpty(S.areaCode) || String.IsNullOrEmpty(S.Operator) || String.IsNullOrEmpty(S.site))
            {
                genRet.MsgText = "拣货员工信息不完整,无法拣货";
                return(genRet);
            }
            pmw_order orderInfo = new pmw_order();

            if (String.IsNullOrEmpty(S.OrderID))
            {
                orderInfo = new DAL.DalGet_order_detail().IsPicking(S);
                if (orderInfo == null)
                {
                    pmw_admin adminInfo = new DAL.DalGet_order_detail().GetShopNameIDArray(S.Operator);
                    if (adminInfo == null || String.IsNullOrEmpty(adminInfo.shop_name))
                    {
                        genRet.MsgText = "无法获取员工管理店铺";
                        return(genRet);
                    }
                    orderInfo = RegionalPicking(adminInfo.shop_name.Split(','), S.site, S.areaCode);
                    if (orderInfo == null || string.IsNullOrEmpty(orderInfo.order_code))
                    {
                        genRet.MsgText = "没有拣货任务了";
                        return(genRet);
                    }
                }
            }
            else
            {
                if (new DAL.DalGet_order_detail().OrderOutBillCodeNotOut(int.Parse(S.OrderID)))
                {
                    new DAL.DalGet_order_detail().UpdateOrderNotOut(int.Parse(S.OrderID), 0);
                }
                orderInfo = new DAL.DalGet_order_detail().OrderIDGetTask(int.Parse(S.OrderID), S.site);
                if ((orderInfo == null || string.IsNullOrEmpty(orderInfo.order_code)) && !new DAL.DalGet_order_detail().IsOutBillCode(int.Parse(S.OrderID)))
                {
                    new DAL.DalGet_order_detail().UpdateOrderNotOut(int.Parse(S.OrderID), 1);
                    genRet.MsgText = "该订单已经下架";
                }
            }

            if (orderInfo != null && !string.IsNullOrEmpty(orderInfo.order_code))
            {
                new DAL.DalGet_order_detail().Release_task(orderInfo.id, S.Operator, 1);
                genRet = GetOrderDetailTask(orderInfo, S.Operator, S.site);
            }
            else
            {
                genRet.MsgText = "无法获取改单号信息";
            }

            return(genRet);
        }
示例#9
0
 public Model.GeneralReturns ZTPutaway(Model.M_ZTPutaway.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.place_code) || string.IsNullOrEmpty(S.billcode) || string.IsNullOrEmpty(S.emp) || string.IsNullOrEmpty(S.wavehouse_name))
     {
         genRet.MsgText = "参数不全,请核实";
     }
     else
     {
         genRet.State   = new DAL.Dal_ZTPutaway().Putaway(S);
         genRet.MsgText = "上架失败";
     }
     return(genRet);
 }
示例#10
0
        public Model.GeneralReturns PushMessage(Model.M_PushMessage.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            bool dbr = new DAL.Dal_PushMessage().ProblemInset(S);

            if (dbr)
            {
                genRet.State = true;
            }
            else
            {
                genRet.MsgText = "无法推送锁定任务";
            }
            return(genRet);
        }
示例#11
0
 public Model.GeneralReturns KD_comInfo()
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     Model.M_KD_comInfo   kdCom  = new Model.M_KD_comInfo();
     kdCom.Kd_comInfo = new DAL.Dal_KD_comInfo().KD_comInfo();
     if (kdCom.Kd_comInfo.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(kdCom);
         genRet.State      = true;
     }
     else
     {
         genRet.MsgText = "获取失败";
     }
     return(genRet);
 }
示例#12
0
 public Model.GeneralReturns PeerInfo()
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     Model.M_PeerInfo     pee    = new Model.M_PeerInfo();
     pee.PD = new DAL.Dal_PeerInfo().PeerInfo();
     if (pee.PD.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(pee);
     }
     else
     {
         genRet.MsgText = "获取失败";
     }
     genRet.State = true;
     return(genRet);
 }
示例#13
0
 public Model.GeneralReturns ztPriceList()
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     Model.M_ztPriceList  ztPri  = new Model.M_ztPriceList();
     ztPri.ztPrice = new DAL.Dal_ztPriceList().ztPriceList();
     if (ztPri.ztPrice.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(ztPri);
         genRet.State      = true;
     }
     else
     {
         genRet.MsgText = "无法获取";
     }
     return(genRet);
 }
示例#14
0
 public Model.GeneralReturns Forwarder()
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     Model.M_Forwarder    der    = new Model.M_Forwarder();
     der.ForwarderLiset = new DAL.Dal_Forwarder().Forwarder();
     if (der.ForwarderLiset.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(der);
         genRet.State      = true;
     }
     else
     {
         genRet.MsgText = "获取失败";
     }
     return(genRet);
 }
示例#15
0
        public Model.GeneralReturns ShopList()
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            Model.M_ShopList     sho    = new Model.M_ShopList();
            sho.tbiList = new DAL.Dal_ShopList().ShopList();
            if (sho.tbiList.Count > 0)
            {
                genRet.ReturnJson = Common.DataHandling.ObjToJson(sho);
                genRet.State      = true;
            }
            else
            {
                genRet.MsgText = "获取失败";
            }

            return(genRet);
        }
示例#16
0
        public Model.GeneralReturns wavehouseList()
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            Model.M_wavehouse    wav    = new Model.M_wavehouse();
            wav.houseInfo = new DAL.Dal_wavehouseList().wavehouseList();
            if (wav.houseInfo.Count > 0)
            {
                genRet.State      = true;
                genRet.ReturnJson = Common.DataHandling.ObjToJson(wav);
            }
            else
            {
                genRet.MsgText = "获取失败";
            }


            return(genRet);
        }
        /// <summary>
        /// 返回拣货任务
        /// </summary>
        /// <param name="orderInfo"></param>
        /// <returns></returns>
        private Model.GeneralReturns GetOrderDetailTask(pmw_order orderInfo, string operatorName, string site)
        {
            Model.GeneralReturns gr = new Model.GeneralReturns();
            Model.M_OffShelf.OffShelfListRuturn offSheListRet = new Model.M_OffShelf.OffShelfListRuturn();
            offSheListRet.OffShelfRuturn = new DAL.DalGet_order_detail().PickingTask(operatorName, site, orderInfo);

            if (offSheListRet.OffShelfRuturn.Count > 0)
            {
                gr.ReturnJson = Common.DataHandling.ObjToJson(offSheListRet);
                gr.State      = true;
            }
            else
            {
                new DAL.DalGet_order_detail().Release_task(orderInfo.id, string.Empty, 0);
                gr.MsgText = "无法获取" + orderInfo.id + "!请重试";
            }
            return(gr);
        }
示例#18
0
        public Model.GeneralReturns PickingStop(Model.M_PickingStop.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();
            if (String.IsNullOrEmpty(S.out_billcode) || String.IsNullOrEmpty(S.oper))
            {
                genRet.MsgText = "运单号为空或操作员为空";
                return(genRet);
            }
            bool dbRes = new DAL.Dal_PickingStop().StopPicking(S.out_billcode, S.oper);

            if (dbRes)
            {
                genRet.State = true;
            }
            else
            {
                genRet.MsgText = "终止拣货失败";
            }
            return(genRet);
        }
示例#19
0
 public Model.GeneralReturns IStask(Model.M_IStask.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.order_code))
     {
         genRet.MsgText = "缺少参数";
     }
     else
     {
         if (new DAL.Dal_IStask().IsTask(S.order_code))
         {
             genRet.State = true;
         }
         else
         {
             genRet.MsgText = "释放任务失败";
         }
     }
     return(genRet);
 }
 public Model.GeneralReturns CheckBillcodeInfo(Model.M_CheckBillcodeInfo.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (String.IsNullOrEmpty(S.billcode))
     {
         genRet.MsgText = "未获取到快递单号";
         return(genRet);
     }
     Model.M_CheckBillcodeInfo che = new Model.M_CheckBillcodeInfo();
     che.cbr = new DAL.Dal_CheckBillcodeInfo().CheckBillcodeInfo(S.billcode);
     if (che.cbr.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(che);
         genRet.State      = true;
     }
     else
     {
         genRet.MsgText = "无法获取";
     }
     return(genRet);
 }
示例#21
0
 public Model.GeneralReturns AbnormalPickingList(Model.M_AbnormalPickingList.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (string.IsNullOrEmpty(S.out_barcode))
     {
         genRet.MsgText = "缺少参数";
         return(genRet);
     }
     Model.M_AbnormalPickingList abnPic = new Model.M_AbnormalPickingList();
     abnPic.OffShelfRuturn = new DAL.Dal_AbnormalPickingList().AbnormalPickingList(S.out_barcode);
     if (abnPic.OffShelfRuturn.Count > 0)
     {
         genRet.ReturnJson = Common.DataHandling.ObjToJson(abnPic);
         genRet.State      = true;
     }
     else
     {
         genRet.MsgText = "无法获取";
     }
     return(genRet);
 }
 public Model.GeneralReturns AbnormalPicking(Model.M_AbnormalPicking.Request S)
 {
     Model.GeneralReturns genRet = new Model.GeneralReturns();
     if (String.IsNullOrEmpty(S.site))
     {
         genRet.MsgText = "操作员仓库不能为空";
         return(genRet);
     }
     Model.M_AbnormalPicking abnPic = new Model.M_AbnormalPicking();
     abnPic.AbnormalPickingListReturn = new DAL.Dal_AbnormalPicking().AbnormalPickingList(S.site);
     if (abnPic.AbnormalPickingListReturn.Count > 0)
     {
         foreach (var A in abnPic.AbnormalPickingListReturn)
         {
             A.site     = S.site;
             A.Operator = S.Operator;
         }
         genRet.ReturnJson = Common.DataHandling.ObjToJson(abnPic);
         genRet.State      = true;
     }
     return(genRet);
 }
示例#23
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);
 }
示例#24
0
 public string AllTransfer(String FunctionName, string JsonData, string CusID, string KeyMd5)
 {
     Common.SystemLog.WriteSystemLog(FunctionName, JsonData);
     Model.GeneralReturns Now_RetObject = new Model.GeneralReturns();
     Now_RetObject.State = false;
     try
     {
         if (FunctionName == null || FunctionName == string.Empty)
         {
             Now_RetObject.MsgText = "错误的FunctionName";
         }
         else
         {
             MethodInfo Mt = this.GetType().GetMethod(FunctionName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
             if (Mt == null || Mt.GetParameters().Count() != 1)
             {
                 Now_RetObject.MsgText = "错误的FunctionName";
             }
             else
             {
                 Type NowType = Mt.GetParameters()[0].ParameterType;
                 var  Obj     = EntityProcess.CheckPostData(Request, NowType, FunctionName, JsonData, CusID, KeyMd5);
                 Now_RetObject = Obj.ReturnMode;
                 if (Now_RetObject.State)
                 {
                     Now_RetObject = (Model.GeneralReturns)Mt.Invoke(System.Activator.CreateInstance(this.GetType()), new object[] { Obj.JsonObject });
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Now_RetObject.MsgText = ex.Message;
     }
     return(HttpHelper.ObjToJson(Now_RetObject));
 }
示例#25
0
 public Model.GeneralReturns Login(Model.LoginMode.LoginRequest S)
 {
     Model.GeneralReturns gr = new Model.GeneralReturns();
     if (String.IsNullOrEmpty(S.Uid) || String.IsNullOrEmpty(S.Pwd))
     {
         gr.MsgText = "用户名或密码为空";
         return(gr);
     }
     Model.LoginMode.LoginReturn loginRet = new DAL.Dal_Login().Login(S.Uid, Common.DataHandling.GetMD5Hash(Common.DataHandling.GetMD5Hash(S.Pwd)));
     if (loginRet == null)
     {
         gr.MsgText = "用户名或密码错误";
     }
     else if (string.IsNullOrEmpty(loginRet.username) || string.IsNullOrEmpty(loginRet.nickname))
     {
         gr.MsgText = "无法获取用户名";
     }
     else
     {
         gr.ReturnJson = Common.DataHandling.ObjToJson(loginRet);
         gr.State      = true;
     }
     return(gr);
 }
示例#26
0
        /// <summary>
        /// 补打运单
        /// </summary>
        /// <param name="gr"></param>
        /// <param name="S"></param>
        /// <returns></returns>
        private Model.GeneralReturns SupplementPrint(Model.GeneralReturns gr, Model.M_Print.Request S)
        {
            if (String.IsNullOrEmpty(S.operateMan) || String.IsNullOrEmpty(S.operateSite))
            {
                gr.MsgText = "缺少操作人或站点";
                gr.State   = false;
                return(gr);
            }

            pmw_billcode billcodeInfo = new DAL.Dal_Print().SupplementGetBillCodeInfo(S.repair);

            if (billcodeInfo == null || string.IsNullOrEmpty(billcodeInfo.packed_billcode))
            {
                gr.MsgText = "无法获取快递单信息";
                return(gr);
            }
            List <Model.M_Print.Return> reqList = new List <Model.M_Print.Return>();
            pmw_order orderInfo = new DAL.Dal_Print().SupplementGetOrderInfo(billcodeInfo.order_code);

            if (orderInfo == null)
            {
                gr.MsgText = "无法获取订单信息";
                return(gr);
            }
            CFHMPring pringInfo = new DAL.Dal_Print().SupplementGetPrintInfo(billcodeInfo.packed_billcode);

            if (pringInfo == null)
            {
                gr.MsgText = "无法获取打印信息";
                return(gr);
            }
            pmw_timeBar flightInfo = new DAL.Dal_Print().getFlightTime(orderInfo.timeBarID);

            if (flightInfo == null)
            {
                gr.MsgText = "无法获取航班信息";
                return(gr);
            }
            GoodsCatalog goodsInfo = new DAL.Dal_Print().getGoodsTypeInfo(orderInfo.goodsType);

            if (goodsInfo == null)
            {
                gr.MsgText = "无法获取货物类型";
                return(gr);
            }
            string SignerCode = string.Empty, VersionCode = string.Empty, addressCode = string.Empty;

            secondEJSPushData(pringInfo.deliveryCom, pringInfo.recipientsAdd, out SignerCode, out VersionCode, out addressCode);
            reqList.Add(new Model.M_Print.Return
            {
                WaybillNo           = pringInfo.CForHM_number,
                billcode            = pringInfo.KD_billcodeList,
                employee            = S.operateMan,
                Js_number           = (int)pringInfo.TurnNumber,
                briefCode           = goodsInfo.briefCode,
                goodsType           = billcodeInfo.goodsTyep,
                goodsName           = pringInfo.goods,
                shopName            = pringInfo.consolidator,
                OrderGoodsNotes     = orderInfo.OrderGoodsNotes,
                CusCode             = pringInfo.deliveryCode,
                timeBarName         = flightInfo.timeBarName,
                orderID             = orderInfo.id.ToString(),
                z_weight            = pringInfo.netWeight.ToString(),
                address             = pringInfo.recipientsAdd,
                Phone               = pringInfo.recipientsPhone,
                recipients          = pringInfo.recipients,
                IdentificationGoods = billcodeInfo.goodsTyep.Contains("特") ? "T" : "",
                ds_mdgj_Free        = orderInfo.pay_type == 1 ? pringInfo.freightPayable.ToString() : "0",
                DFFeer              = pringInfo.freightPayable.ToString(),
                addressCode         = addressCode,
                SignerCode          = SignerCode,
                VersionCode         = VersionCode,
                chargedWeight       = orderInfo.Free_Weight.ToString()
            });
            if (reqList.Count > 0)
            {
                gr.ReturnJson = DataHandling.ObjToJson(reqList);
                gr.State      = true;
                gr.Mb         = pringInfo.deliveryCom;
                gr.MsgText    = S.operateMan;
            }
            else
            {
                gr.MsgText = "无法获取打印信息";
            }

            return(gr);
        }
示例#27
0
        public Model.GeneralReturns Print(Model.M_Print.Request S)
        {
            Model.GeneralReturns genRet = new Model.GeneralReturns();


            if (!string.IsNullOrEmpty(S.repair))
            {
                return(SupplementPrint(genRet, S));
            }

            if (String.IsNullOrEmpty(S.operateMan) || String.IsNullOrEmpty(S.operateSite) || null == S.PackaginBillcode || S.PackaginBillcode.Count == 0)
            {
                genRet.MsgText = "参数不全,请核实";
            }
            else
            {
                List <Model.M_Print.Return> reqList = new List <Model.M_Print.Return>();
                pmw_order orderInfo        = new DAL.Dal_Print().getOrderInfo(long.Parse(S.orderID));
                int       subcontractCount = 0;
                if (orderInfo.subpackageNum == null || orderInfo.subpackageNum < 1)
                {
                    subcontractCount = 1;
                }
                else
                {
                    subcontractCount = int.Parse(orderInfo.subpackageNum.ToString());
                }


                for (int i = 1; i <= subcontractCount; i++)
                {
                    if (orderInfo == null)
                    {
                        genRet.MsgText = "无法获取订单信息";
                    }
                    else
                    {
                        List <string> billcodeList = new List <string>();
                        foreach (var billcode in S.PackaginBillcode)
                        {
                            billcodeList.Add(i == 1 ? billcode.billcode : billcode.billcode + "-" + i);
                        }

                        string        message         = string.Empty;        //错误消息
                        StringBuilder strBuiGoodsCode = new StringBuilder(); //货物类型代码
                        StringBuilder strBuiGoodsType = new StringBuilder(); //货物类型
                        StringBuilder strBuiGoodsName = new StringBuilder(); //货物名称
                        double        billcodeWeight  = 0;

                        if (!IsPackage(orderInfo.order_code, i, billcodeList, ref message, ref strBuiGoodsType, ref strBuiGoodsName, ref billcodeWeight))
                        {
                            genRet.MsgText = message;
                            return(genRet);
                        }
                        #region 代收货款
                        var collectingMoney = orderInfo.pay_type == 1 ? (orderInfo.country_free + orderInfo.agencyFund) : orderInfo.agencyFund;
                        #endregion


                        GoodsCatalog goodsInfo = new DAL.Dal_Print().getGoodsTypeInfo(orderInfo.goodsType);
                        if (goodsInfo == null)
                        {
                            genRet.MsgText = "无法获取货物类型";
                            return(genRet);
                        }

                        strBuiGoodsCode.Append(goodsInfo.briefCode);
                        pmw_member memberInfo = new DAL.Dal_Print().getMemberInfo(orderInfo.member_id);
                        if (memberInfo == null)
                        {
                            genRet.MsgText = "无法获取会员信息";
                            return(genRet);
                        }

                        TaoBaoInfo shopInfo = new DAL.Dal_Print().getShopInfo(memberInfo.astro);
                        if (shopInfo == null)
                        {
                            genRet.MsgText = "无法获取店铺信息";
                            return(genRet);
                        }

                        pmw_house houseInfo = new DAL.Dal_Print().getHouseInfo(long.Parse(S.operateSite));
                        if (houseInfo == null)
                        {
                            genRet.MsgText = "无法获取仓库信息";
                            return(genRet);
                        }
                        pmw_timeBar flightInfo = new DAL.Dal_Print().getFlightTime(orderInfo.timeBarID);
                        if (flightInfo == null)
                        {
                            genRet.MsgText = "无法获取航班时效信息";
                            return(genRet);
                        }
                        PrintConfig printConfigInfo = PrintConfigInfo(orderInfo, S.express);
                        if (printConfigInfo == null)
                        {
                            genRet.MsgText = "无法获取打印配置信息";
                            return(genRet);
                        }

                        Forwarder forwarderInfo = new DAL.Dal_Print().getForwarderCode(printConfigInfo.pjCom, printConfigInfo.pjCode);
                        if (forwarderInfo == null)
                        {
                            genRet.MsgText = "无法获取派件公司信息";
                            return(genRet);
                        }

                        Forwarder_number forwarderNoInfo = new DAL.Dal_Print().getPrintNo(forwarderInfo.id);
                        if (forwarderNoInfo == null || string.IsNullOrEmpty(forwarderNoInfo.num))
                        {
                            genRet.MsgText = "无法获取单号";
                            return(genRet);
                        }
                        string printNo = forwarderNoInfo.num;
                        //if (new DAL.Dal_Print().getForwardingAgentNoCount(forwarderInfo.id) < 2001)
                        //{
                        //    try
                        //    {
                        //        var SentState1 = FastSocket.MaeesgeSend(new MassgeClass()
                        //        {
                        //            IsSite = true,
                        //            Mags = forwarderInfo.ForwarderName,
                        //            MagsID = "0",
                        //            Mags_Type = "HmOrderCount",
                        //            SiteOrUser = new string[] { "客服" }
                        //        }, false);
                        //    }
                        //    catch (Exception ex)
                        //    {

                        //    }
                        //}

                        string recipients = new DAL.Dal_Print().getRecipientName(orderInfo.cname, orderInfo.id);


                        string sentKdBillcode = string.IsNullOrEmpty(orderInfo.sent_kd_billcode) ? printNo : orderInfo.sent_kd_billcode + "," + printNo;
                        bool   dbPrint        = new DAL.Dal_Print().Print(Convert.ToDecimal(collectingMoney), orderInfo, sentKdBillcode, S.express.Contains("黑猫") ? "黑猫宅急便" : S.express, recipients, houseInfo, shopInfo, forwarderInfo, billcodeList.ToArray(), strBuiGoodsName.ToString(), S, printNo, billcodeWeight);
                        if (!dbPrint)
                        {
                            new DAL.Dal_Print().ReleaseForwarder_number(forwarderNoInfo);
                            genRet.MsgText = "无法生成运单";
                            return(genRet);
                        }


                        if (printConfigInfo.pjCom.Contains("国阳"))
                        {
                            ApiHelp.GYHelper gyApi = new ApiHelp.GYHelper();
                            gyApi.AddData(new ApiHelp.GYHelper.Data()
                            {
                                SentType     = S.express.Contains("取货") ? "A02" : "A01",
                                Signer       = recipients,
                                SignAddress  = orderInfo.address,
                                SignPhone    = orderInfo.mobile,
                                SignEmail    = memberInfo.email,
                                StoreName    = S.express.Contains("取货") ? recipients : "",
                                StoreCode    = S.express.Contains("取货") ? orderInfo.customerCode : "",
                                StoreAddress = S.express.Contains("取货") ? orderInfo.address : "",
                                StorePhone   = S.express.Contains("取货") ? orderInfo.mobile : "",
                                OrderCode    = printNo,
                                GoodsName    = strBuiGoodsName.ToString(),
                                GoodsAccount = billcodeList.Count,
                                DsMoney      = (int)collectingMoney,
                                Weight       = (int)billcodeWeight,
                                SentFastType = GyTransferCompanyCode(S.express)
                            });
                            gyApi.ToCsv(Common.Entity.ftpPaht, true);
                        }


                        reqList.Add(new Model.M_Print.Return
                        {
                            WaybillNo           = printNo,
                            billcode            = string.Join(",", billcodeList.ToArray()),
                            employee            = S.operateMan,
                            Js_number           = billcodeList.Count,
                            briefCode           = strBuiGoodsCode.ToString(),
                            goodsType           = strBuiGoodsType.ToString(),
                            shopName            = shopInfo.Name,
                            OrderGoodsNotes     = orderInfo.OrderGoodsNotes,
                            CusCode             = forwarderInfo.ForwarderCode,
                            timeBarName         = flightInfo.timeBarName,
                            orderID             = orderInfo.id.ToString(),
                            z_weight            = billcodeWeight.ToString(),
                            address             = orderInfo.address,
                            Phone               = orderInfo.mobile,
                            recipients          = recipients,
                            IdentificationGoods = strBuiGoodsType.ToString().Contains("特") ? "T" : "",
                            ds_mdgj_Free        = orderInfo.pay_type == 1 ? Math.Round(Convert.ToDecimal(orderInfo.agencyFund + orderInfo.country_free), 2).ToString() : "0",
                            DFFeer              = collectingMoney.ToString(),
                            addressCode         = printNo.Substring(6),
                            goodsName           = strBuiGoodsName.ToString(),
                            chargedWeight       = orderInfo.Free_Weight.ToString()
                        });
                        genRet.State      = true;
                        genRet.Mb         = S.express;
                        genRet.ReturnJson = Common.DataHandling.ObjToJson(reqList);
                        genRet.MsgText    = S.operateMan;
                    }
                }
            }

            return(genRet);
        }