|
|
|
@ -1,9 +1,13 @@ |
|
|
|
package com.hxhq.business.service.impl; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hxhq.business.domain.Step; |
|
|
|
import com.hxhq.common.core.exception.ServiceException; |
|
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.hxhq.business.mapper.TemplateMapper; |
|
|
|
import com.hxhq.business.domain.Template; |
|
|
|
@ -45,8 +49,26 @@ public class TemplateServiceImpl extends ServiceImpl i |
|
|
|
if(template.getStatus()!=null && template.getStatus().intValue()>0){ |
|
|
|
queryWrapper.eq("t.status",template.getStatus()); |
|
|
|
} |
|
|
|
queryWrapper.orderByDesc("t.id"); |
|
|
|
queryWrapper.orderByAsc("t.id"); |
|
|
|
return baseMapper.queryList(queryWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Step> getStepListByTemplateId(Long templateId,String templateSn) { |
|
|
|
Template template = null; |
|
|
|
if(templateId!=null && templateId.longValue()>0){ |
|
|
|
template = getById(templateId); |
|
|
|
}else{ |
|
|
|
QueryWrapper<Template> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("sn",templateSn); |
|
|
|
template = getOne(queryWrapper,false); |
|
|
|
} |
|
|
|
if(template==null){ |
|
|
|
throw new ServiceException("模板不存在"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(template.getStepGroupIds())){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
return baseMapper.getStepListByTemplateStepGroupIds(template.getStepGroupIds()); |
|
|
|
} |
|
|
|
} |