Commit 650b88ba authored by 刘林's avatar 刘林

fix(JG):标志套打模版修改

parent fceb8160
...@@ -789,17 +789,19 @@ public class CommonServiceImpl implements ICommonService { ...@@ -789,17 +789,19 @@ public class CommonServiceImpl implements ICommonService {
String qrCode = ImageUtils.generateQRCode((String) map.getOrDefault("applyNo", ""), 100, 100); String qrCode = ImageUtils.generateQRCode((String) map.getOrDefault("applyNo", ""), 100, 100);
map.put("supervisoryCode", qrCode); // 监管二维码 代码优化 map.put("supervisoryCode", qrCode); // 监管二维码 代码优化
this.fillParamValueToPdf(map, response,"templates/use-registration-model.pdf","套打使用登记证.pdf"); this.fillParamValueToPdf(map, response,"templates/use-registration-model.pdf","套打使用登记证.pdf",12.0f);
} }
/** /**
* 根据参数填充PDF文本域 * 根据参数填充PDF文本域
* @param map 参数 *
* @param response response * @param map 参数
* @param pathResource PDF模版路径 * @param response response
* @param pathResource PDF模版路径
* @param printFileName 生成文件名称 * @param printFileName 生成文件名称
* @param v
*/ */
private void fillParamValueToPdf(Map<String, Object> map, HttpServletResponse response,String pathResource, String printFileName) { private void fillParamValueToPdf(Map<String, Object> map, HttpServletResponse response, String pathResource, String printFileName, float textSize) {
// 读取资源文件夹下的模板 // 读取资源文件夹下的模板
ClassPathResource resource = new ClassPathResource(pathResource); ClassPathResource resource = new ClassPathResource(pathResource);
...@@ -818,7 +820,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -818,7 +820,7 @@ public class CommonServiceImpl implements ICommonService {
// 设置文本域的字体为中文字体 // 设置文本域的字体为中文字体
acroFields.setFieldProperty(param.getKey(), "textfont", font, null); acroFields.setFieldProperty(param.getKey(), "textfont", font, null);
// 设置字体大小 // 设置字体大小
acroFields.setFieldProperty(param.getKey(), "textsize", 12.0f, null); acroFields.setFieldProperty(param.getKey(), "textsize", textSize, null);
// 将 map 中的值写到 pdf 模板对应的文本域中 // 将 map 中的值写到 pdf 模板对应的文本域中
acroFields.setField(param.getKey(), param.getValue() + ""); acroFields.setField(param.getKey(), param.getValue() + "");
} }
...@@ -1671,7 +1673,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1671,7 +1673,7 @@ public class CommonServiceImpl implements ICommonService {
String qrCode = ImageUtils.generateQRCode(Optional.ofNullable(useFlagParamDto.getApplyNo()).orElse(""), 180, 180); String qrCode = ImageUtils.generateQRCode(Optional.ofNullable(useFlagParamDto.getApplyNo()).orElse(""), 180, 180);
paramMap.put("supervisoryCode", qrCode); paramMap.put("supervisoryCode", qrCode);
this.fillParamValueToPdf(paramMap, response, selectPdfTemplate(useFlagParamDto.getEquListCode()), printFileName); this.fillParamValueToPdf(paramMap, response, selectPdfTemplate(useFlagParamDto.getEquListCode()), printFileName, 9.0f);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment