From 4ed47bfce9b3edd78ea447ecffc0babebdbea10b Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期二, 31 十二月 2024 14:14:12 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject

---
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java |   70 ++++++++++++++++++++++++++++++++++-
 1 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
index 6b96a2e..b7e63b4 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
@@ -1,8 +1,29 @@
 package com.mes.hollow.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO;
+import com.mes.hollow.entity.request.HollowTaskRequest;
+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.*;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * (HollowBigStorageCage)琛ㄦ帶鍒跺眰
@@ -10,9 +31,54 @@
  * @author makejava
  * @since 2024-11-21 09:22:39
  */
+@Api(tags = "涓┖鐞嗙墖绗艰鎯�")
 @RestController
 @RequestMapping("hollowBigStorageCage")
 public class HollowBigStorageCageController {
+    @Resource
+    HollowBigStorageCageService hollowBigStorageCageService;
 
+    @ApiOperation("鎸夌収鏌ヨ鏉′欢锛堣澶噄d銆佹祦绋嬪崱銆佽啘绯伙級鑾峰彇璁惧瀵瑰簲鐨勭瀛愮幓鐠冧俊鎭�")
+    @PostMapping("/queryHollowBigStorageCageDetail")
+    public Result<List<HollowBigStorageAndDetailsDTO>> queryHollowBigStorageCageDetail(@RequestBody HollowBigStorageDetailsQueryVO query) {
+        return Result.build(200, "鏌ヨ鎴愬姛", hollowBigStorageCageService.queryHollowBigStorageCageDetail(query));
+    }
+
+    @GetMapping("/generate")
+    public ResponseEntity<FileSystemResource> generate() throws IOException, TemplateException {
+// 鍒涘缓鍜岄厤缃瓼reemarker閰嶇疆瀹炰緥
+        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);
+        HollowTaskRequest request = new HollowTaskRequest();
+        request.setCell(1);
+        request.setFlowCardId("1111");
+        List<HollowTaskRequest> list = new ArrayList<>();
+        list.add(request);
+        list.add(request);
+        list.add(request);
+        root.put("request", request);
+        root.put("list1", list);
+
+        // 鑾峰彇妯℃澘
+        Template temp = cfg.getTemplate("hollowGlass.ftl");
+
+        // 鍚堝苟鏁版嵁妯″瀷鍜屾ā鏉�
+        StringWriter out = new StringWriter();
+        try {
+            temp.process(root, out);
+        } catch (TemplateException | IOException e) {
+            e.printStackTrace();
+        }
+
+        // 杈撳嚭缁撴灉
+        System.out.println(out.toString());
+        return null;
+    }
 }
 

--
Gitblit v1.8.0