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