zhoushihao
2025-01-17 5d1bb80afb4c4db35eec39577c3e47b2d5e91dbb
1、中空模块名字变更
2、移除无用代码
3个文件已修改
46 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/howllowGlassModule/pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/pom.xml
@@ -9,7 +9,7 @@
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>howllowGlass</artifactId>
    <artifactId>hollowGlass</artifactId>
    <properties>
        <maven.compiler.source>8</maven.compiler.source>
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
@@ -2,29 +2,18 @@
import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO;
import com.mes.hollow.entity.dto.LisecHollowDetails;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.service.HollowBigStorageCageService;
import com.mes.utils.Blank;
import com.mes.utils.Result;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.Version;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * (HollowBigStorageCage)表控制层
@@ -43,37 +32,6 @@
    @PostMapping("/queryHollowBigStorageCageDetail")
    public Result<List<HollowBigStorageAndDetailsDTO>> queryHollowBigStorageCageDetail(@RequestBody HollowBigStorageDetailsQueryVO query) {
        return Result.build(200, "查询成功", hollowBigStorageCageService.queryHollowBigStorageCageDetail(query));
    }
    @PostMapping("/generate")
    public ResponseEntity<FileSystemResource> generate(@RequestBody LisecHollowDetails details) throws IOException, TemplateException {
// 创建和配置Freemarker配置实例
        Configuration cfg = new Configuration(new Version("2.3.29"));
        cfg.setClassForTemplateLoading(HollowBigStorageCageController.class, "/templates/");
        // 创建Calculator实例
        Blank blank = new Blank();
        // 创建数据模型
        Map<String, Object> root = new HashMap<>();
        root.put("blank", blank);
        root.put("details", details);
        // 获取模板
        Template temp = cfg.getTemplate("hollowGlass.ftl");
        // 将生成的文件存入指定路径
        //todo:计算生成李赛克需要的数据给到每个属性
        StringWriter out = new StringWriter();
        File file = new File("D:\\temp", "temp.trf");
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
            temp.process(root, out);
            writer.write(out.toString());
        } catch (TemplateException | IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
hangzhoumesParent/moduleService/pom.xml
@@ -19,7 +19,7 @@
        <module>TemperingGlassModule</module>
        <module>UnLoadGlassModule</module>
        <module>GlassStorageModule</module>
        <module>howllowGlassModule</module>
        <module>hollowGlassModule</module>
    </modules>
    <properties>