1、报告生成修改状态;

2、设备全部归档,修改计划完成状态;
This commit is contained in:
2025-01-13 18:25:40 +08:00
parent 03c245758d
commit 54c909324c
6 changed files with 35 additions and 13 deletions

View File

@@ -21,5 +21,7 @@ public interface PqDevMapper extends MPJBaseMapper<PqDev> {
* @Date: 2024/12/12 11:46
*/
List<PreDetection> selectDevInfo(@Param("devIds") List<String> devIds);
void finishPlan(@Param("planId")String planId);
}

View File

@@ -48,5 +48,9 @@
</if>
</where>
</select>
<update id="finishPlan" >
update ad_plan set Test_State = 2 where id = #{planId}
</update>
</mapper>

View File

@@ -189,4 +189,6 @@ public interface IPqDevService extends IService<PqDev> {
boolean updateResult(List<String> ids,String code);
void updatePqDevReportState(String devId, int i);
int countUnReportDev(String planId);
}

View File

@@ -26,7 +26,6 @@ import com.njcn.gather.device.monitor.pojo.po.PqMonitor;
import com.njcn.gather.device.monitor.pojo.vo.PqMonitorExcel;
import com.njcn.gather.device.monitor.service.IPqMonitorService;
import com.njcn.gather.device.pojo.enums.*;
import com.njcn.gather.plan.service.IAdPlanService;
import com.njcn.gather.storage.service.DetectionDataDealService;
import com.njcn.gather.system.dictionary.pojo.po.DictData;
import com.njcn.gather.system.dictionary.service.IDictDataService;
@@ -53,7 +52,6 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
private final IDictDataService dictDataService;
private final IPqMonitorService pqMonitorService;
private final DetectionDataDealService detectionDataDealService;
private final IAdPlanService adPlanService;
@Override
@@ -461,9 +459,9 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
.ne(PqDev::getCheckState, CheckStateEnum.DOCUMENTED.getValue());
int count = this.count(queryWrapper);
if(count == 0 ){
if (count == 0) {
// 如果非归档状态的设备数量为0则更新计划已完成
adPlanService.finishPlan(pqDev.getPlanId());
this.baseMapper.finishPlan(pqDev.getPlanId());
}
}
return true;
@@ -511,6 +509,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
this.update(updateWrapper);
}
@Override
public int countUnReportDev(String planId) {
// 查询该计划下所有设备的检测状态,是否有未生成的
LambdaQueryWrapper<PqDev> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PqDev::getPlanId, planId)
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
.ne(PqDev::getReportState, DevReportStateEnum.GENERATED.getValue());
return this.count(queryWrapper);
}
/**
* 获取检测状态饼状图数据
*