| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Runtime.ConstrainedExecution; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using TencentCloud.Hunyuan.V20230901.Models; |
| | | using TencentCloud.Mrs.V20200910.Models; |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.ProductOfflineGetSameCityTemplateResponse.Types.Template.Types; |
| | | |
| | | namespace cylsg.Application.CyOS |
| | | { |
| | |
| | | |
| | | throw Oops.Oh("科目ID RewardResult不能为空"); |
| | | } |
| | | OaSubjectSet? kemu = null; |
| | | OaSubjectSet kemu = null; |
| | | try |
| | | { |
| | | var kemuid= pram.RewardResult.toInt(); |
| | |
| | | Expression<Func<OA_DeliverPlanPaiche, bool>> SearchList = (x) => true; |
| | | SearchList = SearchList.And(x => x.FirmId == _OAServices.firmId); |
| | | SearchList = SearchList.And(x => x.BusinessManagerId == Permissions.KeyId);//只看自己 客户经理是自己 |
| | | SearchList = SearchList.And(x => x.ShifouDelivery !=2);//过滤有效 |
| | | SearchList = SearchList.And(x => x.ShifouDelivery != 2 && x.ShifouDelivery != 0);//过滤有效 |
| | | if (Param.DeliverKeyID!=null) |
| | | { |
| | | SearchList = SearchList.And(x => x.DriverId == Param.DeliverKeyID); |
| | |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | return await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Includes(x => x.Attachments).Includes(x=>x.Driver).Includes(x=>x.DeliverPlans) |
| | | .Where(x => x.BusinessManagerId == Permissions.KeyId && x.Keyid == KeyId && x.ShifouDelivery != 2).FirstAsync(); |
| | | .Where(x => x.BusinessManagerId == Permissions.KeyId && x.Keyid == KeyId && x.ShifouDelivery != 2&&x.ShifouDelivery!=0).FirstAsync(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取问题反馈订单 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<DeliverOderPageRet> GetProblemPlans(DeliverPlanSearchParam Param) |
| | | { |
| | | if (!await CheckRols()) |
| | | { |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | |
| | | Expression<Func<OA_DeliverPlanPaiche, bool>> SearchList = (x) => true; |
| | | SearchList = SearchList.And(x => x.FirmId == _OAServices.firmId); |
| | | SearchList = SearchList.And(x => x.BusinessManagerId == Permissions.KeyId||x.DriverId==Permissions.KeyId);//只看自己 创建的或者是反馈者是自己的 |
| | | SearchList = SearchList.And(x => x.ShifouDelivery ==0);//过滤有效 |
| | | if (Param.DeliverKeyID != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.DriverId == Param.DeliverKeyID); |
| | | } |
| | | //客户名称 |
| | | if (!string.IsNullOrEmpty(Param.CorporateClient)) |
| | | { |
| | | SearchList = SearchList.And(x => x.CompanyName.Contains(Param.CorporateClient)); |
| | | } |
| | | if (Param.TimeStart != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.DeliverTime >= Param.TimeStart.Value.Date); |
| | | } |
| | | if (Param.TimeEnd != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.DeliverTime < Param.TimeEnd.Value.Date.AddDays(1)); |
| | | } |
| | | if (Param.WanjieStatus != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.Wanjiestatus == Param.WanjieStatus); |
| | | |
| | | } |
| | | |
| | | //强制增加员工过滤 |
| | | RefAsync<int> totle = 0; |
| | | var data = await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Includes(x=>x.ZerenrenInfo).Includes(x=>x.Driver) |
| | | .Where(SearchList).OrderByDescending(x => x.CreateTime.Value.Date).OrderBy(x => SqlFunc.Asc(x.Sort)).ToPageListAsync(Param.page.PageIndex, Param.page.PageSize, totle); |
| | | |
| | | Param.page.TotalCount = totle; |
| | | |
| | | |
| | | return new DeliverOderPageRet |
| | | |
| | | { |
| | | Data = data, |
| | | page = Param.page, |
| | | |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取用户反馈单详情 |
| | | /// </summary> |
| | | /// <param name="KeyId"></param> |
| | | /// <returns></returns> |
| | | public async Task<OA_DeliverPlanPaiche> GetProblemPlanInfo(Guid KeyId) |
| | | { |
| | | |
| | | if (!await CheckRols()) |
| | | { |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | return await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Includes(x=>x.ZerenrenInfo).Includes(x=>x.Driver) |
| | | .Where(x => x.Keyid == KeyId && x.ShifouDelivery == 0).FirstAsync(); |
| | | // |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建一个用户反馈详单 |
| | | /// </summary> |
| | | /// <param name="Param"></param> |
| | | /// <returns></returns> |
| | | [LimitFilter(LimiType = Limttype.User, timespan = 5, ResponseMeg = "请勿在5内重复请求", InCount = 1)] |
| | | public async Task<int> CreatProblemPlan(OA_DeliverPlanPaiche Param) |
| | | { |
| | | |
| | | |
| | | if (!await CheckRols()) |
| | | { |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | |
| | | |
| | | |
| | | OA_DeliverPlanPaiche DeliverPlan = new OA_DeliverPlanPaiche() |
| | | { |
| | | Keyid = Guid.NewGuid(), |
| | | FirmId = _OAServices.firmId, |
| | | BuyerId = Param.BuyerId ?? Guid.Empty, |
| | | DeliverTime =DateTime.Now, |
| | | DeliveredTime=DateTime.Now, |
| | | CarId = 0, |
| | | Wentifankui = Param.Wentifankui, |
| | | Xingzhengzhuize = "", |
| | | Yichangchuli = "", |
| | | Zhuyishixiang = "", |
| | | Gongzuokaoping = "", |
| | | |
| | | |
| | | Transferstatus = 1, |
| | | Sort =1 , |
| | | Creater = Param.Creater ?? Permissions.MemberId, |
| | | CreateTime = DateTime.Now, |
| | | DriverId = Param.DriverId, |
| | | SellerOrderId = "", |
| | | Dianhua = "", |
| | | Dizhi = "", |
| | | Remark = Param.Remark, |
| | | BusinessManagerId =Permissions.KeyId, |
| | | Biddingcompany =0, |
| | | ShifouDelivery = 0, |
| | | Lianxiren ="", |
| | | Deliveredstatus = (int)DeliveredType.Undeliver, |
| | | CompanyName = Param.CompanyName, |
| | | Wanjiestatus= WanjieStatusType.UnFinish, |
| | | |
| | | |
| | | |
| | | |
| | | }; |
| | | |
| | | return await _SugarClient.Insertable(DeliverPlan).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除 问题反馈 |
| | | /// </summary> |
| | | /// <param name="keyid"></param> |
| | | /// <returns></returns> |
| | | [HttpDelete] |
| | | public async Task<int > DeleteProblemPlan(Guid keyid) |
| | | { |
| | | |
| | | |
| | | if (!await CheckRols()) |
| | | { |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | var a=await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Where(x => x.Keyid == keyid && x.ShifouDelivery == 0 && x.Wanjiestatus != WanjieStatusType.Finish&&x.BusinessManagerId==Permissions.KeyId).FirstAsync(); |
| | | if(a != null) |
| | | { |
| | | return await _SugarClient.Deleteable(a).ExecuteCommandAsync(); |
| | | } |
| | | throw Oops.Oh("没有权限或者问题已经处理完结"); |
| | | } |
| | | /// <summary> |
| | | /// 判断是否具有权限 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 员工姓名 |
| | | /// </summary> |
| | | public string? StaffName { get; set; } |
| | | public string StaffName { get; set; } |
| | | /// <summary> |
| | | /// 员工Id |
| | | /// </summary> |