feat
This commit is contained in:
+102
-3
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.sarStandardComplianceAssessResult.controller;
|
package com.adc.da.slrs.sarStandardComplianceAssessResult.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import com.adc.da.base.web.BaseController;
|
import com.adc.da.base.web.BaseController;
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
@@ -16,12 +17,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import oracle.ucp.proxy.annotation.Post;
|
||||||
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -98,6 +104,55 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class InsertEntity<T>{
|
||||||
|
List<Map> entityList;
|
||||||
|
T eo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value="(插入/更新)标准清单")
|
||||||
|
@PostMapping("/standard")
|
||||||
|
public ResponseMessage insertStandard(@RequestBody InsertEntity<SarStandardsInfoEO> insertEntity) throws InvocationTargetException, IllegalAccessException {
|
||||||
|
|
||||||
|
SarStandardsInfoEO eo = insertEntity.eo;
|
||||||
|
|
||||||
|
if (eo.getStandApplicationType() == 1) {
|
||||||
|
|
||||||
|
List<SarStandardComplianceProductAssess> entityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||||
|
SarStandardComplianceProductAssess obj=new SarStandardComplianceProductAssess();
|
||||||
|
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||||
|
entityList.add(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
iSarStandardComplianceProductAssessService.saveOrUpdateBatch(entityList);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
if(eo.getPosition()==1){
|
||||||
|
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||||
|
SarInterpretationNationalStandard obj=new SarInterpretationNationalStandard();
|
||||||
|
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||||
|
entityList.add(obj);
|
||||||
|
}
|
||||||
|
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||||
|
SarInterpretationForeignStandard obj=new SarInterpretationForeignStandard();
|
||||||
|
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||||
|
entityList.add(obj);
|
||||||
|
}
|
||||||
|
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "条件查询标准涉及项目符合性清单")
|
@ApiOperation(value = "条件查询标准涉及项目符合性清单")
|
||||||
@GetMapping("/product")
|
@GetMapping("/product")
|
||||||
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
|
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
|
||||||
@@ -114,6 +169,17 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
return Result.success(page);
|
return Result.success(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "插入标准涉及项目符合性清单")
|
||||||
|
@PostMapping("/product")
|
||||||
|
public ResponseMessage insertProduct(List<SarStandardComplianceProductAssess> eo) throws Exception {
|
||||||
|
|
||||||
|
iSarStandardComplianceProductAssessService.saveOrUpdateBatch(eo);
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "条件查询技术审核符合性清单")
|
@ApiOperation(value = "条件查询技术审核符合性清单")
|
||||||
@GetMapping("/interpretation")
|
@GetMapping("/interpretation")
|
||||||
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
|
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
|
||||||
@@ -137,4 +203,37 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
return Result.success(page);
|
return Result.success(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "插入技术审核符合性清单")
|
||||||
|
@PostMapping("/interpretation")
|
||||||
|
public ResponseMessage insertInterpretation(InsertEntity<InterpretationEO> insertEntity) throws Exception {
|
||||||
|
|
||||||
|
InterpretationEO eo = insertEntity.eo;
|
||||||
|
|
||||||
|
if (eo.getPosition()==1) {
|
||||||
|
|
||||||
|
List<SarInterpretationNationalStandard> entityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||||
|
SarInterpretationNationalStandard obj=new SarInterpretationNationalStandard();
|
||||||
|
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||||
|
entityList.add(obj);
|
||||||
|
}
|
||||||
|
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < insertEntity.entityList.size(); i++) {
|
||||||
|
SarInterpretationForeignStandard obj=new SarInterpretationForeignStandard();
|
||||||
|
BeanUtils.populate(obj, insertEntity.entityList.get(i));
|
||||||
|
entityList.add(obj);
|
||||||
|
}
|
||||||
|
iSarInterpretationForeignStandardService.saveOrUpdateBatch(entityList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user