Пример #1
0
        public async Task <PagedResultDto <LoaiHoSoDto> > GetAllServerPaging(LoaiHoSoInputDto input)
        {
            var query = (from lhs in _LoaiHoSoRepos.GetAll()
                         select new LoaiHoSoDto
            {
                Id = lhs.Id,
                TenLoaiHoSo = lhs.TenLoaiHoSo,
                IsActive = lhs.IsActive,
                MoTa = lhs.MoTa,
                IsXuLy = lhs.IsXuLy,
                QuiTrinhXuLy = lhs.QuiTrinhXuLy,
                PhiXuLy = lhs.PhiXuLy,
                SoNgayXuLy = lhs.SoNgayXuLy,
                DataImage = lhs.DataImage,
                ThuTucId = lhs.ThuTucId,
                IsCoChiTieu = lhs.IsCoChiTieu,
                NiisId = lhs.NiisId,
                SoNgaySuaDoiBoSung = lhs.SoNgaySuaDoiBoSung
            })
                        .WhereIf(!string.IsNullOrEmpty(input.Filter), u => u.TenLoaiHoSo.LocDauLowerCaseDB().Contains(input.Filter.Trim().LocDauLowerCaseDB()) || u.MoTa.LocDauLowerCaseDB().Contains(input.Filter.Trim().LocDauLowerCaseDB()));
            var LoaiHoSoCount = await query.CountAsync();

            var LoaiHoSoGrids = await query
                                .OrderBy(p => p.Id)
                                .PageBy(input)
                                .ToListAsync();

            foreach (var item in LoaiHoSoGrids)
            {
                item.TenThuTuc = item.ThuTucId != null?CommonENum.GetEnumDescription((CommonENum.THU_TUC_ID)(int) item.ThuTucId) : "";
            }

            return(new PagedResultDto <LoaiHoSoDto>(LoaiHoSoCount, LoaiHoSoGrids));
        }
