This commit is contained in:
hongchao 2025-10-15 00:52:48 +08:00
commit 77fa7563d6
6 changed files with 89 additions and 19 deletions

View File

@ -44,6 +44,8 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@Api(tags = "材料站结算申请接口") @Api(tags = "材料站结算申请接口")
@ -244,6 +246,15 @@ public class ClzSltAgreementInfoController extends BaseController {
}else{ }else{
bean.setOverDay(overdueDays-7); bean.setOverDay(overdueDays-7);
} }
if(date!=null && !date.isEmpty()){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate dateParm = LocalDate.parse(date, formatter);
LocalDate resultDate = dateParm.plusDays(7);
bean.setOverTime(resultDate+"");
}
bean.setActualExitTime(date); bean.setActualExitTime(date);
BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal leasePrice = bean.getLeasePrice();
BigDecimal num = bean.getNum(); BigDecimal num = bean.getNum();
@ -469,6 +480,17 @@ public class ClzSltAgreementInfoController extends BaseController {
bean.setOverDay(overdueDays-7); bean.setOverDay(overdueDays-7);
} }
if(teamExitTime!=null && !teamExitTime.isEmpty()){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate dateParm = LocalDate.parse(teamExitTime, formatter);
LocalDate resultDate = dateParm.plusDays(7);
bean.setOverTime(resultDate+"");
}
bean.setActualExitTime(teamExitTime);
BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal leasePrice = bean.getLeasePrice();
BigDecimal num = bean.getNum(); BigDecimal num = bean.getNum();
// 根据班组退场时间计算租赁费用 // 根据班组退场时间计算租赁费用
@ -527,6 +549,8 @@ public class ClzSltAgreementInfoController extends BaseController {
if(date!=null && !date.isEmpty()){ if(date!=null && !date.isEmpty()){
listAll.get(0).setActualExitTime(date); listAll.get(0).setActualExitTime(date);
}else{
listAll.get(0).setActualExitTime("暂无");
} }
projectNames.add(listAll.get(0).getProjectName()); projectNames.add(listAll.get(0).getProjectName());
unitNames.add(listAll.get(0).getUnitName()); unitNames.add(listAll.get(0).getUnitName());

View File

@ -26,7 +26,7 @@ public class LeaseTotalInfo {
private Long parentId; private Long parentId;
@ApiModelProperty(value = "序号") @ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0) @Excel(name = "序号", isSequence = true, sort = 0, width = 5)
private String serialNumber; private String serialNumber;
@ApiModelProperty(value = "分公司") @ApiModelProperty(value = "分公司")

View File

@ -1472,10 +1472,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
list = list.stream() list = list.stream()
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard())) .filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} /*else { }
// 材料员权限
list = filterListInfo(list, username);
}*/
} }
// 处理数据并计算总和 // 处理数据并计算总和
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
@ -1494,7 +1491,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
} }
} }
for (LeaseTotalInfo leaseTotalInfo : list) { /*for (LeaseTotalInfo leaseTotalInfo : list) {
// 根据typeId和parentId查询领料数量 // 根据typeId和parentId查询领料数量
LeaseTotalInfo totalInfo = materialLeaseInfoMapper.getTotalInfo(leaseTotalInfo); LeaseTotalInfo totalInfo = materialLeaseInfoMapper.getTotalInfo(leaseTotalInfo);
if (totalInfo != null) { if (totalInfo != null) {
@ -1518,6 +1515,16 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
summary.setOutNum(outNum.setScale(3, RoundingMode.HALF_UP)); summary.setOutNum(outNum.setScale(3, RoundingMode.HALF_UP));
summary.setPendingNum(pendingNum.setScale(3, RoundingMode.HALF_UP)); summary.setPendingNum(pendingNum.setScale(3, RoundingMode.HALF_UP));
list.add(0, summary); list.add(0, summary);
}*/
// 累加list中的outNum数量
BigDecimal totalOutNum = list.stream()
.map(LeaseTotalInfo::getOutNum)
.reduce(BigDecimal.ZERO, BigDecimal::add);
if (info.getIsExport() == 0) {
LeaseTotalInfo summary = new LeaseTotalInfo();
summary.setUnitName("合计");
summary.setOutNum(totalOutNum.setScale(3, RoundingMode.HALF_UP));
list.add(0, summary);
} }
} }
return list; return list;

View File

@ -1280,6 +1280,25 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
MaterialRetainedEquipmentInfo materialRetainedEquipmentInfo = new MaterialRetainedEquipmentInfo(); MaterialRetainedEquipmentInfo materialRetainedEquipmentInfo = new MaterialRetainedEquipmentInfo();
materialRetainedEquipmentInfo.setSubUnitName("分包直领"); materialRetainedEquipmentInfo.setSubUnitName("分包直领");
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getSubUnitList(bean); List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getSubUnitList(bean);
if (CollectionUtils.isNotEmpty(list)) {
// 使用Stream过滤并收集符合条件的元素
list = list.stream()
.filter(info -> info.getSubUnitName() != null)
.filter(this::hasRelatedAgreements)
.collect(Collectors.toList());
list = new ArrayList<>(list.stream()
// 过滤条件subUnitName非空 + 满足关联协议判断
.filter(info -> info.getSubUnitName() != null)
.filter(this::hasRelatedAgreements)
// subUnitName 去重 subUnitName 做Map的keyvalue为原对象
.collect(Collectors.toMap(
MaterialRetainedEquipmentInfo::getSubUnitName,
info -> info,
(existing, replacement) -> existing
))
// 将Map的value去重后的对象转回List
.values());
}
list.add(0, materialRetainedEquipmentInfo); list.add(0, materialRetainedEquipmentInfo);
return list; return list;
} }

