|
|
@ -1,25 +1,20 @@ |
|
|
|
package com.easy.admin.modules.huzhou.controller; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.Query; |
|
|
|
import com.easy.admin.common.api.vo.Result; |
|
|
|
import com.easy.admin.common.core.annotation.ResponseResult; |
|
|
|
import com.easy.admin.common.core.config.ExecutorConfig; |
|
|
|
import com.easy.admin.common.core.exception.EasyException; |
|
|
|
import com.easy.admin.modules.huzhou.entity.HuzhouPerforman; |
|
|
|
import com.easy.admin.modules.huzhou.entity.HuzhouPerformancescore; |
|
|
|
import com.easy.admin.modules.huzhou.service.IHuzhouPerformancescoreService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.*; |
|
|
|
import org.apache.poi.ss.util.CellRangeAddress; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@RestController |
|
|
@ -27,6 +22,9 @@ import java.util.List; |
|
|
|
@ResponseResult |
|
|
|
public class HuzhouPerformancescoreController { |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ExecutorConfig.class); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ObjectMapper objectMapper; |
|
|
|
@Autowired |
|
|
|
private IHuzhouPerformancescoreService performancescoreService; |
|
|
|
@PostMapping("/importPerformancescore") |
|
|
@ -46,4 +44,22 @@ public class HuzhouPerformancescoreController { |
|
|
|
return performancescoreService.getPerforman(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping( |
|
|
|
value = "/addPerformance", |
|
|
|
consumes = MediaType.MULTIPART_FORM_DATA_VALUE |
|
|
|
) |
|
|
|
public Result<?> addPerformance( |
|
|
|
@RequestParam("performance") String performanceJson, //
|
|
|
|
@RequestPart("file") MultipartFile file // ✅ 用 @RequestPart 接收文件
|
|
|
|
) throws Exception { |
|
|
|
// 手动转成对象
|
|
|
|
HuzhouPerforman performance = objectMapper.readValue(performanceJson, HuzhouPerforman.class); |
|
|
|
performancescoreService.addPerformance(performance); |
|
|
|
String type = performance.getId(); |
|
|
|
performancescoreService.importPerformancescore(file,type); |
|
|
|
return Result.ok("增加绩效考核模板成功!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|