Пример #2
0
        public string SinhSoDangKy(long doanhNghiepId, int thuTucId = 0)
        {
            try
            {
                CommonENum.THU_TUC_ID thuTuc = CommonENum.THU_TUC_ID.THU_TUC_99;
                if (thuTucId > 0)
                {
                    thuTuc = (CommonENum.THU_TUC_ID)thuTucId;
                }

                string strThuTuc = "";
                var    res       = string.Empty;
                if (doanhNghiepId > 0)
                {
                    var doanhNghiepKySoNam = _doanhNghiepRepos.FirstOrDefault(x => x.NamCA == DateTime.Now.Year && x.Id == doanhNghiepId);
                    if (doanhNghiepKySoNam != null)
                    {
                        strThuTuc = CommonENum.GetEnumDescription(thuTuc);
                        var soMoi = SoDangKyMax(doanhNghiepKySoNam, thuTuc) + 1;
                        res = string.Format("{0}/{1}/{2}", soMoi, doanhNghiepKySoNam.MaSoThue, DateTime.Now.Year);
                        UpdateSoDangKyMax(ref doanhNghiepKySoNam, thuTuc, soMoi);
                        _doanhNghiepRepos.Update(doanhNghiepKySoNam);
                    }
                    else
                    {
                        var doanhNghiepNull = _doanhNghiepRepos.FirstOrDefault(x => x.Id == doanhNghiepId);
                        doanhNghiepNull.NamCA = DateTime.Now.Year;

                        #region UpDate Số Thủ tục
                        doanhNghiepNull.SoThuTuc0CA = 0;

                        doanhNghiepNull.SoThuTuc1CA  = 0;
                        doanhNghiepNull.SoThuTuc2CA  = 0;
                        doanhNghiepNull.SoThuTuc3CA  = 0;
                        doanhNghiepNull.SoThuTuc4CA  = 0;
                        doanhNghiepNull.SoThuTuc5CA  = 0;
                        doanhNghiepNull.SoThuTuc6CA  = 0;
                        doanhNghiepNull.SoThuTuc7CA  = 0;
                        doanhNghiepNull.SoThuTuc8CA  = 0;
                        doanhNghiepNull.SoThuTuc9CA  = 0;
                        doanhNghiepNull.SoThuTuc10CA = 0;
                        #endregion

                        strThuTuc = CommonENum.GetEnumDescription(thuTuc);
                        var soMoi = 1;
                        res = string.Format("{0}/{1}/{2}", soMoi, doanhNghiepNull.MaSoThue, DateTime.Now.Year);
                        UpdateSoDangKyMax(ref doanhNghiepNull, thuTuc, 1);
                        _doanhNghiepRepos.Update(doanhNghiepNull);
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        public async Task <List <ThanhToanDto> > GetListThanhToanByHoSoId(int thuTucId = 0, long hoSoId = 0)
        {
            try
            {
                var query = (from tt in _thanhToanRepos.GetAll()
                             where tt.PhanHeId == thuTucId && tt.HoSoId == hoSoId
                             select new ThanhToanDto
                {
                    PhanHeId = tt.PhanHeId,
                    Id = tt.Id,
                    DoanhNghiepId = tt.DoanhNghiepId,
                    HoSoId = tt.HoSoId,
                    GhiChu = tt.GhiChu,
                    KenhThanhToan = tt.KenhThanhToan,
                    PhiDaNop = tt.PhiDaNop,
                    PhiXacNhan = tt.PhiXacNhan,
                    SoTaiKhoanNop = tt.SoTaiKhoanNop,
                    SoTaiKhoanHuong = tt.SoTaiKhoanHuong,
                    MaGiaoDich = tt.MaGiaoDich,
                    MaDonHang = tt.MaDonHang,
                    NgayGiaoDich = tt.NgayGiaoDich,
                    TrangThaiKeToan = tt.TrangThaiKeToan,
                    TrangThaiNganHang = tt.TrangThaiNganHang,
                    TenantId = tt.TenantId,
                    KetQuaGiaoDichJson = tt.KetQuaGiaoDichJson,
                    LyDoHuyThanhToan = tt.LyDoHuyThanhToan,
                    RequestJson = tt.RequestJson,
                    ResponseJson = tt.ResponseJson,
                    ArrHoSoId = tt.ArrHoSoId
                });

                var listTT = await query
                             .OrderBy(x => x.NgayGiaoDich)
                             .ToListAsync();

                foreach (var item in listTT)
                {
                    if (item.KenhThanhToan.HasValue)
                    {
                        var kenhThanhToan = (CommonENum.KENH_THANH_TOAN)item.KenhThanhToan;
                        item.StrKenhThanhToan = CommonENum.GetEnumDescription(kenhThanhToan);
                    }

                    var trangThai = (CommonENum.TRANG_THAI_GIAO_DICH)item.TrangThaiNganHang;
                    item.StrTrangThaiNganHang = CommonENum.GetEnumDescription(trangThai);

                    item.StrNgayGiaoDich = item.NgayGiaoDich.HasValue ? item.NgayGiaoDich.Value.ToString("yyyyMMdd") : string.Empty;
                }

                return(listTT);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <ItemObj <int> > GetVaiTroThamDinhToDDL()
        {
            var _list = new List <ItemObj <int> >();

            foreach (object iEnumItem in Enum.GetValues(typeof(CommonENum.VAI_TRO_THAM_DINH)))
            {
                int iEnum = Convert.ToInt32(iEnumItem);
                _list.Add(new ItemObj <int>
                {
                    Id   = (int)iEnumItem,
                    Name = CommonENum.GetEnumDescription((Enum)Enum.ToObject(typeof(CommonENum.VAI_TRO_THAM_DINH), iEnum))
                });
            }
            return(_list);
        }
Пример #5
0
        public List <ItemObj <int> > GetListChucVuByLoaiTK(int loaiTK)
        {
            var ro_level = GetROLE_LEVELs((LOAI_TAI_KHOAN)loaiTK);
            var _list    = new List <ItemObj <int> >();

            foreach (var item in ro_level)
            {
                _list.Add(new ItemObj <int>()
                {
                    Id   = (int)item,
                    Name = CommonENum.GetEnumDescription(item)
                });
            }
            return(_list);
        }
        public async Task GuiMailThongBaoBoSungHoSo(long hoSoId)
        {
            try
            {
                var hoso = await _hoSoRepos.GetAsync(hoSoId);

                var hosoxl = await _hoSoXuLyRepos.GetAsync(hoso.HoSoXuLyId_Active.Value);

                var subject       = "Thông báo bổ sung hồ sơ";
                var tenancyName   = GetTenancyNameOrNull(_session.TenantId);
                var thuTucStr     = CommonENum.GetEnumDescription((CommonENum.THU_TUC_TEXT)hoso.ThuTucId);
                var emailTemplate = new StringBuilder(_emailTemplateProvider.GetDefaultTemplate(_session.TenantId));
                emailTemplate.Replace("{EMAIL_TITLE}", "Thông báo");
                emailTemplate.Replace("{EMAIL_SUB_TITLE}", "Cục quản lý Y Dược cổ truyền Hà Nội thông báo");

                var doanhNghiep = await _doanhNghiepRepos.GetAsync(hoso.DoanhNghiepId.Value);

                var link            = _webUrlService.GetSiteRootAddress(tenancyName);
                var linkViewCongVan = _webUrlService.GetSiteRootAddress(tenancyName) + "File/GoToViewTaiLieu?url=" + hosoxl.DuongDanTepCA;

                var mailMessage = new StringBuilder();

                mailMessage.AppendLine("<b>" + "Yêu cầu " + doanhNghiep.TenDoanhNghiep + " chỉnh sửa bổ sung hồ sơ " + hoso.MaHoSo + " của thủ tục " + thuTucStr + "</b>" + "<br />");

                if (!String.IsNullOrEmpty(hosoxl.DuongDanTepCA))
                {
                    mailMessage.AppendLine("<b>" + "Nội dung yêu cầu bổ sung vui lòng xem chi tiết tại công văn yêu cầu bổ sung" + "</b>" + "<br />");
                    mailMessage.AppendLine("Click vào link phía dưới để xem công văn yêu cầu bổ sung" + "<br />");
                    mailMessage.AppendLine("<a href=\"" + linkViewCongVan + "\">" + linkViewCongVan + "</a>");
                    mailMessage.AppendLine("<br />");
                }

                mailMessage.AppendLine("Click vào link phía dưới để đăng nhập vào hệ thống" + "<br />");
                mailMessage.AppendLine("<a href=\"" + link + "\">" + link + "</a>");
                emailTemplate.Replace("{EMAIL_BODY}", mailMessage.ToString());

                await _emailSender.SendAsync(doanhNghiep.EmailDoanhNghiep, subject, emailTemplate.ToString());
            }
            catch (Exception ex)
            {
                Logger.Error($"{DateTime.Now.ToString("HH:mm:ss dd/MM/yyyy")} GuiMailThongBaoBoSungHoSo {ex.Message} {JsonConvert.SerializeObject(ex)}");
            }
        }
Пример #7
0
 public List <ItemObj <int> > GetListFormCaseDoanhNghiep()
 {
     try
     {
         var _list = new List <ItemObj <int> >();
         foreach (object iEnumItem in Enum.GetValues(typeof(CommonENum.FORM_CASE_DOANH_NGHIEP)))
         {
             _list.Add(new ItemObj <int>
             {
                 Id   = (int)iEnumItem,
                 Name = CommonENum.GetEnumDescription((CommonENum.FORM_CASE_DOANH_NGHIEP)(int) iEnumItem)
             });
         }
         return(_list);
     }
     catch
     {
         return(null);
     }
 }
Пример #8
0
        public List <DropDownListOutput> GetTrangThaiTraCuu()
        {
            List <DropDownListOutput> objTemList = new List <DropDownListOutput>();

            try
            {
                foreach (object iEnumItem in Enum.GetValues(typeof(CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37)))
                {
                    DropDownListOutput objTem = new DropDownListOutput();
                    objTem.Name = CommonENum.GetEnumDescription((CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37)(int) iEnumItem);
                    objTem.Id   = ((int)iEnumItem);
                    objTemList.Add(objTem);
                }
            }
            catch (Exception ex)
            {
                Logger.Error($"{DateTime.Now.ToString("HH:mm:ss dd/MM/yyyy")} GetTrangThaiTraCuu {ex.Message} {JsonConvert.SerializeObject(ex)}");
            }
            return(objTemList);
        }
Пример #9
0
        public async Task <GetCurrentLoginInformationsOutput> GetCurrentLoginInformations()
        {
            var output = new GetCurrentLoginInformationsOutput
            {
                User = (await GetCurrentUserAsync()).MapTo <UserLoginInfoDto>()
            };

            if (AbpSession.TenantId.HasValue)
            {
                output.Tenant = (await GetCurrentTenantAsync()).MapTo <TenantLoginInfoDto>();
            }

            if (output.User.RoleLevel.HasValue)
            {
                var roleLevel = (CommonENum.ROLE_LEVEL)output.User.RoleLevel;
                output.User.RoleLevelName = CommonENum.GetEnumDescription(roleLevel);
            }
            if (SessionCustom.UserCurrent != null)
            {
                output.User.ThuTucEnum = SessionCustom.UserCurrent.ThuTucEnum;
            }
            return(output);
        }
Пример #10
0
        public async Task <dynamic> QueryBildToKeypay(KeypayDto input)
        {
            try
            {
                if (input != null && input.TenantId.HasValue && input.ThanhToanId.HasValue)
                {
                    var res = await _thanhToanKeyPayAppService.QueryBillStatusV2_MD5(input.TenantId.Value, input.Merchant_trans_id, input.Good_code, input.Trans_time);

                    var    resSplit    = res.Split('|');
                    string _statusCode = "";
                    if (resSplit.Length > 2)
                    {
                        _statusCode = resSplit[1];
                        if (_statusCode == CommonENum.KEYPAY_RESPONSE.THANH_CONG)
                        {
                            var  maDonHangSplit = input.Good_code.Split('.');
                            long hoSoId         = Convert.ToInt64(maDonHangSplit.Last());
                            var  maThuTuc       = maDonHangSplit.First();

                            //THU_TUC_99
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_99))
                            {
                                //await _xuLyHoSoDoanhNghiep99AppService.NopHoSoMoi(hoSoId, true);
                            }
                            #region Thủ Tục hành Chính
                            //THU_TUC_01
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_01))
                            {
                                //await _xuLyHoSoDoanhNghiep01AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_02
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_02))
                            {
                                //await _xuLyHoSoDoanhNghiep02AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_03
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_03))
                            {
                                //await _xuLyHoSoDoanhNghiep03AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_04
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_04))
                            {
                                //await _xuLyHoSoDoanhNghiep04AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_05
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_05))
                            {
                                //await _xuLyHoSoDoanhNghiep05AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_06
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_06))
                            {
                                //await _xuLyHoSoDoanhNghiep06AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_07
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_07))
                            {
                                //await _xuLyHoSoDoanhNghiep07AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_08
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_08))
                            {
                                //await _xuLyHoSoDoanhNghiep08AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_09
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_09))
                            {
                                //await _xuLyHoSoDoanhNghiep09AppService.NopHoSoMoi(hoSoId, true);
                            }
                            //THU_TUC_10
                            if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_10))
                            {
                                //await _xuLyHoSoDoanhNghiep10AppService.NopHoSoMoi(hoSoId, true);
                            }
                            #endregion
                        }
                    }
                    return(new
                    {
                        Status = 1,
                        Data = res,
                        StatusCode = _statusCode
                    });
                }
                return(new
                {
                    Status = 0,
                    Error = true
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #11
0
        public async Task <PagedResultDto <XHoSoDto> > GetListHoSoTraCuuPaging(TraCuuHoSoInput input)
        {
            try
            {
                var query = (from hoso in _hoSoRepos.GetAll()
                             join hsxl in _hoSoXuLyRepos.GetAll() on hoso.HoSoXuLyId_Active equals hsxl.Id
                             join r_dn in _doanhNghiepRepos.GetAll() on hoso.DoanhNghiepId equals r_dn.Id into tb_dn //Left Join
                             from dn in tb_dn.DefaultIfEmpty()
                             where hoso.PId == null
                             select new XHoSoDto
                {
                    Id = hoso.Id,
                    DoanhNghiepId = hoso.DoanhNghiepId,
                    SoDangKy = hoso.SoDangKy,
                    TenDoanhNghiep = hoso.TenDoanhNghiep,
                    TenNguoiDaiDien = hoso.TenNguoiDaiDien,
                    NgaySinh = hoso.NgaySinh,
                    TinhId = (dn != null) ? dn.TinhId : 0,
                    HuyenId = dn.HuyenId,
                    XaId = dn.XaId,
                    StrTinh = (dn != null) ? dn.Tinh : string.Empty,
                    DiaChi = hoso.DiaChi,
                    NgayTraKetQua = hoso.NgayTraKetQua,
                    MaHoSo = hoso.MaHoSo,
                    GiayTiepNhan = hoso.GiayTiepNhan,
                    GiayTiepNhanCA = hsxl.GiayTiepNhanCA,
                    SoGiayTiepNhan = hoso.SoGiayTiepNhan,
                    LoaiHoSoId = hoso.LoaiHoSoId,
                    TrangThaiHoSo = hoso.TrangThaiHoSo,
                    VanThuId = hsxl.VanThuId,
                    ChuyenVienThuLyId = hsxl.ChuyenVienThuLyId,
                    TruongPhongId = hsxl.TruongPhongId,
                    LanhDaoCucId = hsxl.LanhDaoCucId,
                    NgayNopRaSoat = hoso.NgayNopRaSoat,
                    NgayTiepNhan = hsxl.NgayTiepNhan,
                    DonViGui = hsxl.DonViGui,
                    DonViXuLy = hsxl.DonViXuLy,
                    NguoiXuLyId = hsxl.NguoiXuLyId,
                    NguoiGuiId = hsxl.NguoiGuiId,
                    NgayGui = hsxl.NgayGui,



                    HoTenNguoiDeNghi = hoso.HoTenNguoiDeNghi,
                    DiaChiCuTru = hoso.DiaChiCuTru,
                    EmailNguoiDeNghi = hoso.EmailNguoiDeNghi,
                    DienThoaiNguoiDeNghi = hoso.DienThoaiNguoiDeNghi,
                    SoNhanBiet = hoso.SoNhanBiet
                }).WhereIf(input.TinhId.HasValue, x => x.TinhId == input.TinhId)
                            .WhereIf(input.HuyenId.HasValue, x => x.HuyenId == input.HuyenId)
                            .WhereIf(input.XaId.HasValue, x => x.XaId == input.XaId)
                            .WhereIf(input.VanThuId.HasValue, x => x.VanThuId == input.VanThuId)
                            .WhereIf(input.ChuyenVienThuLyId.HasValue, x => x.ChuyenVienThuLyId == input.ChuyenVienThuLyId)
                            .WhereIf(input.TruongPhongId.HasValue, x => x.TruongPhongId == input.TruongPhongId)
                            .WhereIf(input.LanhDaoCucId.HasValue, x => x.LanhDaoCucId == input.LanhDaoCucId)
                            .WhereIf(!String.IsNullOrEmpty(input.HoTenNguoiDeNghi), x => x.HoTenNguoiDeNghi.Contains(input.HoTenNguoiDeNghi))
                            .WhereIf(!String.IsNullOrEmpty(input.MaHoSo), x => x.MaHoSo.Contains(input.MaHoSo))
                            .WhereIf(!String.IsNullOrEmpty(input.MaSoThue), x => x.MaHoSo.Contains(input.MaSoThue))
                            .WhereIf(!String.IsNullOrEmpty(input.DiaChi), x => x.DiaChi.Contains(input.DiaChi));
                var a = query.ToList();

                if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.DA_NOP_HO_SO_MOI)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.DA_NOP_HO_SO_MOI);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.MOT_CUA_DA_TIEP_NHAN)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.MOT_CUA_DA_TIEP_NHAN);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.MOT_CUA_TRA_LAI)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.MOT_CUA_TRA_LAI);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.CHO_TRA_GIAY_TIEP_NHAN)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.CHO_TRA_GIAY_TIEP_NHAN);
                }

                if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.LANH_DAO_DA_PHAN_CONG_HO_SO)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.LANH_DAO_DA_PHAN_CONG_HO_SO);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.PHONG_BAN_TU_CHOI_TIEP_NHAN_HO_SO)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.PHONG_BAN_TU_CHOI_TIEP_NHAN_HO_SO);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.CHUYEN_VIEN_TU_CHOI_TIEP_NHAN_HO_SO)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.CHUYEN_VIEN_TU_CHOI_TIEP_NHAN_HO_SO);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.HO_SO_THAM_XET_LAI)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.HO_SO_THAM_XET_LAI);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.SUA_DOI_BO_SUNG)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.SUA_DOI_BO_SUNG);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.HO_SO_CHO_THAM_DINH)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_THAM_DINH_HO_SO_37.HO_SO_CHO_THAM_DINH);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.TONG_HOP_THAM_DINH_LAI)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_THAM_DINH_HO_SO_37.TONG_HOP_THAM_DINH_LAI);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.HO_SO_TONG_HOP_THAM_DINH_DA_LUU)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_THAM_DINH_HO_SO_37.HO_SO_TONG_HOP_THAM_DINH_DA_LUU);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.LANH_DAO_CUC_DUYET_THAM_DINH)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_THAM_DINH_HO_SO_37.LANH_DAO_CUC_DUYET_THAM_DINH);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.HO_SO_CHO_VAN_THU_TRA_KET_QUA)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_THAM_DINH_HO_SO_37.HO_SO_CHO_VAN_THU_TRA_KET_QUA);
                }

                else if (input.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO_FOR_TRA_CUU_TT37.DA_HOAN_TAT)
                {
                    query = query.Where(x => x.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.DA_HOAN_TAT);
                }


                var _total = await query.CountAsync();

                var dataGrids = await query
                                .OrderByDescending(p => p.NgayTraKetQua)
                                .PageBy(input)
                                .ToListAsync();

                foreach (var item in dataGrids)
                {
                    using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))
                    {
                        if (item.ChuyenVienThuLyId.HasValue)
                        {
                            var chuyenVienThuLyObj = _userRepos.FirstOrDefault(item.ChuyenVienThuLyId.Value);
                            item.ChuyenVienThuLyName = chuyenVienThuLyObj.Surname + " " + chuyenVienThuLyObj.Name;
                        }

                        if (item.NguoiGuiId.HasValue)
                        {
                            var objUser = _userRepos.FirstOrDefault(item.NguoiGuiId.Value);
                            item.TenNguoiGui = objUser.Surname + " " + objUser.Name;
                        }
                        if (item.NguoiXuLyId.HasValue)
                        {
                            var objUser = _userRepos.FirstOrDefault(item.NguoiXuLyId.Value);
                            item.TenNguoiXuLy = objUser.Surname + " " + objUser.Name;
                        }
                    }

                    #region Trạng thái hồ sơ
                    item.StrTrangThai = GetTrangThaiXuLyHoSo(item);
                    #endregion

                    item.StrDonViXuLy = item.DonViXuLy != null?CommonENum.GetEnumDescription((CommonENum.DON_VI_XU_LY)(int) item.DonViXuLy) : "";

                    item.StrDonViGui = item.DonViGui != null?CommonENum.GetEnumDescription((CommonENum.DON_VI_XU_LY)(int) item.DonViGui) : "";
                }

                return(new PagedResultDto <XHoSoDto>(_total, dataGrids));
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex.Message);
                return(null);
            }
        }
