From 2851805852709d379ec339fe7f7f3069ca4650ea Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 12 Nov 2025 17:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/service/impl/MachineServiceImpl.java | 22 +++--- .../controller/IwsCostPushController.java | 12 +-- .../material/push/domain/IwsCostPushBean.java | 2 +- .../service/impl/IwsCostPushServiceImpl.java | 24 +++--- .../lease/LeaseApplyDetailsMapper.xml | 3 + .../mapper/material/ma/MachineMapper.xml | 75 ++++++++++--------- .../settlement/SltAgreementInfoMapper.xml | 4 +- 7 files changed, 79 insertions(+), 63 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java index 006f4b42..89e9e37d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java @@ -224,21 +224,19 @@ public class MachineServiceImpl implements IMachineService //查询ma_machine表,安全工器具 list = machineMapper.getElectronicLabel(machine); } - for (Machine dto : list){ - Date nextCheckTime = dto.getNextCheckTime(); - Date todayStart = new Date(); // 获取当前时间 - // 将 todayStart 设置为当天的开始时间(00:00:00) - todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault()) - .withHour(0).withMinute(0).withSecond(0).withNano(0) - .toInstant()); - if (nextCheckTime != null && nextCheckTime.before(todayStart)) { - type=1; - throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!"); - } - } if (CollectionUtils.isNotEmpty(list)) { for (Machine dto : list) { + Date nextCheckTime = dto.getNextCheckTime(); + Date todayStart = new Date(); // 获取当前时间 + // 将 todayStart 设置为当天的开始时间(00:00:00) + todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault()) + .withHour(0).withMinute(0).withSecond(0).withNano(0) + .toInstant()); + if (nextCheckTime != null && nextCheckTime.before(todayStart)) { + type=1; + throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!"); + } // 根据typeId查询信息 Machine info = machineMapper.selectHouse(dto); if (info != null) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java index 494413b7..df50d329 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java @@ -1,18 +1,20 @@ package com.bonus.material.push.controller; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.convert.Convert; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.utils.AesEncryptUtils; import com.bonus.common.biz.utils.HttpHelper; import com.bonus.common.biz.utils.StringHelper; import com.bonus.common.core.exception.ServiceException; +import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; -import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo; import com.bonus.material.push.domain.IwsCostPushBean; import com.bonus.material.push.domain.vo.IwsCostPushExportVo; import com.bonus.material.push.service.IwsCostPushService; @@ -25,7 +27,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -55,10 +56,11 @@ public class IwsCostPushController extends BaseController { */ @ApiOperation("查询协议推送匹配列表--分页") @GetMapping("/findAgreementPushMatchList") - public TableDataInfo findAgreementPushMatchList(IwsCostPushBean obj) { - startPage(); + public AjaxResult findAgreementPushMatchList(IwsCostPushBean obj) { + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); List list = iwsCostPushService.findAgreement(obj); - return getDataTable(list); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java index c7b24d5e..925dca4f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java @@ -144,7 +144,7 @@ public class IwsCostPushBean implements Serializable { // 是否匹配 @Excel(name = "是否匹配", readConverterExp = "0=未匹配,1=已匹配", sort = 5) - private Byte isMatch = 0; + private Byte isMatch; private String userName; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java index bd6cd5e9..3822a8da 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java @@ -68,15 +68,21 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { public List findAgreement(IwsCostPushBean o) { List pushBeanList = iwsCostPushMapper.findAgreement(o); - // 使用流式操作过滤掉null值,并设置isMatch属性 - return pushBeanList.stream() - .filter(Objects::nonNull) - .peek(bean -> { - if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) { - bean.setIsMatch((byte) 1); - } - }) - .collect(Collectors.toList()); + pushBeanList.forEach(bean -> { + if (bean != null) { + if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) { + bean.setIsMatch((byte) 1); + } else { + bean.setIsMatch((byte) 0); + } + } + }); + + if (o.getIsMatch() != null) { + pushBeanList = pushBeanList.stream().filter(bean -> bean.getIsMatch().equals(o.getIsMatch())).collect(Collectors.toList()); + } + + return pushBeanList; } /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml index a113f346..a7fe7268 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml @@ -432,6 +432,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id = #{userId} WHERE lod.parent_id = #{id} + + AND lod.publish_task = #{publishTask} + and mt4.type_id in diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index 5cda7c47..60c28eed 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -518,40 +518,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 b4913d8a..ba226fb3 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 @@ -329,8 +329,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sai.lease_price as leasePrice, sai.num as num, DATE(sai.start_time) as startTime, - DATE(sai.end_time) as endTime, - DATEDIFF(IF(sai.end_time is null,CURDATE(),sai.end_time), sai.start_time) + 1 as leaseDays + IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time) as endTime, + DATEDIFF(IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time), sai.start_time) + 1 as leaseDays from slt_agreement_info sai LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id