using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Policy; using System.Text; using System.Threading.Tasks; using AutoMapper; using OASystem.Domain.Entities.Groups; using OASystem.Domain.ViewModels.Groups; using OASystem.Infrastructure.Tools; namespace OASystem.Infrastructure.Repositories.Groups { /// /// 团组接待意见调查 /// 仓储 /// public class OpinionaireRepository : BaseRepository { private readonly IMapper _mapper; private string _url; private string _filePath; private JsonView _jsonView; public OpinionaireRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar) { _mapper = mapper; _url = $"{AppSettingsHelper.Get("GrpFileFtpPath")}OpinionaireElectronicSignature"; _filePath = $"{AppSettingsHelper.Get("GrpFileBasePath")}OpinionaireElectronicSignature"; if (!Directory.Exists(_filePath)) { Directory.CreateDirectory(_filePath); } _jsonView= new JsonView(){Code = 400 ,Msg = "操作失败"}; } /// /// 列表 /// /// /// /// /// public async Task Item(int portType, int diId, int type = 1) { if (portType < 1 || portType > 3) return new JsonView() { Code = 400, Msg = "请传入有效的portType" }; if (diId < 1) return new JsonView() { Code = 400, Msg = "请传入有效的diId!" }; var data = await Query(x => x.IsDel == 0 && x.DiId == diId).ToListAsync(); return _jsonView; } } }