Browse Source

2024-04-08

master
zelian_wu 2 years ago
parent
commit
49faad16b2
  1. 5
      src/main/java/com/spring/modules/test/controller/TestPropertiesController.java
  2. 14
      src/main/java/com/spring/modules/test/mapper/TestInformationMapper.java
  3. 5
      src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java
  4. 7
      src/main/java/com/spring/modules/test/service/impl/TestPropertiesServiceImpl.java
  5. 3
      src/main/resources/mapper/base/PropertiesMapper.xml
  6. 6
      src/main/resources/mapper/test/TestInformationMapper.xml

5
src/main/java/com/spring/modules/test/controller/TestPropertiesController.java

@ -35,4 +35,9 @@ public class TestPropertiesController {
testPropertiesService.searchTestPropertiesListFlushed(testProperties);
return R.ok().put("msg","操作成功");
}
@PostMapping("/item")
public R searchTestPropertiesItem(@RequestBody TestProperties testProperties){
return R.ok().put("rows",testPropertiesService.getPropertiesItem(testProperties));
}
}

14
src/main/java/com/spring/modules/test/mapper/TestInformationMapper.java

@ -21,9 +21,17 @@ public interface TestInformationMapper extends BaseMapper<TestInformationEntity>
List<TestInformationVo> searchTestList(TestInformationVo data);
List<TestProperties> searchTestProperties(@Param("site") String site);
List<TestPropertiesVo> searchTestPropertiesVo(@Param("site") String site,@Param("testNo")String testNo);
List<TestProperties> searchTestProperties(@Param("site") String site,
@Param("codeType")String codeType,
@Param("codeNo")String codeNo);
List<TestPropertiesVo> searchTestPropertiesVo(@Param("site") String site,
@Param("testNo")String testNo,
@Param("codeNo")String codeNo);
List<PlmPropertiesItemAvailable> selectAvailBleValue(TestProperties testProperties);
List<TestProperties> searchNotInList(@Param("site")String site,@Param("list") List<TestPropertiesVo> list);
List<TestProperties> searchNotInList(
@Param("site")String site,
@Param("list") List<TestPropertiesVo> list,
@Param("codeType")String codeType,
@Param("codeNo")String codeNo);
}

