Esempio n. 1
0
        /// <summary>
        /// 发货计划-输出接口
        /// </summary>
        /// <param name="icseout">发货计划主记录</param>
        /// <param name="icseoutentry">发货计划明细记录</param>
        /// <returns></returns>
        public string ICSEOUTBILLSync(List <V_ICSEOUTBILLMODEL> icseout, List <V_ICSEOUTBILLENTRYMODEL> icseoutentry)
        {
            try
            {
                if (icseout.Count > 0)
                {
                    int result = 0;
                    foreach (V_ICSEOUTBILLENTRYMODEL entrymodel in icseoutentry)
                    {
                        //普通开单
                        if (icseout[0].FBILLING_TYPE == 1)
                        {
                            //PLANBill_HuaNaiDal.Instance.DeleteWhere(new { FBILLNO = icseout[0].FBILLNO, FSYNCSTATUS = -3 });

                            PLANBill_HuaNaiDal.Instance.DeleteWhere(new { FBILLNO = icseout[0].FBILLNO, FENTRYID = entrymodel.FENTRYID });

                            PLANBill_HuaNaiModel newmodel = new PLANBill_HuaNaiModel();
                            newmodel.FBILLNO     = icseout[0].FBILLNO;
                            newmodel.FSTATUS     = 1;
                            newmodel.FSYNCSTATUS = 0;
                            newmodel.FACCOUNT    = icseout[0].FACCOUNT;
                            //newmodel.FPLATENUMBER =string.Format(@"{0}\{1}\{2}\{3}", icseout[0].FCARNUMBER, icseout[0].FEXPRESSCOMPANYNAME, icseout[0].FDELIVERERADDR, icseout[0].FPROJECTNAME) ;
                            newmodel.FPLATENUMBER      = icseout[0].FCARNUMBER;
                            newmodel.FDRIVER           = icseout[0].FDELIVERER;
                            newmodel.FDRPHONE          = icseout[0].FDELIVERERTEL;
                            newmodel.FCENTER_WAREHOUSE = icseout[0].FCENTER_WAREHOUSE;
                            newmodel.FIS_CONSIGN       = PublicMethod.GetInt(icseout[0].FIS_CONSIGN);
                            newmodel.FDELIVERY_METHOD  = icseout[0].FDELIVERY_METHODNUMBER;
                            newmodel.FENTRYID          = PublicMethod.GetInt(entrymodel.FENTRYID);
                            newmodel.FITEMID           = entrymodel.FITEMID;
                            newmodel.FSRCCODE          = entrymodel.FSRCCODE;
                            newmodel.FSRCNAME          = entrymodel.FSRCNAME;
                            newmodel.FSRCMODEL         = entrymodel.FSRCMODEL;
                            newmodel.FBATCHNO          = entrymodel.FBATCHNO;
                            newmodel.FCOLORNO          = entrymodel.FCOLORNO;
                            newmodel.FPRICE            = entrymodel.FACCOUNTPRICE;
                            newmodel.FAMOUNT           = entrymodel.FAMOUNT;
                            newmodel.FERR_MESSAGE      = entrymodel.FERR_MESSAGE;
                            newmodel.FAUDQTY           = entrymodel.FCOMMITQTY;
                            //newmodel.FCOMMITQTY = entrymodel.FCOMMITQTY;
                            newmodel.FREMARK      = icseout[0].FREMARK;
                            newmodel.FNEEDDATE    = icseout[0].FDELIVERDATE;
                            newmodel.FGRADE       = entrymodel.FLEVEL;
                            newmodel.FLINE_NOTE   = entrymodel.FDESCRIPTION;
                            newmodel.FPLANDESC    = icseout[0].FPLANDESC;
                            newmodel.FPURCHASE_NO = icseout[0].FPURCHASE_NO;
                            newmodel.FIS_CONSIGN  = icseout[0].FIS_CONSIGN;

                            result = PLANBill_HuaNaiDal.Instance.Insert(newmodel);
                        }

                        //托管库开单
                        if (icseout[0].FBILLING_TYPE == 2)
                        {
                            Customer_TG_Order_HuaNaiDal.Instance.DeleteWhere(new { FBILLNO = icseout[0].FBILLNO, FSYNCSTATUS = -3 });

                            Customer_TG_Order_HuaNaiModel newmodel = new Customer_TG_Order_HuaNaiModel();
                            newmodel.FBILLNO         = icseout[0].FBILLNO;
                            newmodel.FNEEDDATE       = icseout[0].FDELIVERDATE;
                            newmodel.CUSTOMER_NO     = icseout[0].FACCOUNT;
                            newmodel.CUST_REF        = icseout[0].FACCOUNT;
                            newmodel.CAR_NO          = icseout[0].FCARNUMBER;
                            newmodel.NOTE            = icseout[0].FPLANDESC;
                            newmodel.PART_NO         = entrymodel.FSRCCODE;
                            newmodel.LOCATION_NO     = entrymodel.FSTOCKNUMBER;
                            newmodel.WareHouse       = entrymodel.FSTOCK;
                            newmodel.LOT_BATCH_NO    = entrymodel.FBATCHNO;
                            newmodel.LOCATION_NO     = entrymodel.FLOCATION_NO;
                            newmodel.QUANTITY        = entrymodel.FCOMMITQTY;
                            newmodel.lineNote        = entrymodel.FDESCRIPTION;
                            newmodel.WAIV_DEV_REJ_NO = entrymodel.FWDR;
                            newmodel.FSYNCSTATUS     = 0;
                            newmodel.FENTRYID        = PublicMethod.GetInt(entrymodel.FENTRYID);

                            result = Customer_TG_Order_HuaNaiDal.Instance.Insert(newmodel);
                        }
                    }

                    if (result > 0)
                    {
                        trans_finishModel model = new trans_finishModel();
                        model.fbillno   = icseout[0].FBILLNO;
                        model.if_TGbill = (icseout[0].FBILLING_TYPE == 2);
                        trans_finishDal.Instance.Insert(model);

                        return(JsonHelper.ToJson(new { errCode = 0, errMsg = "上传成功!" }));
                    }
                }

                return(JsonHelper.ToJson(new { errCode = -1, errMsg = "上传失败!" }));
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex);
                throw ex;
            }
        }
Esempio n. 2
0
 public int Update(PLANBill_HuaNaiModel model)
 {
     return(PLANBill_HuaNaiDal.Instance.Update(model));
 }