|
@@ -26,8 +26,9 @@ namespace OASystem.API.Controllers
|
|
private readonly AirTicketAgentRepository _airTicketAgentRep;
|
|
private readonly AirTicketAgentRepository _airTicketAgentRep;
|
|
private readonly InvitationOfficialActivityDataRepository _InvitationOfficialActivityDataRep;
|
|
private readonly InvitationOfficialActivityDataRepository _InvitationOfficialActivityDataRep;
|
|
private readonly OfficialActivitiesRepository _officialActivitiesRep;
|
|
private readonly OfficialActivitiesRepository _officialActivitiesRep;
|
|
|
|
+ private readonly SqlSugarClient _sqlSugar;
|
|
|
|
|
|
- public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
|
|
|
|
|
|
+ public ResourceController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, CarDataRepository carDataRep,
|
|
LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
|
|
LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
|
|
HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
|
|
HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
|
|
CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
|
|
CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
|
|
@@ -35,6 +36,7 @@ namespace OASystem.API.Controllers
|
|
{
|
|
{
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
_config = config;
|
|
_config = config;
|
|
|
|
+ _sqlSugar = sqlSugar;
|
|
_carDataRep = carDataRep;
|
|
_carDataRep = carDataRep;
|
|
_localGuideDataRep = localGuideDataRep;
|
|
_localGuideDataRep = localGuideDataRep;
|
|
_ThreeCodeRep = threeCodeRep;
|
|
_ThreeCodeRep = threeCodeRep;
|
|
@@ -1454,6 +1456,20 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
}
|
|
}
|
|
|
|
|
|
#region 公务出访
|
|
#region 公务出访
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 获取团组所有信息,绑定下拉框
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> GetGroupAllList(OfficialActivitiesByDiIdDto dto)
|
|
|
|
+ {
|
|
|
|
+ List<Grp_DelegationInfo> _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(a => a.IsDel == 0).OrderBy(a => a.CreateTime, OrderByType.Desc).ToList();
|
|
|
|
+ List<Sys_SetData> data = await _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToListAsync();
|
|
|
|
+ List<Grp_DeleFile> _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel==0 && a.Category== 970).ToList();
|
|
|
|
+ return Ok(JsonView(true, "查询成功!", new { Delegation=_DelegationInfos,SetData=data, DeleFile= _DeleFile }));
|
|
|
|
+ }
|
|
[HttpPost]
|
|
[HttpPost]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> QueryOfficialActivitiesByDiId(OfficialActivitiesByDiIdDto dto)
|
|
public async Task<IActionResult> QueryOfficialActivitiesByDiId(OfficialActivitiesByDiIdDto dto)
|
|
@@ -1521,6 +1537,60 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> UploadOfficialActivities(IFormFile file)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ int Type =int.Parse(Request.Headers["Type"]);//1公务方简介,2公务活动图片,3发票
|
|
|
|
+ int DiId= int.Parse(Request.Headers["DiId"]);
|
|
|
|
+ int CreateUserId= DiId = int.Parse(Request.Headers["CreateUserId"]);
|
|
|
|
+ if (file != null)
|
|
|
|
+ {
|
|
|
|
+ var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
|
|
|
|
+ //文件名称
|
|
|
|
+ string projectFileName = file.FileName;
|
|
|
|
+
|
|
|
|
+ //上传的文件的路径
|
|
|
|
+ string filePath = "";
|
|
|
|
+ if (!Directory.Exists(fileDir))
|
|
|
|
+ {
|
|
|
|
+ Directory.CreateDirectory(fileDir);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //上传的文件的路径
|
|
|
|
+ filePath = fileDir + $@"\商邀相关文件\{projectFileName}";
|
|
|
|
+ using (FileStream fs = System.IO.File.Create(filePath))
|
|
|
|
+ {
|
|
|
|
+ file.CopyTo(fs);
|
|
|
|
+ fs.Flush();
|
|
|
|
+ }
|
|
|
|
+ Grp_DeleFile d = new Grp_DeleFile();
|
|
|
|
+ d.Diid = DiId;
|
|
|
|
+ d.Category = 970;
|
|
|
|
+ if (Type == 1) d.Kind = 1;
|
|
|
|
+ else if (Type == 2) d.Kind = 2;
|
|
|
|
+ else if (Type == 3) d.Kind = 3;
|
|
|
|
+ d.FileName = projectFileName;
|
|
|
|
+ d.FilePath = "";
|
|
|
|
+ d.CreateUserId = CreateUserId;
|
|
|
|
+ int id = await _sqlSugar.Insertable(d).ExecuteReturnIdentityAsync();
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true, "上传成功!", projectFileName));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "上传失败!"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|