5
src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spring.common.utils.Constant;
import com.spring.common.utils.PageUtils;
import com.spring.modules.customer.vo.CustomerInformationVo;
import com.spring.modules.oss.dao.SysOssDao;
@ -90,13 +91,13 @@ public class TestInformationServiceImpl extends ServiceImpl<TestInformationMappe
for (String testPartNo : testPartNoList) {
// 获取测试单号
String testNo = testInformationMapper.getTestNo(data);
data.setTestNo("CS" + testNo);
data.setTestNo(Constant.CS + testNo);
data.setTestPartNo(testPartNo);
data.setTestResultStatus(data.getTestResultStatus());
testInformationMapper.insert(data);
if (testPartNoList.length == 1){
// 新增属性
List<TestProperties> list = testInformationMapper.searchTestProperties(data.getSite());
List<TestProperties> list = testInformationMapper.searchTestProperties(data.getSite(),Constant.TEST_CODE_TYPE,Constant.TEST_CODE_NO);
list = list.stream().peek(testProperties -> {
testProperties.setTestNo(data.getTestNo());
}).collect(Collectors.toList());

7
src/main/java/com/spring/modules/test/service/impl/TestPropertiesServiceImpl.java

@ -2,6 +2,7 @@ package com.spring.modules.test.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spring.common.utils.Constant;
import com.spring.modules.test.entity.TestProperties;
import com.spring.modules.test.mapper.TestInformationMapper;
import com.spring.modules.test.mapper.TestPropertiesMapper;
@ -21,7 +22,7 @@ public class TestPropertiesServiceImpl extends ServiceImpl<TestPropertiesMapper,
private TestInformationMapper testInformationMapper;
@Override
public List<TestPropertiesVo> searchTestPropertiesList(TestProperties testProperties) {
return testInformationMapper.searchTestPropertiesVo(testProperties.getSite(),testProperties.getTestNo());
return testInformationMapper.searchTestPropertiesVo(testProperties.getSite(),testProperties.getTestNo(),Constant.TEST_CODE_NO);
}
@Override
@ -37,7 +38,7 @@ public class TestPropertiesServiceImpl extends ServiceImpl<TestPropertiesMapper,
@Override
@Transactional
public void searchTestPropertiesListFlushed(TestProperties testProperties) {
List<TestProperties> properties = testInformationMapper.searchTestProperties(testProperties.getSite());
List<TestProperties> properties = testInformationMapper.searchTestProperties(testProperties.getSite(),Constant.TEST_CODE_TYPE,Constant.TEST_CODE_NO);
lambdaUpdate().eq(TestProperties::getSite,testProperties.getSite())
.eq(TestProperties::getTestNo,testProperties.getTestNo()).remove();
if (properties != null){
@ -50,6 +51,6 @@ public class TestPropertiesServiceImpl extends ServiceImpl<TestPropertiesMapper,
@Override
public List<TestProperties> getPropertiesItem(TestProperties testProperties) {
return testInformationMapper.searchTestProperties(testProperties.getSite());
return testInformationMapper.searchTestProperties(testProperties.getSite(),Constant.TEST_CODE_TYPE, Constant.TEST_CODE_NO);
}
}

3
src/main/resources/mapper/base/PropertiesMapper.xml

@ -102,7 +102,7 @@
pmh.delflag,
pmh.version,
pmh.is_system,
dbo.plm_get_dictDataLabel(pg.menu_id, pmh.function_type, pmh.site) as functionGroupDesc,
pr.function_group_desc,
pg.menu_id as [group],
pmh.function_group,
pt.function_type_desc
@ -112,6 +112,7 @@
left join properties_bu bu
on bu.site = pmh.site and bu.function_type = pmh.function_type and bu.code_no = pmh.code_no
left join properties_type pt on pt.function_type = pmh.function_type
left join properties_relationship pr on pr.function_group = pmh.function_group and pr.function_type = pmh.function_type
<where>
pmh.site = #{query.site}
<if test="query.codeNo != null and query.codeNo != ''">

6
src/main/resources/mapper/test/TestInformationMapper.xml

@ -192,7 +192,7 @@
b.MinValue
FROM plm_properties_model_detail a
left join plm_properties_item b on a.function_type = b.itemType and a.properties_item_no = b.itemNo and a.site = b.site
where a.function_type = 'TEST' and a.code_no = 'T1' and a.site = #{site}
where a.function_type = #{codeType} and a.code_no = #{codeNo} and a.site = #{site}
order by a.order_id
</select>
@ -213,7 +213,7 @@
a.num_value,
a.test_no
FROM plm_test_properties a
left join plm_properties_model_detail b on a.site = b.site and a.function_type = b.function_type and b.code_no = 'T1' and a.item_no = b.properties_item_no
left join plm_properties_model_detail b on a.site = b.site and a.function_type = b.function_type and b.code_no = #{codeNo} and a.item_no = b.properties_item_no
where test_no = #{testNo} and a.site = #{site} order by b.order_id
</select>
@ -232,7 +232,7 @@
b.MinValue
FROM plm_properties_model_detail a
left join plm_properties_item b on a.function_type = b.itemType and a.properties_item_no = b.itemNo and a.site = b.site
where a.function_type = 'TEST' and a.code_no = 'T1' and a.site = #{site}
where a.function_type = #{codeType} and a.code_no = #{codeNo} and a.site = #{site}
and a.properties_item_no not in (
<foreach collection="list" item="item" separator=",">
#{item.itemNo}

Loading…
Cancel
Save