whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/service/DevAlarmDataVerifyService.java
@@ -11,7 +11,10 @@
import com.whyc.mapper.DevAlarmDataVerifyMapper;
import com.whyc.pojo.BattAlarmDataVerify;
import com.whyc.pojo.DevAlarmDataVerify;
import com.whyc.pojo.WorkflowMain;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -23,12 +26,21 @@
    @Resource
    private DevAlarmDataVerifyMapper mapper;
    @Autowired
    @Lazy
    private AlarmManualClearService clearService;
    public Response<Object> getPage(DevAlarmPar param) {
        List<Integer> allMainIds = clearService.getAllMainIds();
        //int userId = ActionUtil.getUser().getUId().intValue();
        PageHelper.startPage(param.getPage().getPageCurr(),param.getPage().getPageSize());
        List<DevAlarmDataVerify> list = mapper.getList(param);
        list.stream().forEach(data -> {
            data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType()));
            WorkflowMain main = data.getMain();
            if (main != null && allMainIds.contains(main.getId())){
                main.setFaultUploadDone(true);
            }
        });
        PageInfo<DevAlarmDataVerify> pageInfo = new PageInfo<>(list);
        return new Response<>().set(1,pageInfo);