public ActionResult GetFormJson(string keyValue)
 {
     try
     {
         Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current();
         var      data = suppliesacceptbll.GetEntity(keyValue);
         if (data.Status == 1)
         {
             ManyPowerCheckBLL    bll   = new ManyPowerCheckBLL();
             ManyPowerCheckEntity power = bll.GetListByModuleNo(user.OrganizeCode, "YJWZLYSP").OrderByDescending(t => t.SERIALNUM).FirstOrDefault();
             ManyPowerCheckEntity flow  = bll.GetEntity(data.FlowId);
             if (power != null && power.SERIALNUM == flow.SERIALNUM)
             {
                 data.IsLastAudit = true;
             }
             else
             {
                 data.IsLastAudit = false;
             }
         }
         else
         {
             data.IsLastAudit = false;
         }
         return(ToJsonResult(data));
     }
     catch (System.Exception ex)
     {
         return(Error(ex.ToString()));
     }
 }
        public ActionResult SaveForm(string keyValue, JobApprovalFormEntity entity, [System.Web.Http.FromBody] string arr)
        {
            try
            {
                var str = 0;
                var msg = "";
                if (entity.IsSubmit == 1)
                {
                    var list            = JobApprovalFormbll.GetList("").Where(x => x.IsSubmit == 1).Where(x => x.Id != keyValue).ToList();
                    var JobSafetyCardId = string.Join(",", list.Select(x => x.JobSafetyCardId).ToArray()).Replace(",", "','");
                    if (!string.IsNullOrEmpty(entity.JobSafetyCardId))
                    {
                        var cardId = entity.JobSafetyCardId.TrimEnd(',').Split(',');
                        foreach (var item in cardId)
                        {
                            if (JobSafetyCardId.Contains(item))
                            {
                                str = 1;
                                var Applyentity = jobSafetyCardApplybll.GetEntity(item);
                                msg += Applyentity.JobTypeName + "(" + Applyentity.ApplyNo + "),";
                            }
                        }
                        if (str == 1)
                        {
                            return(Error(msg.TrimEnd(',') + "作业安全证已被关联,请重新选择。"));
                        }
                        else
                        {
                            //获取业务数据关联的逐级审核流程步骤信息
                            Operator user = OperatorProvider.Provider.Current();
                            var      data = manyPowerCheckbll.GetListByModuleNo(user.OrganizeCode, entity.ModuleName);

                            JobApprovalFormbll.SaveForm(keyValue, entity, data, arr);
                            return(Success("操作成功。"));
                        }
                    }
                    else
                    {
                        //获取业务数据关联的逐级审核流程步骤信息
                        Operator user = OperatorProvider.Provider.Current();
                        var      data = manyPowerCheckbll.GetListByModuleNo(user.OrganizeCode, entity.ModuleName);

                        JobApprovalFormbll.SaveForm(keyValue, entity, data, arr);
                        return(Success("操作成功。"));
                    }
                }
                else
                {
                    //获取业务数据关联的逐级审核流程步骤信息
                    Operator user = OperatorProvider.Provider.Current();
                    var      data = manyPowerCheckbll.GetListByModuleNo(user.OrganizeCode, entity.ModuleName);

                    JobApprovalFormbll.SaveForm(keyValue, entity, data, arr);
                    return(Success("操作成功。"));
                }
            }
            catch (Exception ex)
            {
                return(Error("操作失败。" + ex.Message));
            }
        }