Commit 8e727980 authored by wujipeng's avatar wujipeng
Browse files

模板新增优化

parent fa780c60
package com.platform.controller; package com.platform.controller;
import com.alibaba.fastjson.JSON;
import com.platform.model.dto.ExcelTemplateDTO; import com.platform.model.dto.ExcelTemplateDTO;
import com.platform.model.resp.Result; import com.platform.model.resp.Result;
import com.platform.model.vo.ExcelTemplateVO; import com.platform.model.vo.ExcelTemplateVO;
...@@ -7,6 +8,7 @@ import com.platform.page.TableDataInfo; ...@@ -7,6 +8,7 @@ import com.platform.page.TableDataInfo;
import com.platform.service.ExcelTemplateService; import com.platform.service.ExcelTemplateService;
import com.platform.utils.DozerUtils; import com.platform.utils.DozerUtils;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -41,6 +43,9 @@ public class ExcelTemplateController extends BaseController { ...@@ -41,6 +43,9 @@ public class ExcelTemplateController extends BaseController {
@ApiOperation(value = "新增编辑") @ApiOperation(value = "新增编辑")
@PostMapping("/save/update") @PostMapping("/save/update")
public Result<Boolean> saveOrUpdate(@RequestBody ExcelTemplateDTO excelTemplateDTO) { public Result<Boolean> saveOrUpdate(@RequestBody ExcelTemplateDTO excelTemplateDTO) {
if(!ObjectUtils.isEmpty(excelTemplateDTO) && !excelTemplateDTO.getTableHeaderList().isEmpty()){
excelTemplateDTO.setJson(JSON.toJSONString(excelTemplateDTO.getTableHeaderList()));
}
return Result.data(excelTemplateService.saveOrUpdate(excelTemplateDTO)); return Result.data(excelTemplateService.saveOrUpdate(excelTemplateDTO));
} }
......
package com.platform.model.entity; package com.platform.model.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.platform.model.vo.TableHeaderVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author : wujipeng * @author : wujipeng
* @date : 2025/7/30 15:03 * @date : 2025/7/30 15:03
...@@ -25,4 +29,8 @@ public class ExcelTemplateEntity { ...@@ -25,4 +29,8 @@ public class ExcelTemplateEntity {
@ApiModelProperty("模板json") @ApiModelProperty("模板json")
private String json; private String json;
@ApiModelProperty("模板json用于展示")
@TableField(exist = false)
private List<TableHeaderVO> tableHeaderList;
} }
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