jsk 检验预警 权限改造

This commit is contained in:
jiask 2026-01-09 14:55:25 +08:00
parent dbf9e35923
commit 2c4db1d75f
2 changed files with 10 additions and 5 deletions

View File

@ -10,10 +10,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Slf4j @Slf4j
@Service @Service
@ -69,7 +66,12 @@ public class ExpectationsServiceImpl implements ExpectationsService {
//在用设备量 //在用设备量
countExpectations = mapper.getUseCountExpectations(entity); countExpectations = mapper.getUseCountExpectations(entity);
} }
return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.error(); Map<String,String> 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) { }catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
return AjaxResult.error(); return AjaxResult.error();

View File

@ -124,6 +124,9 @@
AND sai.`status` = '0' AND sai.`status` = '0'
AND mm.next_check_time &lt; DATE_ADD(CURDATE(), INTERVAL 30 DAY) AND mm.next_check_time &lt; DATE_ADD(CURDATE(), INTERVAL 30 DAY)
AND mt2.type_id not in (6032,6008,6270) AND mt2.type_id not in (6032,6008,6270)
<if test="companyId != null and companyId != ''">
AND mt.company_id=#{companyId}
</if>
GROUP BY name; GROUP BY name;
</select> </select>