Пример #12
0
        public void KeyPayResultIPN()
        {
            var    data   = Request.RequestUri.ParseQueryString();
            Keypay keypay = new Keypay();

            // lấy tham số để truyền vào hàm
            keypay.Merchant_trans_id   = data["merchant_trans_id"];
            keypay.Good_code           = data["good_code"];
            keypay.Trans_id            = data["trans_id"];
            keypay.Merchant_code       = data["merchant_code"];
            keypay.Merchant_secure_key = string.Empty;
            keypay.Bank_code           = data["bank_code"];
            keypay.Command             = data["command"];
            keypay.Nest_code           = data["net_cost"];
            keypay.Response_code       = data["response_code"];
            keypay.Service_code        = data["service_code"];
            keypay.Ship_fee            = data["ship_fee"];
            keypay.Tax          = data["tax"];
            keypay.Current_code = data["currency_code"];
            keypay.Secure_hash  = data["secure_hash"];

            if (!string.IsNullOrEmpty(keypay.Good_code) && keypay.Good_code.Contains("."))
            {
                var arr      = keypay.Good_code.Split('.');
                var maThuTuc = arr.First();

                //THU_TUC_TT-99
                if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_99))
                {
                    _xuLyHoSoDoanhNghiepAppService.UpdateThanhToanKeyPay(keypay, true);
                }
                #region Thủ Tục hành Chính
                //THU_TUC_TT-01
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_01))
                {
                    //_xuLyHoSoDoanhNghiep01AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-02
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_02))
                {
                    //_xuLyHoSoDoanhNghiep02AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-03
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_03))
                {
                    //_xuLyHoSoDoanhNghiep03AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-04
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_04))
                {
                    //_xuLyHoSoDoanhNghiep04AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-05
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_05))
                {
                    //_xuLyHoSoDoanhNghiep05AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-06
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_06))
                {
                    //_xuLyHoSoDoanhNghiep06AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-07
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_07))
                {
                    //_xuLyHoSoDoanhNghiep07AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-08
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_08))
                {
                    //_xuLyHoSoDoanhNghiep08AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                //THU_TUC_TT-09
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_09))
                {
                    //_xuLyHoSoDoanhNghiep09AppService.UpdateThanhToanKeyPay(keypay, true);
                }
                ////THU_TUC_TT-10
                //else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_10))
                //{
                //    _xuLyHoSoDoanhNghiep09AppService.UpdateThanhToanKeyPay(keypay, true);
                //}
                #endregion
            }
        }
