Ejemplo n.º 1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, InvestigateRecordEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 退回添加到历史记录信息
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="arr"></param>
        public void AddBackData(string keyValue, out string newKeyValue)
        {
            //退回的同时保存原始的申请记录
            var dentity = intromissionbll.GetEntity(keyValue); //原始记录
            IntromissionHistoryEntity hentity = new IntromissionHistoryEntity();

            hentity.CREATEUSERID       = dentity.CREATEUSERID;
            hentity.CREATEUSERDEPTCODE = dentity.CREATEUSERDEPTCODE;
            hentity.CREATEUSERORGCODE  = dentity.CREATEUSERORGCODE;
            hentity.CREATEDATE         = dentity.CREATEDATE;
            hentity.CREATEUSERNAME     = dentity.CREATEUSERNAME;
            hentity.MODIFYDATE         = dentity.MODIFYDATE;
            hentity.MODIFYUSERID       = dentity.MODIFYUSERID;
            hentity.MODIFYUSERNAME     = dentity.MODIFYUSERNAME;
            hentity.OUTENGINEERID      = dentity.OUTENGINEERID;
            hentity.INTROMISSIONID     = dentity.ID;
            hentity.APPLYPEOPLEID      = dentity.APPLYPEOPLEID;
            hentity.APPLYPEOPLE        = dentity.APPLYPEOPLE;
            hentity.APPLYTIME          = dentity.APPLYTIME;
            hentity.INVESTIGATESTATE   = dentity.INVESTIGATESTATE;
            hentity.REMARK             = dentity.REMARK;
            hentity.FLOWDEPTNAME       = dentity.FLOWDEPTNAME;
            hentity.FLOWDEPT           = dentity.FLOWDEPT;
            hentity.FLOWROLENAME       = dentity.FLOWROLENAME;
            hentity.FLOWROLE           = dentity.FLOWROLE;
            hentity.FLOWNAME           = dentity.FLOWNAME;
            hentity.FLOWID             = dentity.FLOWNAME;
            intromissionhistorybll.SaveForm("", hentity);

            newKeyValue = hentity.ID;

            //更新审查记录单关联ID
            InvestigateRecordEntity irEntity = investigaterecordbll.GetEntityByIntroKey(keyValue); //审查记录单

            if (null != irEntity)
            {
                irEntity.INTOFACTORYID   = newKeyValue;
                irEntity.INVESTIGATETYPE = "1"; //历史记录标识
                investigaterecordbll.SaveForm(irEntity.ID, irEntity);
            }
        }
Ejemplo 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("操作成功。"));
        }