| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | |
| | | //@PreAuthorize("@ss.hasPermi('hosp:rules:list')") |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "查询规则+病种列表") |
| | | public TableDataInfo list(TjRules tjRules) { |
| | | startPage(); |
| | | public AjaxResult list(TjRules tjRules) { |
| | | |
| | | Page<TjRules> page=new Page<>(tjRules.getPageNum(),tjRules.getPageSize()); |
| | | |
| | | LambdaQueryWrapper<TjRules> wq = new LambdaQueryWrapper<>(); |
| | | if (tjRules.getProId() != null) { |
| | | wq.eq(TjRules::getProId, tjRules.getProId()); |
| | | List<TjProject> projects = projectService.getTjProjectListBySoneId(tjRules.getProId()); |
| | | if(null !=projects && !projects.isEmpty()){ |
| | | wq.and(w-> w.eq(TjRules::getProId, tjRules.getProId()) |
| | | .or().in(TjRules::getProId,projects.stream().map(TjProject::getProId).collect(Collectors.toList()))); |
| | | }else { |
| | | wq.eq(TjRules::getProId, tjRules.getProId()); |
| | | } |
| | | |
| | | } |
| | | if (tjRules.getProName() != null) { |
| | | wq.like(TjRules::getProName, tjRules.getProName()); |
| | |
| | | wq.eq(TjRules::getSex, tjRules.getSex()); |
| | | } |
| | | wq.orderByAsc(TjRules::getSort); |
| | | List<TjRules> list = tjRulesService.list(wq); |
| | | if (list != null) { |
| | | for (TjRules rules : list) { |
| | | LambdaQueryWrapper<TjRuleAdvice> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjRuleAdvice::getBz, rules.getAid()); |
| | | final List<TjRuleAdvice> list1 = tjRuleAdviceService.list(wq1); |
| | | rules.setRuleAdvices(list1); |
| | | } |
| | | } |
| | | return getDataTable(list); |
| | | // List<TjRules> list = tjRulesService.list(wq); |
| | | Page<TjRules> page1 = tjRulesService.page(page, wq); |
| | | Map<String,Object>map=new HashMap<>(); |
| | | map.put("rows",page1.getRecords()); |
| | | map.put("total",page1.getTotal()); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |