|
@@ -733,7 +733,8 @@ public class SalesServiceImpl implements SalesService {
|
|
ImporterEntity importerEntity = IImporterEntityService.getByCertNo(salesContract.getImporterCertNo());
|
|
ImporterEntity importerEntity = IImporterEntityService.getByCertNo(salesContract.getImporterCertNo());
|
|
if (importerEntity != null) {
|
|
if (importerEntity != null) {
|
|
contractTemplateDto.setBuyer(importerEntity.getEntityName());
|
|
contractTemplateDto.setBuyer(importerEntity.getEntityName());
|
|
- contractTemplateDto.setBuyerEn(getEnValues(importerEntity.getI18n(), "entityName"));
|
|
|
|
|
|
+ contractTemplateDto.setBuyerEn(importerEntity.getEntityName());
|
|
|
|
+ // contractTemplateDto.setBuyerEn(getEnValues(importerEntity.getI18n(), "entityName"));
|
|
}
|
|
}
|
|
EnterpriseDto enterpriseDto = enterpriseService.queryMyEnterprise();
|
|
EnterpriseDto enterpriseDto = enterpriseService.queryMyEnterprise();
|
|
if (DictConstants.EXPORT_TYPE_PROXY.equals(enterpriseDto.getExportType())) {
|
|
if (DictConstants.EXPORT_TYPE_PROXY.equals(enterpriseDto.getExportType())) {
|
|
@@ -788,9 +789,11 @@ public class SalesServiceImpl implements SalesService {
|
|
contractTemplateDto.setRemark(contractTerms.getRemark());
|
|
contractTemplateDto.setRemark(contractTerms.getRemark());
|
|
contractTemplateDto.setRemarkEn(getEnValues(contractTerms.getI18n(), "remark"));
|
|
contractTemplateDto.setRemarkEn(getEnValues(contractTerms.getI18n(), "remark"));
|
|
contractTemplateDto.setPortDeparture(salesContract.getPortDeparture());
|
|
contractTemplateDto.setPortDeparture(salesContract.getPortDeparture());
|
|
- contractTemplateDto.setPortDepartureEn(getEnValues(salesContract.getI18n(), "portDeparture"));
|
|
|
|
|
|
+ // contractTemplateDto.setPortDepartureEn(getEnValues(salesContract.getI18n(), "portDeparture"));
|
|
|
|
+ contractTemplateDto.setPortDepartureEn(salesContract.getPortDeparture());
|
|
contractTemplateDto.setPortDestination(salesContract.getPortDestination());
|
|
contractTemplateDto.setPortDestination(salesContract.getPortDestination());
|
|
- contractTemplateDto.setPortDestinationEn(getEnValues(salesContract.getI18n(), "portDestination"));
|
|
|
|
|
|
+ contractTemplateDto.setPortDestinationEn(salesContract.getPortDestination());
|
|
|
|
+ // contractTemplateDto.setPortDestinationEn(getEnValues(salesContract.getI18n(), "portDestination"));
|
|
contractTemplateDto.setTradeTerms(salesContract.getTradeTerms());
|
|
contractTemplateDto.setTradeTerms(salesContract.getTradeTerms());
|
|
StringBuffer paymentInfo = new StringBuffer();
|
|
StringBuffer paymentInfo = new StringBuffer();
|
|
StringBuffer paymentInfoEn = new StringBuffer();
|
|
StringBuffer paymentInfoEn = new StringBuffer();
|
|
@@ -821,9 +824,11 @@ public class SalesServiceImpl implements SalesService {
|
|
contractTemplateDto.setOpeningBankEn(getEnValues(contractTerms.getI18n(), "openingBank"));
|
|
contractTemplateDto.setOpeningBankEn(getEnValues(contractTerms.getI18n(), "openingBank"));
|
|
if (importerEntity != null) {
|
|
if (importerEntity != null) {
|
|
contractTemplateDto.setBuyerContact(importerEntity.getContactName());
|
|
contractTemplateDto.setBuyerContact(importerEntity.getContactName());
|
|
- contractTemplateDto.setBuyerContactEn(getEnValues(importerEntity.getI18n(), "contactName"));
|
|
|
|
|
|
+ contractTemplateDto.setBuyerContactEn(importerEntity.getContactName());
|
|
|
|
+ // contractTemplateDto.setBuyerContactEn(getEnValues(importerEntity.getI18n(), "contactName"));
|
|
contractTemplateDto.setBuyerAddress(importerEntity.getBusinessAddress());
|
|
contractTemplateDto.setBuyerAddress(importerEntity.getBusinessAddress());
|
|
- contractTemplateDto.setBuyerAddressEn(getEnValues(importerEntity.getI18n(), "businessAddress"));
|
|
|
|
|
|
+ contractTemplateDto.setBuyerAddressEn(importerEntity.getBusinessAddress());
|
|
|
|
+ // contractTemplateDto.setBuyerAddressEn(getEnValues(importerEntity.getI18n(), "businessAddress"));
|
|
contractTemplateDto.setBuyerEmail(importerEntity.getContactEmail());
|
|
contractTemplateDto.setBuyerEmail(importerEntity.getContactEmail());
|
|
}
|
|
}
|
|
if (CollectionUtil.isEmpty(titleInfos)) {
|
|
if (CollectionUtil.isEmpty(titleInfos)) {
|
|
@@ -833,7 +838,7 @@ public class SalesServiceImpl implements SalesService {
|
|
if (titleInfos.size() == 1) {
|
|
if (titleInfos.size() == 1) {
|
|
ContractTermsExtend titleInfo = titleInfos.get(0);
|
|
ContractTermsExtend titleInfo = titleInfos.get(0);
|
|
contractTemplateDto
|
|
contractTemplateDto
|
|
- .setTitleInfo(" " + titleInfo.getTermTitle() + "," + titleInfo.getContent() + "。");
|
|
|
|
|
|
+ .setTitleInfo(" " + titleInfo.getTermTitle() + "," + titleInfo.getContent() + "。");
|
|
String titleInfoEn = getEnValues(titleInfo.getI18n(), "titleInfo");
|
|
String titleInfoEn = getEnValues(titleInfo.getI18n(), "titleInfo");
|
|
String contentEn = getEnValues(titleInfo.getI18n(), "titleInfo");
|
|
String contentEn = getEnValues(titleInfo.getI18n(), "titleInfo");
|
|
contractTemplateDto.setTitleInfoEn("\n " + titleInfoEn + "," + contentEn + ".");
|
|
contractTemplateDto.setTitleInfoEn("\n " + titleInfoEn + "," + contentEn + ".");
|
|
@@ -845,7 +850,7 @@ public class SalesServiceImpl implements SalesService {
|
|
String titleInfoEn = getEnValues(titleInfo.getI18n(), "termTitle");
|
|
String titleInfoEn = getEnValues(titleInfo.getI18n(), "termTitle");
|
|
String contentEn = getEnValues(titleInfo.getI18n(), "content");
|
|
String contentEn = getEnValues(titleInfo.getI18n(), "content");
|
|
title.append("\n");
|
|
title.append("\n");
|
|
- title.append(" (").append(i + 1).append(")").append(titleInfo.getTermTitle()).append(",")
|
|
|
|
|
|
+ title.append(" (").append(i + 1).append(")").append(titleInfo.getTermTitle()).append(",")
|
|
.append(titleInfo.getContent()).append(";").append("\n");
|
|
.append(titleInfo.getContent()).append(";").append("\n");
|
|
titleEn.append("\n");
|
|
titleEn.append("\n");
|
|
titleEn.append(" (").append(i + 1).append(")").append(titleInfoEn).append(",").append(contentEn)
|
|
titleEn.append(" (").append(i + 1).append(")").append(titleInfoEn).append(",").append(contentEn)
|
|
@@ -992,8 +997,14 @@ public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
private String getEnValues(Map<String, List<Map<String, String>>> i18n, String fieldName) {
|
|
private String getEnValues(Map<String, List<Map<String, String>>> i18n, String fieldName) {
|
|
if (CollectionUtil.isNotEmpty(i18n) && CollectionUtil.isNotEmpty(i18n.get(fieldName))) {
|
|
if (CollectionUtil.isNotEmpty(i18n) && CollectionUtil.isNotEmpty(i18n.get(fieldName))) {
|
|
- Map<String, String> measurementUnit = i18n.get(fieldName).get(0);
|
|
|
|
- return measurementUnit.get("value");
|
|
|
|
|
|
+ List<Map<String, String>> measurementUnits = i18n.get(fieldName);
|
|
|
|
+ if (CollectionUtil.isNotEmpty(measurementUnits)) {
|
|
|
|
+ Map<String, String> measurementUnit = measurementUnits.stream()
|
|
|
|
+ .filter(m -> "en".equals(m.get("language"))).findFirst().orElse(null);
|
|
|
|
+ if (measurementUnit != null) {
|
|
|
|
+ return measurementUnit.get("value");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|