123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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
- {
- /// <summary>
- /// 团组接待意见调查
- /// 仓储
- /// </summary>
- public class OpinionaireRepository : BaseRepository<Grp_Opinionaire, OpinionaireView>
- {
- 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 = "操作失败"};
- }
- /// <summary>
- /// 列表
- /// </summary>
- /// <param name="portType"></param>
- /// <param name="diId"></param>
- /// <param name="type"></param>
- /// <returns></returns>
- public async Task<JsonView> 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;
- }
- }
- }
|