This commit is contained in:
mashuai 2025-07-19 17:48:40 +08:00
parent 1da5ba205f
commit 16e8fe193a
19 changed files with 128 additions and 24 deletions

View File

@ -321,6 +321,6 @@ public class LeaseApplyInfo extends BaseEntity{
private List<Long> typeIdList;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
@ApiModelProperty(value = "一级类型id结果集")
private String firstId;
}

View File

@ -275,5 +275,5 @@ public class LeasePublishInfo extends BaseEntity{
private List<Long> typeIdList;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
private String firstId;
}

View File

@ -189,6 +189,6 @@ public class RepairInputDetails extends BaseEntity {
private Long userId;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
private String firstId;
}

View File

@ -186,6 +186,6 @@ public class BackApplyInfo implements Serializable {
*/
private Integer isSign;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
@ApiModelProperty(value = "一级类型id集合")
private String firstId;
}

View File

@ -319,8 +319,23 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
list = backApplyInfoMapper.selectBackApplyInfoList(backApplyInfo);
for (BackApplyInfo applyInfo : list) {
if (!CollectionUtils.isEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
list = list.stream()
.filter(item -> typeIdList.contains(item.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
if (StringUtils.isNotBlank(applyInfo.getBackSignUrl())) {

View File

@ -147,5 +147,5 @@ public interface LeaseApplyInfoMapper {
* @param id
* @return
*/
List<LeaseOutSign> selectOutList(Long id);
List<LeaseOutSign> selectOutList(@Param("id") Long id, @Param("leaseSignId") String leaseSignId);
}

View File

@ -187,7 +187,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 根据id查询领料出库情况查询出库人电子签名详情
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id);
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id, null);
if (!CollectionUtils.isEmpty(signList)) {
for (LeaseOutSign applyInfo : signList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -276,6 +276,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
}
// 根据id查询领料出库情况查询出库人电子签名详情
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(bean.getId(), bean.getLeaseSignId());
if (!CollectionUtils.isEmpty(signList)) {
for (LeaseOutSign applyInfo : signList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
applyInfo.setOutSignUrl("data:image/png;base64," + applyInfo.getOutSignUrl());
}
}
leaseApplyRequestVo.setOutSignList(signList);
}
return leaseApplyRequestVo;
} catch (Exception e) {
// 记录异常日志
@ -319,8 +330,23 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sortedList)) {
if (!CollectionUtils.isEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
sortedList = sortedList.stream()
.filter(item -> typeIdList.contains(item.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
String keyWord = leaseApplyInfo.getKeyWord();

View File

@ -760,8 +760,23 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
List<LeasePublishInfo> list = mapper.getPublishList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(list)) {
if (!CollectionUtils.isEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
list = list.stream()
.filter(item -> typeIdList.contains(item.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
String keyWord = leaseApplyInfo.getKeyWord();

View File

@ -188,5 +188,5 @@ public class RepairTask {
private Long userId;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
private String firstId;
}

View File

@ -138,5 +138,5 @@ public class ScrapApplyDetailsVO {
private String dispositionFileName;
@ApiModelProperty(value = "一级类型id")
private Long firstId;
private String firstId;
}

View File

@ -150,8 +150,23 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
if (!CollectionUtil.isNotEmpty(repairQuestList)) {
if (CollectionUtil.isNotEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
repairQuestList = repairQuestList.stream()
.filter(item -> item.getFirstId() != null && typeIdList.contains(item.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
}

View File

@ -2,8 +2,10 @@ package com.bonus.material.repair.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
@ -134,7 +136,21 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
if (CollectionUtils.isNotEmpty(list)) {
if (CollectionUtils.isNotEmpty(typeIdList)) {
list = list.stream()
.filter(inputDetails -> typeIdList.contains(inputDetails.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
}

View File

@ -113,8 +113,23 @@ public class RepairServiceImpl implements RepairService {
List<RepairTask> list = repairMapper.getRepairTaskList(bean);
if (CollectionUtil.isNotEmpty(list)) {
if (CollectionUtil.isNotEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
list = list.stream()
.filter(item -> typeIdList.contains(item.getFirstId()))
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
String keyWord = bean.getKeyWord();

View File

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeName,
bai.`status` AS status,
bai.print_status as printStatus,
mt4.type_id as firstId
GROUP_CONCAT(DISTINCT mt4.type_id) as firstId
FROM
back_apply_info bai
LEFT JOIN back_apply_details bad on bad.parent_id = bai.id

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.contract_part as contractPart,
sd.dept_name as impUnitName,
tt.task_type as taskType,
mt3.type_id as firstId
GROUP_CONCAT(DISTINCT mt3.type_id) as firstId
from
lease_apply_info lai
left join tm_task tt on lai.task_id = tt.task_id
@ -446,7 +446,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on lod.type_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
left join sys_user su on lod.confirm_person = su.user_id
where lod.parent_id = 353
where lod.parent_id = #{id}
and lod.out_num > 0
and lod.lease_sign_id is not null
<if test="keyWord != null and keyWord != ''">
@ -510,7 +510,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where lod.parent_id = #{id}
and lod.out_num > 0
and lod.lease_sign_id = #{leaseSignId}
ORDER BY lod.create_time DESC
</select>
<select id="getLeaseConfirmSign" resultType="com.bonus.common.biz.domain.lease.LeaseConfirmSign">
select
@ -585,6 +585,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
lsi.lease_sign_url IS NOT NULL
and lod.parent_id = #{id}
and lsi.id = #{leaseSignId}
GROUP BY
lod.lease_sign_id
</select>

View File

@ -799,7 +799,7 @@
GROUP_CONCAT(DISTINCT mt1.type_name) AS maTypeNames,
bp.contract_part as contractPart,
sd.dept_name as impUnitName,
mt3.type_id as firstId
GROUP_CONCAT(DISTINCT mt3.type_id) as firstId
from
lease_apply_info lai
left join tm_task tt on lai.task_id = tt.task_id

View File

@ -327,7 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tk.create_time createTime,
tk.remark,
tk.CODE repairNum,
mt4.type_id as firstId
GROUP_CONCAT( DISTINCT mt4.type_id) as firstId
FROM
tm_task tk
LEFT JOIN tm_task tt ON tk.pre_task_id = tt.task_id
@ -371,6 +371,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="appTaskStatus != null and appTaskStatus == 11">
and (tk.task_status = 11 or tk.task_status = 12)
</if>
GROUP BY tk.CODE
order by tk.create_time desc
</select>

View File

@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tt.CODE AS inputCode,
GROUP_CONCAT(DISTINCT mt2.type_name) AS materialType,
tta.agreement_id as agreementId,
mt4.type_id as firstId
GROUP_CONCAT( DISTINCT mt4.type_id) as firstId
FROM
repair_input_details rd
LEFT JOIN ma_type mt on rd.type_id = mt.type_id

View File

@ -265,7 +265,7 @@
bai.CODE AS backCode,
GROUP_CONCAT(DISTINCT mt2.type_name) as type,
rd.level as level,
mt4.type_id as firstId
GROUP_CONCAT(DISTINCT mt4.type_id) as firstId
FROM
repair_apply_details rd
LEFT JOIN ma_type mt on rd.type_id = mt.type_id