From 9f6e4af5e39a917b94fe597a31666970ff9b91ad Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 29 Sep 2025 21:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E7=AE=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E6=94=B6=E8=B4=B9=E9=A1=B9=E7=9B=AE=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E4=B8=BA0=EF=BC=8C=E8=B0=83=E6=95=B4=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=9F=A5=E8=AF=A2=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SltAgreementInfoMapper.java | 18 --------- .../impl/SltAgreementInfoServiceImpl.java | 38 +++++++++++++++++++ .../settlement/SltAgreementInfoMapper.xml | 10 ++--- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index 835985e5..8640f744 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -136,8 +136,6 @@ public interface SltAgreementInfoMapper { /** * 退料结算信息删除 - * @param leaseOutDetails - * @return */ int deleteSltInfo(@Param("record") LeaseOutDetails leaseOutDetails); @@ -174,33 +172,21 @@ public interface SltAgreementInfoMapper { /** * 新增租赁结算明细 - * @param list - * @param id - * @return */ int insertSltAgreementDetailLease(@Param("list") List list,@Param("id") Long id); /** * 新增维修结算明细 - * @param list - * @param id - * @return */ int insertSltAgreementDetailRepair(@Param("list") List list,@Param("id") Long id); /** * 新增报废结算明细 - * @param list - * @param id - * @return */ int insertSltAgreementDetailScrap(@Param("list") List list,@Param("id") Long id); /** * 新增丢失结算明细 - * @param list - * @param id - * @return */ int insertSltAgreementDetailLose(@Param("list") List list,@Param("id") Long id); @@ -219,8 +205,6 @@ public interface SltAgreementInfoMapper { /** * 未结算报表查询 - * @param bean - * @return */ List getSltReportList(SltAgreementInfo bean); @@ -283,8 +267,6 @@ public interface SltAgreementInfoMapper { /** * 获取结算信息 - * @param info - * @return */ List getSltAgreementInfoById(SltAgreementInfo info); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 829a0d96..72845100 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -2,10 +2,13 @@ package com.bonus.material.settlement.service.impl; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import cn.hutool.core.date.DateUtil; import com.bonus.common.biz.constant.GlobalConstants; import com.bonus.common.biz.domain.ProjectTreeBuild; import com.bonus.common.biz.domain.ProjectTreeNode; @@ -169,8 +172,27 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { List leaseList = getLeaseList(info); //维修费用列表 List repairList = getRepairList(info); + // 增加处理,维修不收费的金额设置为0 + if (CollectionUtils.isNotEmpty(repairList)) { + repairList.removeIf(Objects::isNull); + for (SltAgreementInfo repairItem : repairList) { + if (Objects.equals(repairItem.getPartType(), "不收费")) { + repairItem.setCosts(BigDecimal.ZERO); + } + } + } //报废费用列表 List scrapList = getScrapList(info); + // 增加处理,报废不收费的金额设置为0 + if (CollectionUtils.isNotEmpty(scrapList)) { + scrapList.removeIf(Objects::isNull); + for (SltAgreementInfo scrapItem : scrapList) { + if (Objects.equals(scrapItem.getPartType(), "不收费")) { + scrapItem.setCosts(BigDecimal.ZERO); + } + } + } + //丢失费用列表 List loseList = getLoseList(info); //费用减免列表 @@ -1149,6 +1171,9 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { throw new ServiceException("开始日期不能大于结束日期"); } + // 设置当前时间为当天最后的时分秒 + queryDto.setEndDate(getEndOfDay(queryDto.getEndDate())); + try { if (queryDto.getSltManageType() == null) { // 查询当前登陆用户的结算管理权限 @@ -1185,6 +1210,19 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { } } + + // 获取当天的结束时间 23:59:59.999 + public static Date getEndOfDay(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.HOUR_OF_DAY, 23); + cal.set(Calendar.MINUTE, 59); + cal.set(Calendar.SECOND, 59); + cal.set(Calendar.MILLISECOND, 999); + return cal.getTime(); + } + + /** * 过滤掉不在查询范围内的数据 * diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 674a9144..f9e640d4 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -1211,7 +1211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND ( - (bai.is_slt = 1 AND ( + ((bai.is_slt = 1 or bai.is_slt = 2) AND ( (sai.start_time IS NOT NULL AND DATE(sai.start_time) >= #{startDate} AND DATE(sai.start_time) <= #{endDate}) OR @@ -1229,16 +1229,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ((bai.is_slt = 0 OR bai.is_slt IS NULL) AND ( - (sai.start_time IS NOT NULL AND DATE(sai.start_time) >= #{startDate} AND DATE(sai.start_time) <= #{endDate}) + (sai.start_time IS NOT NULL AND DATE(sai.start_time) >= #{startDate} AND DATE(sai.start_time) <= DATE(#{endDate})) OR - (sai.end_time IS NOT NULL AND DATE(sai.end_time) >= #{startDate} AND DATE(sai.end_time) <= #{endDate}) + (sai.end_time IS NOT NULL AND DATE(sai.end_time) >= #{startDate} AND DATE(sai.end_time) <= DATE(#{endDate})) OR - (sai.start_time IS NOT NULL AND DATE(sai.start_time) < #{startDate} AND (sai.end_time IS NULL OR DATE(sai.end_time) > #{endDate})) + (sai.start_time IS NOT NULL AND DATE(sai.start_time) < #{startDate} AND (sai.end_time IS NULL OR DATE(sai.end_time) > DATE(#{endDate}))) OR - (sai.status = '0' AND sai.start_time IS NOT NULL AND DATE(sai.start_time) <= #{endDate}) + (sai.status = '0' AND sai.start_time IS NOT NULL AND DATE(sai.start_time) <= DATE(#{endDate})) )) )