This commit is contained in:
parent
113b6ecd9c
commit
3eec00da89
|
|
@ -133,4 +133,10 @@ public class LeaseApplyDetailExport extends BaseEntity{
|
||||||
private List<Integer> statusList;
|
private List<Integer> statusList;
|
||||||
|
|
||||||
private String businessCode;
|
private String businessCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "协议号")
|
||||||
|
private String agreementCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "合同主体")
|
||||||
|
private String contractPart;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1332,34 +1332,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
List<LeaseApplyDetailExport> listAll = new ArrayList<>();
|
List<LeaseApplyDetailExport> listAll = new ArrayList<>();
|
||||||
//领料
|
//领料
|
||||||
List<LeaseApplyDetailExport> listOne = leaseApplyDetailsMapper.selectLeaseApplyLL(bean);
|
List<LeaseApplyDetailExport> listOne = leaseApplyDetailsMapper.selectLeaseApplyLL(bean);
|
||||||
if (!CollectionUtils.isEmpty(listOne)) {
|
|
||||||
String keyWord = bean.getKeyWord();
|
|
||||||
List<?> statusList = bean.getStatusList();
|
|
||||||
|
|
||||||
// 转换为HashSet提高contains操作的效率(O(1))
|
|
||||||
Set<?> statusSet = CollectionUtils.isEmpty(statusList) ?
|
|
||||||
Collections.emptySet() :
|
|
||||||
new HashSet<>(statusList);
|
|
||||||
|
|
||||||
listOne = listOne.stream()
|
|
||||||
.filter(item -> StringUtils.isBlank(keyWord) || containsKeywordDetail(item, keyWord))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
//领用
|
//领用
|
||||||
List<LeaseApplyDetailExport> listTwo = leaseApplyDetailsMapper.selectLeaseApplyLY(bean);
|
List<LeaseApplyDetailExport> listTwo = leaseApplyDetailsMapper.selectLeaseApplyLY(bean);
|
||||||
if (!CollectionUtils.isEmpty(listTwo)) {
|
|
||||||
String keyWord = bean.getKeyWord();
|
|
||||||
List<?> statusList = bean.getStatusList();
|
|
||||||
|
|
||||||
// 转换为HashSet提高contains操作的效率(O(1))
|
|
||||||
Set<?> statusSet = CollectionUtils.isEmpty(statusList) ?
|
|
||||||
Collections.emptySet() :
|
|
||||||
new HashSet<>(statusList);
|
|
||||||
|
|
||||||
listTwo = listTwo.stream()
|
|
||||||
.filter(item -> StringUtils.isBlank(keyWord) || containsKeywordDetail(item, keyWord))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(listOne)) {
|
if (!CollectionUtils.isEmpty(listOne)) {
|
||||||
listAll.addAll(listOne);
|
listAll.addAll(listOne);
|
||||||
|
|
@ -1370,7 +1344,14 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
|
|
||||||
// 对合并后的列表进行排序
|
// 对合并后的列表进行排序
|
||||||
if (!CollectionUtils.isEmpty(listAll)) {
|
if (!CollectionUtils.isEmpty(listAll)) {
|
||||||
|
String keyWord = bean.getKeyWord();
|
||||||
|
if (StringUtils.isNotBlank(keyWord)) {
|
||||||
|
listAll = listAll.stream()
|
||||||
|
.filter(item -> StringUtils.isBlank(keyWord) || containsKeywordDetail(item, keyWord))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
listAll = listAll.stream()
|
listAll = listAll.stream()
|
||||||
|
// 先按code升序,再按releaseTime降序(null排末尾),一次sorted完成多条件排序
|
||||||
.sorted(Comparator.comparing(LeaseApplyDetailExport::getCode)
|
.sorted(Comparator.comparing(LeaseApplyDetailExport::getCode)
|
||||||
.thenComparing(LeaseApplyDetailExport::getReleaseTime))
|
.thenComparing(LeaseApplyDetailExport::getReleaseTime))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -1414,7 +1395,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
(item.getLeasePerson() != null && item.getLeasePerson().contains(keyWord)) ||
|
(item.getLeasePerson() != null && item.getLeasePerson().contains(keyWord)) ||
|
||||||
(item.getImpUnitName() != null && item.getImpUnitName().contains(keyWord)) ||
|
(item.getImpUnitName() != null && item.getImpUnitName().contains(keyWord)) ||
|
||||||
(item.getTypeModelName() != null && item.getTypeModelName().contains(keyWord)) ||
|
(item.getTypeModelName() != null && item.getTypeModelName().contains(keyWord)) ||
|
||||||
(item.getBusinessCode() != null && item.getBusinessCode().contains(keyWord));
|
(item.getBusinessCode() != null && item.getBusinessCode().contains(keyWord)) ||
|
||||||
|
(item.getContractPart() != null && item.getContractPart().contains(keyWord)) ||
|
||||||
|
(item.getAgreementCode() != null && item.getAgreementCode().contains(keyWord));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -834,7 +834,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
CASE
|
CASE
|
||||||
WHEN mt.manage_type = 0 THEN '编码出库'
|
WHEN mt.manage_type = 0 THEN '编码出库'
|
||||||
ELSE '数量出库'
|
ELSE '数量出库'
|
||||||
END as manageTypeName
|
END as manageTypeName,
|
||||||
|
bai.agreement_code as agreementCode,
|
||||||
|
bp.contract_part as contractPart
|
||||||
from
|
from
|
||||||
lease_out_details lod
|
lease_out_details lod
|
||||||
left join lease_apply_info lai on lai.id = lod.parent_id
|
left join lease_apply_info lai on lai.id = lod.parent_id
|
||||||
|
|
@ -878,7 +880,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
lpd.code as code,
|
lpd.code as code,
|
||||||
lpd.lease_person AS leasePerson,
|
lpd.lease_person AS leasePerson,
|
||||||
tt.task_status as taskStatus,
|
tt.task_status as taskStatus,
|
||||||
tt.create_time AS releaseTime,
|
lpd.create_time AS releaseTime,
|
||||||
bu.unit_name as leaseUnit ,
|
bu.unit_name as leaseUnit ,
|
||||||
bp.pro_name as leaseProject,
|
bp.pro_name as leaseProject,
|
||||||
lod.out_num as alNum,
|
lod.out_num as alNum,
|
||||||
|
|
@ -888,9 +890,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHEN mt.manage_type = 0 THEN '编码出库'
|
WHEN mt.manage_type = 0 THEN '编码出库'
|
||||||
ELSE '数量出库'
|
ELSE '数量出库'
|
||||||
END as manageTypeName,
|
END as manageTypeName,
|
||||||
mm.ma_code as maCode
|
mm.ma_code as maCode,
|
||||||
|
bai.agreement_code as agreementCode,
|
||||||
|
bp.contract_part as contractPart
|
||||||
from
|
from
|
||||||
lease_out_details lod
|
lease_out_details lod
|
||||||
left join lease_apply_info lai on lai.id = lod.parent_id
|
left join lease_apply_info lai on lai.id = lod.parent_id
|
||||||
|
|
@ -899,19 +901,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join bm_unit bu on bu.unit_id = lpd.unit_id
|
left join bm_unit bu on bu.unit_id = lpd.unit_id
|
||||||
left join bm_project bp on bp.pro_id = lpd.project_id
|
left join bm_project bp on bp.pro_id = lpd.project_id
|
||||||
left join sys_dept sd on sd.dept_id = bp.imp_unit
|
left join sys_dept sd on sd.dept_id = bp.imp_unit
|
||||||
|
LEFT JOIN bm_agreement_info bai ON lpd.unit_id = bai.unit_id AND lpd.project_id = bai.project_id AND bai.project_unit_id IS NULL
|
||||||
left join ma_type mt on lod.type_id = mt.type_id and mt.del_flag = '0'
|
left join ma_type mt on lod.type_id = mt.type_id and mt.del_flag = '0'
|
||||||
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
|
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
|
||||||
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
|
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
|
||||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||||
LEFT JOIN ma_machine mm on mm.ma_id = lod.ma_id
|
LEFT JOIN ma_machine mm on mm.ma_id = lod.ma_id
|
||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id =#{userId}
|
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id =#{userId}
|
||||||
</if>
|
</if>
|
||||||
where
|
where
|
||||||
tt.task_type = '19'
|
tt.task_type = '19'
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
and tt.create_time BETWEEN #{startTime} AND #{endTime}
|
and lpd.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="leaseUnitId != null ">
|
<if test="leaseUnitId != null ">
|
||||||
and lpd.unit_id = #{leaseUnitId}
|
and lpd.unit_id = #{leaseUnitId}
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND bp.pro_name is not null
|
AND bp.pro_name is not null
|
||||||
and sai.`status`='0'
|
and sai.`status`='0'
|
||||||
and sai.is_slt = 0
|
and sai.is_slt = 0
|
||||||
|
AND (sai.source = 1 OR sai.source is NULL)
|
||||||
and mm.ma_status = 2
|
and mm.ma_status = 2
|
||||||
and mt2.type_id not in (6032,6008,6270) and mt.company_id = 101
|
and mt2.type_id not in (6032,6008,6270) and mt.company_id = 101
|
||||||
and mt.jiju_type =2
|
and mt.jiju_type =2
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,8 @@
|
||||||
AND mm.this_check_time is not null
|
AND mm.this_check_time is not null
|
||||||
AND mm.next_check_time is not null
|
AND mm.next_check_time is not null
|
||||||
AND mt.jiju_type = 2
|
AND mt.jiju_type = 2
|
||||||
and sai.`status`='0'
|
AND sai.`status`='0'
|
||||||
|
AND (sai.source = 1 OR sai.source is NULL)
|
||||||
AND mt2.type_id not in (6032,6008,6270)
|
AND mt2.type_id not in (6032,6008,6270)
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
AND mt.company_id=#{companyId}
|
AND mt.company_id=#{companyId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue