| | |
| | | using cylsg.utility.Extend; |
| | | using Cylsg.Filter; |
| | | using ECTESTOA; |
| | | using EzCoreNet.Redis; |
| | | using Furion.LinqBuilder; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | private readonly IOAServices _OAServices; |
| | | private readonly ISqlSugarClient _SugarClient; |
| | | private readonly IEzCoreNetRedisService _ezCoreNetRedisService; |
| | | |
| | | private ECTESTOAPermissions Permissions; |
| | | public CyOSStaffController(IOAServices oaServices, ISqlSugarClient sugarClient) |
| | | public CyOSStaffController(IOAServices oaServices, ISqlSugarClient sugarClient,IEzCoreNetRedisService netRedisService) |
| | | { |
| | | _OAServices = oaServices; |
| | | _SugarClient = sugarClient.AsTenant().GetConnection("ECTESTOADB"); |
| | | _ezCoreNetRedisService = netRedisService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | SearchList = SearchList.And(x => x.MemberId == _OAServices.firmId); |
| | | SearchList = SearchList.And(x => x.PlanType == 3); |
| | | SearchList = SearchList.And(x => x.PlanDataType == 17); |
| | | |
| | | if (!string.IsNullOrEmpty(param.StaffName)) |
| | | { |
| | | SearchList = SearchList.And(x => x.SentStaff.Name.Contains(param.StaffName)); |
| | |
| | | |
| | | } |
| | | } |
| | | if (pram.ApprovalStatus != PlanStatusType.Uncommitted) |
| | | pram.EvaluationContent = _ezCoreNetRedisService.GetYYYMMddAnd4sn(); |
| | | else |
| | | pram.EvaluationContent = ""; |
| | | pram.PlanType = 3;//固定为3 |
| | | pram.MemberId = _OAServices.firmId; |
| | | pram.SentStaffId = Permissions.MemberId; |
| | |
| | | pram.PlanRemark = ""; |
| | | pram.PlanPeople = Permissions.Name; |
| | | pram.PlanComplany = ""; |
| | | pram.PlanStatus = PlanStatusType.unApproval; |
| | | if(pram.PlanStatus!= PlanStatusType.Uncommitted) |
| | | { |
| | | pram.PlanStatus = PlanStatusType.unApproval; |
| | | } |
| | | |
| | | |
| | | pram.ApprovalStaffId = Guid.Empty; |
| | | pram.ApprovalTime=DateTime.Now; |
| | | pram.ApprovalContent = ""; |
| | | pram.EvaluationContent = ""; |
| | | pram.ApprovalContent = ""; |
| | | pram.EvaluationStaffId = Guid.Empty; |
| | | pram.EvaluationTime = DateTime.Now; |
| | | pram.RewardMoney = 0; |
| | |
| | | var data= await _SugarClient.Queryable<OaWorkPlan>().Includes(x=>x.WorkPlanAttachments).Includes(x=>x.OaWorkPlanShenpis).Where(x=>x.Keyid==pram.Keyid&&x.SentStaffId==Permissions.MemberId).FirstAsync(); |
| | | if(data==null) |
| | | throw Oops.Oh("没有权限"); |
| | | if(data.ApprovalStatus!= PlanStatusType.unApproval||data.OaWorkPlanShenpis.Count>0) |
| | | if (data.ApprovalStatus != PlanStatusType.Uncommitted) |
| | | { |
| | | if(data.HoubufapiaoStatus == HoubufapiaoStatusType.HouBuFaPiao&&data.HoubufapiaoStatus== HoubufapiaoStatusType.HouBuFaPiao) |
| | | if (data.ApprovalStatus != PlanStatusType.unApproval || data.OaWorkPlanShenpis.Count > 0) |
| | | { |
| | | //后补发票,只能修改发票和附件 |
| | | await _SugarClient.UpdateNav(data).Include(x => x.WorkPlanAttachments).ExecuteCommandAsync(); |
| | | return true; |
| | | } |
| | | else |
| | | if (data.HoubufapiaoStatus == HoubufapiaoStatusType.HouBuFaPiao && data.HoubufapiaoStatus == HoubufapiaoStatusType.HouBuFaPiao) |
| | | { |
| | | //后补发票,只能修改发票和附件 |
| | | await _SugarClient.UpdateNav(data).Include(x => x.WorkPlanAttachments).ExecuteCommandAsync(); |
| | | return true; |
| | | } |
| | | else |
| | | |
| | | throw Oops.Oh("已经进入审批流程不可修改"); |
| | | |
| | | throw Oops.Oh("已经进入审批流程不可修改"); |
| | | |
| | | } |
| | | } |
| | | |
| | | if (data.RewardResult != pram.RewardResult) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if(data.ApprovalStatus== PlanStatusType.Uncommitted&&pram.ApprovalStatus== PlanStatusType.unApproval) |
| | | { |
| | | //重新提交必须修改新的单号 |
| | | data.EvaluationContent = _ezCoreNetRedisService.GetYYYMMddAnd4sn(); |
| | | data.ApprovalStatus = pram.ApprovalStatus; |
| | | } |
| | | |
| | | |
| | | data.PlanMoney=pram.PlanMoney; |
| | | //摘要 |
| | | data.PlanContent =pram.PlanContent; |