doum
昨天 8c73b83777413ce7ed74fb371380be3d353167ff
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningRuleServiceImpl.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.param.request.EventSubRequest;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.DeviceMapper;
import com.doumee.dao.business.WarningMapper;
@@ -342,8 +344,12 @@
        queryWrapper.orderByDesc(WarningRule::getCreateDate);
        IPage<WarningRule> result = warningRuleMapper.selectJoinPage(page, WarningRule.class,queryWrapper);
        if(result.getRecords()!=null && result.getRecords().size()>0){
            List<WarningRuleDetail> allList = warningRuleDetailMapper.selectList(new LambdaQueryWrapper<WarningRuleDetail>()
                    .eq(WarningRuleDetail::getIsdeleted,Constants.ZERO));
            List<WarningRuleDetail> allList = warningRuleDetailMapper.selectJoinList(WarningRuleDetail.class,
                    new MPJLambdaWrapper<WarningRuleDetail>()
                            .selectAll(WarningRuleDetail.class)
                            .selectAs(Warning::getName,WarningRuleDetail::getWarningName)
                            .leftJoin(Warning.class,Warning::getId,WarningRuleDetail::getWarningId)
                            .eq(WarningRuleDetail::getIsdeleted,Constants.ZERO));
            for(WarningRule model :result.getRecords()){
                model.setDetailList(getDetailListFromAll(allList,model.getId()));
            }
@@ -368,4 +374,19 @@
        QueryWrapper<WarningRule> wrapper = new QueryWrapper<>(warningRule);
        return warningRuleMapper.selectCount(wrapper);
    }
    @Override
    public  void updateStatus(WarningRule param) {
        WarningRule model = warningRuleMapper.selectById(param.getId());
        if (model==null || Constants.equalsInteger(model.getIsdeleted(), Constants.ONE)) {
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(Constants.equalsInteger(model.getStatus(),param.getStatus())){
            return;
        }
        model.setStatus(param.getStatus());
        model.setEditDate(new Date());
        model.setEditor(param.getLoginUserInfo().getId());
        warningRuleMapper.updateById(model);
    }
}