Пример #13
0
        public async Task <ActionResult> KeyPayResponse()
        {
            Keypay keypay = new Keypay();

            // lấy tham số để truyền vào hàm
            keypay.Merchant_trans_id = Request.QueryString["merchant_trans_id"];
            keypay.Good_code         = Request.QueryString["good_code"];
            keypay.Trans_id          = Request.QueryString["trans_id"];
            keypay.Merchant_code     = Request.QueryString["merchant_code"];
            //keypay.Merchant_secure_key = string.Empty;
            keypay.Bank_code     = Request.QueryString["bank_code"];
            keypay.Command       = Request.QueryString["command"];
            keypay.Nest_code     = Request.QueryString["net_cost"];
            keypay.Response_code = Request.QueryString["response_code"];
            keypay.Service_code  = Request.QueryString["service_code"];
            keypay.Ship_fee      = Request.QueryString["ship_fee"];
            keypay.Tax           = Request.QueryString["tax"];
            keypay.Current_code  = Request.QueryString["currency_code"];
            keypay.Secure_hash   = Request.QueryString["secure_hash"];
            if (!string.IsNullOrEmpty(keypay.Good_code) && keypay.Good_code.Contains("."))
            {
                var arr      = keypay.Good_code.Split('.');
                var maThuTuc = arr.First();

                //THU_TUC_TT-99
                if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_99))
                {
                    await _xuLyHoSoDoanhNghiepAppService.UpdateThanhToanKeyPay(keypay, false);

                    return(Redirect("/Application#!/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }

                #region Thủ Tục hành Chính

                //THU_TUC_TT-01
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_01))
                {
                    //await _xuLyHoSoDoanhNghiep01AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt01/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-02
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_02))
                {
                    //await _xuLyHoSoDoanhNghiep02AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt02/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-03
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_03))
                {
                    //await _xuLyHoSoDoanhNghiep03AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt03/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-04
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_04))
                {
                    //await _xuLyHoSoDoanhNghiep04AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt04/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-05
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_05))
                {
                    //await _xuLyHoSoDoanhNghiep05AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt05/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-06
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_06))
                {
                    //await _xuLyHoSoDoanhNghiep06AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt06/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-07
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_07))
                {
                    //await _xuLyHoSoDoanhNghiep07AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt07/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-08
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_08))
                {
                    //await _xuLyHoSoDoanhNghiep08AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt08/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                //THU_TUC_TT-09
                else if (maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_09))
                {
                    //await _xuLyHoSoDoanhNghiep09AppService.UpdateThanhToanKeyPay(keypay, false);
                    return(Redirect("/Application#!/tt09/dangkyhoso?kp_statuscode=" + keypay.Response_code));
                }
                ////THU_TUC_TT-10
                //            else if(maThuTuc == CommonENum.GetEnumDescription(THU_TUC_ID.THU_TUC_10))
                //            {
                //                await _xuLyHoSoDoanhNghiep10AppService.UpdateThanhToanKeyPay(keypay, false);
                //                return Redirect("/Application#!/tt10/dangkyhoso?kp_statuscode=" + keypay.Response_code);
                //            }

                #endregion Thủ Tục hành Chính
            }
            return(Redirect("/Application#!/tenant/dashboard"));
        }
