123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using QM.KJGH.CGGL.IRepository;
- using QM.KJGH.CGGL.Model.Cggl;
- using QM.KJGH.Model.KJGH;
- using QM.OrmSqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using WS.AutoMapper;
- namespace QM.KJGH.CGGL.Repository
- {
- /// <summary>
- ///
- /// </summary>
- public class CgglScyjRepository : SqlSugarRepository<CgglScyj>, ICgglScyjRepository
- {
- private ICgglScxmRepository _ICgglScxmRepository;
- public CgglScyjRepository(ICgglScxmRepository ICgglScxmRepository)
- {
- _ICgglScxmRepository = ICgglScxmRepository;
- }
- /// <summary>
- /// 添加审查意见
- /// </summary>
- /// <returns></returns>
- public async Task<bool> Add(CgglScyjDto dto, string currUser)
- {
- var model = dto.MapTo<CgglScyj>();
- model.BSM = Guid.NewGuid().ToString("N");
- model.SCYH = currUser;
- model.SCSJ = DateTime.Now;
- var result = await InsertAsync(model);
- var db = DbClient();
- if (dto.STATUS == 1)
- {
- await _ICgglScxmRepository.AuditCompleted(dto.CG_BSM, "退回");
- }
- return result == null ? false : true;
- }
- /// <summary>
- /// 根据成果编号查询审查列表
- /// </summary>
- /// <param name="cgbsm"></param>
- /// <returns></returns>
- public async Task<List<CgglScyjView>> QueryList(string cgbsm)
- {
- var result = (await GetListAsync(u => u.CG_BSM == cgbsm)).MapTo<CgglScyj, CgglScyjView>();
- return result;
- }
- }
- }
|