Commit e52a1797 authored by 高滢's avatar 高滢

检测方案添加

parent 80eb2c03
...@@ -40,4 +40,7 @@ public class TestObjectData { ...@@ -40,4 +40,7 @@ public class TestObjectData {
@ApiModelProperty("不适用描述") @ApiModelProperty("不适用描述")
private String notApplicable; private String notApplicable;
@ApiModelProperty("检验标准类型")
private String standardType;
} }
...@@ -2,6 +2,7 @@ package com.ruoyi.mapper; ...@@ -2,6 +2,7 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.TestObjectData; import com.ruoyi.domain.TestObjectData;
import com.ruoyi.web.request.ObjectDataSort;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -10,7 +11,7 @@ import java.util.List; ...@@ -10,7 +11,7 @@ import java.util.List;
public interface TestObjectDataMapper extends BaseMapper<TestObjectData> { public interface TestObjectDataMapper extends BaseMapper<TestObjectData> {
public List<TestObjectData> selectTestObjectDataList(); public List<TestObjectData> selectTestObjectDataList(ObjectDataSort objectDataSort);
} }
...@@ -3,9 +3,10 @@ package com.ruoyi.service; ...@@ -3,9 +3,10 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.TestObjectData; import com.ruoyi.domain.TestObjectData;
import com.ruoyi.web.request.ObjectDataSort;
import java.util.List; import java.util.List;
public interface TestObjectDataService extends IService<TestObjectData> { public interface TestObjectDataService extends IService<TestObjectData> {
List<TestObjectData> selectTestObjectDataList(); List<TestObjectData> selectTestObjectDataList(ObjectDataSort objectDataSort);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.TestObjectData; import com.ruoyi.domain.TestObjectData;
import com.ruoyi.mapper.TestObjectDataMapper; import com.ruoyi.mapper.TestObjectDataMapper;
import com.ruoyi.service.TestObjectDataService; import com.ruoyi.service.TestObjectDataService;
import com.ruoyi.web.request.ObjectDataSort;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -17,8 +18,8 @@ public class TestObjectDataServiceImpl extends ServiceImpl<TestObjectDataMapper, ...@@ -17,8 +18,8 @@ public class TestObjectDataServiceImpl extends ServiceImpl<TestObjectDataMapper,
private TestObjectDataMapper testObjectDataMapper; private TestObjectDataMapper testObjectDataMapper;
@Override @Override
public List<TestObjectData> selectTestObjectDataList(){ public List<TestObjectData> selectTestObjectDataList(ObjectDataSort objectDataSort){
return testObjectDataMapper.selectTestObjectDataList(); return testObjectDataMapper.selectTestObjectDataList(objectDataSort);
} }
} }
...@@ -4,12 +4,15 @@ package com.ruoyi.web; ...@@ -4,12 +4,15 @@ package com.ruoyi.web;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.domain.TestObjectData; import com.ruoyi.domain.TestObjectData;
import com.ruoyi.service.TestObjectDataService; import com.ruoyi.service.TestObjectDataService;
import com.ruoyi.web.request.ObjectDataSort;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags; import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace; import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -29,8 +32,8 @@ public class TestObjectDataController { ...@@ -29,8 +32,8 @@ public class TestObjectDataController {
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getList") @RequestMapping(method = RequestMethod.POST, value = "/getList")
public R<List> SelectTestObjectDataList(){ public R<List> SelectTestObjectDataList(@Validated @RequestBody ObjectDataSort objectDataSort){
List<TestObjectData> objectList = testObjectDataService.selectTestObjectDataList(); List<TestObjectData> objectList = testObjectDataService.selectTestObjectDataList(objectDataSort);
Map<String, List<TestObjectData>> groupedObject = objectList.stream().collect(Collectors.groupingBy(TestObjectData::getDescribe,LinkedHashMap::new, Collectors.toList())); Map<String, List<TestObjectData>> groupedObject = objectList.stream().collect(Collectors.groupingBy(TestObjectData::getDescribe,LinkedHashMap::new, Collectors.toList()));
List list= new ArrayList<>(); List list= new ArrayList<>();
final int[] sum = {0}; final int[] sum = {0};
...@@ -38,7 +41,7 @@ public class TestObjectDataController { ...@@ -38,7 +41,7 @@ public class TestObjectDataController {
Map map=new HashMap(); Map map=new HashMap();
map.put("describe",value.get(0).getDescribe()); map.put("describe",value.get(0).getDescribe());
map.put("type",value.get(0).getType()); map.put("type",value.get(0).getType());
map.put("key", String.valueOf(sum[0])); map.put("key", value.get(0).getSort());
Map mapObj =new HashMap(); Map mapObj =new HashMap();
mapObj.put("options",value); mapObj.put("options",value);
map.put("componentProps",mapObj); map.put("componentProps",mapObj);
......
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ObjectDataSort {
@ApiModelProperty("检验标准类型")
private String standardType;
}
...@@ -12,13 +12,18 @@ ...@@ -12,13 +12,18 @@
<result property="useCaseNo" column="use_case_no" /> <result property="useCaseNo" column="use_case_no" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="flag" column="flag" /> <result property="flag" column="flag" />
<result property="standardType" column="standard_type" />
</resultMap> </resultMap>
<sql id="TestObjectDataVo"> <sql id="TestObjectDataVo">
select * from t_test_object_data order by sort asc select * from t_test_object_data
</sql> </sql>
<select id="selectTestObjectDataList" parameterType="com.ruoyi.domain.TestObjectData"> <select id="selectTestObjectDataList" parameterType="com.ruoyi.web.request.ObjectDataSort" resultMap="TestObjectData">
<include refid="TestObjectDataVo"/> <include refid="TestObjectDataVo"/>
<where>
<if test="standardType != null and standardType != ''">and standard_type = #{standardType}</if>
</where>
order by sort asc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment