|
|
@@ -1911,7 +1911,6 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GroupProcessOperation(GroupProcessOperationDto dto)
|
|
|
{
|
|
|
-
|
|
|
#region 参数验证
|
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数"));
|
|
|
|
|
|
@@ -4695,13 +4694,19 @@ FROM
|
|
|
{ 5, "波兰" },
|
|
|
};
|
|
|
|
|
|
- //申根国
|
|
|
+ /// <summary>
|
|
|
+ /// 申根国
|
|
|
+ /// </summary>
|
|
|
private readonly static string[] _shenGenGuos = new string[] { "奥地利", "比利时", "丹麦", "芬兰", "法国", "德国", "冰岛", "意大利", "希腊", "卢森堡", "荷兰", "挪威", "葡萄牙", "西班牙",
|
|
|
"瑞典", "匈牙利", "捷克", "斯洛伐克", "斯洛文尼亚","波兰","爱沙尼亚","拉脱维亚","立陶宛","马耳他","瑞士","列支敦士登" };
|
|
|
- //欧盟国家
|
|
|
+ /// <summary>
|
|
|
+ /// 欧盟国家
|
|
|
+ /// </summary>
|
|
|
private readonly static string[] _eucountries = new string[] { "奥地利", "比利时", "丹麦", "芬兰", "法国", "德国", "意大利", "希腊", "卢森堡", "荷兰", "葡萄牙", "西班牙","爱尔兰","罗马尼亚",
|
|
|
"保加利亚","匈牙利", "捷克", "斯洛伐克", "斯洛文尼亚","波兰","爱沙尼亚","拉脱维亚","立陶宛","马耳他","瑞士","列支敦士登" };
|
|
|
- //欧洲国家
|
|
|
+ /// <summary>
|
|
|
+ /// 欧洲国家
|
|
|
+ /// </summary>
|
|
|
private readonly static string[] _aBC = new string[] { "英国", "爱尔兰" };
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -5044,8 +5049,8 @@ FROM
|
|
|
|
|
|
break;
|
|
|
case 2: // 日本
|
|
|
- visaTypeName = $"日本签证申请表";
|
|
|
- currTempPath = $"{tempPath}/{visaTypeName}.doc";
|
|
|
+ visaTypeName = $"新办日本申请表";
|
|
|
+ currTempPath = $"{tempPath}/{visaTypeName}.pdf";
|
|
|
|
|
|
var jpnSavePath = $"{fileServerPath}/{visaTypeName}/";
|
|
|
if (!Directory.Exists(fileServerPath)) Directory.CreateDirectory(jpnSavePath);
|
|
|
@@ -5063,196 +5068,312 @@ FROM
|
|
|
var currFamilyInfos = familyInfos.Where(x => x.DcId == custInfo.Id).ToList();
|
|
|
var currCompanyInfos = companyInfos.Where(x => x.DcId == custInfo.Id).ToList();
|
|
|
|
|
|
- #region 日本签证模板书签
|
|
|
- dics.Add("LastNameEn", CommonFun.ConvertToPinyin(custInfo?.LastName?.Trim() ?? "")?.ToLower() ?? "");//姓
|
|
|
- dics.Add("FirstNameEn", CommonFun.ConvertToPinyin(custInfo?.FirstName?.Trim() ?? "")?.ToLower() ?? "");//名
|
|
|
+ #region 生成文件
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(custInfo.OldName)) dics.Add("OldNameEn", custInfo?.OldName ?? "");//名
|
|
|
- else dics.Add("OldNameEn", "无");//名
|
|
|
+ PdfReader reader = null;
|
|
|
+ FileStream templateStream = null;
|
|
|
+ FileStream outputStream = null;
|
|
|
+ PdfStamper stamper = null;
|
|
|
|
|
|
- dics.Add("LastName", custInfo?.LastName ?? "");//姓
|
|
|
- dics.Add("FirstName", custInfo?.FirstName ?? "");//名
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string outputPath = $"{jpnSavePath}{custInfo.LastName}{custInfo.FirstName}.pdf";
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(custInfo.OldName)) dics.Add("OldName", custInfo?.OldName ?? "");//名
|
|
|
- else dics.Add("OldName", "无");//名
|
|
|
+ //读取模板文件
|
|
|
+ templateStream = new FileStream(currTempPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
|
|
+ reader = new PdfReader(templateStream);
|
|
|
|
|
|
- string idCard = idInfo?.CertNo?.Trim() ?? "";
|
|
|
- string birthday = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(idCard))
|
|
|
- {
|
|
|
- string year = idCard.Substring(6, 4);
|
|
|
- string month = idCard.Substring(10, 2);
|
|
|
- string day = idCard.Substring(12, 2);
|
|
|
- birthday = year + "/" + month + "/" + day;
|
|
|
- }
|
|
|
+ //创建输出文件
|
|
|
+ outputStream = new FileStream(outputPath, FileMode.Create, FileAccess.Write);
|
|
|
+ stamper = new PdfStamper(reader, outputStream);
|
|
|
|
|
|
- dics.Add("BirthDay", birthday); //出生日期
|
|
|
- dics.Add("BirthProvince", custInfo?.BirthProvince ?? "");//出生省
|
|
|
- dics.Add("BirthCity", custInfo?.BirthCity ?? "");//出生城市
|
|
|
- dics.Add("Nationality", "中国");//国籍
|
|
|
- dics.Add("Address", custInfo?.Address ?? "");//现居家庭地址
|
|
|
- dics.Add("IdCard", idCard);//身份证号码
|
|
|
- dics.Add("OldNationality", "无");//默认没有
|
|
|
- dics.Add("Tel11", custInfo?.Phone ?? "");//座机
|
|
|
+ AcroFields formFields = stamper.AcroFields;
|
|
|
|
|
|
- //护照
|
|
|
- if (passportInfo != null)
|
|
|
- {
|
|
|
- dics.Add("PassprotNo", passportInfo?.CertNo ?? "");// 护照編號
|
|
|
- dics.Add("PassprotIssuePlase", passportInfo?.Area ?? "");// 护照签发地
|
|
|
- dics.Add("PassprotStartTime", passportInfo?.IssueDt?.ToString("yyyy/MM/dd") ?? "");//护照开始时间
|
|
|
- dics.Add("PassprotEndTime", passportInfo?.ExpiryDt?.ToString("yyyy/MM/dd") ?? "");// 护照过期时间
|
|
|
- }
|
|
|
+ #region 设置文本值
|
|
|
|
|
|
- //得到签证国家下的城市
|
|
|
- string city = "";
|
|
|
- string county = "";
|
|
|
- //ResidenceTime1 机票三字码信息
|
|
|
+ SetFieldValue(formFields, "surname_en", CommonFun.ConvertToPinyin(custInfo?.LastName?.Trim() ?? "")?.ToLower() ?? ""); // 姓 英文
|
|
|
+ SetFieldValue(formFields, "name_en", CommonFun.ConvertToPinyin(custInfo?.FirstName?.Trim() ?? "")?.ToLower() ?? ""); // 名 英文
|
|
|
+ SetFieldValue(formFields, "surname_cn", custInfo?.LastName ?? ""); // 姓 中文
|
|
|
+ SetFieldValue(formFields, "name_cn", custInfo?.FirstName ?? ""); // 名 中文
|
|
|
|
|
|
- var atbc = GeneralMethod.GetTableByBlackCode(groupId);
|
|
|
+ if (!string.IsNullOrEmpty(custInfo.OldName))
|
|
|
+ {
|
|
|
+ SetFieldValue(formFields, "formername_en", CommonFun.ConvertToPinyin(custInfo?.OldName?.Trim() ?? "")?.ToLower() ?? ""); // 出生时姓氏
|
|
|
+ SetFieldValue(formFields, "formername_cn", custInfo.OldName); // 出生时姓氏
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SetFieldValue(formFields, "formername_cn", custInfo.OldName); // 出生时姓氏
|
|
|
+ }
|
|
|
|
|
|
- if (atbc != null)
|
|
|
- {
|
|
|
- string startTime = ""; //开始停留时间
|
|
|
- string endTime = ""; //离开时间
|
|
|
- string three = ""; //航司
|
|
|
- string threeCode = ""; //入境口岸
|
|
|
+ // 出生日期(日-月-年)
|
|
|
+ string idCard = idInfo?.CertNo?.Trim() ?? "";
|
|
|
+ string birthday = string.Empty;
|
|
|
+ if (!string.IsNullOrEmpty(idCard))
|
|
|
+ {
|
|
|
+ string year = idCard.Substring(6, 4);
|
|
|
+ string month = idCard.Substring(10, 2);
|
|
|
+ string day = idCard.Substring(12, 2);
|
|
|
+ birthday = day + "-" + month + "-" + year;
|
|
|
+ }
|
|
|
+ SetFieldValue(formFields, "birthday", birthday);
|
|
|
|
|
|
- for (int i = 0; i < atbc.Rows.Count; i++)
|
|
|
+ string currentNationality = custInfo.BirthProvince + custInfo.BirthCity;
|
|
|
+ SetFieldValue(formFields, "birthplace", currentNationality); // 出生地
|
|
|
+ SetFieldValue(formFields, "nationality", "中国"); // 出生国
|
|
|
+ SetFieldValue(formFields, "previous_nationality", "中国"); // 现国籍
|
|
|
+ SetFieldValue(formFields, "IdNo", idCard); // 身份证号码
|
|
|
+
|
|
|
+ #region 性别处理
|
|
|
+ //清除性别
|
|
|
+ SetFieldValue(formFields, "sex_man", "Off"); // 性别 - 男
|
|
|
+ SetFieldValue(formFields, "sex_woman", "Off"); // 性别 - 女
|
|
|
+ //设置性别
|
|
|
+ if (custInfo.Sex == 0) //男
|
|
|
+ {
|
|
|
+ SetFieldValue(formFields, "sex_man", "Yes"); // 性别 - 男
|
|
|
+ }
|
|
|
+ else if (custInfo.Sex == 1) //女
|
|
|
{
|
|
|
- if (i == 0) //得到抵达日期
|
|
|
+ SetFieldValue(formFields, "sex_woman", "Yes"); // 性别 - 女
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 婚姻状况处理
|
|
|
+ //清除婚姻状况
|
|
|
+ SetFieldValue(formFields, "marriage_single", "Off"); // 婚姻状况 - 未婚
|
|
|
+ SetFieldValue(formFields, "marriage_married", "Off"); // 婚姻状况 - 已婚
|
|
|
+ SetFieldValue(formFields, "marriage_divorce", "Off"); // 婚姻状况 - 离婚
|
|
|
+ SetFieldValue(formFields, "marriage_widowedw", "Off"); // 婚姻状况 - 丧偶
|
|
|
+ //设置婚姻状况
|
|
|
+ switch (custInfo.Marriage)
|
|
|
+ {
|
|
|
+ case 1: // 未婚
|
|
|
+ SetFieldValue(formFields, "marriage_single", "Yes");
|
|
|
+ break;
|
|
|
+ case 2: // 已婚
|
|
|
+ SetFieldValue(formFields, "marriage_married", "Yes");
|
|
|
+ break;
|
|
|
+ case 3: // 离异
|
|
|
+ SetFieldValue(formFields, "marriage_divorce", "Yes");
|
|
|
+ break;
|
|
|
+ case 4: // 离异
|
|
|
+ SetFieldValue(formFields, "marriage_widowedw", "Yes");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 护照(旅行证件类型)
|
|
|
+ //清除值
|
|
|
+ SetFieldValue(formFields, "passport_diplomacy", "Off"); // 旅行证件类型 - 外交护照
|
|
|
+ SetFieldValue(formFields, "passport_official", "Off"); // 旅行证件类型 - 公务护照
|
|
|
+ SetFieldValue(formFields, "passport_ordinary", "Off"); // 旅行证件类型 - 普通护照
|
|
|
+ SetFieldValue(formFields, "passport_other", "Off"); // 旅行证件类型 - 其它
|
|
|
+ //设置值
|
|
|
+ if (passportInfo != null)
|
|
|
+ {
|
|
|
+ // 签证类型
|
|
|
+ var visatypeInfo = await _sqlSugar.Queryable<Sys_SetData>().FirstAsync(x => x.Id == passportInfo.PassportType);
|
|
|
+ if (visatypeInfo != null)
|
|
|
{
|
|
|
- three = atbc.Rows[i]["Fliagtcode"].ToString();
|
|
|
- startTime = atbc.Rows[i]["Day"].ToString();
|
|
|
- threeCode = atbc.Rows[i]["Three"].ToString();
|
|
|
- continue;
|
|
|
+ string visaName = visatypeInfo?.Name ?? "-";
|
|
|
+ if (visaName.contains("外交")) SetFieldValue(formFields, "passport_diplomacy", "Yes"); // 旅行证件类型 - 外交护照
|
|
|
+ else if (visaName.contains("公务")) SetFieldValue(formFields, "passport_official", "Yes"); // 旅行证件类型 - 公务护照
|
|
|
+ else if (visaName.contains("普通")) SetFieldValue(formFields, "passport_ordinary", "Yes"); // 旅行证件类型 - 普通护照
|
|
|
+ else if (visaName.contains("其它")) SetFieldValue(formFields, "passport_other", "Yes"); // 旅行证件类型 - 其它
|
|
|
+ else SetFieldValue(formFields, "passport_ordinary", "Yes"); // 旅行证件类型 - 普通护照
|
|
|
}
|
|
|
- if (i == 1)
|
|
|
- endTime = atbc.Rows[i]["Day"].ToString();
|
|
|
+
|
|
|
+ SetFieldValue(formFields, "passport_no", passportInfo.CertNo); // 签证编号
|
|
|
+ SetFieldValue(formFields, "passport_issuplice", passportInfo.Country + passportInfo.Area); // 签发 国、地区
|
|
|
+ SetFieldValue(formFields, "passport_issuauthority", ""); // 签发机关
|
|
|
+ SetFieldValue(formFields, "passport_issudate", passportInfo.IssueDt?.ToString("yyyy-MM-dd") ?? ""); // 签发日期
|
|
|
+ SetFieldValue(formFields, "passport_validdate", passportInfo.ExpiryDt?.ToString("yyyy-MM-dd") ?? ""); // 有效期至
|
|
|
}
|
|
|
- dics.Add("ResidenceTime1", startTime);
|
|
|
- dics.Add("ResidenceTime2", endTime);
|
|
|
- dics.Add("EntryTime", startTime);
|
|
|
- if (!string.IsNullOrEmpty(three))
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ SetFieldValue(formFields, "certification_number", ""); // 再留资格认证证书编号
|
|
|
+ SetFieldValue(formFields, "residentialstatus_purposetojapan", groupInfo?.VisitPurpose ?? ""); // 居住身份、赴日目的
|
|
|
+
|
|
|
+ // 签证国家下的城市
|
|
|
+ string city = "";
|
|
|
+ string county = "";
|
|
|
+
|
|
|
+ #region 入境信息
|
|
|
+ var atbc = GeneralMethod.GetTableByBlackCode(groupId);
|
|
|
+
|
|
|
+ if (atbc != null)
|
|
|
{
|
|
|
- //查询航司名称
|
|
|
- var threeCodeTwo = three.Substring(0, 2);
|
|
|
- var ac = _sqlSugar.Queryable<Res_AirCompany>().Where(x => x.ShortCode == threeCodeTwo).First();
|
|
|
- if (ac != null)
|
|
|
+ string startTime = string.Empty; // 开始停留时间
|
|
|
+ string endTime = string.Empty; // 离开时间
|
|
|
+ string three = string.Empty; // 航司
|
|
|
+ string threeCode = string.Empty; // 入境口岸
|
|
|
+
|
|
|
+ for (int i = 0; i < atbc.Rows.Count; i++)
|
|
|
{
|
|
|
- dics.Add("AirName", $"{ac?.EnName ?? ""} {three}"); //入境口岸
|
|
|
+ if (i == 0) //得到抵达日期
|
|
|
+ {
|
|
|
+ three = atbc.Rows[i]["Fliagtcode"].ToString();
|
|
|
+ startTime = atbc.Rows[i]["Day"].ToString();
|
|
|
+ threeCode = atbc.Rows[i]["Three"].ToString();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (i == 1)
|
|
|
+ endTime = atbc.Rows[i]["Day"].ToString();
|
|
|
}
|
|
|
-
|
|
|
- var tc = _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.Three == threeCodeTwo).First();
|
|
|
- if (tc != null)
|
|
|
+ dics.Add("japandate_stay", startTime); // 预计逗留日期 起
|
|
|
+ dics.Add("japandate_end", endTime); // 预计逗留日期 止
|
|
|
+ dics.Add("japanduring", startTime); // 预计逗留期间
|
|
|
+ if (!string.IsNullOrEmpty(three))
|
|
|
{
|
|
|
- county = tc.Country;
|
|
|
- city = tc.City;
|
|
|
- dics.Add("PortOfEntry", tc?.City ?? ""); //入境口岸
|
|
|
+ //查询航司名称
|
|
|
+ var threeCodeTwo = three.Substring(0, 2);
|
|
|
+ var ac = _sqlSugar.Queryable<Res_AirCompany>().Where(x => x.ShortCode == threeCodeTwo).First();
|
|
|
+ if (ac != null)
|
|
|
+ {
|
|
|
+ dics.Add("shiporairlinename", $"{ac?.EnName ?? ""} {three}"); // 航司名称
|
|
|
+ }
|
|
|
+
|
|
|
+ var tc = _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.Three == threeCodeTwo).First();
|
|
|
+ if (tc != null)
|
|
|
+ {
|
|
|
+ county = tc.Country;
|
|
|
+ city = tc.City;
|
|
|
+ dics.Add("portentry", tc?.City ?? ""); // 入境口岸
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //团组信息
|
|
|
- if (groupInfo != null)
|
|
|
- {
|
|
|
- dics.Add("Destination", groupInfo?.VisitPurpose ?? ""); //出访目的 Destination2
|
|
|
- //DickeyValue.Add("Destination2", dgi.VisitCountry); //出访目的地
|
|
|
- }
|
|
|
+ #endregion
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(city))
|
|
|
- {
|
|
|
- //得到当前国家下的城市酒店信息
|
|
|
- var hotelInfo = _sqlSugar.Queryable<Grp_HotelReservations>()
|
|
|
- .Where(x => x.DiId == groupId)
|
|
|
- .Where(x => x.City.contains(city))
|
|
|
- .First();
|
|
|
- //酒店住址
|
|
|
- if (hotelInfo != null)
|
|
|
+ #region 申请人酒店信息
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(city))
|
|
|
{
|
|
|
- dics.Add("HotalName", hotelInfo?.HotelName ?? ""); //酒店名称
|
|
|
- dics.Add("HotalAddress", hotelInfo?.HotelAddress ?? ""); //酒店地址
|
|
|
- dics.Add("HotalTel", hotelInfo?.HotelTel ?? ""); //酒店电话
|
|
|
+ //得到当前国家下的城市酒店信息
|
|
|
+ var hotelInfo = _sqlSugar.Queryable<Grp_HotelReservations>()
|
|
|
+ .Where(x => x.DiId == groupId)
|
|
|
+ .Where(x => x.City.contains(city))
|
|
|
+ .First();
|
|
|
+ //酒店住址
|
|
|
+ if (hotelInfo != null)
|
|
|
+ {
|
|
|
+ dics.Add("hotelorfriend_name", hotelInfo?.HotelName ?? ""); // 酒店名称
|
|
|
+ dics.Add("hotelorfriend_tel", hotelInfo?.HotelAddress ?? ""); // 酒店地址
|
|
|
+ dics.Add("hotelorfriend_address", hotelInfo?.HotelTel ?? ""); // 酒店电话
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- dics.Add("Tel", custInfo?.Tel ?? "");//移动电话
|
|
|
- dics.Add("Client", companyInfos?.FirstOrDefault()?.Company ?? "");//单位名称
|
|
|
- dics.Add("ClientPhone", companyInfos?.FirstOrDefault()?.Phone ?? "");//单位电话
|
|
|
- dics.Add("ClientAddress", companyInfos?.FirstOrDefault()?.CompanyAddress ?? "");//单位地址
|
|
|
- dics.Add("Job", custInfo?.Job ?? "");//职务
|
|
|
- dics.Add("MateJob", custInfo?.MateJob ?? "");//配偶职务
|
|
|
|
|
|
- //InvitingPartyInfo RB_IP = new InvitingPartyInfoService().GetAddSelect(int.Parse(ddlTeamNames.SelectedValue), RB_County, RB_City);
|
|
|
+ #endregion
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(county) && !string.IsNullOrEmpty(city))
|
|
|
- {
|
|
|
- var oa = _sqlSugar.Queryable<Res_OfficialActivities>()
|
|
|
- .Where(x => x.IsDel == 0 && x.DiId == groupId)
|
|
|
- .Where(x => x.Country.Contains(county))
|
|
|
- .Where(x => x.Area.Contains(city))
|
|
|
- .First();
|
|
|
+ SetFieldValue(formFields, "japanduring_lasttime", ""); // 上次赴日日期及停留时间
|
|
|
|
|
|
- //邀请 接待单位
|
|
|
- if (oa != null)
|
|
|
- {
|
|
|
- dics.Add("OA12", oa?.Contact ?? ""); //接待单位联系人
|
|
|
- dics.Add("OAJob", oa?.Job ?? ""); //接待联系人职务
|
|
|
- dics.Add("OATel", oa?.Tel ?? ""); //接待单位电话
|
|
|
- dics.Add("OAAddress", oa?.Address ?? "");//接待单位地址
|
|
|
- dics.Add("ApplicantGuanxi", "邀请方"); //和申请人关系
|
|
|
- dics.Add("OACountry", "日本"); //邀请方国家
|
|
|
- dics.Add("OADan", "同上"); // 同上
|
|
|
- dics.Add("OAJob1", "同上"); //接待联系人职务
|
|
|
- dics.Add("OATel1", "同上"); // 同上
|
|
|
- dics.Add("OAAddress1", "同上"); // 同上
|
|
|
- dics.Add("ApplicantGuanxi1", "同上"); // 同上
|
|
|
- dics.Add("OACountry1", "同上"); //邀请方国家
|
|
|
- }
|
|
|
- }
|
|
|
+ #region 家庭信息
|
|
|
|
|
|
- dics.Add("NowTime", DateTime.Now.ToString("yyyy/MM/dd")); //获取当前系统时间
|
|
|
- #endregion
|
|
|
+ SetFieldValue(formFields, "family_address", custInfo.Address); // 地址
|
|
|
+ SetFieldValue(formFields, "family_tel", custInfo.Tel); // 电话
|
|
|
+ SetFieldValue(formFields, "family_phone", custInfo.Phone); // 手机
|
|
|
+ SetFieldValue(formFields, "family_email", custInfo.Email); // 电子邮件
|
|
|
|
|
|
- #region 生成文件
|
|
|
+ #endregion
|
|
|
|
|
|
- try
|
|
|
- {
|
|
|
- Document doc = new(currTempPath);
|
|
|
- Aspose.Words.DocumentBuilder builder = new(doc);
|
|
|
+ #region 工作单位信息
|
|
|
|
|
|
- string strTemp = "";
|
|
|
+ SetFieldValue(formFields, "company_name", companyInfos?.FirstOrDefault()?.Company ?? ""); // 名称
|
|
|
+ SetFieldValue(formFields, "company_tel", companyInfos?.FirstOrDefault()?.Phone ?? ""); // 电话
|
|
|
+ SetFieldValue(formFields, "family_address", companyInfos?.FirstOrDefault()?.CompanyAddress ?? "");// 地址
|
|
|
+ SetFieldValue(formFields, "company_job", custInfo?.Job ?? ""); // 职位
|
|
|
|
|
|
- //循环键值对
|
|
|
- foreach (var key in dics.Keys)
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ SetFieldValue(formFields, "spouseorparents_job", custInfo?.MateJob ?? ""); // 配偶职业(如果是未成年人请填写服务的职业)
|
|
|
+
|
|
|
+ #region 担保人、邀请人 信息
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(county) && !string.IsNullOrEmpty(city))
|
|
|
{
|
|
|
- //将光标移入书签的位置
|
|
|
- builder.MoveToBookmark(key);
|
|
|
+ var oa = _sqlSugar.Queryable<Res_OfficialActivities>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.DiId == groupId)
|
|
|
+ .Where(x => x.Country.Contains(county))
|
|
|
+ .Where(x => x.Area.Contains(city))
|
|
|
+ .First();
|
|
|
|
|
|
- //判断书签值是否为空
|
|
|
- if (!string.IsNullOrEmpty(dics[key]))
|
|
|
+ //邀请 接待单位
|
|
|
+ if (oa != null)
|
|
|
{
|
|
|
- strTemp = dics[key];
|
|
|
+ dics.Add("guarantor_name_en", CommonFun.ConvertToPinyin(oa?.Contact?.Trim() ?? "")?.ToLower() ?? ""); // 担保人姓名(英文)
|
|
|
+ dics.Add("guarantor_name_cn", oa?.Contact ?? ""); // 担保人姓名(中文)
|
|
|
+ dics.Add("guarantor_tel", oa?.Tel ?? ""); // 担保人电话
|
|
|
+ dics.Add("guarantor_address_en", CommonFun.ConvertToPinyin(oa?.Address?.Trim() ?? "")?.ToLower() ?? ""); //担保人地址(英文)
|
|
|
+ dics.Add("guarantor_address_cn", oa?.Address ?? ""); // 担保人地址(中文)
|
|
|
+ dics.Add("guarantor_occuandposition", oa?.Job ?? ""); // 担保人职务
|
|
|
+ dics.Add("guarantor_relationship", "邀请方"); // 和申请人关系
|
|
|
+ dics.Add("guarantor_birthday", ""); // 出生日期
|
|
|
+ dics.Add("guarantor_sex_woman", "Off"); // 性别 女
|
|
|
+ dics.Add("guarantor_sex_man", "Off"); // 性别 男
|
|
|
+ dics.Add("guarantor_nationalityandvisatype", "日本"); // 邀请方 国家
|
|
|
+ dics.Add("inviter_name", "同上"); // 邀请人 姓名
|
|
|
+ dics.Add("inviter_tel", "同上"); // 邀请人 电话
|
|
|
+ dics.Add("inviter_addres", "同上"); // 邀请人 地址
|
|
|
+ dics.Add("inviter_birthday", "同上"); // 邀请人 出生日期
|
|
|
+ dics.Add("inviter_sex_man", "Off"); // 邀请人 性别 女
|
|
|
+ dics.Add("inviter_sex_woman", "Off"); // 邀请人 性别 男
|
|
|
+ dics.Add("inviter_relationship", "同上"); // 邀请人 与申请人关系
|
|
|
+ dics.Add("inviter_occuandposition", "同上"); // 邀请人 职业、职务
|
|
|
+ dics.Add("inviter_nationalityandvisatype", "同上"); // 邀请人 国籍
|
|
|
+ dics.Add("inviter_remark", ""); // 邀请人 备注
|
|
|
}
|
|
|
- else strTemp = "";
|
|
|
-
|
|
|
- //填充书签
|
|
|
- builder.Write(strTemp.Replace("\\N", "\n"));
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
- var custName = custInfo?.LastName + custInfo?.FirstName;
|
|
|
- string fileName = $"{custName}_{visaTypeName}.doc";
|
|
|
+ #region 犯罪信息
|
|
|
+ // 在任何国家曾被判决有罪
|
|
|
+ dics.Add("criminal_conviction_yes", "Off");
|
|
|
+ dics.Add("criminal_conviction_no", "Off");
|
|
|
+ // 在任何国家曾被判处一年或一年以上徒刑
|
|
|
+ dics.Add("felony_conviction_yes", "Off");
|
|
|
+ dics.Add("felony_conviction_no", "Off");
|
|
|
+ // 在任何国家曾因非法滞留或违反改过法律法规而被驱逐出镜
|
|
|
+ dics.Add("deportation_order_yes", "Off");
|
|
|
+ dics.Add("deportation_order_no", "Off");
|
|
|
+ // 因违反毒品相关法律被判刑
|
|
|
+ dics.Add("drug_conviction_yes", "Off");
|
|
|
+ dics.Add("drug_conviction_no", "Off");
|
|
|
+ // 从事或参与卖淫相关活动
|
|
|
+ dics.Add("prostitution_involvement_yes", "Off");
|
|
|
+ dics.Add("prostitution_involvement_no", "Off");
|
|
|
+ // 贩卖人口相关犯罪经历
|
|
|
+ dics.Add("human_trafficking_offense_yes", "Off");
|
|
|
+ dics.Add("human_trafficking_offense_no", "Off");
|
|
|
+
|
|
|
+ //备注
|
|
|
+ dics.Add("yes_remark", "");
|
|
|
|
|
|
- var currFilePath = $"{jpnSavePath}{fileName}";
|
|
|
- doc.Save(currFilePath);
|
|
|
+ #endregion
|
|
|
|
|
|
- filePaths.Add(currFilePath);
|
|
|
+ SetFieldValue(formFields, "application_date", DateTime.Now.ToString("dd/MM/yyyy")); // 申请日期
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ filePaths.Add(outputPath);
|
|
|
+ //return outputPath;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- return Ok(JsonView(false, $"{currTempPath}模板不存在!"));
|
|
|
+ return Ok(JsonView(false, $"生成PDF文件时出错:{ex.Message}"));
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ // 按正确顺序关闭资源
|
|
|
+ stamper?.Close();
|
|
|
+ reader?.Close();
|
|
|
+ templateStream?.Close();
|
|
|
+ outputStream?.Close();
|
|
|
}
|
|
|
#endregion
|
|
|
+
|
|
|
}
|
|
|
|
|
|
break;
|