Example #1
0
        public object SaveConfirmation()
        {
            try
            {
                string  res    = ctx.Request["json"];
                dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId = dy.userid;          //当前用户ID
                OperatorProvider.AppUserId = userId; //设置当前用户
                Operator curUser = OperatorProvider.Provider.Current();
                if (null == curUser)
                {
                    return(new { code = -1, count = 0, info = "请求失败,请登录!" });
                }
                string webUrl  = dataitemdetailbll.GetItemValue("imgUrl");
                string signurl = dy.data.signurl;
                SuperviseconfirmationEntity entity = new SuperviseconfirmationEntity();
                entity.SuperviseResult  = dy.data.superviseresult;                                                          //督办结果0同意,1不同意
                entity.SuperviseOpinion = dy.data.superviseopinion;                                                         //督办意见
                entity.SignUrl          = string.IsNullOrWhiteSpace(signurl) ? "" : signurl.Replace(webUrl, "").ToString(); //签名url
                entity.SuperviseId      = dy.data.superviseid;                                                              //主表id
                entity.FeedbackId       = dy.data.feedbackid;                                                               //反馈id
                entity.Flag             = "0";                                                                              //数据状态,0表示当前数据
                entity.ConfirmationDate = Convert.ToDateTime(dy.data.confirmationdate);                                     //确认时间
                superviseconfirmationbll.SaveForm("", entity);
            }
            catch (Exception)
            {
                return(new { code = -1, count = 0, info = "保存失败" });
            }

            return(new { code = 0, count = 0, info = "保存成功" });
        }
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, SuperviseconfirmationEntity entity)
        {
            try
            {
                service.SaveForm(keyValue, entity);

                SafetyworksuperviseBLL announRes = new SafetyworksuperviseBLL();
                var     sl      = announRes.GetEntity(entity.SuperviseId);
                UserBLL userbll = new UserBLL();
                //判断是督办完成还是退回
                if (entity.SuperviseResult == "1")                              //退回
                {
                    UserEntity userEntity = userbll.GetEntity(sl.DutyPersonId); //获取责任人用户信息
                    JPushApi.PushMessage(userEntity.Account, sl.DutyPerson, "GZDB003", "例行安全工作", sl.Id);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
        /// <summary>
        /// 批量确认
        /// </summary>
        /// <param name="SuperviseIds">督办任务ID(多个用逗号分隔)</param>
        /// <param name="result">审核结果(0:同意,1:不同意)</param>
        /// <param name="signImg">签名照片路径</param>
        /// <returns></returns>
        public bool MutilConfirm(string SuperviseIds, string result, string signImg, string remark = "")
        {
            try
            {
                SuperviseconfirmationBLL superviseconfirmationbll = new SuperviseconfirmationBLL();
                DepartmentBLL            departmentBLL            = new DepartmentBLL();
                string sql   = string.Format("update BIS_SAFETYWORKSUPERVISE set FlowState='3',remark='{1}' where id in('{0}')", SuperviseIds.Trim(',').Replace(",", "','"), remark);
                int    count = new DepartmentBLL().ExecuteSql(sql);
                if (count > 0)
                {
                    string[] arr = SuperviseIds.Trim(',').Split(',');
                    foreach (string str in arr)
                    {
                        DataTable dt = departmentBLL.GetDataTable(string.Format(@"select t1.id
 from BIS_SafetyWorkSupervise t left join (select id, superviseid from BIS_SafetyWorkFeedback where flag = '0') t1
on t.id = t1.superviseid left join(select feedbackid from BIS_SuperviseConfirmation where flag = '0') t2 on t1.id = t2.feedbackid
where t.id = '{0}'", str));
                        if (dt.Rows.Count > 0)
                        {
                            SuperviseconfirmationEntity sf = new SuperviseconfirmationEntity
                            {
                                SuperviseResult  = result,
                                ConfirmationDate = DateTime.Now,
                                SignUrl          = signImg,
                                FeedbackId       = dt.Rows[0][0].ToString(),
                                SuperviseId      = str,
                                Flag             = "0"
                            };
                            superviseconfirmationbll.SaveForm(str, sf);
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #4
0
 public ActionResult SaveForm(string keyValue, SuperviseconfirmationEntity entity)
 {
     superviseconfirmationbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }