using NetLibrary; using NetLibrary.Common.Configuration; using NetLibrary.Data; using NetLibrary.OnlineTrade; using NetLibrary.ReportPrint; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Services; using TradeData; using TradeModel; using TradeManageNew; namespace TradeManage.SysManage { /// /// SysManageService 的摘要说明 /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 [System.Web.Script.Services.ScriptService] public class SysManageService : System.Web.Services.WebService { #region 机构 #region 保存机构 [WebMethod(EnableSession = true)] public int Save_JC_Company(JC_Company Model) { Pages.Login(this.Session); int Id=JC_CompanyService.Save(Model); if (Model.CompanyID == null || Model.CompanyID <= 0) //新增机构初始化数据 { BaseService obj = new BaseService(); obj.SaveStartData(Id); } return Id; } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public JsonModel> GetListCompanyList(string cs, int PageIndex, int PageSize) { Pages.Login(this.Session); string where = CustomIO.Base64StringToString(cs); if (where!="")where = "where a.CompanyId>1 and b.State=1 and " + where.Substring(4); var resultModel = new JsonModel>(); int RowCount = 0; resultModel.DataSource = BaseService.GetListCompany(where, PageIndex, PageSize, "", out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 保存 [WebMethod(EnableSession = true)] public int Save_Company(JC_Company Model) { Pages.Login(this.Session); int Id=BaseService.Save_Company(Model); JC_UserInfo2 umd = new JC_UserInfo2(); umd.CompanyId = Id; umd.UserName = Model.UserName; umd.Password = Model.Password; umd.UserType = "P"; umd.State = 1; umd.InDate = DateTime.Now; umd.IsLogin = 1; umd.Name = Model.CompanyName; JC_UserInfoService.Save2(umd); return Id; } #endregion #region 删除机构 [WebMethod(EnableSession = true)] public void Delete_JC_Company(int CompanyID) { Pages.Login(this.Session); JC_CompanyService.Delete(CompanyID); } #endregion #region 开启关闭机构 [WebMethod(EnableSession = true)] public void Update_JC_Company(int CompanyID,int State) { Pages.Login(this.Session); JC_CompanyService.UpdateCompany(CompanyID, State); } #endregion #region 返回机构Model [WebMethod(EnableSession = true)] public JC_Company Get_JC_CompanyModel() { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); return JC_CompanyService.GetModel(CompanyID); } #endregion #region 返回机构Model [WebMethod(EnableSession = true)] public JC_Company Get_JC_CompanyModel2(int CompanyID) { Pages.Login(this.Session); return JC_CompanyService.GetModel(CompanyID); } #endregion #region 分页查询_机构 [WebMethod(EnableSession = true)] public JsonModel> Select_JC_CompanyPageList(string Shen, string Shi, string Qu, string CompanyName, int PageIndex, int PageSize) { Pages.Login(this.Session); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; RefParameterCollection param = new RefParameterCollection(); //param.Add("state", "=", 1, DbType.Int32); if (string.IsNullOrEmpty(Shen) == false) param.Add("a.Shen", "=", Shen, DbType.String); if (string.IsNullOrEmpty(Shi) == false) param.Add("a.Shi", "=", Shi, DbType.String); if (string.IsNullOrEmpty(Qu) == false) param.Add("a.Qu", "=", Qu, DbType.String); if (string.IsNullOrEmpty(CompanyName) == false) param.Add("CompanyName", "like", CompanyName, DbType.String); resultModel.DataSource = JC_CompanyService.GetListJC_Company(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 判断名称是否重复 [WebMethod(EnableSession = true)] public bool CheckCompanyName(int CompanyID, string CompanyName) { Pages.Login(this.Session); return JC_CompanyService.CheckCompanyName(CompanyID, CompanyName); } #endregion #region 判断简称是否重复 [WebMethod(EnableSession = true)] public bool CheckSimpleName(int CompanyID, string SimpleName) { Pages.Login(this.Session); return JC_CompanyService.CheckSimpleName(CompanyID, SimpleName); } #endregion #region 判断代码是否重复 [WebMethod(EnableSession = true)] public bool CheckCompanyCode(int CompanyID, string CompanyCode) { Pages.Login(this.Session); return JC_CompanyService.CheckCompanyCode(CompanyID, CompanyCode); } #endregion #endregion #region 基础设置 #region 读取模块所属设置列表 [WebMethod(EnableSession = true)] public List GetJC_BaseCode(int CompanyID, string ModuleName) { return JC_BaseCodeService.GetJC_BaseCode(CompanyID, ModuleName); } #endregion #region 读取单项设置 [WebMethod(EnableSession = true)] public List GetJC_BaseCodeDetail(int CompanyID, string KeyName) { return JC_BaseCodeService.GetJC_BaseCodeDetail(CompanyID, KeyName); } #endregion #region 读取平台类型设置 [WebMethod(EnableSession = true)] public List GetJC_BaseCodePTLX(int CompanyID, string KeyName) { return JC_BaseCodeService.GetJC_BaseCodePTLX(CompanyID, KeyName); } #endregion #region 删除 [WebMethod(EnableSession = true)] public void DeleteCodeDetail(int Code) { JC_BaseCodeService.DeleteCodeDetail(Code); } #endregion #region 保存基础设置 [WebMethod(EnableSession = true)] public void Save_JC_BaseCodeDetail(int CompanyID, string KeyName, List ListModel) { JC_BaseCodeService.Save(CompanyID, KeyName, ListModel); } #endregion #region 保存基础设置 [WebMethod(EnableSession = true)] public void Save_JPLXBaseCode(string KeyName,List list) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); JC_BaseCodeService obj = new JC_BaseCodeService(); obj.DeleteKeyName(CompanyID, KeyName); if (list != null) { foreach (var md in list) { md.CompanyId = CompanyID; obj.SaveBaseCode(md); } } } #endregion #endregion #region 部门 #region 保存 [WebMethod(EnableSession = true)] public int Save_JC_DepartMent(JC_DepartMent Model) { Pages.Login(this.Session); int CompanyId=Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; return JC_DepartMentService.Save(Model); } #endregion #region 保存 [WebMethod(EnableSession = true)] public string Save_JC_DepartMentForTM(JC_DepartMent Model) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; string info=""; var list = new List(); if (Model.MasterName.Trim() != "") { string[] Names = Model.MasterName.Trim().Split(' '); for (int i = 0; i < Names.Length; i++) { int UserId = JC_ShopService.IsShopUser(CompanyId, Names[i].Trim()); if (UserId == 0) { info += Names[i].Trim() + "不存在,确定姓名是否填写正确"; } else { JC_UserInfo md = new JC_UserInfo(); md.UserId = UserId; md.Name = Names[i].Trim(); list.Add(md); } } } if (info == "") { int DeptId = JC_DepartMentService.SaveForTM(Model); JC_DepartMentService.SaveDeptMaster(DeptId, list); info = "保存成功"; } return info; } #endregion #region 删除 [WebMethod(EnableSession = true)] public void Delete_JC_DepartMent(int DeptId) { Pages.Login(this.Session); JC_DepartMentService.Delete(DeptId); } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public JsonModel> Select_JC_DepartMentPageList(int CompanyID, string DeptName, int PageIndex, int PageSize) { Pages.Login(this.Session); CompanyID = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; RefParameterCollection param = new RefParameterCollection(); param.Add("CompanyID", "=", CompanyID, DbType.Int32); if (string.IsNullOrEmpty(DeptName) == false) param.Add("DeptName", "like", DeptName, DbType.String); resultModel.DataSource = JC_DepartMentService.GetListJC_DepartMent(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public JsonModel> Select_JC_DepartMentPageForTM(int CompanyID, string DeptName, int PageIndex, int PageSize) { Pages.Login(this.Session); CompanyID = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "DeptId"; RefParameterCollection param = new RefParameterCollection(); param.Add("CompanyID", "=", CompanyID, DbType.Int32); if (string.IsNullOrEmpty(DeptName) == false) param.Add("DeptName", "like", DeptName, DbType.String); resultModel.DataSource = JC_DepartMentService.GetListJC_DepartMentForTM(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 判断名称是否重复 [WebMethod(EnableSession = true)] public bool CheckDeptName(int DeptID, string DeptName) { Pages.Login(this.Session); return JC_DepartMentService.CheckDeptName(DeptID, DeptName); } #endregion #region 判断代码是否重复 [WebMethod(EnableSession = true)] public bool CheckDeptCode(int DeptID, string DeptCode) { Pages.Login(this.Session); return JC_DepartMentService.CheckDeptCode(DeptID, DeptCode); } #endregion #region 保存部门下属员工 [WebMethod(EnableSession = true)] public void SaveDeptUser(int DeptID, List ListModel) { Pages.Login(this.Session); JC_DepartMentService.SaveDeptUser(DeptID, ListModel); } #endregion #region 保存部门下属员工 [WebMethod(EnableSession = true)] public void SaveDeptUserForTM(int DeptID, List ListModel) { Pages.Login(this.Session); JC_DepartMentService.SaveDeptUserForTM(DeptID, ListModel); } #endregion #endregion #region 用户信息 #region 保存-用户信息 [WebMethod(EnableSession = true)] public int Save_JC_UserInfo(JC_UserInfo Model) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyID; return JC_UserInfoService.Save(Model); } #endregion #region 保存-用户信息 [WebMethod(EnableSession = true)] public int Save_JC_UserInfoForTM(JC_UserInfoNew Model) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyID; Model.InDate = DateTime.Now; int Userid=JC_UserInfoService.SaveUserInfoForTM(Model); if (Model.RoleId > 0) { JC_RoleUser rmd = new JC_RoleUser(); rmd.RoleId = Model.RoleId.Value; rmd.RoleType = 1; rmd.UserId = Userid; rmd.UserName = Model.Name; JC_RoleInfoService.SaveRoleUser(rmd); } return Userid; } #endregion #region 删除-用户信息 [WebMethod(EnableSession = true)] public void Delete_JC_UserInfo(int UserId) { Pages.Login(this.Session); JC_UserInfoService.Delete(UserId); } #endregion #region 返回Model-用户信息 [WebMethod(EnableSession = true)] public JC_UserInfo GetModel_JC_UserInfo(int UserId) { Pages.Login(this.Session); return JC_UserInfoService.GetModel(UserId); } #endregion #region 分页查询-用户信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_UserInfo(int CompanyID, int DeptID, string Name, int PageIndex, int PageSize) { Pages.Login(this.Session); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; CompanyID = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection param = new RefParameterCollection(); param.Add("CompanyID", "=", CompanyID, DbType.Int32); param.Add("State", ">", 0, DbType.Int32); if (string.IsNullOrEmpty(Name) == false) { param.Add("(Name", "like", Name, DbType.String); param.Add("UserName", "like", Name, "or", ")", DbType.String); } resultModel.DataSource = JC_UserInfoService.GetListJC_UserInfo(DeptID, param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 分页查询-用户信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_UserInfoForTM(int CompanyID, int DeptID, string Name, int State, int IsRoom, string HuKou, string EmployeeType, int PageIndex, int PageSize) { Pages.Login(this.Session); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "UserId"; CompanyID = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection param = new RefParameterCollection(); param.Add("a.CompanyID", "=", CompanyID, DbType.Int32); if (DeptID>0) param.Add("a.DeptId", "=", DeptID, DbType.Int32); param.Add("a.State", "=", State, DbType.Int32); if (IsRoom>-1) param.Add("a.IsRoom", "=", IsRoom, DbType.Int32); if (HuKou!="-1") param.Add("a.HuKou", "=", HuKou, DbType.String); if (EmployeeType != "-1") param.Add("a.EmployeeType", "=", EmployeeType, DbType.String); if (string.IsNullOrEmpty(Name) == false) { param.Add("(Name", "like", Name, DbType.String); param.Add("UserName", "like", Name, "or", ")", DbType.String); } resultModel.DataSource = JC_UserInfoService.GetListJC_UserInfoForTM(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; if (resultModel.DataSource != null) { foreach (var md in resultModel.DataSource) { var rlist=JC_RoleInfoService.GetUserRoleList(md.UserId.Value); if (rlist != null && rlist.Count > 0) md.RoleId = rlist[0].RoleId; } } return resultModel; } #endregion #region 普通查询列表 [WebMethod(EnableSession = true)] public List GetListShop() { Pages.Login(this.Session); var ListModel = JC_ShopService.GetListShop(0); return ListModel; } #endregion #region 普通查询列表 [WebMethod(EnableSession = true)] public List GetKFUserInfo() { Pages.Login(this.Session); var ListModel = DataNew.GetKFUserInfo(); return ListModel; } #endregion #region 分页查询-用户信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_UserWorkForTM(int DeptID, string Name, int PageIndex, int PageSize) { Pages.Login(this.Session); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; int CompanyID = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection param = new RefParameterCollection(); param.Add("a.CompanyID", "=", CompanyID, DbType.Int32); if (DeptID > 0) param.Add("a.DeptId", "=", DeptID, DbType.Int32); param.Add("a.State", "=", 1, DbType.Int32); if (string.IsNullOrEmpty(Name) == false) { param.Add("(Name", "like", Name, DbType.String); param.Add("UserName", "like", Name, "or", ")", DbType.String); } resultModel.DataSource = JC_UserInfoService.GetListJC_UserInfoForTM(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 判断姓名是否重复-用户信息 [WebMethod(EnableSession = true)] public void SaveUserWork(int UserId, string WorkDesc) { Pages.Login(this.Session); JC_UserInfoNew Model = new JC_UserInfoNew(); Model.UserId = UserId; Model.WorkDesc = WorkDesc; JC_UserInfoService.SaveUserWork(Model); } #endregion #region 判断姓名是否重复-用户信息 [WebMethod(EnableSession = true)] public bool CheckName(int UserID, string Name) { Pages.Login(this.Session); return JC_UserInfoService.CheckName(UserID, Name); } #endregion #region 判断工号是否重复-用户信息 [WebMethod(EnableSession = true)] public bool CheckUserCode(int UserID, string UserCode) { Pages.Login(this.Session); return JC_UserInfoService.CheckUserCode(UserID, UserCode); } #endregion #region 判断用户名是否重复-用户信息 [WebMethod(EnableSession = true)] public bool CheckUserName(int UserID, string UserName) { Pages.Login(this.Session); return JC_UserInfoService.CheckUserName(UserID, UserName); } #endregion #endregion #region 角色 #region 读取角色列表 [WebMethod(EnableSession = true)] public List GetList_JC_RoleInfo(int CompanyID) { Pages.Login(this.Session); if (CompanyID == 0) CompanyID = Convert.ToInt32(Session["CompanyId"]); return JC_RoleInfoService.GetList(CompanyID); } #endregion #region 删除角色 [WebMethod(EnableSession = true)] public void Delete_JC_RoleInfo(int RoleId) { Pages.Login(this.Session); JC_RoleInfoService.Delete(RoleId); } #endregion #region 保存角色 [WebMethod(EnableSession = true)] public void Save_JC_RoleInfo(int RoleID, int CompanyID, string RoleName) { Pages.Login(this.Session); JC_RoleInfoService.Save(RoleID, CompanyID, RoleName); } #endregion #region 保存角色明细 [WebMethod(EnableSession = true)] public void SaveDetail_JC_RoleInfo(int CompanyID, JC_RoleInfo Model) { Pages.Login(this.Session); JC_RoleInfoService.SaveDetail(CompanyID, Model); } #endregion #region 读取菜单父节点 [WebMethod(EnableSession = true)] public List GetParentMenuList(int CompanyID) { Pages.Login(this.Session); return JC_RoleInfoService.GetParentMenuList(CompanyID); } #endregion #region 读取角色对象 [WebMethod(EnableSession = true)] public JC_RoleInfo GetModel_JC_RoleInfo(int CompanyID, int RoleID) { Pages.Login(this.Session); return JC_RoleInfoService.GetModel(CompanyID, RoleID); } #endregion #endregion #region 店铺管理 #region 保存 [WebMethod(EnableSession = true)] public int Save_JC_Shop(JC_Shop Model) { Pages.Login(this.Session); Model.CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_ShopService.Save(Model); } #endregion #region 保存店铺 [WebMethod(EnableSession = true)] public string Save_Shop(JC_Shop Model) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; Model.InDate = DateTime.Now; string error = ""; List list = new List(); if (Model.Master!=null&&Model.Master.Trim() != "") { string[] muser = Model.Master.Trim().Split(' '); for (int i = 0; i < muser.Length; i++) { int uid = JC_ShopService.IsShopUser(CompanyId,muser[i].Trim()); if(uid>0) { JC_ShopUser md = new JC_ShopUser(); md.SType = "M"; md.UserId = uid; list.Add(md); } else error += muser[i].Trim() + ";"; } } if (Model.Buyer!=null&&Model.Buyer.Trim() != "") { string[] buser = Model.Buyer.Trim().Split(' '); for (int i = 0; i < buser.Length; i++) { int uid = JC_ShopService.IsShopUser(CompanyId,buser[i].Trim()); if (uid > 0) { JC_ShopUser md = new JC_ShopUser(); md.SType = "B"; md.UserId = uid; list.Add(md); } else error += buser[i].Trim() + ";"; } } if (Model.ShopUser != null && Model.ShopUser.Trim() != "") { string[] cuser = Model.ShopUser.Trim().Split(' '); for (int i = 0; i < cuser.Length; i++) { int uid = JC_ShopService.IsShopUser(CompanyId,cuser[i].Trim()); if (uid > 0) { JC_ShopUser md = new JC_ShopUser(); md.SType = "S"; md.UserId = uid; list.Add(md); } else error += cuser[i].Trim() + ";"; } } if (error != "") return error + "没有在系统找到,请确定名字填写是否正确"; int ShopId= JC_ShopService.SaveShop(Model); JC_ShopService.DeleteShopUser(ShopId); if (list != null) { foreach (var md in list) { md.ShopId = ShopId; JC_ShopService.SaveShopUser(md); } } return "成功"; } #endregion #region 删除 [WebMethod(EnableSession = true)] public void Delete_JC_Shop(int ShopId) { Pages.Login(this.Session); JC_ShopService.Delete(ShopId); } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Shop(int CompanyID, int PlatType, string ShopName, int PageIndex, int PageSize) { Pages.Login(this.Session); if (CompanyID == 0) CompanyID = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; RefParameterCollection param = new RefParameterCollection(); param.Add("CompanyID", "=", CompanyID, DbType.Int32); param.Add("PlatType", "=", PlatType, DbType.Int32); if (string.IsNullOrEmpty(ShopName) == false) param.Add("ShopName", "like", ShopName, DbType.String); resultModel.DataSource = JC_ShopService.GetListJC_Shop(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 分页查询店铺 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_ShopForTM(int CompanyID,int DeptId, int PlatType, string ShopName,string Master,string Buyer,string ShopUser, int PageIndex, int PageSize) { Pages.Login(this.Session); if (CompanyID == 0) CompanyID = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "a.DeptId"; RefParameterCollection param = new RefParameterCollection(); if (DeptId>0) param.Add("a.DeptId", "=", DeptId, DbType.Int32); param.Add("a.CompanyID", "=", CompanyID, DbType.Int32); if (PlatType>0) param.Add("PlatType", "=", PlatType, DbType.Int32); if (string.IsNullOrEmpty(ShopName) == false) param.Add("ShopName", "like", ShopName, DbType.String); if (string.IsNullOrEmpty(Master) == false) param.Add("Master", "like", Master, DbType.String); if (string.IsNullOrEmpty(Buyer) == false) param.Add("Buyer", "like", Buyer, DbType.String); if (string.IsNullOrEmpty(ShopUser) == false) param.Add("ShopUser", "like", ShopUser, DbType.String); resultModel.DataSource = JC_ShopService.GetListJC_ShopForTM(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 读取速卖通默认Appkey与DeveKey [WebMethod(EnableSession = true)] public JC_Shop GetAppkeyOrDeveKey() { Pages.Login(this.Session); JC_Shop Model = new JC_Shop(); if (Session["Alibaba_Appkey"] == null) { string path = AppDomain.CurrentDomain.BaseDirectory + "Web.config"; string Alibaba_Appkey = ConfigurationSourceSection.LoadXml_Attribute(path, "Alibaba_Appkey"); string Alibaba_DeveKey = ConfigurationSourceSection.LoadXml_Attribute(path, "Alibaba_DeveKey"); Model.Appkey = Alibaba_Appkey; Model.DeveKey = Alibaba_DeveKey; } else { Model.Appkey = Convert.ToString(Session["Alibaba_Appkey"]); Model.DeveKey = Convert.ToString(Session["Alibaba_DeveKey"]); } return Model; } #endregion #region 读取速卖通Code [WebMethod(EnableSession = true)] public string GetAlibaba_Code(string Appkey, string DeveKey) { Pages.Login(this.Session); AlibabaApi obj = new AlibabaApi(); obj.Appkey = Appkey.Trim(); obj.DeveKey = DeveKey.Trim(); return obj.GetAuthUrl(); } [WebMethod(EnableSession = true)] public string GetAlibaba_Code2(string Appkey, string DeveKey) { Pages.Login(this.Session); AlibabaApi obj = new AlibabaApi(); obj.Appkey = Appkey.Trim(); obj.DeveKey = DeveKey.Trim(); return obj.GetAuthUrl2(); } #endregion #region 读取速卖通RefreshToken [WebMethod(EnableSession = true)] public JC_Shop GetAlibaba_RefreshToken(string Appkey, string DeveKey, string Code) { Pages.Login(this.Session); AlibabaApi obj = new AlibabaApi(); obj.Appkey = Appkey.Trim(); obj.DeveKey = DeveKey.Trim(); obj.Code = Code.Trim(); string ErrorMessage = ""; obj.GetAllToken(out ErrorMessage); if (string.IsNullOrEmpty(ErrorMessage) == false) return null; JC_Shop model = new JC_Shop(); model.RefreshToken = obj.RefreshToken; model.AccessToken = obj.AccessToken; model.RefreshTokenSaveTime = obj.RefreshTokenSaveTime; model.AccessTokenUpdateTime = obj.AccessTokenUpdateTime; return model; } #endregion #region 读取亚马逊默认开发者开发者AccessKeyId与SecretAccessKey [WebMethod(EnableSession = true)] public JC_Shop GetAccessKeyIdOrSecretAccessKey() { Pages.Login(this.Session); JC_Shop Model = new JC_Shop(); if (Session["Amazon_AccessKeyId"] == null) { string path = AppDomain.CurrentDomain.BaseDirectory + "Web.config"; string Amazon_AccessKeyId = ConfigurationSourceSection.LoadXml_Attribute(path, "Amazon_AccessKeyId"); string Amazon_SecretAccessKey = ConfigurationSourceSection.LoadXml_Attribute(path, "Amazon_SecretAccessKey"); Model.Appkey = Amazon_AccessKeyId; Model.DeveKey = Amazon_SecretAccessKey; } else { Model.Appkey = Convert.ToString(Session["Amazon_AccessKeyId"]); Model.DeveKey = Convert.ToString(Session["Amazon_SecretAccessKey"]); } return Model; } #endregion #region 读取亚马逊_国家列表 [WebMethod(EnableSession = true)] public List GetList_API_Country(int PlatType) { Pages.Login(this.Session); return JC_ShopService.GetList_API_Country(PlatType); } #endregion #region 读取Ebay默认Appkey与DeveKey与CertKey [WebMethod(EnableSession = true)] public JC_Shop GetEbay_AppkeyOrDeveKey() { Pages.Login(this.Session); JC_Shop Model = new JC_Shop(); if (Session["Alibaba_Appkey"] == null) { string path = AppDomain.CurrentDomain.BaseDirectory + "Web.config"; string Ebay_Appkey = ConfigurationSourceSection.LoadXml_Attribute(path, "Ebay_Appkey"); string Ebay_DeveKey = ConfigurationSourceSection.LoadXml_Attribute(path, "Ebay_DeveKey"); string Ebay_CertKey = ConfigurationSourceSection.LoadXml_Attribute(path, "Ebay_CertKey"); Model.Appkey = Ebay_Appkey; Model.DeveKey = Ebay_DeveKey; Model.RefreshToken = Ebay_CertKey; } else { Model.Appkey = Convert.ToString(Session["Ebay_Appkey"]); Model.DeveKey = Convert.ToString(Session["Ebay_DeveKey"]); Model.RefreshToken = Convert.ToString(Session["Ebay_CertKey"]); } return Model; } #endregion #region 读取所属人员 [WebMethod(EnableSession = true)] public List GetListShopUser(int ShopId) { Pages.Login(this.Session); return JC_ShopService.GetListShopUser(ShopId); } #endregion #region 保存所属人员 [WebMethod(EnableSession = true)] public void SaveShopUser(int ShopId, List ListModel) { Pages.Login(this.Session); JC_ShopService.SaveShopUser(ShopId, ListModel); } #endregion #endregion #region 店铺重新授权 [WebMethod(EnableSession = true)] public string ShopGetAccessToken(List ListModel) { Pages.Login(this.Session); AlibabaApi obj = new AlibabaApi(); string mess = ""; foreach (int ShopId in ListModel) { string error = ""; JC_Shop ShopModel = JC_ShopService.GetModel(ShopId); obj.ShopId = ShopId; obj.Appkey = ShopModel.Appkey; obj.DeveKey = ShopModel.DeveKey; obj.RefreshToken = ShopModel.RefreshToken; obj.AccessToken = ShopModel.AccessToken; obj.GroupName = ShopModel.ShopName; obj.RefreshTokenSaveTime = ShopModel.RefreshTokenSaveTime; obj.AccessTokenUpdateTime = ShopModel.AccessTokenUpdateTime; obj.GetAccessToken2(out error); mess += error; } if (mess == "") mess = "授权成功"; return mess; } #endregion #region API数据导入 [WebMethod(EnableSession = true)] public string ImportApi(int PlatType,DateTime? StartDate,DateTime? StopDate,List ListModel) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); bool bk = BaseService.SyncLock(CompanyID, 1, UserId, DateTime.Now); if (bk == false) return "当前有其他人正在导入,请稍候再尝试此操作"; string Error = ""; if (StartDate == null) StartDate = DateTime.Today.AddDays(-7); switch (PlatType) { case 1: Error = API_OrderInfoServiceNew.ImportAlibab(StartDate, StopDate, ListModel); break; case 2: Error = API_OrderInfoService.ImportAmazon(StartDate, StopDate, ListModel); break; case 3: Error = API_OrderInfoService.ImportEbay(StartDate, StopDate, ListModel); break; case 4: Error = API_OrderInfoService.ImportWish2(ListModel); break; case 6: Error = API_OrderInfoServiceNew.ImportWalmart(null,null,ListModel); break; default: break; } List ListOrder = API_OrderInfoService.GetList(CompanyID); foreach (int OrderID in ListOrder) { BaseService.OrderAdd(CompanyID, OrderID); } BaseService.UnSyncLock(CompanyID, 1, DateTime.Now); return Error; } #endregion #region API数据导入 [WebMethod(EnableSession = true)] public string ImportApiForTM(int PlatType, DateTime? StartDate, DateTime? StopDate, List ListModel) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); string ShopIds = ""; foreach (int ShopId in ListModel) { ShopIds += ShopId.ToString() + ","; // bool bk = BaseService.SyncLock(ShopId, 1, UserId, DateTime.Now); // if (bk == false) return "当前有其他人正在导入订单,请稍候再尝试此操作"; } string Error = ""; try { if (StartDate == null) StartDate = DateTime.Today.AddDays(-15); switch (PlatType) { case 1: Error = API_OrderInfoService.ImportAlibab(StartDate, StopDate, ListModel); break; case 2: Error = API_OrderInfoService.ImportAmazon(StartDate, StopDate, ListModel); break; case 3: Error = API_OrderInfoService.ImportEbayForTM(StartDate, StopDate, ListModel); break; case 4: Error = API_OrderInfoService.ImportWish2(ListModel); break; case 5: Error = API_OrderInfoService.ImportLazada(ListModel); break; default: break; } if (ShopIds != "") { List ListOrder = API_OrderInfoService.GetListForShop(CompanyID, ShopIds.Trim(',')); foreach (int OrderID in ListOrder) { BaseService.OrderAddForTM(CompanyID, OrderID, UserId); } } //foreach (int ShopId in ListModel) //{ // BaseService.UnSyncLock(ShopId, 1, DateTime.Now); //} } catch { //foreach (int ShopId in ListModel) //{ // BaseService.UnSyncLock(ShopId, 1, DateTime.Now); //} } return Error; } #endregion #region API数据导入 [WebMethod(EnableSession = true)] public string ImportApiForTM2(int PlatType, DateTime? StartDate, DateTime? StopDate, List ListModel) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); string Name = Convert.ToString(Session["Name"]); string ShopIds = ""; foreach (int ShopId in ListModel) { ShopIds += ShopId.ToString() + ","; } bool bk = BaseService.SyncLock2(ShopIds.Trim(','),UserId, Name, StartDate, StopDate); if (bk == true) return "当前有其他人正在导入其中店铺订单,请稍候再尝试此操作"; string Error = ""; return Error; } #endregion #region API数据导入 [WebMethod(EnableSession = true)] public string ImportApiAll() { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); string Name = Convert.ToString(Session["Name"]); BaseService.SyncLockAll(UserId, Name, DateTime.Today.AddDays(-3), DateTime.Today); return "已经开始同步订单,请耐心等待一会儿再刷新订单查询"; } #endregion #region API数据导入 [WebMethod(EnableSession = true)] public string ImportApiLook(List ListModel) { Pages.Login(this.Session); int CompanyID = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); string ShopIds = ""; foreach (int ShopId in ListModel) { ShopIds += ShopId.ToString() + ","; } var list = BaseService.GetSyncState(ShopIds.Trim(',')); string info = ""; if (list != null && list.Count > 0) { foreach (var md in list) { string ks = ""; if (md.StartDate != null) ks = md.StartDate.Value.ToString("yyyy-MM-dd HH:mm"); if (md.State==1&&md.EndDate==null) { info += md.InName + ks + "导入的" + md.ShopName + "还在加油导入中,请稍后再查看\r\n"; } else if (md.EndDate!=null && md.DDResult != null && md.DDResult != "") { info += md.InName + ks + "导入的" + md.ShopName + md.DDResult + "\r\n"; } else if (md.EndDate!=null && md.DDResult == null) { info += md.ShopName + "没有导入记录\r\n"; } } } return info; } #endregion #region 发货快递 #region 保存 [WebMethod(EnableSession = true)] public void Save_Express(JC_ExpressPost Model) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; if(Model.ExpressPostID==0) Model.IsSys = 0; if (Model.UserCode == "") Model.UserCode = null; if (Model.CheckCode == "") Model.CheckCode = null; if (Model.vipcode == "") Model.vipcode = null; if (Model.customercode == "") Model.customercode = null; JC_ExpressService.SaveExpressPost(Model); } #endregion #region 设置地址 [WebMethod(EnableSession = true)] public void UpdateExpressAddr(List list, int AddrId) { Pages.Login(this.Session); if (list != null) { foreach (var md in list) { JC_ExpressService.UpdateExpressAddr(md.ExpressPostID.Value, AddrId); } } } #endregion #region 删除 [WebMethod(EnableSession = true)] public void DeleteExpress(int ExpressPostID) { Pages.Login(this.Session); JC_ExpressService.DeleteExpress(ExpressPostID); } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public List GetListJC_Express(int LogisticsId,int IsAddr) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_ExpressService.GetListJC_Express(CompanyId, LogisticsId, IsAddr); } #endregion #endregion #region wish店铺授权 [WebMethod(EnableSession = true)] public string WishGetAccessToken(int ShopId, string client_id, string client_secret, string code, string redirect_uri) { Pages.Login(this.Session); WishApi obj = new WishApi(); obj.ShopId = ShopId; obj.client_id = client_id; obj.client_secret = client_secret; obj.code = code; obj.grant_type = "authorization_code"; obj.redirect_uri = redirect_uri; string errormess = ""; string mess = obj.GetToken(out errormess); if (errormess != "") return "错误:" + errormess; return mess; } #endregion #region 保存 [WebMethod(EnableSession = true)] public int Save_JC_Shop2(JC_Shop Model) { Pages.Login(this.Session); Model.CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_ShopService.Save2(Model); } #endregion #region 分页查询店铺 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_ShopForTM2(int CompanyID, int DeptId, int PlatType, string ShopName, string Master, string Buyer, string ShopUser, int PageIndex, int PageSize) { Pages.Login(this.Session); if (CompanyID == 0) CompanyID = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "a.DeptId"; RefParameterCollection param = new RefParameterCollection(); if (DeptId > 0) param.Add("a.DeptId", "=", DeptId, DbType.Int32); param.Add("a.CompanyID", "=", CompanyID, DbType.Int32); if (PlatType > 0) param.Add("PlatType", "=", PlatType, DbType.Int32); if (string.IsNullOrEmpty(ShopName) == false) param.Add("ShopName", "like", ShopName, DbType.String); if (string.IsNullOrEmpty(Master) == false) param.Add("Master", "like", Master, DbType.String); if (string.IsNullOrEmpty(Buyer) == false) param.Add("Buyer", "like", Buyer, DbType.String); if (string.IsNullOrEmpty(ShopUser) == false) param.Add("ShopUser", "like", ShopUser, DbType.String); resultModel.DataSource = JC_ShopService.GetListJC_ShopForTM2(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 订单模拟 [WebMethod(EnableSession = true)] public List GetListOrder() { List ListModel = new List(); OrderPrcel model = null; OrderPrcelDetail model2 = null; //eub model = new OrderPrcel(); model.ExpressID = 1; model.ExpressService = "中国邮政(EUB)"; model.ListPrintTemplate.Add("EUB.txt"); model.ListPrintTemplate.Add("EUB2.txt"); //model.ListPrintTemplate.Add("EUB3.txt"); model.AreaSerial = "1"; model.RevCountry = "加拿大"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LS782382965CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //宁波小包 model = new OrderPrcel(); model.ExpressID = 2; model.ExpressService = "中国邮政(宁波小包)"; model.ListPrintTemplate.Add("宁波小包.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //甬沪小包 model = new OrderPrcel(); model.ExpressID = 3; model.ExpressService = "中国邮政(甬沪小包)"; model.ListPrintTemplate.Add("甬沪小包.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.CountryCode = "BTNC"; model.AreaSerial2 = "21"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //上海小包 model = new OrderPrcel(); model.ExpressID = 4; model.ExpressService = "中国邮政(上海小包)"; model.ListPrintTemplate.Add("上海小包.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //线上小包 model = new OrderPrcel(); model.ExpressID = 9; model.ExpressService = "线上小包"; model.ListPrintTemplate.Add("线上小包.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.CountryCode = "IL"; model.AreaSerial2 = "29"; model.AreaSerial = "10"; model.CountryName = "摩洛哥"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //俄邮宝 model = new OrderPrcel(); model.ExpressID = 6; model.ExpressService = "中国邮政(俄邮宝)"; model.ListPrintTemplate.Add("俄邮宝.txt"); model.ListPrintTemplate.Add("俄邮宝2.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.RevMobile = "9415869423"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //顺风 model = new OrderPrcel(); model.ExpressID = 7; model.ExpressService = "顺丰"; model.ListPrintTemplate.Add("顺丰.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //比利时邮政 model = new OrderPrcel(); model.ExpressID = 8; model.ExpressService = "比利时邮政"; model.ListPrintTemplate.Add("比利时邮政.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.RevMobile = "9415869423"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); //EUB缩放 model = new OrderPrcel(); model.ExpressID = 10; model.ExpressService = "EUB缩放"; model.ListPrintTemplate.Add("EUB3.txt"); model.AreaSerial = "5"; model.RevCountry = "拉脱维亚"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "34236"; model.SendPerson = "jacky"; model.SendAddress = "Building 4 Guangyuan road " + "
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 10; model.ExpressService = "中国邮政(平邮)"; model.ListPrintTemplate.Add("宁波平邮.txt"); //model.ListPrintTemplate.Add("EUB3.txt"); model.AreaSerial = "1"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevMobile = "9415869423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 11; model.ExpressService = "中国邮政(平邮)"; model.ListPrintTemplate.Add("燕文上海平邮.txt"); model.ListPrintTemplate.Add("燕文上海平邮2.txt"); model.AreaSerial = "1"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 12; model.ExpressService = "中国邮政(燕邮宝)"; model.ListPrintTemplate.Add("燕邮宝.txt"); model.AreaSerial = "1"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model.OrderDate = DateTime.Today.ToString("yyyy/MM/dd"); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 13; model.ExpressService = "中国邮政(燕文北京)"; model.ListPrintTemplate.Add("燕文北京平邮.txt"); model.ListPrintTemplate.Add("燕文北京平邮2.txt"); model.AreaSerial = "1"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "9415869423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 14; model.ExpressService = "中国邮政"; model.ListPrintTemplate.Add("杭州小包.txt"); model.AreaSerial = "4"; model.AreaSerial2 = "22"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model.OrderDate = DateTime.Today.ToString("yyyy/MM/dd"); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); model = new OrderPrcel(); model.ExpressID = 15; model.ExpressService = "中国邮政"; model.ListPrintTemplate.Add("杭州平邮.txt"); model.AreaSerial = "4"; model.AreaSerial2 = "22"; model.RevCountry = "RU"; model.CountryCode = "RU"; model.RevMobile = "15888546021"; model.CountryName = "俄罗斯"; model.RevPerson = "rebecca siff"; model.RevAddress = "1140 Hampton rd sarasota" + "
" + "Florida United States"; model.RevPhone = "94-158-98969423"; model.RevZip = "42015987"; model.CreateRevZipBarCode(); model.SendPerson = "jacky"; model.SendAddress = "Guangyuan Road 69 (Asia Tiger Park Building 4),Jiangbei District,Ningbo,China";// +"
" + "No.69 NINGBO"; model.SendPhone = "(181)89137798"; model.SendZip = "315520"; model.BarCode = "LN729029398CN"; model.OrderCode = "D123456789"; model.CountGoodsNum = "1"; model.CountGoodsPrice = "79.98"; model.CountGoodsWeight = "0.56"; model.OrderDate = DateTime.Today.ToString("yyyy/MM/dd"); model2 = new OrderPrcelDetail(); model2.GoodsNum = "1"; model2.GoodsPrice = "79.98"; model2.GoodsWeight = "0.56"; model2.GoodsName = "New Women Flat Ankle Snow Motorcycle Boots Female Suede Leather Lace-Up Martin Boot Plus Size 4.5-10"; model2.GoodsSimpleName = "Snow Motorcycle"; model2.GoodsOrigin = "China"; model2.GoodsSku = "sku123456789"; model.ListModel.Add(model2); ListModel.Add(model); return ListModel; } #endregion #region 读取默认快递 [WebMethod(EnableSession = true)] public List GetListShopExpress(int ShopId) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_ShopService.GetListShopExpress(CompanyId, ShopId); } #endregion #region 保存默认快递 [WebMethod(EnableSession = true)] public void SaveShopExpress(int ShopId, List ListModel) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); JC_ShopService.SaveShopExpress(CompanyId, ShopId, ListModel); } #endregion #region 导入快递单号 [WebMethod(EnableSession = true)] public string ImportExpressCode(string FileName, int ExpressId) { Pages.Login(this.Session); if (string.IsNullOrEmpty(FileName) == true) return "要导入的文件路径不能为空"; string ServerFileName = AppDomain.CurrentDomain.BaseDirectory + FileName; if (System.IO.File.Exists(ServerFileName) == false) return "要导入的文件路径不存在"; int CompanyId = Convert.ToInt32(Session["CompanyId"]); try { MicrosoftExcel excel = new MicrosoftExcel(); DataTable tb = excel.ImportExcel(ServerFileName); string error = ""; if (tb.Columns.Contains("快递单号") == false) { error = error + "导入模板的 快递单号 列不存在"; } if (string.IsNullOrEmpty(error) == false) return error; List ListModel = new List(); foreach (DataRow row in tb.Rows) { ListModel.Add(row["快递单号"].ToString()); } JC_ExpressCodeService.ImportExpressCode(CompanyId, ExpressId, ListModel); } catch (Exception e) { return "文件导入失败!请严格按照模板,填写数据,重新导入!!!"; } return ""; } #endregion #region Eaby导入快递单号 [WebMethod(EnableSession = true)] public string EabyExpressCode(string FileName, int ExpressId) { Pages.Login(this.Session); if (string.IsNullOrEmpty(FileName) == true) return "要导入的文件路径不能为空"; string ServerFileName = AppDomain.CurrentDomain.BaseDirectory + FileName; if (System.IO.File.Exists(ServerFileName) == false) return "要导入的文件路径不存在"; int CompanyId = Convert.ToInt32(Session["CompanyId"]); try { MicrosoftExcel excel = new MicrosoftExcel(); DataTable tb = excel.ImportExcel(ServerFileName); string error = ""; if (tb.Columns.Contains("Order1") == false) { error = error + " 单号 列不存在"; } if (tb.Columns.Contains("TrackCode") == false) { error = error + " 跟踪码 列不存在"; } if (string.IsNullOrEmpty(error) == false) return error; var obj = new DD_OrderData(); foreach (DataRow row in tb.Rows) { string morderno = "M" + row["Order1"].ToString(); DD_OrderData dom = new DD_OrderData(); var ordermodel = dom.GetjoOrderModel(morderno); if (ordermodel == null) { ordermodel = dom.GetOrdernoModel(row["Order1"].ToString()); } if (ordermodel == null) { error = error + row["Order1"].ToString() + "订单不存在不存在\r\n"; continue; } foreach (var q in ordermodel) { DT_TrackCodeApply Model = new DT_TrackCodeApply(); Model.TrackCode = row["TrackCode"].ToString().Trim(); if (obj.IsOrderTrackCode(q.OrderId.GetValueOrDefault(0), row["TrackCode"].ToString().Trim()) > 0) { error = error + row["TrackCode"].ToString().Trim() + "该跟踪码已经存在\r\n"; if(morderno.Contains("M")) obj.UpdateTrackPostEbay(ExpressId, q.OrderId.GetValueOrDefault(0), 1); continue; } Model.GetDate = DateTime.Now; Model.InName = Session["Name"].ToString(); if (q.JoinOrderCode != null) { if (q.JoinOrderCode != "") { Model.OrderCode = q.JoinOrderCode; } } else Model.OrderCode = q.OrderCode; Model.OrderId = q.OrderId; Model.PostId = ExpressId; Model.State = 1; Model.TrackType = 1; Model.UpdateTime = DateTime.Now; Model.IsSpare = q.IsSpare; Model.JoinOrderCode = q.JoinOrderCode; //obj.UpdateTrackCode(PostCode, PostId,OrderId, ErrorInfo); obj.UpdateTrackPostEbay(ExpressId,q.OrderId.GetValueOrDefault(0),1); obj.SaveTrackCodeApply(Model); } } } catch (Exception e) { return "文件导入失败!请严格按照模板,填写数据,重新导入!!!"; } return ""; } #endregion #region 删除快递单号 [WebMethod(EnableSession = true)] public void DeleteExpressCode(int Id) { Pages.Login(this.Session); JC_ExpressCodeService.Delete(Id); } #endregion #region 删除快递单号 [WebMethod(EnableSession = true)] public void DeleteExpressCodeM(List list) { Pages.Login(this.Session); if (list != null) { foreach (var md in list) { JC_ExpressCodeService.Delete(md.Id.Value); } } } #endregion #region 分页查询快递单号 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_ExpressCode(int ExpressID,int IsUse,string PostCode, int PageIndex, int PageSize) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "Id"; RefParameterCollection param = new RefParameterCollection(); param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); if (IsUse>-1) param.Add("a.IsUse", "=", IsUse, DbType.Int32); if (PostCode!="") param.Add("a.PostCode", "like", PostCode, DbType.String); if (ExpressID > 0) param.Add("a.ExpressID", "=", ExpressID, DbType.Int32); resultModel.DataSource = JC_ExpressCodeService.GetListJC_ExpressCode(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 导出快递单号模板 [WebMethod(EnableSession = true)] public string TemplateExpressCode() { Pages.Login(this.Session); TableColumnCollection listColumns = new TableColumnCollection(); listColumns.Add("PostCode", "快递单号", DbType.String, ""); DataTable tb = new DataTable(); tb.Columns.Add("PostCode"); MicrosoftExcel obj = new MicrosoftExcel(); return obj.Export(tb, listColumns); } #endregion #region 保存快递费率 [WebMethod(EnableSession = true)] public void Save_JC_PostFee(JC_PostFee Model) { Pages.Login(this.Session); JC_PostFeeService.Save(Model); } #endregion #region 保存快递费率 [WebMethod(EnableSession = true)] public int Save_PostFeeDetail(JC_PostFeeDetail Model) { Pages.Login(this.Session); if (Model.CountryName == "不限") { Model.Country = "0"; } Model.CompanyId = Convert.ToInt32(Session["CompanyId"]); int a= JC_PostFeeService.SavePostFeeDetail(Model); return a; } #endregion #region 导入快递费率 [WebMethod(EnableSession = true)] public string ImportPostFeeDetail(string FileName, int ExpressID) { Pages.Login(this.Session); if (string.IsNullOrEmpty(FileName) == true) return "要导入的文件路径不能为空"; string ServerFileName = AppDomain.CurrentDomain.BaseDirectory + FileName; if (System.IO.File.Exists(ServerFileName) == false) return "要导入的文件路径不存在"; int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); string Name = Convert.ToString(Session["Name"]); try { JC_PostFee Model = new JC_PostFee(); Model.CompanyId = CompanyId; Model.ExpressID = ExpressID; Model.FeeType = 1; int FedId=JC_PostFeeService.SavePostFee(Model); MicrosoftExcel excel = new MicrosoftExcel(); DataTable tb = excel.ImportExcel(ServerFileName); var obj1 = new HuoWuData(); string error = ""; if (tb.Columns.Contains("国家英文") == false) { error = error + "导入模板的国家英文列不存在"; } if (tb.Columns.Contains("国家中文") == false) { error = error + "导入模板的国家中文列不存在"; } if (tb.Columns.Contains("操作费或挂号费") == false) { error = error + "导入模板的操作费或挂号费列不存在"; } if (tb.Columns.Contains("费率(KG千克)") == false) { error = error + "导入模板的费率(KG千克)列不存在"; } if (tb.Columns.Contains("费率(G克)") == false) { error = error + "导入模板的费率(G克)列不存在"; } if (string.IsNullOrEmpty(error) == false) return error + ";请导入格式不正确"; HuoWuData obj = new HuoWuData(); int Num = 0; for (int i = 0; i < tb.Rows.Count; i++) { JC_PostFeeDetail deModel = new JC_PostFeeDetail(); deModel.ExpressId = ExpressID; deModel.CompanyId = CompanyId; deModel.FeeId = FedId; if (tb.Rows[i]["起始重量g"].ToString().Trim() != "") deModel.SWeight = Convert.ToInt32(tb.Rows[i]["起始重量g"].ToString().Trim()); else deModel.SWeight = 0; if (tb.Rows[i]["截止重量g"].ToString().Trim() != "") deModel.EWeight = Convert.ToInt32(tb.Rows[i]["截止重量g"].ToString().Trim()); else deModel.EWeight = 2000; deModel.WeightType = 1; if(tb.Rows[i]["货币单位"].ToString().Trim() != ""&&tb.Rows[i]["货币单位"].ToString().Trim()!="CNY") deModel.MoneyCode = tb.Rows[i]["货币单位"].ToString().Trim(); if(tb.Rows[i]["国家英文"].ToString().Trim()!="") deModel.Country = tb.Rows[i]["国家英文"].ToString().Trim(); else if (tb.Rows[i]["国家中文"].ToString().Trim() != "") deModel.Country = tb.Rows[i]["国家中文"].ToString().Trim(); if (deModel.Country == null || deModel.Country == "") continue; try { if(tb.Rows[i]["操作费或挂号费"].ToString().Trim()!="") deModel.CodeFee =Convert.ToDecimal(tb.Rows[i]["操作费或挂号费"].ToString().Trim()); else deModel.CodeFee =0; } catch(Exception ex) { deModel.CodeFee =0; } try { if (tb.Rows[i]["费率(KG千克)"].ToString().Trim() != "") deModel.FeeRate = Convert.ToDecimal(tb.Rows[i]["费率(KG千克)"].ToString().Trim()) / 1000; } catch (Exception ex) { } try { if (tb.Rows[i]["费率(G克)"].ToString().Trim() != "") deModel.FeeRate = Convert.ToDecimal(tb.Rows[i]["费率(KG千克)"].ToString().Trim()); } catch (Exception ex) { } int a= JC_PostFeeService.SavePostFeeDetail22(deModel); if (a == 0) error += "第"+(i+2).ToString()+"条"+ deModel.Country+"国家对应不上"; else Num++; } error = error + ";数据导入成功【" + Num.ToString() + "条】;"; return error; } catch (Exception e) { return "文件导入失败!请确定模板格式是否正确,或者重新下载模板,填写数据,重新导入!!!" + e.Message; } return "导入成功"; } #endregion #region 删除快递费率 [WebMethod(EnableSession = true)] public void DeletePostFeeDetailList(List list) { Pages.Login(this.Session); if (list == null) return; foreach (var md in list) { JC_PostFeeService.DeletePostFeeDetail(md.Id.Value); } } #endregion #region 删除快递费率 [WebMethod(EnableSession = true)] public void DeletePostFeeDetail(int Id) { Pages.Login(this.Session); JC_PostFeeService.DeletePostFeeDetail(Id); } #endregion #region 返回对象 [WebMethod(EnableSession = true)] public JC_PostFee GetModel_JC_PostFee(int ExpressID) { Pages.Login(this.Session); return JC_PostFeeService.GetModel(ExpressID); } #endregion #region 分页查询快递费率 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_PostFee(int ExpressID,int PageIndex, int PageSize) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "b.ExpressID asc"; RefParameterCollection param = new RefParameterCollection(); param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); param.Add("a.IsUse", "=", true, DbType.Boolean); if (ExpressID > 0) param.Add("b.ExpressID", "=", ExpressID, DbType.Int32); resultModel.DataSource = JC_PostFeeService.GetListJC_PostFee(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 读取货币 [WebMethod(EnableSession = true)] public List GetMoneyList() { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); BaseService obj = new BaseService(); return obj.GetMoneyList(CompanyId); } #endregion #region 读取货币 [WebMethod(EnableSession = true)] public List GetMoneyListForTM(int PlatId) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); BaseService obj = new BaseService(); return obj.GetMoneyListForTM(CompanyId, PlatId); } #endregion #region 保存货币 [WebMethod(EnableSession = true)] public void SaveMoney(List list) { Pages.Login(this.Session); BaseService obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); if (list != null) { foreach (var md in list) { md.CompanyId = CompanyId; obj.SaveMoney(md); } } } #endregion #region 保存货币 [WebMethod(EnableSession = true)] public void SaveMoneyForTM(List list,int PlatId) { Pages.Login(this.Session); BaseService obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); if (list != null) { foreach (var md in list) { md.PlatId = PlatId; md.CompanyId = CompanyId; obj.SaveMoneyForTM(md); } } } #endregion #region 删除货币 [WebMethod(EnableSession = true)] public void DeleteMoney(int Id) { Pages.Login(this.Session); BaseService obj = new BaseService(); obj.DeleteMoney(Id); } #endregion #region 国家 #region 保存国家 [WebMethod(EnableSession = true)] public void Save_JC_Country(JC_Country Model) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; JC_CountryService.Save(Model); } #endregion #region 删除国家 [WebMethod(EnableSession = true)] public void Delete_JC_Country(int Id) { Pages.Login(this.Session); JC_CountryService.Delete(Id); } #endregion #region 分页查询国家 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Country(string Name,int PageIndex, int PageSize) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = ""; RefParameterCollection param = new RefParameterCollection(); if (Name != "") { param.Add("(a.Code", "=", Name, DbType.String); param.Add("a.Name", "like", Name,"or", DbType.String); param.Add("a.EnglishName", "like", Name, "or", ")", DbType.String); } //param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); resultModel.DataSource = JC_CountryService.GetListJC_Country(param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 判断名称是否重复 [WebMethod(EnableSession = true)] public bool CheckName_JC_Country(int Id, string Name) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_CountryService.CheckName(Id, CompanyId, Name); } #endregion #region 判断代码是否重复 [WebMethod(EnableSession = true)] public bool CheckCode_JC_Country(int Id, string Code) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); return JC_CountryService.CheckCode(Id, CompanyId, Code); } #endregion #endregion #region 保存通知 [WebMethod(EnableSession = true)] public int SaveNotice(TZ_Notice Model, List list) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); Model.InUserId = UserId; Model.CompayId = CompanyId; if (Model.Id == 0) Model.InDate = DateTime.Now; BaseService obj = new BaseService(); int id = obj.SaveNotice(Model); obj.DeleteNoticeRece(id); if (list != null) { foreach (var md in list) { md.NoticeId = id; md.ReceType = 1; obj.SaveNoticeRece(md); } } return id; } #endregion #region 返回通知Model [WebMethod(EnableSession = true)] public TZ_Notice GetNoticeModel(int Id) { Pages.Login(this.Session); BaseService obj = new BaseService(); var md = obj.GetNoticeModel(Id); return md; } #endregion #region 读取通知公司 [WebMethod(EnableSession = true)] public List GetCompanyList(string Name) { Pages.Login(this.Session); var list = JC_CompanyService.GetCompanyList(Name); return list; } #endregion #region 读取通知接受人 [WebMethod(EnableSession = true)] public List GetNoticeReceList(int NoticeId) { Pages.Login(this.Session); BaseService obj = new BaseService(); var list = obj.GetNoticeReceList(NoticeId); return list; } #endregion #region 删除通知 [WebMethod(EnableSession = true)] public void DeleteNotice(int Id) { Pages.Login(this.Session); BaseService obj = new BaseService(); obj.DeleteNotice(Id); } #endregion #region 分页查询通知 [WebMethod(Description = "分页查询通知", EnableSession = true)] public JsonModel> GetListTZ_Notice(int IsFB, string Title, string Name, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); RefParameterCollection Param = new RefParameterCollection(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); if (IsFB == 1) Param.Add("a.InUserId", "=", UserId, DbType.Int32); if (Title != "") Param.Add("a.Title", "like", Title, DbType.String); if (Name != "") Param.Add("a.SendName", "like", Name, DbType.String); if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id desc"; resultModel.DataSource = obj.GetListTZ_Notice(CompanyId, Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 保存公告 [WebMethod(EnableSession = true)] public int SaveGGNotice(GG_Notice Model, List list) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); Model.InUserId = UserId; Model.CompayId = CompanyId; if (Model.Id == 0) Model.InDate = DateTime.Now; BaseService obj = new BaseService(); int id = obj.SaveGGNotice(Model); obj.DeleteGGNoticeRece(id); if (list != null) { foreach (var md in list) { md.NoticeId = id; md.ReceType = 1; obj.SaveGGNoticeRece(md); } } return id; } #endregion #region 返回公告通知Model [WebMethod(EnableSession = true)] public GG_Notice GetGGNoticeModel(int Id) { Pages.Login(this.Session); BaseService obj = new BaseService(); var md = obj.GetGGNoticeModel(Id); return md; } #endregion #region 读取公告通知接受人 [WebMethod(EnableSession = true)] public List GetGGNoticeReceList(int NoticeId) { Pages.Login(this.Session); BaseService obj = new BaseService(); var list = obj.GetGGNoticeReceList(NoticeId); return list; } #endregion #region 删除公告通知 [WebMethod(EnableSession = true)] public void DeleteGGNotice(int Id) { Pages.Login(this.Session); BaseService obj = new BaseService(); obj.DeleteGGNotice(Id); } #endregion #region 分页查询公告通知 [WebMethod(Description = "分页查询通知", EnableSession = true)] public JsonModel> GetListGG_Notice(int IsFB, string Title, string Name, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); RefParameterCollection Param = new RefParameterCollection(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); if (IsFB == 1) Param.Add("a.InUserId", "=", UserId, DbType.Int32); if (Title != "") Param.Add("a.Title", "like", Title, DbType.String); if (Name != "") Param.Add("a.SendName", "like", Name, DbType.String); if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id desc"; resultModel.DataSource = obj.GetListGG_Notice(CompanyId, Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 发货地址 #region 保存发货地址 [WebMethod(EnableSession = true)] public void SavePostAddress(JC_PostAddress Model) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); Model.CompanyId = CompanyId; obj.SavePostAddress(Model); } #endregion #region 删除发货地址 [WebMethod(EnableSession = true)] public void DeletePostAddress(int Id) { Pages.Login(this.Session); var obj = new BaseService(); obj.DeletePostAddress(Id); } #endregion #region 分页发货地址 [WebMethod(EnableSession = true)] public List GetPostAddressList() { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var obj = new BaseService(); var list = obj.GetPostAddressList(CompanyId); return list; } #endregion #region 查询物流 [WebMethod(EnableSession = true)] public List GetExpressTypeList() { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var obj = new JC_ExpressService(); var list = obj.GetExpressTypeList(); return list; } #endregion #region 查询物流面板 [WebMethod(EnableSession = true)] public List GetExpressTemp(int LogisticsId) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var obj = new JC_ExpressService(); var list = obj.GetExpressTemp(LogisticsId); return list; } #endregion #endregion #region 读取默认时间 [WebMethod(EnableSession = true)] public string GetDefaultTime(int Days) { return DateTime.Today.AddDays(Days).ToString("yyyy-MM-dd"); } #endregion #region 读取生成Code [WebMethod(EnableSession = true)] public void CreateCode(int Num) { Random ran = new Random(); var obj = new BaseService(); for (int i = 0; i < Num; i++) { int RandKey = ran.Next(1000, 9999); int RandKey1 = ran.Next(1, 9999); string Code=RandKey.ToString() + DateTime.Now.ToString("yyyyMMddHHss") + RandKey1.ToString("0000"); JC_FriendCode Model = new JC_FriendCode(); Model.FriendCode = Code; Model.UseState = 0; Model.CreatTime = DateTime.Now; obj.SaveFriendCode(Model); } } #endregion #region 分页邀请码 [WebMethod(Description = "分页查询邀请码", EnableSession = true)] public JsonModel> GetListJC_FriendCode(string Code, int State,DateTime? Sdate,DateTime? Edate,int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); RefParameterCollection Param = new RefParameterCollection(); if (State>-1) Param.Add("a.UseState", "=", State, DbType.Int32); if (Code != "") Param.Add("a.FriendCode", "like", Code, DbType.String); if(Sdate!=null) Param.Add("a.CreatTime", ">=", Sdate, DbType.DateTime); if (Edate != null) Param.Add("a.CreatTime", "<", Edate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id desc"; resultModel.DataSource = obj.GetListJC_FriendCode(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 删除邀请码 [WebMethod(EnableSession = true)] public void DeleteFriendCode(List list) { Pages.Login(this.Session); var obj = new BaseService(); if (list != null) { foreach (var md in list) { obj.DeleteFriendCode(md.Id.Value); } } } #endregion #region 修改邀请码 [WebMethod(EnableSession = true)] public void UpdateFriendCode(List list) { Pages.Login(this.Session); var obj = new BaseService(); if (list != null) { foreach (var md in list) { obj.SetFriendCode(md.Remark,md.Id.Value); } } } #endregion #region 查询供应商信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Supplier(string Name, string Phone, string Goods, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); if (Name!="") Param.Add("a.SupplierName", "like", Name.Trim(), DbType.String); if (Phone != "") { Phone = Phone.Trim(); Param.Add("(a.Mobile", "like", Phone, DbType.String); Param.Add("a.Phone", "like", Phone,"or", DbType.String); Param.Add("a.Person", "like", Phone, "or",")", DbType.String); } JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "SupplierId desc"; resultModel.DataSource = obj.GetListJC_Supplier(CompanyId,Goods.Trim(),Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 查询供应商信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_SupplierForTM(string Name,string Buyer,string MoneyType,int IsCG,int IsHW, string Phone, string Goods, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); if (Name != "") Param.Add("a.SupplierName", "like", Name.Trim(), DbType.String); if (Buyer!="") Param.Add("a.BuyerName", "like", Buyer.Trim(), DbType.String); if (MoneyType!="0") Param.Add("a.MoneyType", "=", MoneyType, DbType.String); if (IsCG==1) Param.Add("a.BuyUserId ", "is", null, DbType.String); if (Phone != "") { Phone = Phone.Trim(); Param.Add("(a.Mobile", "like", Phone, DbType.String); Param.Add("a.Phone", "like", Phone, "or", DbType.String); Param.Add("a.Person", "like", Phone, "or", ")", DbType.String); } JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "SupplierId desc"; resultModel.DataSource = obj.GetListJC_SupplierForTM(CompanyId, Goods.Trim(), Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; if (resultModel.DataSource != null && IsHW == 1) { foreach (var md in resultModel.DataSource) { md.GoodsList=obj.GetSupplierGoodsList(md.SupplierId.Value); } } return resultModel; } #endregion #region 查询供应商信息 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_SupplierForTM2(string Name, string Buyer, string MoneyType, int IsCG, int IsHW, string Phone, string Goods, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("a.CompanyId", "=", CompanyId, DbType.Int32); if (Name != "") { Param.Add("(a.SupplierName", "like", Name.Trim(), DbType.String); Param.Add("a.SupplierCode", "like", Name.Trim(),"or",")", DbType.String); } if (Buyer != "") Param.Add("a.BuyerName", "like", Buyer.Trim(), DbType.String); if (MoneyType != "0") Param.Add("a.MoneyType", "=", MoneyType, DbType.String); if (IsCG == 1) Param.Add("a.BuyUserId ", "is", null, DbType.String); if (Phone != "") { Phone = Phone.Trim(); Param.Add("(a.Mobile", "like", Phone, DbType.String); Param.Add("a.Phone", "like", Phone, "or", DbType.String); Param.Add("a.Person", "like", Phone, "or", ")", DbType.String); } JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "SupplierId desc"; resultModel.DataSource = obj.GetListJC_SupplierForTM2(CompanyId, Goods.Trim(), Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; if (resultModel.DataSource != null && IsHW == 1) { foreach (var md in resultModel.DataSource) { md.GoodsList = obj.GetSupplierGoodsList(md.SupplierId.Value); } } return resultModel; } #endregion #region 查询供应商信息 [WebMethod(EnableSession = true)] public List GetSupplierList() { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var list = obj.GetSupplierList(CompanyId); return list; } #endregion #region 查询供应商信息 [WebMethod(EnableSession = true)] public List GetSupplierListFromName(string Name,int GoodsId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var list = obj.GetSupplierListFromName(CompanyId, Name.Trim(), GoodsId); return list; } #endregion #region 查询供应商货物信息 [WebMethod(EnableSession = true)] public List GetSupplierGoods(string GoodsName,int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var list =new List(); if(SupplierId==0) list = obj.GetSupplierGoodsAll(CompanyId, GoodsName); else list = obj.GetSupplierGoods(SupplierId, GoodsName); return list; } #endregion #region 查询供应商货物信息 [WebMethod(EnableSession = true)] public List GetSupplierGoodsForTM(string GoodsName, int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var list = new List(); if (SupplierId == 0) list = obj.GetSupplierGoodsAllForTM(CompanyId, GoodsName); else list = obj.GetSupplierGoodsForTM(SupplierId, GoodsName); return list; } #endregion #region 删除供应商 [WebMethod(EnableSession = true)] public void DeleteSupplier(int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); obj.DeleteSupplier(SupplierId); obj.DeleteSupplierGoods(SupplierId); } #endregion #region 删除供应商 [WebMethod(EnableSession = true)] public void DeleteSupplierForTM(int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); obj.DeleteSupplier(SupplierId); } #endregion #region 保存供应商货物信息 [WebMethod(EnableSession = true)] public void SaveSupplierGoods(List list, int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); obj.DeleteSupplierGoods(SupplierId); if (list != null) { foreach (var md in list) { obj.SaveSupplierGoods(md); } } } #endregion #region 保存供应商货物信息 [WebMethod(EnableSession = true)] public void SaveSupplierGoodsForTM(List list, int SupplierId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); obj.DeleteSupplierGoodsForTM(SupplierId); if (list != null) { foreach (var md in list) { obj.SaveSupplierGoodsForTM(md); } } } #endregion #region 保存供应商货物信息 [WebMethod(EnableSession = true)] public void SaveSupplierGoods2(List list, int GoodsId) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); obj.DeleteSupplierFromGoods(GoodsId); if (list != null) { foreach (var md in list) { obj.SaveSupplierGoods(md); } } } #endregion #region 保存 [WebMethod(EnableSession = true)] public void SaveSupplier(JC_Supplier Model) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); Model.CompanyId = CompanyId; Model.InUserId = UserId; Model.InDate = DateTime.Now; obj.SaveSupplier(Model); } #endregion #region 保存供应商 [WebMethod(EnableSession = true)] public string SaveSupplierForTM(JC_Supplier Model) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); Model.CompanyId = CompanyId; Model.InUserId = UserId; Model.InDate = DateTime.Now; if (Model.BuyerName.Trim() != "") { int buserid = JC_ShopService.IsShopUser(CompanyId, Model.BuyerName.Trim()); if (buserid == 0) return Model.BuyerName.Trim()+"没有在系统找到该人,请确定人名填写是否正确"; Model.BuyerName = Model.BuyerName.Trim(); Model.BuyUserId = buserid; } obj.SaveSupplierForTM(Model); return "成功"; } #endregion #region 保存供应商 [WebMethod(EnableSession = true)] public string SaveSupplierForTM2(JC_Supplier Model) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); int UserId = Convert.ToInt32(Session["UserId"]); Model.CompanyId = CompanyId; Model.InUserId = UserId; Model.InDate = DateTime.Now; if (Model.BuyerName.Trim() != "") { int buserid = JC_ShopService.IsShopUser(CompanyId, Model.BuyerName.Trim()); //if (buserid == 0) // return Model.BuyerName.Trim() + "没有在系统找到该人,请确定人名填写是否正确"; Model.BuyerName = Model.BuyerName.Trim(); Model.BuyUserId = buserid; } obj.SaveSupplierForTM2(Model); return "成功"; } #endregion #region 保存供应商采购人 [WebMethod(EnableSession = true)] public string SaveSupplierBuyer(JC_Supplier Model) { Pages.Login(this.Session); var obj = new BaseService(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); if (Model.BuyerName.Trim() != "") { int buserid = JC_ShopService.IsShopUser(CompanyId, Model.BuyerName.Trim()); if (buserid == 0) return Model.BuyerName.Trim() + "没有在系统找到该人,请确定人名填写是否正确"; Model.BuyerName = Model.BuyerName.Trim(); Model.BuyUserId = buserid; } obj.UpdateSupplierForTM(Model); return "成功"; } #endregion #region 查询邮局信息模板 [WebMethod(EnableSession = true)] public List GetPostExcelTemp() { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var list = obj.GetPostExcelTemp(CompanyId); return list; } #endregion #region 查询邮局信息模板明细 [WebMethod(EnableSession = true)] public List GetPostExcelTempDetail(int ExpressId) { Pages.Login(this.Session); var obj = new DD_OrderData(); var list = obj.GetPostExcelTempDetail(ExpressId); return list; } #endregion #region 查询邮局信息模板列 [WebMethod(EnableSession = true)] public List GetPostExcelTempRow() { Pages.Login(this.Session); var obj = new DD_OrderData(); var list = obj.GetPostExcelTempRow(); return list; } #endregion #region 查询邮局信息模板对象 [WebMethod(EnableSession = true)] public DT_PostExcelTemp GetPostExcelTempModel(int ExpressId) { Pages.Login(this.Session); var obj = new DD_OrderData(); var model = obj.GetExcelTempModel(ExpressId); return model; } #endregion #region 保存邮局模板 [WebMethod(EnableSession = true)] public void SavePostExcelTemp(DT_PostExcelTemp model, List list) { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); model.CompanyId = CompanyId; int ExcelId = obj.SavePostExcelTemp(model); obj.DeleteExcelTempDetail(ExcelId); if (list != null) { int SortNo = 1; foreach (var md in list) { md.ExcelId = ExcelId; md.Id = 0; md.SortNo = SortNo; obj.SavePostExcelTempDetail(md); SortNo++; } } } #endregion #region 删除邮局信息 [WebMethod(EnableSession = true)] public void DeletePostExcelTemp(int ExcelId) { Pages.Login(this.Session); var obj = new DD_OrderData(); obj.DeletePostExcelTemp(ExcelId); } #endregion #region 查询部门列表 [WebMethod(EnableSession = true)] public List GetDepartList(string DeptType) { Pages.Login(this.Session); int CompanyId = Convert.ToInt32(Session["CompanyId"]); var obj = new JC_DepartMentService(); var list = obj.GetDepartList(CompanyId, DeptType); return list; } #endregion #region 保存店铺数据 [WebMethod(EnableSession = true)] public int SaveShopData(JC_ShopData Model) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); if(Model.Id==null||Model.Id.Value==0) Model.InDate = DateTime.Now; Model.InName = Session["Name"].ToString(); Model.InUserId = Convert.ToInt32(Session["UserId"]); string tempstr=""; if(Model.InforViolate>0) { tempstr += Model.ShopName + "店铺 商品信息质量违规 " + Model.InforViolate; } if (Model.PropertyViolate > 0) { tempstr += Model.ShopName + "店铺 知识产权禁限售违规 " + Model.PropertyViolate; } if (Model.OtherViolate > 0) { tempstr += Model.ShopName + "店铺 交易违规及其他 " + Model.OtherViolate; } //if(tempstr!="") //{ // JC_OpenMess mess = new JC_OpenMess(); // mess.UserId = 1; // mess.UserType = "p"; // mess.Content = tempstr; // mess.IsRead = 0; // mess.OpenDate = DateTime.Now; // BaseService.SaveOpenMess(mess); // JC_OpenMess mess1 = new JC_OpenMess(); // mess1.UserId = 39; // mess1.UserType = "p"; // mess1.Content = tempstr; // mess1.IsRead = 0; // mess1.OpenDate = DateTime.Now; // BaseService.SaveOpenMess(mess1); // JC_OpenMess mess2 = new JC_OpenMess(); // mess2.UserId = 26; // mess2.UserType = "p"; // mess2.Content = tempstr; // mess2.IsRead = 0; // mess2.OpenDate = DateTime.Now; // BaseService.SaveOpenMess(mess2); //} int Id = BaseService.SaveShopData(Model); return Id; } #endregion #region 保存店铺数据 [WebMethod(EnableSession = true)] public int SaveShopData2(JC_ShopData Model) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); if (Model.Id == null || Model.Id.Value == 0) Model.InDate = DateTime.Now; Model.InName = Session["Name"].ToString(); Model.InUserId = Convert.ToInt32(Session["UserId"]); //string tempstr = ""; //if (Model.InforViolate > 0) //{ // tempstr += Model.ShopName + "店铺 商品信息质量违规 " + Model.InforViolate; //} //if (Model.PropertyViolate > 0) //{ // tempstr += Model.ShopName + "店铺 知识产权禁限售违规 " + Model.PropertyViolate; //} //if (Model.OtherViolate > 0) //{ // tempstr += Model.ShopName + "店铺 交易违规及其他 " + Model.OtherViolate; //} int Id = BaseService.SaveShopData(Model); return Id; } #endregion #region 删除店铺数据 [WebMethod(EnableSession = true)] public void DeleteShopData(int Id) { Pages.Login(this.Session); BaseService.DeleteShopData(Id); } #endregion #region 查询店铺数据 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_ShopData(int ShopId,string ShopIds, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); RefParameterCollection Param = new RefParameterCollection(); if (ShopId > 0) Param.Add("a.ShopId", "=", ShopId, DbType.Int32); else if (ShopIds!="") { Param.Add("a.ShopId", "in", ShopIds.Trim(','), DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "Id desc"; resultModel.DataSource = BaseService.GetListJC_ShopData(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 查询店铺数据 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_ShopData2(int ShopId, string ShopIds, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); RefParameterCollection Param = new RefParameterCollection(); if (ShopId > 0) Param.Add("a.ShopId", "=", ShopId, DbType.Int32); else if (ShopIds != "") { Param.Add("a.ShopId", "in", ShopIds.Trim(','), DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "Id desc"; resultModel.DataSource = BaseService.GetListJC_ShopData2(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 绩效统计数据 [WebMethod(EnableSession = true)] public string GetShopMoneyCount(int DeptId,int PlatId,int ShopId,int Year,int Month) { Pages.Login(this.Session); return ""; } #endregion #region 查询日志 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Log1(DateTime? SDate, DateTime? EDate, string Content, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("(a.LogType", "like", "订单", DbType.String); Param.Add("a.LogType", "like", "声明","or",")", DbType.String); if (Content.Trim() != "") { Param.Add("(a.LogContext", "like", Content.Trim(), DbType.String); Param.Add("c.PlatOrderCode", "=", Content.Trim(), "or", DbType.String); Param.Add("c.JoinOrderCode", "=", Content.Trim(), "or", DbType.String); Param.Add("b.Name", "like", Content.Trim(),"or",")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<=", EDate, DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id"; resultModel.DataSource = BaseService.GetListJC_Log1(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 查询日志 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Log2(DateTime? SDate, DateTime? EDate, string Content, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("a.LogType", "like", "采购", DbType.String); if (Content.Trim() != "") { Param.Add("(a.LogContext", "like", Content.Trim(), DbType.String); Param.Add("c.ChaseCode", "=", Content.Trim(), "or", DbType.String); Param.Add("c.BuyCode", "=", Content.Trim(), "or", DbType.String); Param.Add("b.Name", "like", Content.Trim(), "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<=", EDate, DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id"; resultModel.DataSource = BaseService.GetListJC_Log2(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 查询日志 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Log3(DateTime? SDate, DateTime? EDate, string Content, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); //Param.Add("a.LogType", "like", "仓库", DbType.String); if (Content.Trim() != "") { Param.Add("(a.OrderCode", "like", Content.Trim(), DbType.String); Param.Add("c.PlatOrderCode", "=", Content.Trim(), "or", DbType.String); Param.Add("c.JoinOrderCode", "=", Content.Trim(), "or", DbType.String); Param.Add("b.Name", "like", Content.Trim(), "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<=", EDate, DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id"; resultModel.DataSource = BaseService.GetListJC_Log3(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 查询日志 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_Log4(DateTime? SDate, DateTime? EDate, string Content, int PageIndex, int PageSize) { Pages.Login(this.Session); var obj = new DD_OrderData(); int CompanyId = Convert.ToInt32(Session["CompanyId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("a.LogType", "like", "货物", DbType.String); if (Content.Trim() != "") { Param.Add("(a.LogContext", "like", Content.Trim(), DbType.String); Param.Add("c.GoodsCode", "=", Content.Trim(), "or", DbType.String); Param.Add("c.GoodsOldCode", "=", Content.Trim(), "or", DbType.String); Param.Add("c.GoodsName", "like", Content.Trim(), "or", DbType.String); Param.Add("b.Name", "like", Content.Trim(), "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<=", EDate, DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "id"; resultModel.DataSource = BaseService.GetListJC_Log2(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 分页消息提醒 [WebMethod(EnableSession = true)] public JsonModel> GetListOpenMess(int Type,DateTime? Sdate, DateTime? Edate, string Name, string Title, int PageIndex, int PageSize) { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); var obj = new BaseService(); RefParameterCollection Param = new RefParameterCollection(); string Sort = "Id desc"; if (Type==1) Param.Add("a.UserId", "=", UserId, DbType.Int32); if (Type==2) Param.Add("a.InUserId", "=", UserId, DbType.Int32); if (Title != "") { Param.Add("a.Content", "like", Title, DbType.String); } if (Name != "") { Param.Add("(b.Name", "like", Title, DbType.String); Param.Add("c.Name", "like", Title, "or", ")", DbType.String); } if (Sdate != null) Param.Add("OpenDate", ">=", Sdate, DbType.DateTime); if (Edate != null) Param.Add("OpenDate", "<", Edate.Value.AddDays(1), DbType.DateTime); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; resultModel.DataSource = BaseService.GetListJC_OpenMess(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 消息已读 [WebMethod(EnableSession = true)] public void MessRead(int Id) { Pages.Login(this.Session); BaseService.MessRead(Id); } #endregion #region 保存赔款申请 [WebMethod(EnableSession = true)] public int SaveBackMoneyApply(DT_OrderBackMoneyApply model) { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); BaseService obj1 = new BaseService(); if (model.Id == null || model.Id == 0) { int a=obj.IsOrderBackMoney(model.OrderCode); if (a > 0) return a; } model.Indate = DateTime.Now; model.InUserId = UserId; model.InName = Name; var clist = obj1.GetDeptCharge2(DeptId); if (clist != null && clist.Count > 0) { model.CompanyName1 = clist[0].Name; model.CompanyUserId = clist[0].UserId; } model.OrderCode = model.OrderCode.Trim(); model.GoodsCode = model.GoodsCode.Trim(); string imgids = ""; if (model.imglist != null) { foreach (var md in model.imglist) { imgids += md.id + ","; } } if (imgids != "") model.ImageIds = imgids.Trim(','); obj.SaveBackMoneyApply(model); if (model.FactPrice != null && model.BackDate!=null) { model.OrderCode = model.OrderCode.Trim(); obj.SaveBackMoneyFact(model); } return 0; } #endregion #region 保存赔款申请 [WebMethod(EnableSession = true)] public int SaveBackMoneyApply2(int BackState,DT_OrderBackMoneyApply model) { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); BaseService obj1 = new BaseService(); //if (model.Id == null || model.Id == 0) //{ // int a = obj.IsOrderBackMoney(model.OrderCode); // if (a > 0) // return 1; //} //if (model.Id == null || model.Id == 0) //{ // int orderid = obj.IsOrderBackMoney2(model.OrderCode); // if (orderid==0) // return 2; // model.OrderId = orderid; //} model.Indate = DateTime.Now; model.InUserId = UserId; model.InName = Name; //var clist = obj1.GetDeptCharge2(DeptId); //if (clist != null && clist.Count > 0) //{ // model.CompanyName1 = clist[0].Name; // model.CompanyUserId = clist[0].UserId; //} model.OrderCode = model.OrderCode.Trim(); model.GoodsCode = model.GoodsCode.Trim(); model.BackDate = DateTime.Now; string imgids = ""; if (model.imglist != null) { foreach (var md in model.imglist) { imgids += md.id + ","; } } if (imgids != "") model.ImageIds = imgids.Trim(','); obj.SaveBackMoneyForOrder(model.OrderId.Value, BackState); obj.SaveBackMoneyApply2(BackState,model); //if (model.FactPrice != null && model.BackDate != null) //{ // model.OrderCode = model.OrderCode.Trim(); // obj.SaveBackMoneyFact(model); //} BaseService.SendOpenMess(1, Name+"有个订单退货赔款申请需要你审批", ""); return 0; } #endregion #region 保存赔款申请 [WebMethod(EnableSession = true)] public int SaveBackMoneyApply3(DT_OrderBackMoneyApply model) { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); obj.SaveBackMoneyApply3(model); return 0; } #endregion #region 保存赔款批注 [WebMethod(EnableSession = true)] public void SaveBackMoneyCheck(DT_OrderBackMoneyApply model) { Pages.Login(this.Session); // int UserId = Convert.ToInt32(Session["UserId"]); // string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); obj.SaveBackMoneyCheck2(model); } #endregion #region 保存订单处理状态 [WebMethod(EnableSession = true)] public void SaveBackMoneyState(int Id,int State,int BackState) { Pages.Login(this.Session); // int UserId = Convert.ToInt32(Session["UserId"]); // string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); obj.SaveBackMoneyState(Id, State,BackState); } #endregion #region 保存赔款批注 [WebMethod(EnableSession = true)] public void SaveBackMoneyCheckList(List list) { Pages.Login(this.Session); if (list == null) return; int UserId = Convert.ToInt32(Session["UserId"]); // string Name = Convert.ToString(Session["Name"]); DD_OrderData obj = new DD_OrderData(); foreach (var md in list) { if (UserId == 1) md.CompanyAgree2 = "同意赔款"; else md.CompanyAgree1 = "同意赔款"; obj.SaveBackMoneyCheck2(md); } } #endregion #region 保存赔款实际 [WebMethod(EnableSession = true)] public void SaveBackMoneyFact(DT_OrderBackMoneyApply model) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); model.OrderCode = model.OrderCode.Trim(); obj.SaveBackMoneyFact(model); } #endregion #region 查询部门负责人 [WebMethod(EnableSession = true)] public string GetDeptName() { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); BaseService obj = new BaseService(); var list=obj.GetDeptCharge(UserId); string name = ""; if (list != null) { foreach (var md in list) { name += md.Name + ","; } } return name.Trim(','); } #endregion #region 查询赔款数据 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_OrderBack(int ShopId, string ShopIds, string Reason1, string Reason2, string Reason3, string Name, int CheckState1, int CheckState2, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string DName = Convert.ToString(Session["Name"]); string Duty= Convert.ToString(Session["Duty"]); RefParameterCollection Param = new RefParameterCollection(); if (Duty != "副总经理" && Duty != "总经理" && Duty != "经理") { Param.Add("(a.InUserId", "=", UserId, DbType.Int32); Param.Add("a.CompanyUserId", "=", UserId, "or", DbType.Int32); Param.Add("a.DeptName", "=", DName, "or", ")", DbType.String); } if (ShopId> 0) Param.Add("b.DeptId", "=", ShopId, DbType.Int32); if (ShopIds != "") { Param.Add("a.ShopId", "in", ShopIds.Trim(','), DbType.String); } if (CheckState1 == 1) { Param.Add("a.CompanyAgree1", "=", "同意赔款", DbType.String); } else if (CheckState1 == 2) { Param.Add("a.CompanyAgree1", "=", "不同意赔款", DbType.String); } else if (CheckState1 == 0) { Param.Add("isnull(a.CompanyAgree1,'')", "=", "", DbType.String); } if (CheckState2 == 1) { Param.Add("a.CompanyAgree2", "=", "同意赔款", DbType.String); } else if (CheckState2 == 2) { Param.Add("a.CompanyAgree2", "=", "不同意赔款", DbType.String); } else if (CheckState2 == 0) { Param.Add("isnull(a.CompanyAgree2,'')", "=", "", DbType.String); } if (Name != "") { Param.Add("(a.InName", "like", Name, DbType.String); Param.Add("a.OrderCode", "like", Name, "or", DbType.String); Param.Add("a.GoodsCode", "like", Name, "or",")",DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); if (Reason1 != "0") Param.Add("a.BackReason1", "=", Reason1, DbType.String); if (Reason2 != "0") Param.Add("a.BackReason2", "=", Reason2, DbType.String); if (Reason3 != "0") Param.Add("a.BackReason3", "=", Reason3, DbType.String); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "Id desc"; resultModel.DataSource = obj.GetListDT_OrderBackMoneyApply(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; var md1 = obj.GetListDT_OrderBackMoneyApply2(Param); if (md1 != null && md1.PlanPrice!=null) resultModel.ErrorMsg = md1.PlanPrice.ToString(); else resultModel.ErrorMsg ="0"; if (resultModel.DataSource != null) { foreach (var md in resultModel.DataSource) { if (md.BackReason1 == "事业部"&&md.DName!= null) { md.BackReason1 += "【" + md.DName + "】"; } if (md.CompanyDate1 != null) { string remark = ""; if (md.CompanyAgree1 != null && md.CompanyAgree1 != "") remark = md.CompanyAgree1; if (md.CompanyRemark != null && md.CompanyRemark != "") remark += md.CompanyRemark; md.CompanyContent =remark + "【" + md.CompanyName1 + " " + md.CompanyDate1.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } if (md.CompanyDate2 != null) { string remark2 = ""; if (md.CompanyAgree2!= null && md.CompanyAgree2 != "") remark2 = md.CompanyAgree2; if (md.CompanyRemark2 != null && md.CompanyRemark2 != "") remark2 += md.CompanyRemark2; md.CompanyContent += "
" + remark2 + "【总经理" + md.CompanyDate2.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } } } return resultModel; } #endregion #region 查询赔款数据 [WebMethod(EnableSession = true)] public JsonModel> GetListJC_OrderBack2(int ShopId, string Reason1, string Name, int CheckState1, int CheckState2, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string DName = Convert.ToString(Session["Name"]); string Duty = Convert.ToString(Session["Duty"]); RefParameterCollection Param = new RefParameterCollection(); if (Duty != "副总经理" && Duty != "总经理" && Duty != "经理") { Param.Add("a.InUserId", "=", UserId, DbType.Int32); } if (ShopId>0) { Param.Add("a.ShopId", "=", ShopId, DbType.String); } if(CheckState1!=-1) Param.Add("a.State", "=", CheckState1, DbType.Int32); if (CheckState2 == 1) { Param.Add("a.CompanyAgree2", "=", "同意赔款", DbType.String); } else if (CheckState2== 2) { Param.Add("a.CompanyAgree2", "=", "不同意赔款", DbType.String); } else if (CheckState2== 0) { Param.Add("isnull(a.CompanyAgree2,'')", "=", "", DbType.String); } if (Name != "") { Param.Add("(a.InName", "like", Name, DbType.String); Param.Add("a.OrderCode", "like", Name, "or", DbType.String); Param.Add("a.GoodsCode", "like", Name, "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); if (Reason1 != "0") Param.Add("a.BackReason1", "=", Reason1, DbType.String); JsonModel> resultModel = new JsonModel>(); int RowCount = 0; string Sort = "c.OrderDate desc"; resultModel.DataSource = obj.GetListDT_OrderBackMoneyApply2(Param, PageIndex, PageSize, Sort, out RowCount); resultModel.RowCount = RowCount; if (resultModel.DataSource != null) { string OrderIds = ""; List list = new List(); List list2 = new List(); foreach (var md in resultModel.DataSource) { OrderIds += md.OrderId.Value.ToString() + ","; } if (OrderIds != "") { list = obj.Get_OrderGoodsForBack(OrderIds.TrimEnd(',')); list2 = obj.Get_OrderGoodsForBack2(OrderIds.TrimEnd(',')); } if(list==null) list = new List(); if (list2 == null) list2 = new List(); decimal USDRate = Convert.ToDecimal(6.5); var obj2 = new BaseService(); var mlist = obj2.GetMoneyList2(); foreach (var md in resultModel.DataSource) { decimal lr = 0; var mmd = mlist.Find(n => n.PlatId == md.PlatId && n.MCode == "USD"); if (mmd != null) USDRate = mmd.MRate.Value; decimal yjll=0; if (md.PlatId == 1) yjll =Convert.ToDecimal(0.05); else if (md.PlatId == 2 || md.PlatId == 3) yjll = Convert.ToDecimal(0.15); else if (md.PlatId == 5) yjll = Convert.ToDecimal(0.1); if(md.OrderPrice!=null) md.YJPrice = Convert.ToDecimal((md.OrderPrice.Value * yjll).ToString("0.00")); else md.YJPrice = 0; decimal ddje = md.OrderPrice.Value; if (md.OrderState == 0) { md.YJPrice = Convert.ToDecimal((md.YJPrice.Value * Convert.ToDecimal(0.2)).ToString("0.00")); ddje = 0; } var md1 = list.FindAll(n => n.OrderId == md.OrderId); var md2 = list2.FindAll(n => n.OrderId == md.OrderId); decimal GoodFee=0; if (md1 != null) { foreach (var md11 in md1) { GoodFee +=Convert.ToDecimal(((md11.GDFee.Value + md11.Fee1.Value)/USDRate).ToString("0.00"))+ md11.Fee2.Value; } } md.GoodsFee = GoodFee; if (md.BackState == 1 || md.BackState == 3) md.GoodsFee = 0; md.OnePostFee = 0; md.PostRate = 0; if (md2 != null && md2.Count>0) { md.OnePostFee = md2[0].Fee1; if (md2[0].PostId == 65) md.PostRate = md2[0].Fee1.Value * Convert.ToDecimal(0.1); } decimal yf=0; if(md.PostFee!=null&&md.PostFee>0) yf=md.PostFee.Value; decimal pk=0; if(md.FactPrice!=null&&md.FactPrice>0) pk=md.FactPrice.Value; lr = ddje - md.YJPrice.Value -md.escrowFee.Value- md.GoodsFee.Value - md.OnePostFee.Value - md.PostRate.Value - pk - yf; md.LRFee = lr; } } //var md1 = obj.GetListDT_OrderBackMoneyApply2(Param); //if (md1 != null && md1.PlanPrice != null) // resultModel.ErrorMsg = md1.PlanPrice.ToString(); //else // resultModel.ErrorMsg = "0"; return resultModel; } #endregion #region 导出赔款数据 [WebMethod(EnableSession = true)] public string GetListJC_OrderBackExcel(int ShopId, string Reason1, string Name, int CheckState1, int CheckState2, DateTime? SDate, DateTime? EDate, int PageIndex, int PageSize) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string DName = Convert.ToString(Session["Name"]); string Duty = Convert.ToString(Session["Duty"]); RefParameterCollection Param = new RefParameterCollection(); if (Duty != "副总经理" && Duty != "总经理" && Duty != "经理") { Param.Add("a.InUserId", "=", UserId, DbType.Int32); } if (ShopId > 0) { Param.Add("a.ShopId", "=", ShopId, DbType.String); } if (CheckState1 != -1) Param.Add("a.State", "=", CheckState1, DbType.Int32); if (CheckState2 == 1) { Param.Add("a.CompanyAgree2", "=", "同意赔款", DbType.String); } else if (CheckState2 == 2) { Param.Add("a.CompanyAgree2", "=", "不同意赔款", DbType.String); } else if (CheckState2 == 0) { Param.Add("isnull(a.CompanyAgree2,'')", "=", "", DbType.String); } if (Name != "") { Param.Add("(a.InName", "like", Name, DbType.String); Param.Add("a.OrderCode", "like", Name, "or", DbType.String); Param.Add("a.GoodsCode", "like", Name, "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); if (Reason1 != "0") Param.Add("a.BackReason1", "=", Reason1, DbType.String); int RowCount = 0; string Sort = "c.OrderDate desc"; List list3= obj.GetListDT_OrderBackMoneyApply2(Param, PageIndex, PageSize, Sort, out RowCount); if (list3 != null) { string OrderIds = ""; List list = new List(); List list2 = new List(); foreach (var md in list3) { OrderIds += md.OrderId.Value.ToString() + ","; } if (OrderIds != "") { list = obj.Get_OrderGoodsForBack(OrderIds.TrimEnd(',')); list2 = obj.Get_OrderGoodsForBack2(OrderIds.TrimEnd(',')); } if (list == null) list = new List(); if (list2 == null) list2 = new List(); decimal USDRate = Convert.ToDecimal(6.5); var obj2 = new BaseService(); var mlist = obj2.GetMoneyList2(); foreach (var md in list3) { decimal lr = 0; var mmd = mlist.Find(n => n.PlatId == md.PlatId && n.MCode == "USD"); if (mmd != null) USDRate = mmd.MRate.Value; decimal yjll = 0; if (md.PlatId == 1) yjll = Convert.ToDecimal(0.05); else if (md.PlatId == 2 || md.PlatId == 3) yjll = Convert.ToDecimal(0.15); else if (md.PlatId == 5) yjll = Convert.ToDecimal(0.1); if (md.OrderPrice != null) md.YJPrice = Convert.ToDecimal((md.OrderPrice.Value * yjll).ToString("0.00")); else md.YJPrice = 0; decimal ddje = md.OrderPrice.Value; if (md.OrderState == 0) { md.YJPrice = Convert.ToDecimal((md.YJPrice.Value * Convert.ToDecimal(0.2)).ToString("0.00")); ddje = 0; } var md1 = list.FindAll(n => n.OrderId == md.OrderId); var md2 = list2.FindAll(n => n.OrderId == md.OrderId); decimal GoodFee = 0; if (md1 != null) { foreach (var md11 in md1) { GoodFee += Convert.ToDecimal(((md11.GDFee.Value + md11.Fee1.Value) / USDRate).ToString("0.00")) + md11.Fee2.Value; } } md.GoodsFee = GoodFee; if (md.BackState == 1 || md.BackState == 3) md.GoodsFee = 0; md.OnePostFee = 0; md.PostRate = 0; if (md2 != null && md2.Count > 0) { md.OnePostFee = md2[0].Fee1; if (md2[0].PostId == 65) md.PostRate = md2[0].Fee1.Value * Convert.ToDecimal(0.1); } decimal yf = 0; if (md.PostFee != null && md.PostFee > 0) yf = md.PostFee.Value; decimal pk = 0; if (md.FactPrice != null && md.FactPrice > 0) pk = md.FactPrice.Value; lr = ddje - md.YJPrice.Value-md.escrowFee.Value - md.GoodsFee.Value - md.OnePostFee.Value - md.PostRate.Value - pk - yf; md.LRFee = lr; } } DataTable tb = list3.ToDataTable(); TableColumnCollection listColumns = new TableColumnCollection(); listColumns.Add("ShopName", "店铺", DbType.String, ""); listColumns.Add("OrderCode", "订单号", DbType.String, ""); listColumns.Add("GoodsCode", "货物编号", DbType.String, ""); listColumns.Add("BackReason1", "订单日期", DbType.String, ""); listColumns.Add("OrderDate", "赔款原因", DbType.String, "yyyy-MM-dd"); listColumns.Add("BackAdvise", "赔款初步方案", DbType.String, ""); listColumns.Add("BackAdvise2", "赔款最终方案", DbType.String, ""); listColumns.Add("OrderStateName", "订单状态", DbType.String, ""); listColumns.Add("OrderPrice", "订单原金额", DbType.String, ""); listColumns.Add("YJPrice", "佣金$", DbType.String, ""); listColumns.Add("escrowFee", "税费", DbType.String, ""); listColumns.Add("GoodsFee", "货物成本", DbType.String, ""); listColumns.Add("OnePostFee", "首次运费", DbType.String, ""); listColumns.Add("PostRate", "运费佣金", DbType.String, ""); listColumns.Add("FactPrice", "实际赔款", DbType.String, ""); listColumns.Add("PostFee", "我们承担退货运费", DbType.String, ""); listColumns.Add("LRFee", "利润", DbType.String, ""); listColumns.Add("BackStateName", "退货仓库验货", DbType.String, ""); listColumns.Add("StateName", "处理状态", DbType.String, ""); listColumns.Add("InName", "提交人", DbType.String, ""); listColumns.Add("CompanyRemark", "领导意见1", DbType.String, ""); listColumns.Add("CompanyRemark2", "领导意见2", DbType.String, ""); MicrosoftExcel obj3 = new MicrosoftExcel(); return obj3.Export(tb, listColumns); } #endregion #region 查询赔款数据 [WebMethod(EnableSession = true)] public List GetOrderBackCount1(int ShopId, string ShopIds, string Name, int CheckState1, int CheckState2, DateTime? SDate, DateTime? EDate) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); string DName = Convert.ToString(Session["Name"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("(a.InUserId", "=", UserId, DbType.Int32); Param.Add("a.CompanyUserId", "=", UserId, "or", DbType.Int32); Param.Add("a.DeptName", "=", DName, "or", ")", DbType.String); if (ShopId > 0) Param.Add("b.DeptId", "=", ShopId, DbType.Int32); if (ShopIds != "") { Param.Add("a.ShopId", "in", ShopIds.Trim(','), DbType.String); } if (CheckState1 == 1) { Param.Add("a.CompanyAgree1", "=", "同意赔款", DbType.String); } else if (CheckState1 == 2) { Param.Add("a.CompanyAgree1", "=", "不同意赔款", DbType.String); } else if (CheckState1 == 0) { Param.Add("isnull(a.CompanyAgree1,'')", "=", "", DbType.String); } if (CheckState2 == 1) { Param.Add("a.CompanyAgree2", "=", "同意赔款", DbType.String); } else if (CheckState2 == 2) { Param.Add("a.CompanyAgree2", "=", "不同意赔款", DbType.String); } else if (CheckState2 == 0) { Param.Add("isnull(a.CompanyAgree2,'')", "=", "", DbType.String); } if (Name != "") { Param.Add("(a.InName", "like", Name, DbType.String); Param.Add("a.OrderCode", "like", Name, "or", DbType.String); Param.Add("a.GoodsCode", "like", Name, "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); var list = obj.GetListDT_OrderBackMoneyApply3(Param); return list; } #endregion #region 查询赔款数据 [WebMethod(EnableSession = true)] public List GetOrderBackCount2(int ShopId, string ShopIds, string Name, string Reason1, int CheckState1, int CheckState2, DateTime? SDate, DateTime? EDate) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); int UserId = Convert.ToInt32(Session["UserId"]); int DeptId = Convert.ToInt32(Session["DeptId"]); RefParameterCollection Param = new RefParameterCollection(); Param.Add("(a.InUserId", "=", UserId, DbType.Int32); Param.Add("a.CompanyUserId", "=", UserId, "or", ")", DbType.Int32); if (ShopId > 0) Param.Add("b.DeptId", "=", ShopId, DbType.Int32); if (ShopIds != "") { Param.Add("a.ShopId", "in", ShopIds.Trim(','), DbType.String); } if (CheckState1 == 1) { Param.Add("a.CompanyAgree1", "=", "同意赔款", DbType.String); } else if (CheckState1 == 2) { Param.Add("a.CompanyAgree1", "=", "不同意赔款", DbType.String); } else if (CheckState1 == 0) { Param.Add("isnull(a.CompanyAgree1,'')", "=", "", DbType.String); } if (CheckState2 == 1) { Param.Add("a.CompanyAgree2", "=", "同意赔款", DbType.String); } else if (CheckState2 == 2) { Param.Add("a.CompanyAgree2", "=", "不同意赔款", DbType.String); } else if (CheckState2 == 0) { Param.Add("isnull(a.CompanyAgree2,'')", "=", "", DbType.String); } if (Name != "") { Param.Add("(a.InName", "like", Name, DbType.String); Param.Add("a.OrderCode", "like", Name, "or", DbType.String); Param.Add("a.GoodsCode", "like", Name, "or", ")", DbType.String); } if (SDate != null) Param.Add("a.InDate", ">=", SDate, DbType.DateTime); if (EDate != null) Param.Add("a.InDate", "<", EDate.Value.AddDays(1), DbType.DateTime); if (Reason1 != "0") Param.Add("a.BackReason1", "=", Reason1, DbType.String); var list = obj.GetListDT_OrderBackMoneyApply4(Param); return list; } #endregion #region 获取赔款 [WebMethod(EnableSession = true)] public DT_OrderBackMoneyApply GetOrderBackMoneyModel(int Id) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); var md = obj.GetOrderBackMoneyModel(Id); if (md != null && md.ImageIds != null && md.ImageIds != "") { BaseService obj1 = new BaseService(); var list = obj1.GetListJC_Resource(md.ImageIds.Trim(',')); md.imglist = list; } if (md != null) { if (md.CompanyDate1 != null) { string remark = ""; if (md.CompanyAgree1 != null && md.CompanyAgree1 != "") remark = md.CompanyAgree1; if (md.CompanyRemark != null && md.CompanyRemark != "") remark += md.CompanyRemark; md.CompanyContent = remark + "【" + md.CompanyName1 + " " + md.CompanyDate1.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } if (md.CompanyDate2 != null) { string remark2 = ""; if (md.CompanyAgree2 != null && md.CompanyAgree2 != "") remark2 = md.CompanyAgree2; if (md.CompanyRemark2 != null && md.CompanyRemark2 != "") remark2 += md.CompanyRemark2; md.CompanyContent += "
" + remark2 + "【总经理" + md.CompanyDate2.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } } return md; } #endregion #region 获取赔款 [WebMethod(EnableSession = true)] public DT_OrderBackMoneyApply GetOrderBackMoneyModel22(int Id) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); var md = obj.GetOrderBackMoneyModel22(Id); if (md != null && md.ImageIds != null && md.ImageIds != "") { BaseService obj1 = new BaseService(); var list = obj1.GetListJC_Resource(md.ImageIds.Trim(',')); md.imglist = list; } //if (md != null) //{ // if (md.CompanyDate1 != null) // { // string remark = ""; // if (md.CompanyAgree1 != null && md.CompanyAgree1 != "") // remark = md.CompanyAgree1; // if (md.CompanyRemark != null && md.CompanyRemark != "") // remark += md.CompanyRemark; // md.CompanyContent = remark + "【" + md.CompanyName1 + " " + md.CompanyDate1.Value.ToString("yyyy-MM-dd HH:mm") + "】"; // } // if (md.CompanyDate2 != null) // { // string remark2 = ""; // if (md.CompanyAgree2 != null && md.CompanyAgree2 != "") // remark2 = md.CompanyAgree2; // if (md.CompanyRemark2 != null && md.CompanyRemark2 != "") // remark2 += md.CompanyRemark2; // md.CompanyContent += "
" + remark2 + "【总经理" + md.CompanyDate2.Value.ToString("yyyy-MM-dd HH:mm") + "】"; // } //} return md; } #endregion #region 获取赔款 [WebMethod(EnableSession = true)] public DT_OrderBackMoneyApply GetOrderBackMoneyModel2(int OrderId) { Pages.Login(this.Session); DD_OrderData obj = new DD_OrderData(); var md = obj.GetOrderBackMoneyModel2(OrderId); if (md != null && md.ImageIds != null && md.ImageIds != "") { BaseService obj1 = new BaseService(); var list = obj1.GetListJC_Resource(md.ImageIds.Trim(',')); md.imglist = list; } if (md != null) { if (md.CompanyDate1 != null) { string remark = ""; if (md.CompanyAgree1 != null && md.CompanyAgree1 != "") remark = md.CompanyAgree1; if (md.CompanyRemark != null && md.CompanyRemark != "") remark += md.CompanyRemark; md.CompanyContent = remark + "【" + md.CompanyName1 + " " + md.CompanyDate1.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } if (md.CompanyDate2 != null) { string remark2 = ""; if (md.CompanyAgree2 != null && md.CompanyAgree2 != "") remark2 = md.CompanyAgree2; if (md.CompanyRemark2 != null && md.CompanyRemark2 != "") remark2 += md.CompanyRemark2; md.CompanyContent += "
" + remark2 + "【总经理" + md.CompanyDate2.Value.ToString("yyyy-MM-dd HH:mm") + "】"; } } return md; } #endregion #region 删除赔款 [WebMethod(EnableSession = true)] public void DeleteOrderBackMoney(int Id) { Pages.Login(this.Session); var obj = new DD_OrderData(); obj.DeleteOrderBackMoney(Id); } #endregion #region 赔款 [WebMethod(EnableSession = true)] public void UpdateOrderBackMoney() { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); var obj = new DD_OrderData(); obj.UpdateOrderBackMoney(UserId); } #endregion #region 订单纠纷 [WebMethod(EnableSession = true)] public string queryIssueList(List ListModel) { string ErrorMess = ""; string errorlist = ""; string success = ""; API_OrderInfoService aois = new API_OrderInfoService(); foreach (int ShopId in ListModel) { try { string errorm = ""; AlibabaApi obj = new AlibabaApi(); var model = JC_ShopService.GetModel(ShopId); if (model != null) { obj.Appkey = model.Appkey; obj.DeveKey = model.DeveKey; obj.RefreshToken = model.RefreshToken; obj.AccessToken = model.AccessToken; obj.GroupName = model.ShopName; obj.RefreshTokenSaveTime = model.RefreshTokenSaveTime; obj.AccessTokenUpdateTime = model.AccessTokenUpdateTime; string orderstr = obj.GetQueryIssueList(1, "", out errorm); if (!orderstr.Contains("失败")) { JObject jo = (JObject)JsonConvert.DeserializeObject(orderstr); string totalItem = jo["totalItem"].ToString(); if (totalItem == "0") errorlist += "没有纠纷订单\r\n"; int totalpage = (int)((Convert.ToInt32(totalItem) + 9) / 10); for (int i = totalpage; i >= 1; i--) { orderstr = obj.GetQueryIssueList(i, "", out errorm);//WAIT_SELLER_CONFIRM_REFUND if (!orderstr.Contains("失败")) { jo = (JObject)JsonConvert.DeserializeObject(orderstr); string orderList = jo["dataList"].ToString(); JArray ja = (JArray)JsonConvert.DeserializeObject(orderList); for (int j = 0; j < ja.Count(); j++) { if (ja[j]["orderId"] == null) { errorlist += "订单号采集不到!\r\n"; break; } IssueList ilist = new IssueList(); ilist.id = ja[j]["id"].ToString(); ilist.orderId = ja[j]["orderId"].ToString();//订单号 string temptime = ja[j]["gmtCreate"].ToString(); string dtime = temptime.Insert(12, ":").Insert(10, ":").Insert(8, " ").Insert(6, "-").Insert(4, "-").Substring(0, 19); ilist.gmtCreate = Convert.ToDateTime(dtime); temptime = ja[j]["gmtModified"].ToString(); dtime = temptime.Insert(12, ":").Insert(10, ":").Insert(8, " ").Insert(6, "-").Insert(4, "-").Substring(0, 19); ilist.gmtModified = Convert.ToDateTime(dtime); ilist.issueStatus = ja[j]["issueStatus"].ToString(); ilist.reasonChinese = ja[j]["reasonChinese"].ToString(); ilist.reasonEnglish = ja[j]["reasonEnglish"].ToString(); aois.SaveIssue(ilist); } } else { errorlist += errorm; } } } else { errorlist += errorm; } } else { errorlist += "不存在该店铺\r\n"; } } catch { ErrorMess = "异常\r\n"; } } ErrorMess = errorlist; return success; } #endregion #region 查询请假列表 [WebMethod(EnableSession = true)] public List GetUserLeave(int UserId) { Pages.Login(this.Session); BaseService bs = new BaseService(); List list = new List(); list = bs.GetUserLeave(UserId); return list; } #endregion #region 查询请假单个 [WebMethod(EnableSession = true)] public OA_TotalLeave GetUserLeaveModel(int UserId) { Pages.Login(this.Session); BaseService bs = new BaseService(); OA_TotalLeave list = new OA_TotalLeave(); list = bs.GetUserLeaveModel(UserId); return list; } #endregion #region 查询请假单个 [WebMethod(EnableSession = true)] public void SaveUserLeaveModel(int UserId, Decimal AnnualLeave, Decimal DelLeave, Decimal MoodLeave, Decimal AddLeave, DateTime EndDate) { Pages.Login(this.Session); BaseService bs = new BaseService(); OA_TotalLeave list = new OA_TotalLeave(); list.UserID = UserId; list.AnnualLeave = AnnualLeave; list.DelLeave = DelLeave; list.MoodLeave = MoodLeave; list.AddLeave = AddLeave; bs.SaveUserLeaveModel(list); } #endregion #region 查询请假单个 [WebMethod(EnableSession = true)] public DT_BackOrder GetBackOrder(string OrderCode) { Pages.Login(this.Session); DD_OrderData bs = new DD_OrderData(); var md=bs.GetBackOrder(OrderCode); return md; } #endregion #region 分页查询 [WebMethod(EnableSession = true)] public JsonModel> GetListCompanyFee(string cs,int PageIndex, int PageSize) { Pages.Login(this.Session); string where = CustomIO.Base64StringToString(cs); if (where!="")where = "where " + where.Substring(4); var resultModel = new JsonModel>(); int RowCount = 0; resultModel.DataSource=JC_CompanyService.GetListCompanyFee(where,PageIndex,PageSize, "", out RowCount); resultModel.RowCount = RowCount; return resultModel; } #endregion #region 充值金额 [WebMethod(EnableSession = true)] public void SaveCZMoney(JC_CompanyFee model) { Pages.Login(this.Session); int UserId = Convert.ToInt32(Session["UserId"]); string Name = Convert.ToString(Session["Name"]); model.InDate = DateTime.Now; model.InName = Name; var obj2 = new BaseService(); var mlist = obj2.GetMoneyList2(); decimal USDRate =Convert.ToDecimal(6.31); var mmd = mlist.Find(n => n.PlatId==2&&n.MCode == "USD"); if (mmd != null) USDRate = mmd.MRate.Value; model.InFee = model.InUSDFee * USDRate; JC_CompanyService.Save_CompanyFee(model); } #endregion [WebMethod(EnableSession = true)] public List GetListJC_OrderBackUnRead() { Pages.Login(base.Session); int num = Convert.ToInt32(base.Session["UserId"]); DD_OrderData data = new DD_OrderData(); if (num > 1) { return null; } return data.GetListDT_OrderBackUnRead(); } [WebMethod(EnableSession = true)] public List GetListJC_OrderBackUnRead2() { Pages.Login(base.Session); int num = Convert.ToInt32(base.Session["UserId"]); DD_OrderData data = new DD_OrderData(); if (num > 1) { return null; } return data.GetListDT_OrderBackUnRead2(); } [WebMethod(EnableSession = true)] public void UpdateOrderBackMoneyRead(int Id) { Pages.Login(base.Session); DD_OrderData obj = new DD_OrderData(); obj.UpdateOrderBackMoneyRead(Id); } } }