Commit 3e76afd6 authored by chenhao's avatar chenhao

修改bug 4827

parent 8f98585a
...@@ -21,4 +21,6 @@ public interface IDataDictionaryService { ...@@ -21,4 +21,6 @@ public interface IDataDictionaryService {
List<MenuFrom> getGWMCDataDictionary(String type) throws Exception; List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
public List<DataDictionary> getByType(String type); public List<DataDictionary> getByType(String type);
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception;
} }
...@@ -155,4 +155,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -155,4 +155,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
// root.setChildren(menus); // root.setChildren(menus);
return list; return list;
} }
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>();
wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type);
wrapper.eq(DataDictionary::getParent, parent);
return this.baseMapper.selectList(wrapper);
}
} }
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto; import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import java.util.List;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -18,5 +21,5 @@ public interface IFireExpertsService { ...@@ -18,5 +21,5 @@ public interface IFireExpertsService {
public Page<FireExpertsDto> queryForFireExpertsPage(Page<FireExpertsDto> page, public Page<FireExpertsDto> queryForFireExpertsPage(Page<FireExpertsDto> page,
@Condition(Operator.eq) Boolean isDelete, @Condition(Operator.eq) Boolean isDelete,
@Condition(Operator.like) String name, @Condition(Operator.like) String name,
@Condition(Operator.eq) String expertCode); @Condition(Operator.in) List<String> expertCode);
} }
...@@ -29,6 +29,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -29,6 +29,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -151,18 +152,31 @@ public class FireExpertsController extends BaseController { ...@@ -151,18 +152,31 @@ public class FireExpertsController extends BaseController {
* @param size 每页大小 * @param size 每页大小
* @param fireExpertsDto 查询参数 * @param fireExpertsDto 查询参数
* @return 返回结果 * @return 返回结果
* @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public ResponseModel<IPage<FireExpertsDto>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<IPage<FireExpertsDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
FireExpertsDto fireExpertsDto) { FireExpertsDto fireExpertsDto) throws Exception {
Page<FireExpertsDto> page = new Page<>(); Page<FireExpertsDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
/* 修改bug : 4827 开始*/
String expertCode = fireExpertsDto.getExpertCode();
List<String> expertCodeArr = new ArrayList<String>();
expertCodeArr.add(expertCode);
List<DataDictionary> detaList = dataDictionaryService.getAllChildNodes("ZJLY", Long.parseLong(fireExpertsDto.getExpertCode()));
if(detaList!=null && detaList.size()>0 ) {
for (DataDictionary i : detaList) {
expertCodeArr.add(i.getCode());
}
}
/* 修改bug : 4827 结束*/
Page<FireExpertsDto> fireExpertsDtoPage = fireExpertsServiceImpl.queryForFireExpertsPage(page, false, Page<FireExpertsDto> fireExpertsDtoPage = fireExpertsServiceImpl.queryForFireExpertsPage(page, false,
fireExpertsDto.getName(), fireExpertsDto.getExpertCode()); fireExpertsDto.getName(), expertCodeArr);
List<FireExpertsDto> fireExpertsDtoList = fireExpertsDtoPage.getRecords().stream().map(item -> { List<FireExpertsDto> fireExpertsDtoList = fireExpertsDtoPage.getRecords().stream().map(item -> {
item.setAge(DateUtils.getAge(item.getBirthdayTime())); item.setAge(DateUtils.getAge(item.getBirthdayTime()));
return item; return item;
......
...@@ -29,7 +29,7 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe ...@@ -29,7 +29,7 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe
public Page<FireExpertsDto> queryForFireExpertsPage(Page<FireExpertsDto> page, public Page<FireExpertsDto> queryForFireExpertsPage(Page<FireExpertsDto> page,
@Condition(Operator.eq) Boolean isDelete, @Condition(Operator.eq) Boolean isDelete,
@Condition(Operator.like) String name, @Condition(Operator.like) String name,
@Condition(Operator.eq) String expertCode) { @Condition(Operator.in) List<String> expertCode) {
// 消防专家按时间倒叙排列add rec_date 2021-09-08 by kongfm // 消防专家按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false, isDelete, name, expertCode); return this.queryForPage(page, "rec_date", false, isDelete, name, expertCode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment