From 4e0147ac43533a4dc99f86d443618a4959c28162 Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期二, 04 七月 2023 12:14:53 +0800 Subject: [PATCH] 邮件用户查询更新 --- src/main/java/com/whyc/controller/SoftwareController.java | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/whyc/controller/SoftwareController.java b/src/main/java/com/whyc/controller/SoftwareController.java index cfa34a0..462c62f 100644 --- a/src/main/java/com/whyc/controller/SoftwareController.java +++ b/src/main/java/com/whyc/controller/SoftwareController.java @@ -1,8 +1,10 @@ package com.whyc.controller; +import com.google.gson.reflect.TypeToken; import com.whyc.dto.Response; import com.whyc.pojo.Software; import com.whyc.service.SoftwareService; +import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; @@ -10,6 +12,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.text.ParseException; import java.util.List; @@ -31,23 +35,34 @@ if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){ response.set(1,false,"鏂囦欢瑙f瀽閿欒:涓婁紶鏍煎紡闈瀍xcel鏍煎紡"); }else{ - List<Software> list = service.excelParse(multipartFile.getInputStream()); - response.setII(1,true,list,"鏂囦欢瑙f瀽鎴愬姛"); + response = service.excelParse(multipartFile.getInputStream()); } return response; } @ApiOperation("杞欢涓婁紶") @PostMapping("upload") - public Response upload(@RequestParam MultipartFile file1,@RequestParam MultipartFile file2,@RequestParam String softwareStr){ + public Response upload(@RequestParam MultipartFile file1,@RequestParam MultipartFile file2,@RequestParam String fontUpdateTime,@RequestParam String softwareStr) throws IOException { + List<Software> softwareList = ActionUtil.getGson().fromJson(softwareStr,new TypeToken<List<Software>>(){}.getType()); + return service.upload(file1,file2,fontUpdateTime,softwareList); + } - return null; + @ApiOperation("鏇存柊杞欢鐗堟湰瀵瑰簲鐨勯�傜敤鏈哄瀷") + @PutMapping("applyModel") + public Response updateApplyModel(@RequestParam MultipartFile multipartFile,@RequestParam String softwareStr) throws IOException { + List<Software> softwareList = ActionUtil.getGson().fromJson(softwareStr,new TypeToken<List<Software>>(){}.getType()); + return service.updateApplyModel(multipartFile,softwareList); } @ApiOperation(value = "鏌ヨ杞欢鍒楄〃鐨勪俊鎭�") @GetMapping("getAllSoftware") - public Response getAllSoftware(@RequestParam(required = false) String fileName,@RequestParam int pageCurr,@RequestParam int pageSize ){ - return service.getAllSoftware(fileName,pageCurr,pageSize); + public Response getAllSoftware(@RequestParam(required = false) String fileName, + @RequestParam(required = false) String applyMaterialCode, + @RequestParam(required = false) String applyModel, + @RequestParam(required = false) String owner, + @RequestParam(required = false) String boardNumber, + @RequestParam int pageCurr,@RequestParam int pageSize ){ + return service.getAllSoftware(fileName,applyMaterialCode,applyModel,owner,boardNumber,pageCurr,pageSize); } @ApiOperation(value = "鏍规嵁subcode鏌ヨ杞欢鍒楄〃") @@ -56,5 +71,15 @@ return service.getSoftBySubCode(subCode); } + @ApiOperation(value = "鏍规嵁杞欢id瀹炵幇杞欢涓嬭浇") + @GetMapping("downLoadSoftware") + public void downLoadSoftware(HttpServletRequest req, HttpServletResponse resp, @RequestParam int id){ + service.downLoadSoftware(req,resp,id); + } + @ApiOperation(value = "鏍规嵁杞欢id淇敼杞欢閿佸畾鐘舵��") + @GetMapping("updateSoftwareLock") + public Response updateSoftwareLock(@RequestParam String fileUrl,@RequestParam int lockFlag,@RequestParam String localReason){ + return service.updateSoftwareLock(fileUrl,lockFlag,localReason); + } } -- Gitblit v1.9.1