Exemplo n.º 1
0
        public ActionResult SaveForm(string keyValue, InvestigateEntity entity)
        {
            //审查信息
            investigatebll.SaveForm(keyValue, entity);

            //审查内容
            string investigatecontent = Request.Form["INVESTIGATECONTENT"].ToString();

            JArray arrData = JArray.Parse(investigatecontent);

            //先删除
            if (!string.IsNullOrEmpty(keyValue))
            {
                investigatecontentbll.RemoveFormByRecId(keyValue);
            }

            foreach (string str in arrData)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    InvestigateContentEntity centity = new InvestigateContentEntity();
                    centity.INVESTIGATEID      = entity.ID;
                    centity.INVESTIGATECONTENT = str.Split(',')[0];
                    centity.SORTID             = int.Parse(str.Split(',')[1].ToString());
                    investigatecontentbll.SaveForm("", centity);
                }
            }
            return(Success("操作成功。"));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, InvestigateEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
        public ActionResult SubmitForm(string keyValue, IntromissionEntity entity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string deptid   = string.Empty;
            string deptname = string.Empty;
            string roleid   = string.Empty;
            string rolename = string.Empty;

            bool isMulti = false;

            //保存信息
            entity.INVESTIGATESTATE = "0";
            if (string.IsNullOrEmpty(keyValue))
            {
                entity.APPLYTIME = DateTime.Now;
            }
            intromissionbll.SaveForm(keyValue, entity);

            string moduleName    = "入厂许可审查";
            string outengineerid = entity.OUTENGINEERID;

            //判断是否需要审查(审查配置表)
            var list = investigatebll.GetList(curUser.OrganizeId).Where(p => p.SETTINGTYPE == "入厂许可").ToList();

            ManyPowerCheckEntity mpcEntity = null;

            InvestigateEntity investigateEntity = null;

            bool isUseSetting = true;

            if (list.Count() > 0)
            {
                investigateEntity = list.FirstOrDefault();
            }
            //审查配置不为空
            if (null != investigateEntity)
            {
                //启用审查
                if (investigateEntity.ISUSE == "是")
                {
                    entity.FLOWNAME         = "审查中";
                    entity.INVESTIGATESTATE = "1"; //审查状态

                    //新增审查记录
                    InvestigateRecordEntity rcEntity = new InvestigateRecordEntity();
                    rcEntity.INTOFACTORYID   = entity.ID;
                    rcEntity.INVESTIGATETYPE = "0";//当前记录标识
                    investigaterecordbll.SaveForm("", rcEntity);

                    //获取审查内容
                    var contentList = investigatecontentbll.GetList(investigateEntity.ID).ToList();

                    //批量增加审查内容到审查记录中
                    foreach (InvestigateContentEntity icEntity in contentList)
                    {
                        InvestigateDtRecordEntity dtEntity = new InvestigateDtRecordEntity();
                        dtEntity.INVESTIGATERECORDID  = rcEntity.ID;
                        dtEntity.INVESTIGATECONTENT   = icEntity.INVESTIGATECONTENT;
                        dtEntity.INVESTIGATECONTENTID = icEntity.ID;
                        investigatedtrecordbll.SaveForm("", dtEntity);
                    }
                }
                else  //未启用审查,直接跳转到审核
                {
                    entity.FLOWNAME         = "审核中";
                    entity.INVESTIGATESTATE = "2"; //审核状态
                }
            }
            else
            {
                //如果没有审查配置,直接到审核
                isUseSetting            = false;
                entity.FLOWNAME         = "审核中";
                entity.INVESTIGATESTATE = "2"; //审核状态
            }
            string status = "";

            //更改申请信息状态
            mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out status, moduleName, outengineerid, false, entity.FLOWID);

            if (null != mpcEntity)
            {
                entity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                entity.FLOWROLE     = mpcEntity.CHECKROLEID;
                entity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                entity.FLOWID       = mpcEntity.ID;
                DataTable dt          = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME);
                var       userAccount = dt.Rows[0]["account"].ToString();
                var       userName    = dt.Rows[0]["realname"].ToString();
                JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID);
            }
            else
            {
                entity.FLOWNAME         = "已完结";
                entity.INVESTIGATESTATE = "3"; //完结状态
            }
            intromissionbll.SaveForm(entity.ID, entity);

            //推送到下一个流程
            return(Success("操作成功。"));
        }