Commit c4fb047a by lijingjing

修改分厂数据查询问题;

parent fd9a5857
......@@ -390,7 +390,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Entrust entrust = dto.convert(Entrust.class);
List<EntrustSampleDTO> sampleDTOList = dto.getSampleDTOList();
RestAssert.fail(CollectionUtils.isEmpty(sampleDTOList), "委托样品为空");
Long materialId = sampleDTOList.get(0).getMaterialId();
final Long materialId = sampleDTOList.get(0).getMaterialId();
// 赋值 物资ID
if (null == entrust.getMaterialId() && null != materialId) {
entrust.setMaterialId(materialId);
......@@ -470,9 +470,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust.setTotalFee(totalFee);
//保存样品名称
entrust.setSampleName(sampleDTOList.get(0).getName());
if (null == entrust.getMaterialId()) {
entrust.setMaterialId(sampleDTOList.get(0).getMaterialId());
}
saveEntrust(entrust);
if (CollectionUtils.isNotEmpty(saveSampleList)) {
entrustSampleService.saveBatch(saveSampleList);
......
......@@ -25,25 +25,25 @@
<if test="null!=vo.sampleName">
AND e.sample_name like concat('%',#{vo.sampleName},'%')
</if>
<if test="null!=vo.assignor">
<if test="null != vo.assignor">
AND e.assignor like concat('%',#{vo.assignor},'%')
</if>
<if test="null!=vo.period">
<if test="null != vo.period">
AND (e.period is null or e.period = #{vo.period} )
</if>
<if test="null != vo.isSelf and true == vo.isSelf">
AND (
e.uid = #{vo.uid} or
exists (
select 1 from business_staff s
where s.deleted = 0
and s.biz_id = e.material_id
and s.biz_type = 'REPORT_RECIPIENT'
and s.staff_id = #{vo.uid}
<if test="null != vo.period">
AND (e.period is null or (e.period is not null and e.period = #{vo.period}))
</if>
)
e.uid = #{vo.uid} or exists (
select
1
from business_staff s
join material m
on m.id = s.biz_id and m.deleted = 0
where s.deleted = 0
and s.biz_type = 'REPORT_RECIPIENT'
and m.name = e.sample_name
and s.staff_id = #{vo.uid}
)
)
</if>
<if test="null == vo.isSelf and null != vo.uid">
......
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