| | |
| | | |
| | | |
| | | import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO; |
| | | import com.mes.hollow.entity.request.HollowTaskRequest; |
| | | 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 io.swagger.annotations.ApiOperation; |
| | | import org.springframework.core.io.FileSystemResource; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | 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.IOException; |
| | | import java.io.StringWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return Result.build(200, "查询成功", hollowBigStorageCageService.queryHollowBigStorageCageDetail(query)); |
| | | } |
| | | |
| | | @GetMapping("/generate") |
| | | public ResponseEntity<FileSystemResource> generate() throws IOException, TemplateException { |
| | | @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/"); |
| | |
| | | // 创建数据模型 |
| | | 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); |
| | | |
| | | root.put("details", details); |
| | | |
| | | // 获取模板 |
| | | Template temp = cfg.getTemplate("hollowGlass.ftl"); |