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