Compare commits

..

2 Commits

Author SHA1 Message Date
xiaofajia
e1aaa4ac12 补正提醒 2024-12-13 15:06:19 +08:00
xiaofajia
409ba7e88e 补正 2024-12-13 11:08:30 +08:00
3 changed files with 13 additions and 3 deletions

View File

@ -4,8 +4,11 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -13,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.module.inspection.entity.WarnMessage; import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
import cn.iocoder.yudao.module.inspection.service.IWarnMessageService; import cn.iocoder.yudao.module.inspection.service.IWarnMessageService;
import io.prometheus.client.CollectorRegistry;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cn.iocoder.yudao.module.inspection.mapper.InspectionEquInfoMapper; import cn.iocoder.yudao.module.inspection.mapper.InspectionEquInfoMapper;
@ -30,6 +34,7 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
{ {
@Autowired @Autowired
private IWarnMessageService messageService; private IWarnMessageService messageService;
private CollectorRegistry collectorRegistry;
/** /**
* 查询equInfo * 查询equInfo
@ -92,14 +97,16 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
* @return 结果 * @return 结果
*/ */
@Override @Override
@DSTransactional
public int updateInspectionEquInfo(InspectionEquInfo inspectionEquInfo) public int updateInspectionEquInfo(InspectionEquInfo inspectionEquInfo)
{ {
LambdaQueryWrapper<WarnMessage> queryWrapper =new LambdaQueryWrapper<>(); LambdaQueryWrapper<WarnMessage> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(WarnMessage::getType,"equ").eq(WarnMessage::getObjectId,inspectionEquInfo.getId()); queryWrapper.eq(WarnMessage::getType,"equ").eq(WarnMessage::getObjectId,inspectionEquInfo.getId());
WarnMessage one = messageService.getOne(queryWrapper); List<WarnMessage> list = messageService.list(queryWrapper);
if (ObjectUtil.isNotEmpty(one)){ if (CollUtil.isNotEmpty(list)){
//更新处理 //更新处理
messageService.removeById(one.getId()); List<Long> ids = list.stream().map(WarnMessage::getId).collect(Collectors.toList());
messageService.removeBatchByIds(ids);
} }
if (ObjectUtil.isNotEmpty(inspectionEquInfo.getNextCheckTime())){ if (ObjectUtil.isNotEmpty(inspectionEquInfo.getNextCheckTime())){
//同时处理提醒信息 //同时处理提醒信息

View File

@ -534,6 +534,7 @@ FROM
CASE CASE
WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格' WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格'
WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格' WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格'
WHEN t.status = '已完成' THEN '未知'
ELSE '' ELSE ''
END AS result, END AS result,
t.status t.status
@ -546,6 +547,7 @@ FROM
ELSE '已支付' ELSE '已支付'
END AS pay, END AS pay,
CASE CASE
WHEN oi.pay_type IS NOT NULL THEN '已完成'
WHEN has_status_0_or_null THEN '检测中' WHEN has_status_0_or_null THEN '检测中'
WHEN (ii.status = 0 OR ii.status = 2) AND has_status_1 THEN '检测中' WHEN (ii.status = 0 OR ii.status = 2) AND has_status_1 THEN '检测中'
WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成' WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成'

View File

@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warnMessage.title != null and warnMessage.title != ''"> and title = #{warnMessage.title}</if> <if test="warnMessage.title != null and warnMessage.title != ''"> and title = #{warnMessage.title}</if>
<if test="warnMessage.partnerId != null "> and partner_id = #{warnMessage.partnerId}</if> <if test="warnMessage.partnerId != null "> and partner_id = #{warnMessage.partnerId}</if>
<if test="warnMessage.isRead != null and warnMessage.isRead != ''"> and is_read = #{warnMessage.isRead}</if> <if test="warnMessage.isRead != null and warnMessage.isRead != ''"> and is_read = #{warnMessage.isRead}</if>
and deleted = '0'
</where> </where>
order by create_time desc order by create_time desc
</select> </select>