public List <WXOBJ1> AfterSRepair(string userName, int type) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null);//身份验证失败 } MLogin.GetExeUname(); string where = " and BILLMAN='" + userName + "' and zf3 <> '' and left(code,1) <> '*' "; string by = " top 20 * "; if (type == 0) { where += " and ((zf2='' and sz10=0 ) or (zf2<>'" + userName + "')) order by id desc ";//未接收 } else if (type == 1) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '接受' and BILLMAN ='" + userName + "' ) order by id desc";//处理中 } else if (type == 2) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '完结' and BILLMAN ='" + userName + "' ) order by id desc";//维修完成 } else { } List <WXOBJ1> ms = new List <WXOBJ1>(); clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(where, by); foreach (clientservice_AfterServiceBill c in list) { WXOBJ1 o = new WXOBJ1(); o.ID = c.ID; o.CODE = c.CODE;//维修单号 o.BILLMAN = c.BILLMAN; o.CLIENT = c.CLIENT; o.BILLTYPE = c.BILLTYPE; o.ZF1 = c.ZF1; //机床编号 o.NOTEPRE = c.NOTEPRE; //内容描述(电话回访) o.ZF3 = c.ZF3; //分析描述 初判断 o.CONTACT = c.ZF27; o.PHONE = c.ZF28; o.ZF5 = c.ZF5; ms.Add(o); } return(ms); }
private void GetWxinfo(IEnumerable <string> Plist) { string mm = string.Empty; foreach (var c in Plist) { mm += "'" + c + "',"; } if (mm == string.Empty) { return; } mm = Ifun.Left(mm, mm.Length - 1); clientservice_AfterServiceBill cab = new clientservice_AfterServiceBill(); Wxinfo = cab.Select(" and code in (" + mm + ")"); }
public string WxGet(string userName) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null);//身份验证失败 } MLogin.GetExeUname(); string where = " and BILLMAN='" + userName + "' and zf3 <> '' and left(code,1) <> '*' "; where += " and ((zf2='' and sz10=0 ) or (zf2<>'" + userName + "')) ";//未接收 clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(where); if (list.Count <= 0) { return(null);//没有未接收消息 } string msg = "您有" + list.Count.ToString() + "条维修单未接收,请尽快处理!"; return(msg); }
public List <WXOBJ1> NeibuWx(string userName) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null);//身份验证失败 } MLogin.GetExeUname(); List <WXOBJ1> ms = new List <WXOBJ1>(); BILLnouse2 JC = new BILLnouse2(); string where = "and BILLTYPE ='售后返厂维修' and (isnull(Paytype,'')<>'')and left(code,1)<>'*' and (freenum5 is null or freenum5 < 1)"; List <BILLnouse2> bs = JC.Select(where, " PAYTYPE "); string str = string.Empty; foreach (BILLnouse2 h in bs) { str += "'" + h.PAYTYPE + "',"; } str = str.Substring(0, str.Length - 1); clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(" and BILLMAN='" + userName + "' and code in (" + str + ")"); foreach (clientservice_AfterServiceBill c in list) { WXOBJ1 o = new WXOBJ1(); o.BILLMAN = c.BILLMAN; o.CLIENT = c.CLIENT; o.BILLTYPE = c.BILLTYPE; o.ZF1 = c.ZF1; ms.Add(o); } return(ms); }
public int WxReport(string userName, double lng1, double lat1, string userId, string client, string billcode, int id, string note) { int flag = 0; string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(-10);//身份验证失败 } MLogin.GetExeUname(); string position = KFLocation.Get(client); double lng, lat; if (MyGlobal.AERA_CHECK) //是否范围校验 { if (position == "") //该客户没有定位,将现在这个位置赋值给当前客户 { flag = -2; return(flag); } else if (position == "none")//不存在该用户 { flag = -3; return(flag); } else { } string[] strs = position.Split(','); lng = Convert.ToDouble(strs[0]); lat = Convert.ToDouble(strs[1]); if (ScueFun.LngLatDis.GetDistance(lng, lat, lng1, lat1) > MyGlobal.VISITAERA) { flag = 5; return(flag);//超出范围不能提交 } } else { lng = lng1; lat = lat1; } //事务处理开始,劫持链接通道的sql语句 TransactionSql.Start(MyGlobal.DataBase); //===>开始 DateTime now = SysTime.GetTime; clientservice_AfterServiceBill C = new clientservice_AfterServiceBill(); C.ZF5 = note; string[] strs_p = Function.StayTime(userId, lng1, lat1, client); if (strs_p != null) { C.ZF11 = strs_p[0] == null ? "" : strs_p[0]; //开始时间 C.ZF12 = strs_p[1] == null ? "" : strs_p[1]; //结束时间 C.ZF13 = strs_p[2] == null ? "" : strs_p[2]; //时间间隔 } C.Updata(" AND ID=" + id); L_AfterRepair repair = new L_AfterRepair(); repair.BILLMAN = userName; repair.OPERATE_TIME = now.ToString(); repair.REFERCODE = billcode; //关联维修单号 repair.OPERATE_TYPE = "完结"; repair.ZF1 = id.ToString(); //关联维修单号的id repair.Insert(); //更新关联单据号,最新的,可作为最后打卡的目标公司,名称、地址 20180904 skl puku_user u = new puku_user(); u.REFERCODE = billcode; u.ZF1 = client; u.ZF2 = lng.ToString(); u.ZF3 = lat.ToString(); u.ZF4 = now.ToString("yyyy-MM-dd HH:mm:ss"); u.Updata(" and USERPU='" + userId + "' "); //提交事务到sql服务器处理//===>结束 if (!TransactionSql.EndSql())//判断是否成功 { flag = -1; } return(flag); }