From 2c4db1d75f18e4848d19bdccf60f3144f43bc2a3 Mon Sep 17 00:00:00 2001 From: jiask <1069621233@qq.com> Date: Fri, 9 Jan 2026 14:55:25 +0800 Subject: [PATCH] =?UTF-8?q?jsk=20=20=20=E6=A3=80=E9=AA=8C=E9=A2=84?= =?UTF-8?q?=E8=AD=A6=20=E6=9D=83=E9=99=90=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExpectationsServiceImpl.java | 12 +++++++----- .../material/expectations/ExpectationsMapper.xml | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java index 93116460..540913ac 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java @@ -10,10 +10,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; @Slf4j @Service @@ -69,7 +66,12 @@ public class ExpectationsServiceImpl implements ExpectationsService { //在用设备量 countExpectations = mapper.getUseCountExpectations(entity); } - return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.error(); + Map map=new HashMap<>(); + if(!ObjectUtils.isNotEmpty(countExpectations)){ + map.put("expired","0"); + map.put("aboutToExpire","0"); + } + return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.success(map); }catch (Exception e) { log.error(e.getMessage()); return AjaxResult.error(); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml index 7421de14..fcc2984e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml @@ -124,6 +124,9 @@ AND sai.`status` = '0' AND mm.next_check_time < DATE_ADD(CURDATE(), INTERVAL 30 DAY) AND mt2.type_id not in (6032,6008,6270) + + AND mt.company_id=#{companyId} + GROUP BY name;