| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | |
| | | import com.qcloud.cos.utils.IOUtils; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | import com.ruoyi.domain.ZfEconomy; |
| | | import com.ruoyi.domain.excel.ZfEconomyExcelBean; |
| | | import com.ruoyi.service.ZfEconomyService; |
| | | import com.ruoyi.service.impl.GetOrPut; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import lombok.val; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | ZfEconomyService zfEconomyService; |
| | | |
| | | @Autowired |
| | | GetOrPut getOrPut; |
| | | |
| | | @GetMapping("cc") |
| | | public void ll() throws IOException { |
| | | List<ZfEconomy> change = zfEconomyService.change(); |
| | | for (ZfEconomy ch:change) { |
| | | if (ch.getUrl() != null) { |
| | | String[] splits = ch.getUrl().split(","); |
| | | StringBuilder list= new StringBuilder(); |
| | | for (int i=0;i<splits.length;i++) { |
| | | if (splits[i] != null && splits[i].length() !=0) { |
| | | // splits[i]=splits[i].replace("\\", "/"); |
| | | String cs = getOrPut.uploadWebFile("https://www.bendudu.com:8080/" + splits[i]); |
| | | if(i>=1) { |
| | | list.append(",").append(cs); |
| | | }else { |
| | | list.append(cs); |
| | | } |
| | | } |
| | | } |
| | | ch.setCosKey(list.toString()); |
| | | zfEconomyService.updateById(ch); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(ZfEconomy zfEconomy){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | |
| | | return zfEconomyService.selectDataList(zfEconomy, pageNum, pageSize); |
| | | } |
| | | |
| | | @GetMapping("/type") |
| | | public AjaxResult listType(){ |
| | | return zfEconomyService.listType(); |
| | | } |
| | | |
| | | /** |
| | | * 获取导入模板 |
| | | */ |