123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881 |
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc;
- using OASystem.API.OAMethodLib;
- using OASystem.API.OAMethodLib.File;
- using OASystem.Domain;
- using OASystem.Domain.Dtos.Financial;
- using OASystem.Domain.Entities.Groups;
- using OASystem.Domain.ViewModels.Financial;
- using OASystem.Domain.ViewModels.Groups;
- using OASystem.Infrastructure.Repositories.Financial;
- using OASystem.Infrastructure.Repositories.Groups;
- using System.Data;
- namespace OASystem.API.Controllers
- {
- /// <summary>
- /// 财务模块
- /// </summary>
- [Route("api/[controller]/[action]")]
- [ApiController]
- public class FinancialController : ControllerBase
- {
- private readonly IMapper _mapper;
- private readonly IConfiguration _config;
- private readonly SqlSugarClient _sqlSugar;
- private readonly SetDataTypeRepository _setDataTypeRep;
- private readonly DailyFeePaymentRepository _daiRep; //日付申请仓库
- private readonly TeamRateRepository _teamRateRep; //团组汇率仓库
- private readonly ForeignReceivablesRepository _ForForeignReceivablesRep; //对外收款账单仓库
- private readonly ProceedsReceivedRepository _proceedsReceivedRep; //已收款项仓库
- /// <summary>
- /// 初始化
- /// </summary>
- public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep, TeamRateRepository teamRateRep, ForeignReceivablesRepository ForForeignReceivablesRep, ProceedsReceivedRepository proceedsReceivedRep)
- {
- _mapper = mapper;
- _config = configuration;
- _daiRep = daiRep;
- _sqlSugar = sqlSugar;
- _setDataTypeRep = setDataTypeRep;
- _teamRateRep = teamRateRep;
- _ForForeignReceivablesRep = ForForeignReceivablesRep;
- _proceedsReceivedRep = proceedsReceivedRep;
- }
- #region 日付申请
- /// <summary>
- /// 获取日付申请 基础数据源
- /// </summary>
- /// <param name="dto"> 日付申请 分页 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostPageSearchDailyPaymentPriceTypeData(PortDtoBase dto)
- {
- var result = await _daiRep.GetPagePriceTypeData(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- var data = result.Data;
- return Ok(JsonView(data));
- }
-
- /// <summary>
- /// 获取日付申请 基础数据源 - 转账表识
- /// </summary>
- /// <param name="dto"> 日付申请 分页 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> GetSearchDailyPaymentPriceTypeAddData(PortDtoBase dto)
- {
- var result = await _daiRep.GetPriceTypeAddData(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- var data = result.Data;
- return Ok(JsonView(data));
- }
- /// <summary>
- /// 日付申请 Page Search
- /// </summary>
- /// <param name="dto"> 日付申请 分页 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostPageSearchDailyPaymentList(PageDailyFeePaymentDto dto)
- {
- var result = await _daiRep.GetPageSearchAll(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- var data = result.Data;
- if (data == null)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(data));
- }
-
- /// <summary>
- /// 日付申请 Single Search By Id
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostSearchDailyPaymentInfo(SearchDailyFeePaymentDto dto)
- {
- var result = await _daiRep.GetSearchById(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(result.Data));
- }
-
- /// <summary>
- /// 日付申请 添加
- /// </summary>
- /// <param name="dto"> 日付申请 添加 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAddDailyPayment(AddDailyFeePaymentDto dto)
- {
- var result = await _daiRep.Add(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(true));
- }
- /// <summary>
- /// 日付申请 Update
- /// </summary>
- /// <param name="dto"> 日付申请 修改 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostEditDailyPayment(EditDailyFeePaymentDto dto)
- {
- var result = await _daiRep.Edit(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(true));
- }
- /// <summary>
- /// 日付申请 Del
- /// </summary>
- /// <param name="dto"> 日付申请 删除 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostDelDailyPayment(DelDailyFeePaymentDto dto)
- {
- var result = await _daiRep.Del(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(true));
- }
- /// <summary>
- /// 日付申请 财务审核
- /// </summary>
- /// <param name="dto"> dto </param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostDelDailyPaymentAudit(DP_AuditStatusDto dto)
- {
- var result = await _daiRep.DelDailyPaymentAudit(dto);
- if (result == null || result.Code != 0)
- {
- return Ok(JsonView(false, result.Msg));
- }
- return Ok(JsonView(true));
- }
- /// <summary>
- /// 日付申请 Single Excel Download
- /// </summary>
- /// <param name="dto"> dto </param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostExcelDailyPaymentDownload(SearchDailyFeePaymentDto dto)
- {
- if (dto.PortType == 1 || dto.PortType == 2)
- {
- Fin_DailyFeePaymentInfolView feeData = new Fin_DailyFeePaymentInfolView();
- string feeSql = string.Format(@"Select * From Fin_DailyFeePayment
- Where IsDel=0 And Id = {0} ", dto.Id);
- feeData = await _sqlSugar.SqlQueryable<Fin_DailyFeePaymentInfolView>(feeSql).FirstAsync();
- if (feeData == null)
- {
- return Ok(JsonView(false, "暂无数据!"));
- }
- string feeContentSql = string.Format(@"Select * From Fin_DailyFeePaymentContent
- Where IsDel=0 And DFPId = {0} ", dto.Id);
- feeData.FeeContents = await _sqlSugar.SqlQueryable<Fin_DailyFeePaymentContentInfolView>(feeContentSql).ToListAsync();
- if (feeData != null)
- {
- string userName = string.Empty;
- string userSql = string.Format("Select * From Sys_Users Where Id={0} And Isdel = {1}", feeData.CreateUserId, 0);
- Sys_Users user = await _sqlSugar.SqlQueryable<Sys_Users>(userSql).FirstAsync();
- if (user != null) { userName = user.CnName; }
- var setData = _setDataTypeRep.QueryDto<Sys_SetData, Fin_DailyFeePaymentPagePriceSubTypeView>().ToList();
- //48人员费用 49办公费用 50 销售费用 51 其他费用 55 大运会
- var priceSubTypeData = setData.Where(s => s.STid == 55).ToList();
- Dictionary<string, object> pairs = new Dictionary<string, object>();
- List<DataTable> datas = new List<DataTable>();
- //if (priceSubTypeData.Where(s => s.Id == feeData.PriceTypeId).ToList().Count() > 0)//大运会专属模板
- //{
-
- // //AsposeHelper.ExpertExcelToModel("日常费用付款申请模板-大运会数据.xls", "DailyPayment", "大运会所有日常费用付款申请.xls",
- // // pairs, datas);
- //}
- //else //日付常规模板
- //{
- pairs.Clear();
- pairs.Add("Opertor", userName);
- pairs.Add("DateTime", feeData.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"));
- pairs.Add("FAuditStatus", feeData.FAuditDesc);
- pairs.Add("MAuditStatus", feeData.MAuditDesc);
- pairs.Add("SumPrice", feeData.SumPrice);
- DataTable data = AsposeHelper.ListToDataTable("DailyFeePayment", feeData.FeeContents);
- datas.Clear();
- datas.Add(data);
- string fileName = string.Format("{0}-日常费用付款申请.xlsx", feeData.Instructions);
- string msg = AsposeHelper.ExpertExcelToModel("日常费用付款申请模板.xlsx", "DailyPayment", fileName, pairs, datas);
- return Ok(JsonView(true, msg));
- //}
-
- }
- else
- {
- return Ok(JsonView(false, "暂无数据!"));
- }
- }
-
- return Ok(JsonView(true));
- }
- #endregion
- #region 团组提成
- /// <summary>
- /// 提成 Page Search
- /// </summary>
- /// <param name="dto"> 提成 分页 dto</param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostPageSearchCommissionList(GroupCommissionDto dto)
- {
- var data = await GroupCommission.GetCommissionPageList(dto);
- return Ok(JsonView(data.Data));
- }
- #endregion
- #region 团组汇率
- /// <summary>
- /// 团组汇率 Select数据源(团组列,汇率列)
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> GetGroupRateDataSources(TeamRateDto dto)
- {
- try
- {
- Result teamRateData = await _teamRateRep.GetGroupRateDataSource(dto);
- if (teamRateData.Code != 0)
- {
- return Ok(JsonView(false, teamRateData.Msg));
- }
- return Ok(JsonView(true, teamRateData.Msg, teamRateData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- ///// <summary>
- ///// 团组汇率 changge
- ///// </summary>
- ///// <returns></returns>
- //[HttpPost]
- //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- //public async Task<IActionResult> ChangeGroupRateInfo()
- //{
- // try
- // {
- // Result teamRateData = await _teamRateRep.GetGroupRateChangeData();
- // if (teamRateData.Code != 0)
- // {
- // return Ok(JsonView(false, teamRateData.Msg));
- // }
- // return Ok(JsonView(true, teamRateData.Msg, teamRateData.Data));
- // }
- // catch (Exception ex)
- // {
- // return Ok(JsonView(false, ex.Message));
- // throw;
- // }
- //}
- /// <summary>
- /// 团组汇率 Select汇率详情
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> GetGroupRateInfo(TeamRateInfoDto dto)
- {
- try
- {
- Result teamRateData = await _teamRateRep.GetGroupRateInfoByDiid(dto);
- if (teamRateData.Code != 0)
- {
- return Ok(JsonView(false, teamRateData.Msg));
- }
- return Ok(JsonView(true, teamRateData.Msg, teamRateData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 团组汇率 添加 or 更新
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostGroupRateUpdate(TeamRateUpdateDto dto)
- {
- try
- {
- Result teamRateData = await _teamRateRep.PostGroupRateUpdate(dto);
- if (teamRateData.Code != 0)
- {
- return Ok(JsonView(false, teamRateData.Msg));
- }
- return Ok(JsonView(true, teamRateData.Msg, teamRateData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- #endregion
- #region 对外收款账单 关联已收款项
- /// <summary>
- /// 对外收款账单 Select数据源(团组名,币种,汇款方式)
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> GetForeignReceivablesDataSources()
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.GetDataSource();
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 对外收款账单
- /// 账单详情
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> GetGroupReceivablesInfoByDiId(ForForeignReceivablesInfoDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.GetGroupReceivablesInfoByDiId(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 对外收款账单
- /// 账单 删除
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostGroupReceivablesDel(DelForForeignReceivablesInfoDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep._Del(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 对外收款账单
- /// 添加 And 更新
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostReceivablesOperate(ForeignReceivablesAddAndUpdateDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.PostReceivablesOperate(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 已收款项
- /// 账单 删除
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAmountReceivedDel(ProceedsReceivedDelDto dto)
- {
- try
- {
- Result ffrData = await _proceedsReceivedRep._Del(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 已收款项
- /// 添加 And 更新
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAmountReceivedOperate(ProceedsReceivedDto dto)
- {
- try
- {
- Result ffrData = await _proceedsReceivedRep.PostAmountReceivedOperate(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 财务 已收款项
- /// 分配已收款项至 应收项下
- /// 关联已收款项
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAllocateAmountReceived(AllocateAmountReceivedDto dto)
- {
- try
- {
- Result ffrData = await _proceedsReceivedRep.PostAllocateAmountReceived(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- ///// <summary>
- ///// 财务 收款账单
- ///// 导出Word(北京,四川)
- ///// </summary>
- ///// <param name="dto"></param>
- ///// <returns></returns>
- //[HttpPost]
- //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- //public async Task<IActionResult> PostAccountReceivableWordExport(AccountReceivableWordExportDto dto)
- //{
- // try
- // {
- // //模板处理
- // string typeName = string.Empty;
- // if (dto.TemplateType == 1) //四川
- // {
- // typeName = "四川";
- // }
- // else if (dto.TemplateType == 2) //北京
- // {
- // typeName = "北京";
- // }
- // else return Ok(JsonView(false,"请选择正确的模板类型!"));
- // string wordTempName = string.Format("收款账单({0})模板.doc", typeName);
- // }
- // catch (Exception ex)
- // {
- // return Ok(JsonView(false, ex.Message));
- // }
- //}
- #endregion
- #region 对外收款账单
- /// <summary>
- /// 对外收款账单
- /// 数据源
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostGroupReceivablesDataSource()
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.PostDataSource();
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 对外收款账单
- /// 账单详情
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostGroupReceivablesInfoByDiId(ForForeignReceivablesNewDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.PostGroupReceivablesInfoByDiId(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 对外收款账单
- /// 添加 And 更新
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostReceivablesSave(ForeignReceivablesSaveDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.PostReceivablesSave(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- /// <summary>
- /// 已收账单
- /// 删除
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostReceivablesDel(ForeignReceivablesDelDto dto)
- {
- try
- {
- Result ffrData = await _ForForeignReceivablesRep.PostReceivablesDel(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- throw;
- }
- }
- #endregion
- #region 已收款项
- /// <summary>
- /// 已收款项
- /// 查询
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAmountReceived(AmountReceivedDto dto)
- {
- try
- {
- if (dto == null)
- {
- return Ok(JsonView(false, "参数不能为空!"));
- }
- Result ffrData = await _proceedsReceivedRep.PostAmountReceived(dto.DiId );
- dynamic data = null;
- if (dto.PortType == 1)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- data= ffrData.Data;
- }
- else if(dto.PortType == 2)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- data = ffrData.Data;
- }
- else if (dto.PortType == 2)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- data = ffrData.Data;
- }
- else
- {
- return Ok(JsonView(false, "请选择正确的端口号!"));
- }
- return Ok(JsonView(true,"操作成功!", data));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- }
- }
- /// <summary>
- /// 已收款项
- /// Add Or Edit
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAmountReceivedAddOrEdit(AmountReceivedAddOrEditDto dto)
- {
- try
- {
- if (dto == null)
- {
- return Ok(JsonView(false, "参数不能为空!"));
- }
- Result ffrData = await _proceedsReceivedRep.PostAmountReceivedAddOrEditDto(dto);
- if (dto.PortType == 1)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- }
- else if (dto.PortType == 2)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- }
- else if (dto.PortType == 2)
- {
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- }
- else
- {
- return Ok(JsonView(false, "请选择正确的端口号!"));
- }
- return Ok(JsonView(true, "操作成功!"));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- }
- }
- /// <summary>
- /// 已收款项
- /// Del
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost]
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
- public async Task<IActionResult> PostAmountReceived_Del(AmountReceivedDelDto dto)
- {
- try
- {
- if (dto == null)
- {
- return Ok(JsonView(false, "参数不能为空!"));
- }
- Result ffrData = await _proceedsReceivedRep.PostAmountReceivedDel(dto);
- if (ffrData.Code != 0)
- {
- return Ok(JsonView(false, ffrData.Msg));
- }
- return Ok(JsonView(true, "操作成功!"));
- }
- catch (Exception ex)
- {
- return Ok(JsonView(false, ex.Message));
- }
- }
- #endregion
- }
- }
|