Commit cdb68f95 authored by 刘林's avatar 刘林

fix(jg):证打印标记功能开发

parent b369bcae
...@@ -246,5 +246,5 @@ public class JgUseRegistrationManage extends BaseEntity { ...@@ -246,5 +246,5 @@ public class JgUseRegistrationManage extends BaseEntity {
* 证书是否打印标记 * 证书是否打印标记
*/ */
@TableField("certificate_print_tag") @TableField("certificate_print_tag")
private JSONObject certificatePrintTag; private String certificatePrintTag;
} }
...@@ -603,9 +603,11 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -603,9 +603,11 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
} }
private void handleExportSummaryTable(HttpServletResponse response, JgUseRegistrationManage manage) { private void handleExportSummaryTable(HttpServletResponse response, JgUseRegistrationManage manage) {
JSONObject tagJson = Optional.ofNullable(manage.getCertificatePrintTag()).orElse(new JSONObject()); JSONObject tagJson = Optional.ofNullable(manage.getCertificatePrintTag())
.map(JSONObject::parseObject)
.orElse(new JSONObject());
tagJson.put(EXPORT_SUMMARY_TABLE, 2); tagJson.put(EXPORT_SUMMARY_TABLE, 2);
manage.setCertificatePrintTag(tagJson); manage.setCertificatePrintTag(JSONObject.toJSONString(tagJson));
List<JgUseRegistration> registrations = jgUseRegistrationService.getBaseMapper().selectList( List<JgUseRegistration> registrations = jgUseRegistrationService.getBaseMapper().selectList(
new LambdaQueryWrapper<JgUseRegistration>() new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getUseRegistrationCode, manage.getUseRegistrationCode()) .eq(JgUseRegistration::getUseRegistrationCode, manage.getUseRegistrationCode())
...@@ -625,7 +627,9 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -625,7 +627,9 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
throw new BadRequest("设备信息为空,导出失败!"); throw new BadRequest("设备信息为空,导出失败!");
} }
Map<String, Object> params = buildExportParams(manage, deviceList); Map<String, Object> params = buildExportParams(manage, deviceList);
JSONObject tagJson = new JSONObject(manage.getCertificatePrintTag()); JSONObject tagJson = Optional.ofNullable(manage.getCertificatePrintTag())
.map(JSONObject::parseObject)
.orElse(new JSONObject());
switch (printType) { switch (printType) {
case CERTIFICATE_NORMAL://证 普打 case CERTIFICATE_NORMAL://证 普打
commonService.generateCertificateReport(params, response); commonService.generateCertificateReport(params, response);
...@@ -646,7 +650,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -646,7 +650,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
default: default:
throw new BadRequest("无效的打印类型!"); throw new BadRequest("无效的打印类型!");
} }
manage.setCertificatePrintTag(tagJson); manage.setCertificatePrintTag(JSONObject.toJSONString(tagJson));
} }
private Map<String, Object> buildExportParams(JgUseRegistrationManage manage, List<JSONObject> deviceList) { private Map<String, Object> buildExportParams(JgUseRegistrationManage manage, List<JSONObject> deviceList) {
......
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