whycxzp
2022-09-09 db95f1a014aae02f59f3e8a95a576e5ac7964c5b
src/main/java/com/whyc/controller/SoftwareController.java
@@ -35,23 +35,26 @@
        if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){
            response.set(1,false,"文件解析错误:上传格式非excel格式");
        }else{
            List<Software> list = service.excelParse(multipartFile.getInputStream());
            response.setII(1,true,list,"文件解析成功");
            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 softwareStr) throws IOException {
        List<Software> softwareList = ActionUtil.getGson().fromJson(softwareStr,new TypeToken<List<Software>>(){}.getType());
        return service.upload(file1,file2,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 int pageCurr,@RequestParam int pageSize ){
        return service.getAllSoftware(fileName,applyMaterialCode,applyModel,owner,pageCurr,pageSize);
    }
    @ApiOperation(value = "根据subcode查询软件列表")