123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737 |
- using PMS.BusinessModels.SmartForm;
- using PMS.BusinessModels.SMS;
- using PMS.EntityModels.SmartForm;
- using PMS.Interface;
- using PMS.Interface.MessageManage;
- using PMS.Interface.SmartForm;
- using QWPlatform.SystemLibrary;
- using QWPlatform.SystemLibrary.Email;
- using QWPlatform.SystemLibrary.Utils;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Web;
- using System.Web.Mvc;
- namespace PMS.WebUI.Controllers
- {
- public class SmartFormController : BaseController
- {
- /// <summary>
- /// 实例接口
- /// </summary>
- ISmartForm SmartForm = InterfaceFactory.CreateBusinessInstance<ISmartForm>();
- //推送消息
- IMessageManage notice = InterfaceFactory.CreateBusinessInstance<IMessageManage>();
- private static EmailServerInfo emailServerInfo;
- private static SmtpEmail smtpClient;
- private static Plugins.Email.SmtpEmail _smtpClient;//内部重写
- // GET: SmartForm
- public ActionResult SmartIndex()
- {
- return View();
- }
- public ActionResult AddSmartForm()
- {
- return View();
- }
- /// <summary>
- /// 新增分类
- /// </summary>
- /// <returns></returns>
- public ActionResult AddClass()
- {
- return View();
- }
- /// <summary>
- /// 项目填报管理
- /// </summary>
- /// <returns></returns>
- public ActionResult FillingManagement()
- {
- return View();
- }
-
- /// <summary>
- /// 新增修改分类
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult AddCategory(ZNBDFL model)
- {
- ZNBDFLModel zNBDFLModel = new ZNBDFLModel();
- zNBDFLModel.ID = model.ID;
- zNBDFLModel.上级ID = model.上级ID;
- zNBDFLModel.名称 = model.名称;
- zNBDFLModel.应用性质 = model.应用性质;
- zNBDFLModel.应用范围 = model.应用范围;
- var r= SmartForm.AddCategory(model.type, zNBDFLModel);
- if (r)
- {//保存成功
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
- }
- else
- {//保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
- }
- }
- /// <summary>
- /// 删除智能表单分类
- /// </summary>
- /// <param name="zNBDFLModel"></param>
- /// <returns></returns>
- public ActionResult DelCategory(ZNBDFLModel zNBDFLModel)
- {
- var msg = "删除成功!";
- var r = SmartForm.DelCategory(zNBDFLModel,ref msg);
- if (r)
- {//保存成功
- return this.ResponseJson(System.Net.HttpStatusCode.OK, msg);
- }
- else
- {//保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, msg);
- }
- }
- /// <summary>
- /// 获取分类下来树
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCategory(string id)
- {
- var list= SmartForm.GetCategory(id);
- var json = Strings.ObjectToJson(list);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 审核通过时,邮件需要推送附件
- /// </summary>
- /// <param name="id">记录id</param>
- /// <param name="BDXXID">表单id</param>
- /// <param name="XM">项目</param>
- /// <returns></returns>
- public ActionResult UploadFileInfo(string id,string BDXXID, string XM)
- {
- ViewBag.ID = id;
- ViewBag.BDXXID = BDXXID;
- ViewBag.CLR = GetCurrentUser().Name;
- ViewBag.XM = XM;
- return View();
- }
- /// <summary>
- /// 保存智能表单
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult AddSmartFormInfo(ZNBCXX model)
- {
- ZNBCXXModel XMmodel = new ZNBCXXModel();
- XMmodel.FLID = model.FLID;
- XMmodel.MC = model.MC;
- XMmodel.BT = model.BT;
- //XMmodel.TXTS = model.TXTS;
- XMmodel.TXXZ = model.TXXZ;
- XMmodel.CLMS = model.CLMS;
- XMmodel.BZ = model.BZ;
- XMmodel.SFTX = model.SFTX;
- XMmodel.TXHM = model.TXHM;
- XMmodel.YJTS = model.YJTS;
- XMmodel.SHTX = model.SHTX;
- XMmodel.SHTXHM = model.SHTXHM;
- XMmodel.SHYJTS = model.SHYJTS;
- XMmodel.SHBHFJ = model.SHBHFJ;
-
- ZNBCMBModel BBModel = new ZNBCMBModel();
- BBModel.BDNR = HttpUtility.UrlDecode(model.BDNR);
- BBModel.BDCLNR = HttpUtility.UrlDecode(model.BDCLNR);
- BBModel.CZR= GetCurrentUser().Name;
- var r = SmartForm.Add(XMmodel, BBModel);
- if (r)
- {//保存成功
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
- }
- else
- {//保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
- }
-
- }
- /// <summary>
- /// 更新智能表单
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult UpdateSmartForm(ZNBCXX model)
- {
- ZNBCXXModel XMmodel = new ZNBCXXModel();
- XMmodel.FLID = model.FLID;
- XMmodel.MC = model.MC;
- XMmodel.BT = model.BT;
- //XMmodel.TXTS = model.TXTS;
- XMmodel.TXXZ = model.TXXZ;
- XMmodel.CLMS = model.CLMS;
- XMmodel.BZ = model.BZ;
- XMmodel.SFTX = model.SFTX;
- XMmodel.TXHM = model.TXHM;
- XMmodel.YJTS = model.YJTS;
- XMmodel.SHTX = model.SHTX;
- XMmodel.SHTXHM = model.SHTXHM;
- XMmodel.SHYJTS = model.SHYJTS;
- XMmodel.SHBHFJ = model.SHBHFJ;
- XMmodel.ID = model.ID;
- XMmodel.ZT = model.ZT;
- ZNBCMBModel BBModel = new ZNBCMBModel();
- BBModel.BDNR = HttpUtility.UrlDecode(model.BDNR);
- BBModel.BDCLNR = HttpUtility.UrlDecode(model.BDCLNR);
- BBModel.CZR = GetCurrentUser().Name;
- var r = SmartForm.UpdateSmartForm(XMmodel, BBModel);
- if (r)
- {//保存成功
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
- }
- else
- {//保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
- }
- }
- /// <summary>
- /// 查询数据对象并进行赋值【查询智能表单信息】
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult BdxxSelect(string id)
- {
- var list = SmartForm.BdxxSelect(id);
- var json = Strings.ObjectToJson(list);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 表单信息列表查询
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult BdxxSelectList(ZNBCXXModel model)
- {
- var list = SmartForm.BdxxSelectList(model);
- var json = Strings.ObjectToJson(list);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 复制表单
- /// </summary>
- /// <param name="id">表单id</param>
- /// <returns></returns>
- public ActionResult CopySmartForm(string id)
- {
- var CZR = GetCurrentUser().Name;
- var r = SmartForm.CopySmartForm(id, CZR);
- if (r)
- {//保存成功
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
- }
- else
- {//保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
- }
- }
- #region 表单填写记录
- /// <summary>
- /// 表单信息列表查询
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult SelectRecordList(SelectBDTXJLModel model)
- {
- var list = SmartForm.SelectRecordList(model);
- var json = Strings.ObjectToJson(new { total = model.total, rows = list });
- return Content(json, "application/json");
- }
- /// <summary>
- /// 查询所有的分类下面【表单填写记录】
- /// </summary>
- /// <param name="model"></param>
- /// <param name="classID"></param>
- /// <returns></returns>
- public ActionResult SelectRecordListAll(SelectBDTXJLModel model)
- {
- var list = SmartForm.SelectRecordListAll(model,"0");
- var json = Strings.ObjectToJson(new { total = model.total, rows = list });
- return Content(json, "application/json");
- }
- /// <summary>
- /// 保存表单内容
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult AddRecord(BDTXJLModel model)
- {
- model.TBR = GetCurrentUser().Name;
- model.TBRID = GetCurrentUser().PersonID;
- model.QDID = GetCurrentUser().CompanyID;
- model.QDMC = GetCurrentUser().Company;
- model.BDNR = HttpUtility.UrlDecode(model.BDNR);
- model.BDCLNR = HttpUtility.UrlDecode(model.BDCLNR);
- model.BDJG = HttpUtility.UrlDecode(model.BDJG);
- var rs = SmartForm.AddRecord(model);
- if (rs)
- {
- if(model.TBZT==0)
- {
- //通知线程(邮件等)
- ThreadPool.QueueUserWorkItem(new WaitCallback(PushMessg), model);
- }
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, "成功", null).ToString(), "application/json");
- }
- else
- {
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, "失败", null).ToString(), "application/json");
- }
- }
- //填报推送
- private void PushMessg(object model)
- {
- var processModel = model as BDTXJLModel;
- try
- {
- var dtmodel = SmartForm.BdxxSelect(processModel.BDXXID);
- if (dtmodel.SFTX == 1)
- {
- NotificationDto no = new NotificationDto();
- no.style = "3";
- no.template_code = "_irn5-4QRA2cFx7MWC0S_5AGlf1VVMXWIM1BPxi_RwQ";
- var time = DateTime.Now;
- var coutent ="【"+ processModel.QDMC+"-"+ processModel.TBR+ "】对【" + processModel.XMMC + "】提交了【"+ dtmodel.MC+ "】";
- var title = "您收到新的表单填报!";
- no.template_value = "{\"first\":{\"value\":\"" + title + "\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + time + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + dtmodel.MC + "\",\"color\":\"#173177\"},\"keyword3\":{\"value\":\"" + coutent + "\",\"color\":\"#173177\"},\"remark\":{\"value\":\"请登录问题管理系统进行处理。\",\"color\":\"#173177\"}}";
- //no.url = "https://zlpms.zlsoft.com:8078/MobileProblem/ProblemDetail/" + ProblemID;
- List<MessageDetailsDto> list = new List<MessageDetailsDto>();
- var dt= SmartForm.GetPushAccountInfo(dtmodel.TXHM);
- if (dt != null && dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- MessageDetailsDto mdd = new MessageDetailsDto();
- mdd.接收人id = dt.Rows[i].GetValueByName<string>("微信id");
- list.Add(mdd);
-
- }
- no.record_items = list;
- notice.SendWeChartTempletMessge(no);
- }
- //邮件
- //touser.Add("zp@zlsoft.cn");
- //touser.Add("zxm@zlsoft.cn");
- List<string> ccuser = new List<string>();
- List<string> touser = new List<string>();
- if (dtmodel.YJTS != null || dtmodel.YJTS != "")
- {
- var arr = dtmodel.YJTS.Split(',');
- for (int i = 0; i < arr.Length; i++)
- {
- touser.Add(arr[i]);
- }
- emailServerInfo = new EmailServerInfo("m.zlsoft.cn", "问题管理工具", "zljtysywpt@zlsoft.cn", "zlsoft@2019");
- //实例化发送对象 ""
- smtpClient = new SmtpEmail(emailServerInfo);
- var emai = new EmailInfo(title, coutent, touser.ToArray(), ccuser.ToArray());
- var user = emailServerInfo.SendEmail;
- var name = emailServerInfo.SendUserName;
- emai.FromUser(user, name);
- //发送邮件
- smtpClient?.Send(emai);
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- /// <summary>
- /// 审核推送
- /// </summary>
- /// <param name="model"></param>
- private void AuditPushMessg(object model)
- {
- var processModel = model as BDTXJLModel;
- try
- {
- BDTXJLModel bdmodel = new BDTXJLModel();
- bdmodel.ID = processModel.ID;
- var fromInfor= SmartForm.MyRecordList(bdmodel);
- NotificationDto no = new NotificationDto();
- no.style = "3";
- no.template_code = "OIE51OsXeECnoPxGgPTQ7acXybc7t1plgAbdlH-mMWE";
- var time = DateTime.Now;
- var state = processModel.TBZT == 1 ? "通过" : "退回";
- var coutent ="【" + fromInfor.FirstOrDefault().XMMC + "】填报的表单已被【" + processModel.SHR + "】" + state;
- var title = "表单处理结果通知!";
- var color = "#173177";
- if (processModel.TBZT == 1)
- {
- no.url = "https://zlpms.zlsoft.com:8078/SmartForm/MobileSmartDetailPreview/" + processModel.ID;
-
- }
- else
- {
- color = "#2ab8ff";
- no.url = "https://zlpms.zlsoft.com:8078/SmartForm/EditMobileSmartDetail/" + processModel.ID;
- }
- no.template_value = "{\"first\":{\"value\":\"" + title + "\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + time + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + coutent + "\",\"color\":\"" + color + "\"},\"remark\":{\"value\":\"点击【查看详情】立即查阅您填写的表单\",\"color\":\"#173177\"}}";
- List<MessageDetailsDto> list = new List<MessageDetailsDto>();
- var dt = SmartForm.GetSysAccountInfo(fromInfor.FirstOrDefault().TBRID);
- if (dt != null && dt.Rows.Count > 0)
- {
- //邮件
- List<string> ccuser = new List<string>();
- List<string> touser = new List<string>();
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- MessageDetailsDto mdd = new MessageDetailsDto();
- if(dt.Rows[i].GetValueByName<string>("微信id")!=null)
- {
- mdd.接收人id = dt.Rows[i].GetValueByName<string>("微信id");
- list.Add(mdd);
- }
- if (dt.Rows[i].GetValueByName<string>("邮箱") != null)
- {
- touser.Add(dt.Rows[i].GetValueByName<string>("邮箱"));
- }
-
- }
- no.record_items = list;
- if(no.record_items.Count>0)
- {
- notice.SendWeChartTempletMessge(no);
- }
- if(touser.Count>0)
- {
- emailServerInfo = new EmailServerInfo("m.zlsoft.cn", "问题管理工具", "zljtysywpt@zlsoft.cn", "zlsoft@2019");
- //实例化发送对象 ""
- smtpClient = new SmtpEmail(emailServerInfo);
- var emai = new EmailInfo(title, coutent, touser.ToArray(), ccuser.ToArray());
- var user = emailServerInfo.SendEmail;
- var name = emailServerInfo.SendUserName;
- emai.FromUser(user, name);
- //发送邮件
- smtpClient?.Send(emai);
- }
-
- }
-
- }
- catch (Exception ex)
- {
- }
- }
- /// <summary>
- /// 更新记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult UpdateRecord(BDTXJLModel model)
- {
- model.SHR = GetCurrentUser().Name;
- model.SHRID = GetCurrentUser().PersonID;
- model.TBR = GetCurrentUser().Name;
- model.QDID = GetCurrentUser().CompanyID;
- model.QDMC = GetCurrentUser().Company;
- //处理页面有html
- model.BDJG = HttpUtility.UrlDecode(model.BDJG);
- model.BDCLJG = HttpUtility.UrlDecode(model.BDCLJG);
-
- var rs = SmartForm.UpdateRecord(model, int.Parse(model.BZ));//这个地方的备注传界面操作状态
- if (rs)
- {
- if (model.BZ=="3")//退回重新填报
- {
- //通知线程(邮件等)
- ThreadPool.QueueUserWorkItem(new WaitCallback(PushMessg), model);
- }
- else if(model.BZ=="2")
- { //审核通过通知填报人
- ThreadPool.QueueUserWorkItem(new WaitCallback(AuditPushMessg), model);
- }
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, "成功", null).ToString(), "application/json");
- }
- else
- {
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, "失败", null).ToString(), "application/json");
- }
- }
- /// <summary>
- /// 审核推送带附件
- /// </summary>
- /// <param name="emailPush"></param>
- /// <returns></returns>
- public ActionResult AuditAttachmentPush(EmailPush emailPush)
- {
- BDTXJLModel model =new BDTXJLModel();
- model.SHR = GetCurrentUser().Name;
- model.SHRID = GetCurrentUser().PersonID;
- model.TBR = GetCurrentUser().Name;
- model.QDID = GetCurrentUser().CompanyID;
- model.QDMC = GetCurrentUser().Company;
- model.TBZT = 1;
- model.BZ ="2";
- model.ID = emailPush.ID;
- //处理页面有html
- model.BDJG = HttpUtility.UrlDecode(model.BDJG);
- model.BDCLJG = HttpUtility.UrlDecode(model.BDCLJG);
- var rs = SmartForm.UpdateRecord(model, int.Parse(model.BZ));//这个地方的备注传界面操作状态
- if (rs)
- {
- //审核通过通知公司相关人员
- ThreadPool.QueueUserWorkItem(new WaitCallback(AuditEnclosurePushMessg), emailPush);
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, "成功", null).ToString(), "application/json");
- }
- else
- {
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, "失败", null).ToString(), "application/json");
- }
- }
-
- /// <summary>
- /// 审核带附件推送
- /// </summary>
- /// <param name="model"></param>
- private void AuditEnclosurePushMessg(object model)
- {
- var processModel = model as EmailPush;
- try
- {
- var dtmodel = SmartForm.BdxxSelect(processModel.BDXXID);
- if (dtmodel.SHTX == 1)
- {
-
- NotificationDto no = new NotificationDto();
- no.style = "3";
- no.template_code = "OIE51OsXeECnoPxGgPTQ7acXybc7t1plgAbdlH-mMWE";
- var time = DateTime.Now;
- var color = "#173177";
- no.url = "https://zlpms.zlsoft.com:8078/SmartForm/MobileSmartDetailPreview/" + processModel.ID;
- no.template_value = "{\"first\":{\"value\":\"" + processModel.TSBT + "\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + time + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + processModel.TSNR + "\",\"color\":\"" + color + "\"},\"remark\":{\"value\":\"点击【查看详情】立即查阅您填写的表单\",\"color\":\"#173177\"}}";
- //邮件
- List<string> ccuser = new List<string>();
- List<string> touser = new List<string>();
- List<MessageDetailsDto> list = new List<MessageDetailsDto>();
- //将当前填报人加入推送消息中
- BDTXJLModel bdmodel = new BDTXJLModel();
- bdmodel.ID = processModel.ID;
- var fromInfor = SmartForm.MyRecordList(bdmodel);
- var nowdt = SmartForm.GetSysAccountInfo(fromInfor.FirstOrDefault().TBRID);
- if (nowdt != null && nowdt.Rows.Count > 0)
- {
- for (int i = 0; i < nowdt.Rows.Count; i++)
- {
- MessageDetailsDto mdd = new MessageDetailsDto();
- if (nowdt.Rows[i].GetValueByName<string>("微信id") != null)
- {
- mdd.接收人id = nowdt.Rows[i].GetValueByName<string>("微信id");
- list.Add(mdd);
- }
- if (nowdt.Rows[i].GetValueByName<string>("邮箱") != null)
- {
- touser.Add(nowdt.Rows[i].GetValueByName<string>("邮箱"));
- }
- }
- }
- //将审核人员添加到推送消息列表
- var dt = SmartForm.GetPushAccountInfo(dtmodel.TXHM);
- if (dt != null && dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- MessageDetailsDto mdd = new MessageDetailsDto();
- if (dt.Rows[i].GetValueByName<string>("微信id") != null)
- {
- mdd.接收人id = dt.Rows[i].GetValueByName<string>("微信id");
- list.Add(mdd);
- }
-
- }
- no.record_items = list;
- if (no.record_items.Count > 0)
- {
- notice.SendWeChartTempletMessge(no);
- }
- }
- //邮件推送
- if(dtmodel.SHYJTS!=null || dtmodel.SHYJTS!="")
- {
- var arr = dtmodel.SHYJTS.Split(',');
- for (int i = 0; i < arr.Length; i++)
- {
- touser.Add(arr[i]);
- }
- if (touser.Count > 0)
- {
- List<string> AttachFiles = new List<string>();
- List<Plugins.Email.FileArray> AttachFilesArray = new List<Plugins.Email.FileArray>();
- if (processModel.File!=null)
- {
- foreach (var item in processModel.File)
- {
- Plugins.Email.FileArray _fileArray = new Plugins.Email.FileArray();
- byte[] imageBytes = Convert.FromBase64String(item.data.Replace("data:image/jpeg;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/gif;base64,", "").Replace("data:image/jpg;base64,", ""));
- _fileArray.filesBate = imageBytes;
- _fileArray.filesName = item.name;
- AttachFilesArray.Add(_fileArray);
- }
-
-
- }
-
- var _emailServerInfo = new Plugins.Email.EmailServerInfo("m.zlsoft.cn", "问题管理工具", "zljtysywpt@zlsoft.cn", "zlsoft@2019");
- //实例化发送对象 ""
- var _smtpClient = new Plugins.Email.SmtpEmail(_emailServerInfo);
- var emai = new Plugins.Email.EmailInfo(processModel.TSBT, processModel.TSNR, touser.ToArray(), ccuser.ToArray(), AttachFiles, AttachFilesArray);
- var user = _emailServerInfo.SendEmail;
- var name = _emailServerInfo.SendUserName;
- emai.FromUser(user, name);
- //发送邮件
- _smtpClient?.Send(emai);
- }
- }
-
- }
- }
- catch (Exception ex)
- {
- }
- }
- #region 智能表单
- /// <summary>
- /// 智能表单预览
- /// </summary>
- /// <returns></returns>
- public ActionResult SmarView()
- {
- return View();
- }
- //PC端新增智能表单
- public ActionResult PcSmartFormList(string id, string xmid,string xmmc)
- {
- ViewBag.ID = id;
- ViewBag.XMID = xmid;
- ViewBag.XMMC = xmmc;
- return View();
- }
- public ActionResult EditPcSmartFormList(string id)
- {
- ViewBag.ID = id;
- return View();
- }
- #endregion
- #endregion
- #region 移动端智能表单
- public ActionResult MobileSmart()
- {
- return View();
- }
- public ActionResult MobileSmartDetail(string id)
- {
- ViewBag.ID = id;
- return View();
- }
- /// <summary>
- /// 我的填写
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult MobileMySmart()
- {
- ViewBag.TBRID = GetCurrentUser().PersonID;
- return View();
- }
-
- /// <summary>
- /// 我的填写记录
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult MyRecordList(BDTXJLModel model)
- {
- if(model.TBRID != "-1")
- {
- model.TBRID = GetCurrentUser().PersonID;
- }
- else
- {
- model.TBRID = "";
- }
- var list = SmartForm.MyRecordList(model);
- var json = Strings.ObjectToJson(list);
- return Content(json, "application/json");
- }
-
- /// <summary>
- /// 表单预览
- /// </summary>
- /// <returns></returns>
- public ActionResult MobileSmartDetailPreview(string id)
- {
- ViewBag.ID = id;
- return View();
- }
- /// <summary>
- /// 编辑表单记录
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult EditMobileSmartDetail(string id)
- {
- ViewBag.ID = id;
- return View();
- }
-
- #endregion
- }
- }
|