新增数据清洗算法(文件方式存储)
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.njcn.dataProcess.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.HttpResultUtil;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.dataProcess.service.IPqDataVerifyNewService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pqDataVerifyNew")
|
||||
public class PqDataVerifyNewController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IPqDataVerifyNewService pqDataVerifyNewService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/insertDataBatch")
|
||||
@ApiOperation("存储清洗的异常数据")
|
||||
public HttpResult<List<String>> insertDataBatch(@RequestBody List<PqDataVerifyBak> list) {
|
||||
String methodDescribe = getMethodDescribe("insertDataBatch");
|
||||
pqDataVerifyNewService.insertDataBatch(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/insertData")
|
||||
@ApiOperation("存储清洗的异常数据")
|
||||
public HttpResult<List<String>> insertData(@RequestBody PqDataVerifyBak pqDataVerifyBak) {
|
||||
String methodDescribe = getMethodDescribe("insertData");
|
||||
pqDataVerifyNewService.insertData(pqDataVerifyBak);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
public interface PqDataVerifyNewMapper extends MppBaseMapper<PqDataVerifyBak> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
public interface IPqDataVerifyNewService extends IMppService<PqDataVerifyBak> {
|
||||
|
||||
/**
|
||||
* 异常数据插入
|
||||
* @param list
|
||||
*/
|
||||
void insertDataBatch(List<PqDataVerifyBak> list);
|
||||
|
||||
/**
|
||||
* 异常数据插入
|
||||
*/
|
||||
void insertData(PqDataVerifyBak pqDataVerifyBak);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.PqDataVerifyNewMapper;
|
||||
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.dataProcess.service.IPqDataVerifyNewService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class PqDataVerifyNewServiceImpl extends MppServiceImpl<PqDataVerifyNewMapper, PqDataVerifyBak> implements IPqDataVerifyNewService {
|
||||
|
||||
@Override
|
||||
public void insertDataBatch(List<PqDataVerifyBak> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list,1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertData(PqDataVerifyBak pqDataVerifyBak) {
|
||||
this.saveOrUpdateByMultiId(pqDataVerifyBak);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user