View File

@ -1346,6 +1346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bu.type_id = 36 AND bu.type_id = 36
and sd.dept_id not in (342,345,347,348,101) and sd.dept_id not in (342,345,347,348,101)
and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_id not in (3414,1192,3321,3595)
and bp.pro_center IS NOT NULL
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name = #{impUnitName} AND sd.dept_name = #{impUnitName}
</if> </if>
@ -1514,6 +1515,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bp.external_id is not NULL AND bp.external_id is not NULL
and sd.dept_id not in (342,345,347,348,101) and sd.dept_id not in (342,345,347,348,101)
and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_id not in (3414,1192,3321,3595)
and bp.pro_center IS NOT NULL
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name = #{impUnitName} AND sd.dept_name = #{impUnitName}
</if> </if>
@ -1738,23 +1740,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSubUnitList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo"> <select id="getSubUnitList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
SELECT DISTINCT SELECT DISTINCT
bz.bzmc AS teamName, bu.unit_name AS teamName,
bz.ssfbdw AS subUnitName bp.external_id AS externalId,
bz.ssfbdw AS subUnitName
FROM FROM
`micro-tool`.bzgl_bz bz clz_slt_agreement_info sai
LEFT JOIN bm_project bp ON bz.project_id = bp.external_id LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id AND bu.del_flag = '0'
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
LEFT JOIN `micro-tool`.bzgl_bz bz ON bp.external_id = bz.project_id AND bz.bzmc = bu.unit_name
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
WHERE WHERE
bz.bzmc IS NOT NULL sai.`status` = '0'
AND sai.end_time IS NULL
AND sai.back_id IS NULL
AND bu.unit_name is not null
AND bp.external_id is not NULL
and sd.dept_id not in (342,345,347,348,101)
and bp.pro_id not in (3414,1192,3321,3595)
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name LIKE CONCAT('%', #{impUnitName}, '%') AND sd.dept_name = #{impUnitName}
</if> </if>
<if test="proName != null and proName != ''"> <if test="proName != null and proName != ''">
AND bp.pro_name LIKE CONCAT('%', #{proName}, '%') AND bp.pro_name = #{proName}
</if> </if>
<if test="departName != null and departName != ''"> <if test="departName != null and departName != ''">
AND df.project_dept LIKE CONCAT('%', #{departName}, '%') AND bp.pro_center LIKE CONCAT('%', #{departName}, '%')
</if>
<if test="teamName != null and teamName != ''">
AND bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
</if>
<if test="subUnitName != null and subUnitName != ''">
AND bz.ssfbdw LIKE CONCAT('%', #{subUnitName}, '%')
</if> </if>
<if test="projectIdList != null and projectIdList.size() > 0"> <if test="projectIdList != null and projectIdList.size() > 0">
AND bp.external_id in AND bp.external_id in
@ -1762,14 +1781,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="subUnitName != null and subUnitName != ''">
AND bz.ssfbdw LIKE CONCAT('%', #{subUnitName}, '%')
</if>
<if test="impUnit != null and impUnit != ''"> <if test="impUnit != null and impUnit != ''">
AND bp.imp_unit = #{impUnit} AND bp.imp_unit = #{impUnit}
</if> </if>
GROUP BY GROUP BY
bz.ssfbdw mt.type_id, bu.unit_name, bp.pro_name, bz.ssfbdw
</select> </select>
<select id="getStoreNumAndUseList" resultType="com.bonus.material.clz.domain.vo.MaterialStorageAndUseNumInfo"> <select id="getStoreNumAndUseList" resultType="com.bonus.material.clz.domain.vo.MaterialStorageAndUseNumInfo">
@ -2062,6 +2078,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.is_slt = '0' sai.is_slt = '0'
AND bp.external_id IS NOT NULL AND bp.external_id IS NOT NULL
and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_id not in (3414,1192,3321,3595)
and bp.pro_center IS NOT NULL
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name = #{impUnitName} AND sd.dept_name = #{impUnitName}
</if> </if>
@ -2137,6 +2154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND sai.end_time IS NULL AND sai.end_time IS NULL
AND sai.back_id IS NULL AND sai.back_id IS NULL
and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_id not in (3414,1192,3321,3595)
and bp.pro_center IS NOT NULL
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name = #{impUnitName} AND sd.dept_name = #{impUnitName}
</if> </if>
@ -2399,6 +2417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bp.external_id IS NOT NULL AND bp.external_id IS NOT NULL
AND bu.type_id in(32,33) AND bu.type_id in(32,33)
and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_id not in (3414,1192,3321,3595)
and bp.pro_center IS NOT NULL
<if test="impUnitName != null and impUnitName != ''"> <if test="impUnitName != null and impUnitName != ''">
AND sd.dept_name = #{impUnitName} AND sd.dept_name = #{impUnitName}
</if> </if>

View File

@ -499,6 +499,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.del_flag = '0' bp.del_flag = '0'
-- 剔除已结算工程 -- 剔除已结算工程
AND bp.pro_id IN (SELECT project_id FROM bm_agreement_info WHERE is_slt = 0) AND bp.pro_id IN (SELECT project_id FROM bm_agreement_info WHERE is_slt = 0)
AND bp.external_id IS NOT NULL
<if test="impUnit != null and impUnit != ''"> <if test="impUnit != null and impUnit != ''">
and bp.imp_unit = #{impUnit} and bp.imp_unit = #{impUnit}
</if> </if>