feat: scc流程上传压缩包返回id字段
This commit is contained in:
+2
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
@@ -434,6 +435,7 @@ public class ProcessHandleServiceImpl implements IProcessHandleService {
|
||||
|
||||
// 使用 ObjectMapper 将 detailInfoMapList 转换为 JSON 字符串
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
String jsonString = objectMapper.writeValueAsString(detailInfoMapList);
|
||||
|
||||
// 将 JSON 字符串反序列化为 List<ProcessStandardComplianceCheckDetail>
|
||||
|
||||
+4
-2
@@ -199,8 +199,10 @@ public class ProcessStandardComplianceCheckController extends JeroController<Pro
|
||||
@AutoLog(value = "法规符合性排查流程-导入")
|
||||
@ApiOperation(value="法规符合性排查流程-导入", notes="法规符合性排查流程-导入")
|
||||
@PostMapping("/importExcelWithData")
|
||||
public Result<?> importExcelWithData(@RequestParam("file") @ApiParam("文件") MultipartFile file) throws IOException {
|
||||
Map<String, Object> resultMap = sccService.importExcelWithData(file);
|
||||
@Translation
|
||||
public Result<?> importExcelWithData(@RequestParam("file") @ApiParam("文件") MultipartFile file,
|
||||
@RequestParam("taskId") @ApiParam("任务Id") String taskId) throws IOException {
|
||||
Map<String, Object> resultMap = sccService.importExcelWithData(file, taskId);
|
||||
Object flag = resultMap.get("flag");
|
||||
if (flag == YesOrNoEnum.YES.getValue()) {
|
||||
List<ProcessStandardComplianceCheckDetail> dataList = (List<ProcessStandardComplianceCheckDetail>)
|
||||
|
||||
+2
@@ -8,6 +8,8 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
@Data
|
||||
public class WithoutDistributeExcelTemplate {
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 条款号
|
||||
*/
|
||||
|
||||
+1
-1
@@ -35,6 +35,6 @@ public interface IProcessStandardComplianceCheckService extends IService<Process
|
||||
void exportXls(String taskId, HttpServletResponse response);
|
||||
void exportXlsWithoutDistribute(String taskId, HttpServletResponse response);
|
||||
|
||||
Map<String, Object> importExcelWithData(MultipartFile file) throws IOException;
|
||||
Map<String, Object> importExcelWithData(MultipartFile file, String taskId) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
+8
-5
@@ -596,7 +596,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> importExcelWithData(MultipartFile file) throws IOException {
|
||||
public Map<String, Object> importExcelWithData(MultipartFile file, String taskId) throws IOException {
|
||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<String> errorMsgs = new ArrayList<>();
|
||||
@@ -688,7 +688,8 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
// 转换为字典值
|
||||
this.transToDictValue(list, listDict, fileMap);
|
||||
// 清洗
|
||||
this.cleanData(list);
|
||||
ProcessInfoVO<ProcessSccVO> handleData = this.getHandleData(taskId);
|
||||
this.cleanData(list, handleData.getBusinessInfoDTO().getDetailInfoList());
|
||||
resultMap.put("dataList", list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -730,8 +731,10 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
return errorMsgs;
|
||||
}
|
||||
|
||||
private void cleanData(List<WithoutDistributeExcelTemplate> list) {
|
||||
list.forEach(item -> {
|
||||
private void cleanData(List<WithoutDistributeExcelTemplate> list, List<ProcessStandardComplianceCheckDetail> existDataList) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
WithoutDistributeExcelTemplate item = list.get(i);
|
||||
item.setId(existDataList.get(i).getId());
|
||||
String result = item.getResult();
|
||||
if (StrUtil.isBlank(result)) {
|
||||
item.setUnsatisfiedRequire(null);
|
||||
@@ -757,7 +760,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
item.setMaterial(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void transToDictValue(List<WithoutDistributeExcelTemplate> list, List<SysDictItemCore> listDict, Map<String, File> fileMap) {
|
||||
|
||||
Reference in New Issue
Block a user