Ejemplo n.º 1
0
 public void SaveApplyForm(string keyValue, HighRiskCommonApplyEntity entity)
 {
     try
     {
         service.SaveApplyForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="entity"></param>
 public void UpdateForm(HighRiskCommonApplyEntity entity)
 {
     try
     {
         service.UpdateForm(entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 转交短消息
        /// </summary>
        /// <param name="keyValue"></param>
        public void TransformSendMessage(TransferrecordEntity entity)
        {
            //1、判断当前是措施确认还是审批阶段
            Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current();
            HighRiskCommonApplyEntity commonEntity = service.GetEntity(entity.RecId);
            string          moduleName             = GetModuleName(commonEntity);
            PushMessageData pushdata = new PushMessageData();

            if (commonEntity.FlowName == "确认中")
            {
                //措施确认转交
                pushdata.SendCode = "ZY001";
            }
            else
            {
                //审核转交
                pushdata.SendCode = "ZY002";
            }
            //极光推送
            pushdata.EntityId    = commonEntity.Id;
            pushdata.UserAccount = entity.InTransferUserAccount;
            PushMessageForCommon(pushdata);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 确认,审核
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="state"></param>
 /// <param name="recordData"></param>
 /// <param name="entity"></param>
 /// <param name="aentity"></param>
 public void SubmitCheckForm(string keyValue, string state, string recordData, HighRiskCommonApplyEntity entity, ScaffoldauditrecordEntity aentity)
 {
     try
     {
         PushMessageData pushdata = service.SubmitCheckForm(keyValue, state, recordData, entity, aentity);
         if (pushdata != null)
         {
             if (pushdata.Success == 1 && !string.IsNullOrEmpty(pushdata.SendCode))
             {
                 pushdata.Content = getName(entity.WorkType, "CommonType");
                 if (pushdata.SendCode == "ZY003")
                 {
                     pushdata.Content = "您提交的" + pushdata.Content + "申请未通过,请及时处理。";
                     var high = GetEntity(entity.Id);
                     if (high != null)
                     {
                         UserEntity userEntity = userservice.GetEntity(high.CreateUserId);
                         if (userEntity != null)
                         {
                             JPushApi.PushMessage(userEntity.Account, userEntity.RealName, pushdata.SendCode, "", pushdata.Content, pushdata.EntityId);
                         }
                     }
                 }
                 else if (pushdata.SendCode == "ZY018")
                 {
                     var high = GetEntity(entity.Id);
                     if (high != null)
                     {
                         String CommonType = pushdata.Content;
                         pushdata.Content = "作业内容:" + high.WorkContent + "&#10;作业时间:" + high.WorkStartTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + " 到 " + high.WorkEndTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + "&#10;作业地点:" + high.WorkPlace;
                         UserEntity userEntity         = userservice.GetEntity(high.CreateUserId);
                         UserEntity tutelageuserEntity = userservice.GetEntity(high.WorkTutelageUserId);
                         string[]   workuserlist       = (high.WorkDutyUserId + "," + high.WorkUserIds).Split(',');
                         //List<string> b = workuserlist.ToList();
                         //b.Add(high.WorkDutyUserId);
                         //workuserlist = b.ToArray();
                         DataTable dutyuserDt = new DataTable();
                         dutyuserDt = userservice.GetUserTable(workuserlist);
                         //推送给作业申请人
                         if (userEntity != null)
                         {
                             JPushApi.PushMessage(userEntity.Account, userEntity.RealName, pushdata.SendCode, "高风险作业(" + CommonType + ")申请已通过,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                         //推送给作业负责人/作业人
                         if (dutyuserDt.Rows.Count > 0)
                         {
                             string Account  = "";
                             string RealName = "";
                             foreach (DataRow item in dutyuserDt.Rows)
                             {
                                 Account  += item["account"].ToString() + ",";
                                 RealName += item["realname"].ToString() + ",";
                             }
                             if (!string.IsNullOrEmpty(Account))
                             {
                                 Account  = Account.Substring(0, Account.Length - 1);
                                 RealName = RealName.Substring(0, RealName.Length - 1);
                             }
                             JPushApi.PushMessage(Account, RealName, pushdata.SendCode, "您有一条新的高风险作业(" + CommonType + ")任务,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                         //推送给作业监护人
                         if (tutelageuserEntity != null)
                         {
                             JPushApi.PushMessage(tutelageuserEntity.Account, tutelageuserEntity.RealName, pushdata.SendCode, "您有一条新的高风险作业(" + CommonType + ")监护任务,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                     }
                 }
                 else
                 {
                     //极光推送
                     PushMessageForCommon(pushdata);
                 }
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取审核流程名称
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public string GetModuleName(HighRiskCommonApplyEntity entity)
 {
     return(service.GetModuleName(entity));
 }