Exemplo n.º 1
0
        public IActionResult daiban(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var time    = DateTime.Now;
                var nowdate = time.ToString("yyyy-MM-dd HH:mm:ss");
                var endtime = time.AddDays(+3).ToString("yyyy-MM-dd HH:mm:ss");//紧急为3天
                if (model.Priority == "普通")
                {
                    endtime = time.AddDays(+5).ToString("yyyy-MM-dd HH:mm:ss");//普通为5天
                }
                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);
                entity.AuditStatus  = "0";                //返回状态为办理中
                entity.Accomplish   = "0";                //未完成
                entity.FinishTime   = endtime;
                entity.AuditOpinion = model.auditOpinion; //审核意见
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
Exemplo n.º 2
0
        public IActionResult chongqitask(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);
                entity.Recycle = "0";//状态回到未删状态
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
Exemplo n.º 3
0
        public IActionResult shenheontongguo(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);
                entity.AuditStatus  = "0";                //返回状态为办理中
                entity.AuditOpinion = model.auditOpinion; //审核意见
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
        public IActionResult chongqitasktrue(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);
                entity.Accomplish  = "0"; //任务回到未完成状态
                entity.AuditStatus = "0"; //待审核(任务回到进行中)
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
        public IActionResult create(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                if (model.StartTime.ToString() != "" && model.FinishTime.ToString() != "" && Convert.ToDateTime(model.StartTime) >= Convert.ToDateTime(model.FinishTime))
                {
                    response.SetFailed("任务开始时间不能大于或等于结束时间!");
                    return(Ok(response));
                }

                var entity = new Mission();
                entity.MissionUuid     = Guid.NewGuid();
                entity.PriorityUuid    = Guid.Parse(model.PriorityUUID);               //所属重点工作
                entity.MissionHeadline = model.MissionHeadline;                        //任务标题标题
                entity.Principal       = model.Principal;                              //负责人
                entity.StartTime       = model.StartTime;                              //开始时间
                entity.FinishTime      = model.FinishTime;                             //结束时间
                entity.MissionDescribe = model.MissionDescribe;                        //任务描述
                entity.Priority        = model.Priority;                               //优先级
                entity.Manhour         = model.Manhour;                                //计划工时
                entity.Approver        = model.Approver;                               //审批人
                entity.Participant     = "," + model.Participant;                      //参与人
                entity.EstablishTime   = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"); //创建时间
                entity.EstablishName   = model.establisthtruename;                     //创建人uuid
                entity.Recycle         = "0";                                          //未删除
                entity.AuditStatus     = "0";                                          //审核状态为待审核
                entity.Accomplish      = "0";                                          //完成状态为未完成
                entity.Preserve        = "2";                                          //保存状态为保存到草稿箱
                _dbContext.Mission.Add(entity);                                        //添加
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
Exemplo n.º 6
0
        public IActionResult wanchen(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);


                entity.Remark      = model.Remark;                                 //备注
                entity.AuditStatus = "1";                                          //状态为完成,待审核状态
                entity.Sortord     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //任务完成时间
                entity.Fujian      = model.fujian;                                 //附件
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }
        public IActionResult baocunEdit(taskCreateViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                if (model.StartTime.ToString() != "" && model.FinishTime.ToString() != "" && Convert.ToDateTime(model.StartTime) >= Convert.ToDateTime(model.FinishTime))
                {
                    response.SetFailed("任务开始时间不能大于或等于结束时间!");
                    return(Ok(response));
                }


                var entity = _dbContext.Mission.FirstOrDefault(x => x.MissionUuid == model.MissionUUID);

                entity.PriorityUuid    = Guid.Parse(model.PriorityUUID); //所属重点工作
                entity.MissionHeadline = model.MissionHeadline;          //任务标题标题
                entity.Principal       = model.Principal;                //负责人
                entity.StartTime       = model.StartTime;                //开始时间
                entity.FinishTime      = model.FinishTime;               //结束时间
                entity.MissionDescribe = model.MissionDescribe;          //任务描述
                entity.Priority        = model.Priority;                 //优先级
                entity.Manhour         = model.Manhour;                  //计划工时
                entity.Participant     = model.Participant;              //参与人
                entity.Approver        = model.Approver;                 //审批人
                entity.Participant     = model.Participant.Trim(',');    //参与人
                entity.Preserve        = "1";                            //移除草稿箱
                _dbContext.SaveChanges();
                response = ResponseModelFactory.CreateInstance;
                return(Ok(response));
            }
        }