解读入库

This commit is contained in:
yuezhihang
2021-08-18 14:44:27 +08:00
parent 39561c91d2
commit af1ffe9313
12 changed files with 62 additions and 49 deletions
@@ -61,64 +61,64 @@ public class SarStandardComplianceAssessResultController {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
}
if (eo.getType() != null && !eo.getType().trim().equals("")) {
queryWrapper.like("type",eo.getType().trim());
queryWrapper.like("type", eo.getType().trim());
}
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
while (page.getRecords().remove(null)) ;
return Result.success(page);
}else {
if(eo.getPosition()==1){
} else {
if (eo.getPosition() == 1) {
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
}
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
while (page.getRecords().remove(null)) ;
return Result.success(page);
}else{
} else {
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
}
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
while (page.getRecords().remove(null)) ;
return Result.success(page);
}
}
}
private static class InsertEntity<T>{
private static class InsertEntity<T> {
List<Map> entityList;
T eo;
}
@ApiOperation(value="(插入/更新)标准清单")
@ApiOperation(value = "(插入/更新)标准清单")
@PostMapping("/standard")
public ResponseMessage insertStandard(@RequestBody InsertEntity<SarStandardsInfoEO> insertEntity) throws InvocationTargetException, IllegalAccessException {
@@ -128,27 +128,27 @@ public class SarStandardComplianceAssessResultController {
List<SarStandardComplianceProductAssess> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarStandardComplianceProductAssess obj=new SarStandardComplianceProductAssess();
SarStandardComplianceProductAssess obj = new SarStandardComplianceProductAssess();
BeanUtils.populate(obj, insertEntity.entityList.get(i));
entityList.add(obj);
}
iSarStandardComplianceProductAssessService.saveOrUpdateBatch(entityList);
}else {
if(eo.getPosition()==1){
} else {
if (eo.getPosition() == 1) {
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationNationalStandard obj=new SarInterpretationNationalStandard();
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
BeanUtils.populate(obj, insertEntity.entityList.get(i));
entityList.add(obj);
}
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
}else{
} else {
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationForeignStandard obj=new SarInterpretationForeignStandard();
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
BeanUtils.populate(obj, insertEntity.entityList.get(i));
entityList.add(obj);
}
@@ -166,14 +166,11 @@ public class SarStandardComplianceAssessResultController {
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
// if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
// if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
// while(page.getRecords().remove(null));
return Result.success(page);
}
@@ -195,22 +192,22 @@ public class SarStandardComplianceAssessResultController {
@ApiOperation(value = "条件查询技术审核符合性清单")
@GetMapping("/interpretation")
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
if (eo.getPosition()==1) {
if (eo.getPosition() == 1) {
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
if(eo.getStandId()!=null)queryWrapper.eq("STAND_ID",eo.getStandId());
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
while (page.getRecords().remove(null)) ;
return Result.success(page);
} else {
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
if(eo.getStandId()!=null)queryWrapper.eq("STAND_ID",eo.getStandId());
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
while (page.getRecords().remove(null)) ;
return Result.success(page);
}
@@ -223,11 +220,11 @@ public class SarStandardComplianceAssessResultController {
InterpretationEO eo = insertEntity.eo;
if (eo.getPosition()==1) {
if (eo.getPosition() == 1) {
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationNationalStandard obj=new SarInterpretationNationalStandard();
SarInterpretationNationalStandard obj = new SarInterpretationNationalStandard();
BeanUtils.populate(obj, insertEntity.entityList.get(i));
entityList.add(obj);
}
@@ -235,10 +232,9 @@ public class SarStandardComplianceAssessResultController {
} else {
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationForeignStandard obj=new SarInterpretationForeignStandard();
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
BeanUtils.populate(obj, insertEntity.entityList.get(i));
entityList.add(obj);
}
@@ -18,6 +18,10 @@ public class SarStandardComplianceProductAssessEO{
@TableField("STAND_ID")
private String standId;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
@ApiModelProperty(value = "'项目名称'")
private String productName;
@@ -25,6 +25,9 @@ public class SarStandardsInfoEO {
@ApiModelProperty(value = "国内1,国外2")
private Integer position=1;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
@ApiModelProperty("页数")
private Integer current=1;