Пример #14
0
        public PagedResultDto <HoSoReportDto> GetTraCuuHoSo(HoSoReportInputDto input)
        {
            int total     = 0;
            var dataGrids = new List <HoSoReportDto>();

            try
            {
                var sqlUnionThuTuc = "";
                foreach (int tt in _userCurrent.ThuTucEnum)
                {
                    string maTT        = tt < 10 ? $"0{tt}" : tt.ToString();
                    string thuTucQuery = $@" select {SelectStringSql(tt, input)} from dbo.TT{maTT}_HoSo hs
                    left join dbo.TT{maTT}_HoSoXuLy hsxl on hs.HoSoXuLyId_Active = hsxl.Id
                    where hs.IsDeleted = 0 
                    and hs.PId is null 
                    and  {WhereStringSql(tt, input)} ";
                    sqlUnionThuTuc = string.IsNullOrEmpty(sqlUnionThuTuc) ? thuTucQuery : $"{sqlUnionThuTuc} UNION ALL {thuTucQuery}";
                }
                string sqlQuery = $@"select TotalRows = Count(1) Over(),
                                        A.* from ( {sqlUnionThuTuc} ) as A
                                        order by A.CreationTime
                                        OFFSET (@skip) ROWS
	                                    FETCH NEXT @rows ROWS ONLY; "    ;

                using (var ctx = new AppDbContext())
                {
                    SqlParameter[] prm = ParmeterThuTucReport(input);
                    dataGrids = ctx.Database.SqlQuery <HoSoReportDto>(sqlQuery, prm).ToList();
                    total     = dataGrids.Count > 0 ? dataGrids[0].TotalRows.Value : 0;
                }
                for (int idx = 0; idx < dataGrids.Count; idx++)
                {
                    var item = dataGrids[idx];
                    item.FormId   = input.FormId;
                    item.FormCase = input.FormCase;
                    item          = GetTrangThaiXuLyHoSo(item, input);
                    item          = GetPhongBanPhanCong(item, input);

                    item.StrDonViXuLy = item.DonViXuLy != null?CommonENum.GetEnumDescription((CommonENum.DON_VI_XU_LY)(int) item.DonViXuLy) : "";

                    item.StrDonViGui = item.DonViGui != null?CommonENum.GetEnumDescription((CommonENum.DON_VI_XU_LY)(int) item.DonViGui) : "";

                    using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))
                    {
                        if (item.ChuyenVienThuLyId.HasValue)
                        {
                            var chuyenVienThuLyObj = _userRepos.FirstOrDefault(item.ChuyenVienThuLyId.Value);
                            item.ChuyenVienThuLyName = chuyenVienThuLyObj.Surname + " " + chuyenVienThuLyObj.Name;
                        }
                        if (item.ChuyenVienPhoiHopId.HasValue)
                        {
                            var chuyenVienPhoiHopObj = _userRepos.FirstOrDefault(item.ChuyenVienPhoiHopId.Value);
                            item.ChuyenVienPhoiHopName = chuyenVienPhoiHopObj.Surname + " " + chuyenVienPhoiHopObj.Name;
                        }
                        if (item.NguoiGuiId.HasValue)
                        {
                            var objUser = _userRepos.FirstOrDefault(item.NguoiGuiId.Value);
                            item.TenNguoiGui = objUser.Surname + " " + objUser.Name;
                        }
                        if (item.NguoiXuLyId.HasValue)
                        {
                            var objUser = _userRepos.FirstOrDefault(item.NguoiXuLyId.Value);
                            item.TenNguoiXuLy = objUser.Surname + " " + objUser.Name;
                        }
                    }
                    if (item.IsChiCuc != true)
                    {
                        item.TenChiCuc = "Cục Quản Lý Dược - Bộ Y Tế";
                    }

                    #region Số ngày quá hạn
                    item.SoNgayQuaHan = 0;
                    if (item.TrangThaiHoSo != (int)CommonENum.TRANG_THAI_HO_SO.DA_HOAN_TAT && item.TrangThaiHoSo != (int)CommonENum.TRANG_THAI_HO_SO.SUA_DOI_BO_SUNG && item.NgayHenTra != null)
                    {
                        DateTime ngay_begin = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                        DateTime ngay_end   = new DateTime(item.NgayHenTra.Value.Year, item.NgayHenTra.Value.Month, item.NgayHenTra.Value.Day);
                        if (ngay_begin > ngay_end)
                        {
                            TimeSpan Time = ngay_begin - ngay_end;
                            item.SoNgayQuaHan = Time.Days;
                            item.StrQuaHan    = "Quá hạn " + item.SoNgayQuaHan + " ngày";
                        }
                        else
                        {
                            item.SoNgayQuaHan = _lichLamViecAppService.GetSoNgayLamViec(ngay_begin, ngay_end);
                            item.StrQuaHan    = "Còn " + item.SoNgayQuaHan + " ngày làm việc";
                            item.SoNgayQuaHan = item.SoNgayQuaHan * (-1);
                        }
                    }
                    else if (item.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.SUA_DOI_BO_SUNG)
                    {
                        item.StrQuaHan = "Đã trả công văn (TB)";
                    }
                    else if (item.TrangThaiHoSo == (int)CommonENum.TRANG_THAI_HO_SO.DA_HOAN_TAT)
                    {
                        item.StrQuaHan = "Xử lý xong";
                    }
                    #endregion

                    #region Các phòng ban có thể xử lý (một cửa phân công)
                    if (input.FormId == (int)CommonENum.FORM_ID.FORM_MOT_CUA_PHAN_CONG)
                    {
                        var _listPhongBan = (from ploai in _phongBanLoaiHoSoRepos.GetAll()
                                             join pb in _phongBanRepos.GetAll() on ploai.PhongBanId equals pb.Id
                                             where ploai.LoaiHoSoId == item.LoaiHoSoId
                                             select new ItemDto <int>
                        {
                            Id = pb.Id,
                            Name = pb.TenPhongBan,
                            Checked = false
                        }).ToList();

                        if (item.PhongBanId.HasValue && item.PhongBanId > 0)
                        {
                            foreach (var phongban in _listPhongBan)
                            {
                                if (phongban.Id == item.PhongBanId)
                                {
                                    phongban.Checked = true;
                                }
                            }
                        }

                        item.ArrPhongBanXuLy = _listPhongBan;
                    }
                    #endregion

                    #region Chức năng trên grid

                    List <int> _arrChucNang = new List <int>();

                    //FORM 2
                    if (input.FormId == (int)CommonENum.FORM_ID.FORM_MOT_CUA_PHAN_CONG)
                    {
                        _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.XEM_HO_SO);
                        _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.XEM_BAN_DANG_KY);
                        if (!item.TruongPhongId.HasValue)
                        {
                            _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.MOT_CUA_RA_SOAT_HO_SO);
                        }
                    }

                    //FORM 7
                    if (input.FormId == (int)CommonENum.FORM_ID.FORM_VAN_THU_DUYET)
                    {
                        _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.XEM_HO_SO);
                        _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.XEM_BAN_DANG_KY);

                        if (item.DonViXuLy == (int)CommonENum.DON_VI_XU_LY.VAN_THU)
                        {
                            if (item.HoSoIsDat == true)
                            {
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.VAN_THU_DUYET);
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.VAN_THU_DONG_DAU);
                            }
                            else
                            {
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.XEM_CONG_VAN);
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.VAN_THU_DUYET);
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.VAN_THU_DONG_DAU);
                                _arrChucNang.Add((int)CommonENum.FORM_FUNCTION.VAN_THU_BAO_CAO_CONG_VAN_CO_SAI_SOT);
                            }
                        }
                    }

                    item.ArrChucNang = _arrChucNang;
                    #endregion

                    dataGrids[idx] = item;
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }
            return(new PagedResultDto <HoSoReportDto>(total, dataGrids));
        }