Commit d5322f40 by lijingjing

测试问题修改

parent 1fc0b93f
...@@ -366,6 +366,26 @@ public class ContractSampleController extends ServiceController { ...@@ -366,6 +366,26 @@ public class ContractSampleController extends ServiceController {
ContractSampleStatusEnum.OUT_DRIFT, ContractSampleStatusEnum.OUT_DRIFT,
ContractSampleStatusEnum.OUT_INPUT, ContractSampleStatusEnum.OUT_INPUT,
ContractSampleStatusEnum.ENTRUST_REG, ContractSampleStatusEnum.ENTRUST_REG,
ContractSampleStatusEnum.STORAGE_REGISTER,
ContractSampleStatusEnum.ACCEPTANCE_CHECK_PUBLISH
));
contractSample.setUserOrgName(userInfoService.getOrgNameByUserPeriod(getAccount(), "二期验收室", "三期验收室"));
return success(contractSampleService.pageVO(getPage(), contractSample));
}
@ApiOperation("储运入库登记历史分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_storage_register_his")
public RestResult<Page<ContractSampleVO>> getPageStorageRegisterHis(ContractSampleVO contractSample) {
contractSample.setStatusList(Lists.newArrayList(
ContractSampleStatusEnum.OUT_DRIFT,
ContractSampleStatusEnum.OUT_INPUT,
ContractSampleStatusEnum.ENTRUST_REG,
ContractSampleStatusEnum.ACCEPTANCE_CHECK_PUBLISH ContractSampleStatusEnum.ACCEPTANCE_CHECK_PUBLISH
)); ));
contractSample.setUserOrgName(userInfoService.getOrgNameByUserPeriod(getAccount(), "二期验收室", "三期验收室")); contractSample.setUserOrgName(userInfoService.getOrgNameByUserPeriod(getAccount(), "二期验收室", "三期验收室"));
......
...@@ -1014,7 +1014,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -1014,7 +1014,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
int composeJudge = null == t.getComposeJudge() ? 0 : t.getComposeJudge().intValue(); int composeJudge = null == t.getComposeJudge() ? 0 : t.getComposeJudge().intValue();
// 符合此条件,需要判断是否此标准且为稀有元素且值小于0.01即可忽略为0 // 符合此条件,需要判断是否此标准且为稀有元素且值小于0.01即可忽略为0
RestAssert.fail(!isNumber(testValue), String.format("样品编号【%s】存在错误检测值【%s】", sample.getCode(), testValue)); RestAssert.fail(!isNumber(testValue), String.format("样品编号【%s】存在错误检测值【%s】", sample.getCode(), testValue));
if (1 == composeJudge || (isSpecStandard && otherYsList.contains(t.getName()) && Double.parseDouble(testValue) >= 0.01)) { // 判定包含稀有元素
boolean incSpecElement = otherYsList.stream().anyMatch(x -> t.getName().contains(x));
if (1 == composeJudge || (isSpecStandard && incSpecElement && Double.parseDouble(testValue) >= 0.01)) {
return new BigDecimal(testValue); return new BigDecimal(testValue);
} }
return BigDecimal.ZERO; return BigDecimal.ZERO;
...@@ -1530,7 +1532,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -1530,7 +1532,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List<EntrustSampleItemIndexVO> itemIndexVOList = entrustSampleItemIndexService.listVOBySampleIds(Collections.singletonList(vo.getId())); List<EntrustSampleItemIndexVO> itemIndexVOList = entrustSampleItemIndexService.listVOBySampleIds(Collections.singletonList(vo.getId()));
for (EntrustSampleItemIndexVO indexVO : itemIndexVOList) { for (EntrustSampleItemIndexVO indexVO : itemIndexVOList) {
if (StringUtils.isBlank(indexVO.getTestValue()) || !otherYsList.contains(indexVO.getName())) { boolean incSpecElement = otherYsList.stream().anyMatch(t -> indexVO.getName().contains(t));
if (StringUtils.isBlank(indexVO.getTestValue()) || !incSpecElement) {
continue; continue;
} }
if (Double.parseDouble(indexVO.getTestValue()) >= 0.01d) { if (Double.parseDouble(indexVO.getTestValue()) >= 0.01d) {
......
...@@ -124,8 +124,9 @@ ...@@ -124,8 +124,9 @@
<select id="selectVOList" resultType="com.patzn.cloud.service.hmhj.vo.EntrustVO"> <select id="selectVOList" resultType="com.patzn.cloud.service.hmhj.vo.EntrustVO">
with sample as ( with sample as (
select s.* from ( SELECT
select s.*,row_number() over(partition by s.entrust_id order by s.id asc) "rn" from entrust_sample s where s.deleted = 0 and s.type = 0 s.company_id,s.entrust_id,max(s.sample_from) "sample_from"
from entrust_sample s where s.deleted = 0 and s.type = 0
<if test="null != vo.sampleStatus"> <if test="null != vo.sampleStatus">
and s.status = #{vo.sampleStatus} and s.status = #{vo.sampleStatus}
</if> </if>
...@@ -141,7 +142,20 @@ ...@@ -141,7 +142,20 @@
<if test="null != vo.notSampleStatus"> <if test="null != vo.notSampleStatus">
and s.status != #{vo.notSampleStatus} and s.status != #{vo.notSampleStatus}
</if> </if>
) s where s.rn = 1 <if test="null != vo.itemStatus">
AND exists (
select 1 from entrust_sample_item i where i.deleted = 0
and i.entrust_sample_id = s.id and i.status = #{vo.itemStatus}
)
</if>
<if test="null!=vo.testerId">
and exists (
select 1 from entrust_sample_item i where i.deleted = 0
and i.entrust_sample_id = s.id and i.tester_id = #{vo.testerId}
)
</if>
GROUP BY s.company_id,s.entrust_id
) )
SELECT e.*,s.sample_from SELECT e.*,s.sample_from
FROM entrust e FROM entrust e
...@@ -159,24 +173,6 @@ ...@@ -159,24 +173,6 @@
) )
</if> </if>
<if test="null != vo.itemStatus">
AND exists (
select 1 from entrust_sample_item i
join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0
and s.entrust_id = e.id and i.status = #{vo.itemStatus}
)
</if>
<if test="null!=vo.testerId">
and exists (
select 1 from entrust_sample_item i
join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0
and s.entrust_id = e.id and i.tester_id = #{vo.testerId}
)
</if>
<if test="null != vo.reportStatus"> <if test="null != vo.reportStatus">
AND exists ( AND exists (
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
......
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