123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749 |
- using PMS.BusinessModels.Account;
- using PMS.BusinessModels.Problem;
- using PMS.DBService.Product;
- using PMS.Interface.Product;
- using QWPlatform.IService;
- using QWPlatform.SystemLibrary.Utils;
- using QWPlatform.SystemLibrary;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using Microsoft.Win32;
- using PMS.EntityModels.Product;
- using PMS.Interface.WorkFlow;
- using PMS.DBService.WorkFlow;
- using PMS.EntityModels.WorkFlow;
- namespace PMS.BusinessService.Product
- {
- /// <summary>
- /// 创建者:冉利
- /// 创建日期:2019/1/4
- /// 功能描述:产品问题记录
- /// </summary>
- public class CPWTJLBusiness : ICPWTJLModel
- {
- private CPWTJLService db_ProInfo = DataServiceBase.Instance<CPWTJLService>();
- #region 自定义查询方案,默认方案得加载,及combobox得点击
- /// <summary>
- /// 自定义方案查询
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string ProjectZdyCxInfo(CPWTJLModel model, int page, int rows)
- {
- int total = 0;
- DataTable dt = db_ProInfo.ProjectZdyCxInfoSqlBulder(model, page, rows, out total);
- return dt.ToEasyUIGridJson(total);
- }
- /// <summary>
- /// 根据渠道id查询下面得项目信息
- /// </summary>
- /// <param name="qdID"></param>
- /// <returns></returns>
- public string QdXm(string qdID)
- {
- string s = Strings.ObjectToJson(db_ProInfo.QdXm(qdID), true);
- return s;
- }
- /// <summary>
- /// 获取项目机构
- /// </summary>
- /// <param name="jgID"></param>
- /// <returns></returns>
- public string XmJgs(string jgID)
- {
- string s = Strings.ObjectToJson(db_ProInfo.XmJgs(jgID), true);
- return s;
- }
- /// <summary>
- /// 获取项目产品
- /// </summary>
- /// <param name="cpID"></param>
- /// <returns></returns>
- public string XmCp(string XmID)
- {
- string s = Strings.ObjectToJson(db_ProInfo.XmCp(XmID), true);
- return s;
- }
- /// <summary>
- /// 快速查询
- /// </summary>
- /// <returns></returns>
- public string KsSelect(string KsCx, int page, int rows, int total)
- {
- int StartNumbers = StartNumber(page, rows, 20);
- int Endnumbers = Endnumber(page, rows, 20);
- DataTable dt = db_ProInfo.KsSelect(KsCx, StartNumbers, Endnumbers, out total);
- if (dt != null)
- {
- return dt.ToEasyUIGridJson(total);
- }
- return string.Empty;
- }
- /// <summary>
- /// 卫计委,本部,渠道人员根据渠道id查询数据权限
- /// </summary>
- /// <param name="model"></param>
- /// <param name="channel"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- public string ProjectZdyCxInfoQKW(string channel, int page, int rows)
- {
- int total = 0;
- DataTable dt = db_ProInfo.ProjectZdyCxInfoQKW(channel, page, rows, out total);
- return dt.ToEasyUIGridJson(total);
- }
- /// <summary>
- /// 4医院管理员 自己机构(站点信息)的数据
- /// </summary>
- /// <param name="model"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- public string ProjectZdyCxZd(string DJRID, int page, int rows)
- {
- int total = 0;
- DataTable dt = db_ProInfo.ProjectZdyCxZd(DJRID, page, rows, out total);
- return dt.ToEasyUIGridJson(total);
- }
- /// <summary>
- /// 客户人员(自己登记的问题)
- /// </summary>
- /// <param name="DJRID"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- /// <returns></returns>
- public string ProjectZdyCxInfoKh(string DJRID, int page, int rows)
- {
- int total = 0;
- DataTable dt = db_ProInfo.ProjectZdyCxInfoKh(DJRID, page, rows, out total);
- return dt.ToEasyUIGridJson(total);
- }
- /// <summary>
- /// 问题确认
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public string WtQr(string id, string JlrID, DateTime Jlsj, int Qrlx)
- {
- //--状态(1,正常,2,被回退,3,终止),记录人ID,记录时间,确认类型(1机构,2卫计委,3项目,4技术,5研发人员)
- return db_ProInfo.WtQr(id, JlrID, Jlsj, Qrlx);
- }
- /// <summary>
- /// 查询产品问题记录是否被确认
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public string WtsfQr(string id)
- {
- string result = db_ProInfo.WtsfQr(id);
- return result;
- }
- /// <summary>
- /// 判断问题是否被终止
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public string SfZz(string id)
- {
- string result = db_ProInfo.SfZz(id);
- return result;
- }
- /// <summary>
- /// 查看问题详情
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public string Wtdetail(string id)
- {
- return db_ProInfo.Wtdetail(id).ToJson();
- }
- /// <summary>
- /// 获取基础编码
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public string GetBaseCode(string type)
- {
- return db_ProInfo.GetBaseCode(type).ToJson();
- }
- #endregion
- #region 开始行结束行
- /// <summary>
- /// 开始行
- /// </summary>
- /// <param name="page">页码</param>
- /// <param name="rows">行数</param>
- /// <param name="defaultpage">默认行数</param>
- /// <returns></returns>
- private int StartNumber(int page, int rows, int defaultpage)
- {
- try
- {
- int _pageNum = page == 0 ? 1 : page;
- int _pagerows = rows == 0 ? defaultpage : rows;
- return ((_pageNum - 1) * _pagerows + 1);
- }
- catch (Exception)
- {
- return 0;
- }
- }
- /// <summary>
- /// 结束行
- /// </summary>
- /// <param name="page">页码</param>
- /// <param name="rows">行数</param>
- /// <param name="defaultpage">默认页码</param>
- /// <returns></returns>
- private int Endnumber(int page, int rows, int defaultpage)
- {
- try
- {
- int _pageNum = page == 0 ? 1 : page;
- int _pagerows = rows == 0 ? defaultpage : rows;
- return (_pageNum * _pagerows);
- }
- catch (Exception)
- {
- return 0;
- }
- }
- /// <summary>
- /// 是否医院内审核医院管理员可以提交问题
- /// </summary>
- /// <param name="personID"></param>
- /// <returns></returns>
- public string SfSh(string personID)
- {
- DataTable dt = db_ProInfo.SfSh(personID);
- return dt.ToJson();
- }
- /// <summary>
- /// 是否卫计委可以处理问题
- /// </summary>
- /// <param name="personID"></param>
- /// <returns></returns>
- public string SfShWjW(string personID)
- {
- DataTable dt = db_ProInfo.SfShWjW(personID);
- return dt.ToJson();
- }
- #endregion
- #region 所有combobox需要信息
- /// <summary>
- /// 获取所有渠道信息
- /// </summary>
- /// <param name="channel"></param>
- /// <returns></returns>
- public string GETQDinfo(string channel)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETQDinfo(channel), true);
- return s;
- }
- /// <summary>
- /// 获取所有项目信息
- /// </summary>
- /// <param name="channel"></param>
- /// <returns></returns>
- public string GETXMinfo(string channel)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETXMinfo(channel), true);
- return s;
- }
- /// <summary>
- /// 获取机构信息
- /// </summary>
- /// <returns></returns>
- public string GETJGinfo(string project)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETJGinfo(project), true);
- return s;
- }
- /// <summary>
- /// 获取产品信息
- /// </summary>
- /// <returns></returns>
- public string GETCPinfo(string project)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETCPinfo(project), true);
- return s;
- }
- /// <summary>
- /// 获取性质信息
- /// </summary>
- /// <returns></returns>
- public string GETXZinfo()
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETXZinfo(), true);
- return s;
- }
- /// <summary>
- /// 获取紧急程度信息
- /// </summary>
- /// <returns></returns>
- public string GETJJCDinfo()
- {
- string s = Strings.ObjectToJson(db_ProInfo.GETJJCDinfo(), true);
- return s;
- }
- /// <summary>
- /// 获取问题流程信息
- /// </summary>
- /// <returns></returns>
- public string GEDQHJinfo(int PersonProperty)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GEDQHJinfo(PersonProperty), true);
- return s;
- }
- /// <summary>
- /// 关键字
- /// </summary>
- /// <returns></returns>
- public string GEDGJZinfo(string project)
- {
- string s = Strings.ObjectToJson(db_ProInfo.GEDGJZinfo(project), true);
- return s;
- }
- #endregion
- #region 信息查询
- //迭代信息
- public string GetLterationList()
- {
- return db_ProInfo.GetLterationList().ToJson();
- }
- //获取数据库时间
- public DateTime GetDatabaseTime()
- {
- return db_ProInfo.GetDatabaseTime();
- }
- //获取研发人员
- public string GetAssignPerson()
- {
- return db_ProInfo.GetAssignPerson().ToJson();
- }
- //获取所有模块
- public string GetAllModual()
- {
- return db_ProInfo.GetAllModual().ToJson();
- }
- //获取关注的产品信息
- public string GetMyConfig(string myconfig, string id)
- {
- return db_ProInfo.GetMyConfig(myconfig, id).ToJson();
- }
- //获取关注的模块信息
- public string GetMyConfigModual(string myconfig, string CPID)
- {
- return db_ProInfo.GetMyConfigModual(myconfig, CPID).ToJson();
- }
- //获取用户信息
- public string GetUserInfo(UserInfo user)
- {
- return db_ProInfo.GetUserInfo(user).ToJson();
- }
- //判断是否可以删除
- public DataTable CheckState(string id)
- {
- return db_ProInfo.CheckState(id);
- }
- //加载产品
- public string GetCpwtjlByID(string xmid, string cpid)
- {
- return db_ProInfo.GetCpwtjlByID(xmid, cpid).ToJson();
- }
- //获取项目id
- public string GetXMID(string id)
- {
- return "1";
- }
- //获取问题状态
- public bool GetProblemState(string id, UserInfo model)
- {
- return db_ProInfo.GetProblemState(id, model);
- }
- //根据问题编号获取问题信息
- public DataTable GetInfolByBH(int id)
- {
- return db_ProInfo.GetInfolByBH(id);
- }
- //根据人员权限获取产品信息
- public string GetProductByID(string defaultProjectID)
- {
- return db_ProInfo.GetProductByID(defaultProjectID).ToJson();
- }
- //根据项目获取对应的渠道
- public string GetChannelByInfo(string id)
- {
- return db_ProInfo.GetChannelByInfo(id).ToJson();
- }
- //根据登录人员获取对应的项目
- public string GetProjectByInfo(UserInfo user)
- {
- //本部人员
- if (user.PersonProperty == 1)
- {
- return db_ProInfo.GetProjectByInfo().ToJson();
- }
- //其他人员
- return db_ProInfo.GetProjectByInfo(user).ToJson();
- }
- //根据项目获取对应的机构
- public string GetStationByID(string id)
- {
- return db_ProInfo.GetStationByID(id).ToJson();
- }
- //获取问题紧急程度
- public string GetEmergencylevel()
- {
- return db_ProInfo.GetEmergencylevel().ToJson();
- }
- //项目产品模块信息
- public string SelectProjectModualInfo(string id)
- {
- return db_ProInfo.SelectProjectModualInfo(id).ToJson();
- }
- //根据登录人员ID获取人员信息
- public string GetPersonInfoByID(string PersonID)
- {
- return db_ProInfo.GetPersonInfoByID(PersonID).ToJson();
- }
- //根据产品ID获取产品模块
- public string GetModualByCPID(string id)
- {
- return db_ProInfo.GetModualByCPID(id).ToJson();
- }
- public string getmk(string id)
- {
- DataTable dt = db_ProInfo.GetModualByCPID(id);
- int count = 0;
- int x = 0;
- var json = "[";
- foreach (DataRow row in dt.Rows)
- {
- if (String.IsNullOrEmpty(row.GetValueByName<string>("上级ID")))
- {
- json += "{id:'" + row.GetValueByName<string>("ID") + "',text:'" + row.GetValueByName<string>("名称") + "'";
- foreach (DataRow r in dt.Rows)
- {
- if (r.GetValueByName<string>("上级ID") == row.GetValueByName<string>("ID"))
- {
- if (count == 0)
- {
- json += ",children: [";
- count++;
- x++;
- }
- json += "{id:'" + r.GetValueByName<string>("ID") + "',text: '" + r.GetValueByName<string>("名称") + "'},";
- }
- }
- if (x != 0)
- {
- json = json.Substring(0, json.Length - 1) + "]";
- }
- json += "},";
- count = x = 0;
- }
- }
- //json = json.Substring(0, json.Length - 1);
- json += "]";
- return json;
- }
- //获取唯一问题序列编号
- public string GetSequence()
- {
- return db_ProInfo.GetSequence().ToJson();
- }
- //问题来源
- public string GetProblemSource(int personProperty)
- {
- //如果性质为产品用户
- if (personProperty == 3 || personProperty == 4 || personProperty == 5)
- {
- return db_ProInfo.GetProblemSource(personProperty, "5").ToJson();
- }
- else
- {
- return db_ProInfo.GetProblemSource(personProperty).ToJson();
- }
- }
- //问题性质
- public string GetProblemNature(int personProperty)
- {
- //如果性质为产品用户
- if (personProperty == 3 || personProperty == 4 || personProperty == 5)
- {
- return db_ProInfo.GetProblemNature(personProperty, "1").ToJson();
- }
- else
- {
- return db_ProInfo.GetProblemNature(personProperty).ToJson();
- }
- }
- //根据性质ID返回性质代码
- public DataTable SelectNature(string wTXZ)
- {
- return db_ProInfo.SelectNature(wTXZ);
- }
- //获取所有反馈人
- public string GetFKR(string text, string CompanyID)
- {
- return db_ProInfo.GetFKR(text, CompanyID).ToJson();
- }
- //获取问题登记时的过程ID
- public string GetNewProcessID(string problemid)
- {
- return db_ProInfo.GetNewProcessID(problemid);
- }
- // 根据问题id获取产品id
- public string GetCPID(string id)
- {
- return db_ProInfo.GetCPID(id).ToString();
- }
- //根据渠道Id获取用户信息
- public string GetUserInfoByChannelId()
- {
- return this.db_ProInfo.GetUserInfoByChannelId().ToJson();
- }
- #endregion
- #region 问题登记
- //登记操作
- public ProblemStateModel RegisterProblem(ProblemBusinessModel model, UserInfo user, string id)
- {
- //用户、机构管理员、卫计委信息科
- if (user.PersonProperty == 3 || user.PersonProperty == 4 || user.PersonProperty == 5)
- {
- return db_ProInfo.RegisterProblem(model, user, id);
- }
- else
- {
- //直接提交
- if (model.RegisterType == 1)
- {
- return db_ProInfo.RegisterSubitProblem(model, user, id);
- }
- //中联人员
- return db_ProInfo.RegisterProblemByZL(model, user, id);
- }
- }
- //提交问题
- public int PostProblem(string id, string flowID, UserInfo user, string ProcessID)
- {
- return db_ProInfo.PostProblem(id, flowID, user, ProcessID);
- }
- //上传附件
- public bool FileUpload(string ProblemID, string AnnexID, string Name, string fileType, string id)
- {
- var result = db_ProInfo.FileUpload(ProblemID, AnnexID, Name, fileType, id);
- return result == 1;
- }
- //判断项目的审核流程是否允许用户反馈问题
- public bool CheckApprovalProcess(string QDID, string xMID, string JGID)
- {
- return db_ProInfo.CheckApprovalProcess(QDID, xMID, JGID) > 0;
- }
- //根据项目获取对应的渠道
- public DataTable GetChannelByProId(string id)
- {
- return this.db_ProInfo.GetChannelByInfo(id);
- }
- #endregion
- #region 问题修改
- //修改问题操作
- public int UpdateProblem(ProblemBusinessModel model, UserInfo user)
- {
- return db_ProInfo.UpdateProblem(model, user);
- }
- //返回问题是否有受理人
- public int GetAccept(string id)
- {
- return db_ProInfo.GetAccept(id);
- }
- /// <summary>
- /// 获取问题记录信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public DataTable GetProblemInfo(string id)
- {
- return db_ProInfo.GetProblemInfo(id);
- }
- //获取问题附件
- public DataTable GetAttachment(string id)
- {
- return db_ProInfo.GetAttachment(id);
- }
- //删除附件
- public int Delete_Img(string id)
- {
- return db_ProInfo.Delete_Img(id);
- }
- #endregion
- #region 删除问题
- //删除问题
- public int Delete_Problem(string id)
- {
- return db_ProInfo.Delete_Problem(id);
- }
- #endregion
- #region 向上提交
- //提交操作
- public int Submit(string id, UserInfo user, string CodeID)
- {
- return db_ProInfo.Submit(id, user, CodeID);
- }
- #endregion
- #region 查看问题
- //查看问题
- public string CheckProblem(string id)
- {
- return db_ProInfo.CheckProblem(id).ToJson();
- }
- //根据编号获取问题ID
- public string GetProblemID(int bH)
- {
- return db_ProInfo.GetProblemID(bH);
- }
- //问题过程的附件上传
- public bool ProcessFileUpload(string problemID, string data, string name, string fileType, string processID)
- {
- var result = db_ProInfo.ProcessFileUpload(problemID, data, name, fileType, processID);
- return result == 1;
- }
- #endregion
- #region 处理问题
- public int SaveResource(ResourceBusinessModels model)
- {
- return db_ProInfo.SaveResource(model);
- }
- public int DelResource(string id)
- {
- return db_ProInfo.DelResource(id);
- }
- public int GetNumber(string id)
- {
- return db_ProInfo.GetNumber(id);
- }
- /// <summary>
- /// 获取问题的资源列表
- /// </summary>
- /// <param name="proid"></param>
- /// <returns></returns>
- public string ResourceData(string proid)
- {
- return db_ProInfo.ResourceData(proid).ToJson();
- }
- public object ResourceData_Layui(string proid)
- {
- return db_ProInfo.ResourceData_Layui(proid);
- }
- public string DoBHGet(string url, string v1, string v2)
- {
- return db_ProInfo.DoBHGet(url, v1, v2);
- }
- public string GetVersionById(string id, int type)
- {
- return db_ProInfo.GetVersionById(id, type).ToJson();
- }
- public int ChangeVersionState(string id, int state)
- {
- return this.db_ProInfo.ChangeVersionState(id, state);
- }
- /// <summary>
- /// 标准底线问题
- /// </summary>
- /// <param name="id"></param>
- /// <param name="state"></param>
- /// <returns></returns>
- public int Bottomlineissues(string id, int state)
- {
- return this.db_ProInfo.ChangeVersionState(id, state);
- }
- public DataTable GetProjectProducct(string id)
- {
- return this.db_ProInfo.GetProjectProducct(id);
- }
- public bool CheckRepeat(string id)
- {
- return this.db_ProInfo.CheckRepeat(id);
- }
- public int SaveDevTest(string id, string dev, string test)
- {
- return this.db_ProInfo.SaveDevTest(id, dev, test);
- }
- public void GetDevTest(string id, out string dev, out string test)
- {
- this.db_ProInfo.GetDevTest(id, out dev, out test);
- }
-
- #endregion
- }
- }
|