refactor(steady): 重构数据校验功能并新增PQDIF解析预留模块
- 将数据校验中的缺失率相关字段替换为数据完整性字段 - 新增数据校验任务删除功能及相应测试 - 在tools模块中添加parse-pqdif子模块作为PQDIF文件解析预留 - 更新README文档以反映新的模块结构和依赖关系 - 优化数据校验统计汇总逻辑和测试覆盖 - 在entrance模块中集成parse-pqdif依赖 - 重构数据校验服务层实现和数据对象映射
This commit is contained in:
55
tools/parse-pqdif/pom.xml
Normal file
55
tools/parse-pqdif/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.njcn.gather</groupId>
|
||||
<artifactId>tools</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>parse-pqdif</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>njcn-common</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>spingboot2.3.12</artifactId>
|
||||
<version>2.3.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>parse-pqdif</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.gather.tool.parsepqdif.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.gather.tool.parsepqdif.pojo.vo.PqdifParseResponse;
|
||||
import com.njcn.gather.tool.parsepqdif.service.ParsePqdifService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* PQDIF 解析接口入口。
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "PQDIF解析")
|
||||
@RestController
|
||||
@RequestMapping("/api/parse-pqdif")
|
||||
@RequiredArgsConstructor
|
||||
public class ParsePqdifController extends BaseController {
|
||||
|
||||
private final ParsePqdifService parsePqdifService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("上传 PQDIF 文件并解析")
|
||||
@ApiImplicitParam(name = "pqdifFile", value = "PQDIF文件", required = true, dataType = "__file", paramType = "form")
|
||||
@PostMapping(value = "/parse", consumes = {"multipart/form-data"})
|
||||
public HttpResult<PqdifParseResponse> parse(@RequestPart("pqdifFile") MultipartFile pqdifFile) {
|
||||
String methodDescribe = getMethodDescribe("parse");
|
||||
LogUtil.njcnDebug(log, "{},PQDIF解析预留入口,fileName={}",
|
||||
methodDescribe, pqdifFile == null ? null : pqdifFile.getOriginalFilename());
|
||||
PqdifParseResponse result = parsePqdifService.parse(pqdifFile);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.gather.tool.parsepqdif.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* PQDIF 解析占位响应。
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("PQDIF解析响应")
|
||||
public class PqdifParseResponse {
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("提示信息")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty("文件名")
|
||||
private String fileName;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.gather.tool.parsepqdif.service;
|
||||
|
||||
import com.njcn.gather.tool.parsepqdif.pojo.vo.PqdifParseResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* PQDIF 解析服务。
|
||||
*/
|
||||
public interface ParsePqdifService {
|
||||
|
||||
PqdifParseResponse parse(MultipartFile pqdifFile);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.gather.tool.parsepqdif.service.impl;
|
||||
|
||||
import com.njcn.gather.tool.parsepqdif.pojo.vo.PqdifParseResponse;
|
||||
import com.njcn.gather.tool.parsepqdif.service.ParsePqdifService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* PQDIF 解析服务实现。
|
||||
*/
|
||||
@Service
|
||||
public class ParsePqdifServiceImpl implements ParsePqdifService {
|
||||
|
||||
private static final String STATUS_NOT_SUPPORTED = "NOT_SUPPORTED";
|
||||
|
||||
@Override
|
||||
public PqdifParseResponse parse(MultipartFile pqdifFile) {
|
||||
PqdifParseResponse response = new PqdifParseResponse();
|
||||
response.setStatus(STATUS_NOT_SUPPORTED);
|
||||
response.setMessage("PQDIF解析功能待实现");
|
||||
response.setFileName(pqdifFile == null ? null : pqdifFile.getOriginalFilename());
|
||||
return response;
|
||||
}
|
||||
}
|
||||
1
tools/parse-pqdif/src/main/resources/.gitkeep
Normal file
1
tools/parse-pqdif/src/main/resources/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user