打印模板代码提交

master
郑明梁 2 years ago
parent be77e4a07a
commit 986db0079d

@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.File;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -47,6 +48,9 @@ public class SysPdfTemplateController {
List<SystemPDFTemplateResponse> systemPDFTemplateResponseList = systemPDFTemplateEntityList.stream().map(item -> {
SystemPDFTemplateResponse systemPDFTemplateResponse = new SystemPDFTemplateResponse();
BeanUtils.copyProperties(item, systemPDFTemplateResponse);
if(item.getBussinessStatus()!=null){
systemPDFTemplateResponse.setBussinessStatusList(Arrays.asList(item.getBussinessStatus().split(",")));
}
return systemPDFTemplateResponse;
}).collect(Collectors.toList());
@ -115,7 +119,10 @@ public class SysPdfTemplateController {
SystemPDFTemplateEntity systemPDFTemplateEntity = new SystemPDFTemplateEntity();
BeanUtils.copyProperties(sysPdfTemplateSaveRequest, systemPDFTemplateEntity);
if(sysPdfTemplateSaveRequest.getBussinessStatusList().size()>0){
String bussinessStatus = String.join(",", sysPdfTemplateSaveRequest.getBussinessStatusList());
systemPDFTemplateEntity.setBussinessStatus(bussinessStatus);
}
systemPDFTemplateEntity.setCreate_time(new Date());
systemPDFTemplateEntity.setUpdate_time(new Date());
@ -131,6 +138,10 @@ public class SysPdfTemplateController {
@PostMapping("/system/pdf/template/update")
public BaseResponse update(@RequestBody SysPdfTemplateSaveRequest sysPdfTemplateSaveRequest) {
// systemPDFTemplateSaveRequest.setId(1);
if(sysPdfTemplateSaveRequest.getBussinessStatusList().size()>0){
String bussinessStatus = String.join(",", sysPdfTemplateSaveRequest.getBussinessStatusList());
sysPdfTemplateSaveRequest.setBussinessStatus(bussinessStatus);
}
sysPdfTemplateSaveRequest.setUpdate_time(new Date());
systemPDFTemplateService.updateById(sysPdfTemplateSaveRequest);

@ -3,6 +3,7 @@ package com.glxp.api.entity.system;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemPDFTemplateEntity {
@ -19,4 +20,6 @@ public class SystemPDFTemplateEntity {
private Date create_time;
private Date update_time;
private String jrxmlPath;
private Integer bussinessType;
private String bussinessStatus;
}

@ -3,6 +3,7 @@ package com.glxp.api.req.system;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SysPdfTemplateSaveRequest {
@ -19,4 +20,7 @@ public class SysPdfTemplateSaveRequest {
private Date create_time;
private Date update_time;
private String jrxmlPath;
private Integer bussinessType;
private List<String> bussinessStatusList;
private String bussinessStatus;
}

@ -3,6 +3,7 @@ package com.glxp.api.res.system;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemPDFTemplateResponse {
@ -19,4 +20,7 @@ public class SystemPDFTemplateResponse {
private Date create_time;
private Date update_time;
private String jrxmlPath;
private Integer bussinessType;
private String bussinessStatus;
private List<String> bussinessStatusList;
}

@ -5,7 +5,7 @@
<select id="queryPage" parameterType="com.glxp.api.req.system.FilterPdfTemplateRequest"
resultType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
SELECT id,name,type,module,param,path,rowCount,qrcodeCount,remark,create_time,update_time,jrxmlPath
SELECT id,name,type,module,param,path,rowCount,qrcodeCount,remark,create_time,update_time,jrxmlPath,bussinessType,bussinessStatus
FROM sys_pdf_template
<where>
<if test="name != null and '' != name">
@ -46,6 +46,8 @@
<if test="create_time != null">create_time=#{create_time},</if>
<if test="update_time != null">update_time=#{update_time},</if>
<if test="jrxmlPath != null">jrxmlPath=#{jrxmlPath},</if>
<if test="bussinessType != null">bussinessType=#{bussinessType},</if>
<if test="bussinessStatus != null">bussinessStatus=#{bussinessStatus},</if>
</set>
WHERE id=#{id}
@ -54,7 +56,7 @@
<insert id="insert" parameterType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
insert INTO sys_pdf_template(name,
type, module, param, path, rowCount, qrcodeCount, remark, create_time,
update_time, jrxmlPath)
update_time, jrxmlPath,bussinessType,bussinessStatus)
values (#{name},
#{type},
#{module},
@ -64,7 +66,7 @@
#{qrcodeCount},
#{remark},
#{create_time},
#{update_time}, #{jrxmlPath})
#{update_time}, #{jrxmlPath},#{bussinessType},#{bussinessStatus})
</insert>
<select id="listPDFTemplates" parameterType="java.lang.Integer"

Loading…
Cancel
Save