Commit 8a458707 by 王力

Merge branch 'dev_engineer_filter' into 'develop'

修改

See merge request !160
2 parents 81c0cfaf a200436d
...@@ -20,11 +20,16 @@ public class EngineerController { ...@@ -20,11 +20,16 @@ public class EngineerController {
private EngineerService engineerService; private EngineerService engineerService;
@GetMapping("/engineer/info/list") @GetMapping("/engineer/info/list")
public Result<?> getEngineerInfoList(@RequestParam long page, @RequestParam long size) { public Result<?> getEngineerInfoList(@RequestParam String levelType,
@RequestParam String levelValue,
@RequestParam long page,
@RequestParam long size,
@RequestParam(required = false) String kind,
@RequestParam(required = false) String key) {
// 获取工程师基础信息列表 // 获取工程师基础信息列表
Result<?> res = null; Result<?> res = null;
try { try {
res = engineerService.getEngineerInfoList(page, size); res = engineerService.getEngineerInfoList(levelType, levelValue, page, size, kind, key);
} catch (BusinessException e) { } catch (BusinessException e) {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
} }
...@@ -44,11 +49,16 @@ public class EngineerController { ...@@ -44,11 +49,16 @@ public class EngineerController {
} }
@GetMapping("/engineer/skill/list") @GetMapping("/engineer/skill/list")
public Result<?> getEngineerSkillList(@RequestParam long page, @RequestParam long size) { public Result<?> getEngineerSkillList(@RequestParam String levelType,
@RequestParam String levelValue,
@RequestParam long page,
@RequestParam long size,
@RequestParam(required = false) String kind,
@RequestParam(required = false) String key) {
// 获取工程师技能信息列表 // 获取工程师技能信息列表
Result<?> res = null; Result<?> res = null;
try { try {
res = engineerService.getEngineerSkillList(page, size); res = engineerService.getEngineerSkillList(levelType, levelValue, page, size, kind, key);
} catch (BusinessException e) { } catch (BusinessException e) {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
} }
...@@ -79,11 +89,16 @@ public class EngineerController { ...@@ -79,11 +89,16 @@ public class EngineerController {
} }
@GetMapping("/engineer/business/list") @GetMapping("/engineer/business/list")
public Result<?> getEngineerBusinessList(@RequestParam long page, @RequestParam long size) { public Result<?> getEngineerBusinessList(@RequestParam String levelType,
@RequestParam String levelValue,
@RequestParam long page,
@RequestParam long size,
@RequestParam(required = false) String kind,
@RequestParam(required = false) String key) {
// 技术员业务属性配置列表 // 技术员业务属性配置列表
Result<?> res = null; Result<?> res = null;
try { try {
res = engineerService.getEngineerBusinessList(page, size); res = engineerService.getEngineerBusinessList(levelType, levelValue, page, size, kind, key);
} catch (BusinessException e) { } catch (BusinessException e) {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
} }
......
...@@ -8,16 +8,16 @@ import java.util.List; ...@@ -8,16 +8,16 @@ import java.util.List;
public interface EngineerService { public interface EngineerService {
// 获取公司列表 // 获取公司列表
Result<?> getEngineerInfoList(long page, long size); Result<?> getEngineerInfoList(String levelType, String levelValue, long page, long size, String kind, String key);
Result<?> getEngineerInfoDetail(String engineerCode); Result<?> getEngineerInfoDetail(String engineerCode);
// 获取工程师技能列表 // 获取工程师技能列表
Result<?> getEngineerSkillList(long page, long size); Result<?> getEngineerSkillList(String levelType, String levelValue, long page, long size, String kind, String key);
Result<?> getEngineerSkillDetail(String engineerCode); Result<?> getEngineerSkillDetail(String engineerCode);
Result<?> engineerSkillUpdate(String engineerCode, List<String> categoryIds); Result<?> engineerSkillUpdate(String engineerCode, List<String> categoryIds);
// 工程师业务属性配置列表 // 工程师业务属性配置列表
Result<?> getEngineerBusinessList(long page, long size); Result<?> getEngineerBusinessList(String levelType, String levelValue, long page, long size, String kind, String key);
Result<?> getEngineerBusinessDetail(String engineerCode); Result<?> getEngineerBusinessDetail(String engineerCode);
// 技术员业务属性配置修改 // 技术员业务属性配置修改
......
package com.dituhui.pea.order.service.impl; package com.dituhui.pea.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dituhui.pea.common.BusinessException; import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.TimeUtils; import com.dituhui.pea.order.common.TimeUtils;
...@@ -7,10 +11,6 @@ import com.dituhui.pea.order.dao.*; ...@@ -7,10 +11,6 @@ import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.*; import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.EngineerService; import com.dituhui.pea.order.service.EngineerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -51,9 +51,9 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -51,9 +51,9 @@ public class EngineerServiceImpl implements EngineerService {
@Transactional @Transactional
@Override @Override
public Result<?> getEngineerInfoList(long page, long size) { public Result<?> getEngineerInfoList(String levelType, String levelValue, long page, long size, String kind, String key) {
// 查询工程师信息 // 查询工程师信息
IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(page, size); IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(levelType, levelValue, page, size, kind, key);
List<EngineerInfo> records = pg.getRecords(); List<EngineerInfo> records = pg.getRecords();
...@@ -96,9 +96,9 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -96,9 +96,9 @@ public class EngineerServiceImpl implements EngineerService {
@Transactional @Transactional
@Override @Override
public Result<?> getEngineerSkillList(long page, long size) { public Result<?> getEngineerSkillList(String levelType, String levelValue, long page, long size, String kind, String key) {
// 获取技术员技能列表 // 获取技术员技能列表
IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(page, size); IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(levelType, levelValue, page, size, kind, key);
List<EngineerInfo> engineers = pg.getRecords(); List<EngineerInfo> engineers = pg.getRecords();
EngineerSkillListResp res = new EngineerSkillListResp(); EngineerSkillListResp res = new EngineerSkillListResp();
...@@ -167,11 +167,11 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -167,11 +167,11 @@ public class EngineerServiceImpl implements EngineerService {
@Transactional @Transactional
@Override @Override
public Result<?> getEngineerBusinessList(long page, long size) { public Result<?> getEngineerBusinessList(String levelType, String levelValue, long page, long size, String kind, String key) {
// 技术员业务属性配置列表 // 技术员业务属性配置列表
// 查询技术员列表 // 查询技术员列表
IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(page, size); IPage<EngineerInfo> pg = this.queryEngineerInfoIPage(levelType, levelValue, page, size, kind, key);
List<EngineerInfo> engineers = pg.getRecords(); List<EngineerInfo> engineers = pg.getRecords();
// 查询技术员业务属性 // 查询技术员业务属性
...@@ -227,9 +227,25 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -227,9 +227,25 @@ public class EngineerServiceImpl implements EngineerService {
return Result.success(null); return Result.success(null);
} }
private IPage<EngineerInfo> queryEngineerInfoIPage(long page, long size) { private IPage<EngineerInfo> queryEngineerInfoIPage(String levelType, String levelValue, long page, long size, String kind, String key) {
// 分页查询工程师基础信息 // 分页查询工程师基础信息
// 查询技术员所在的groupIds
LambdaQueryWrapper<OrgGroup> wrapper = new LambdaQueryWrapper<>();
wrapper.select(OrgGroup::getGroupId);
wrapper.eq(levelType.equals("cluster"), OrgGroup::getClusterId, levelValue);
wrapper.eq(levelType.equals("branch"), OrgGroup::getBranchId, levelValue);
wrapper.eq(levelType.equals("group"), OrgGroup::getGroupId, levelValue);
List<String> groupIds = orgGroupMPDao.selectList(wrapper).stream().map(OrgGroup::getGroupId).collect(Collectors.toList());
LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>();
lqw.in(groupIds != null && !groupIds.isEmpty(), EngineerInfo::getGroupId, groupIds);
lqw.eq(kind != null && !kind.isEmpty(), EngineerInfo::getKind, (kind == "fullJob") ? 1 : 2);
if (key != null && !key.isEmpty()) {
lqw.or().like(EngineerInfo::getPhone, key);
lqw.or().like(EngineerInfo::getName, key);
lqw.or().like(EngineerInfo::getEngineerCode, key);
}
lqw.orderByAsc(EngineerInfo::getGroupId); lqw.orderByAsc(EngineerInfo::getGroupId);
lqw.orderByAsc(EngineerInfo::getEngineerCode); lqw.orderByAsc(EngineerInfo::getEngineerCode);
...@@ -493,7 +509,7 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -493,7 +509,7 @@ public class EngineerServiceImpl implements EngineerService {
} else { } else {
engineer.setCapTotal(capacityEngineerStat.getCapTotal().toString()).setCapUsed(capacityEngineerStat.getCapUsed().toString()); engineer.setCapTotal(capacityEngineerStat.getCapTotal().toString()).setCapUsed(capacityEngineerStat.getCapUsed().toString());
} }
if (mapEngineers.containsKey(engineerCode)){ if (mapEngineers.containsKey(engineerCode)) {
engineer.setOrders(mapEngineers.get(engineerCode)); engineer.setOrders(mapEngineers.get(engineerCode));
} }
// engineer.setErrorTip(); todo // engineer.setErrorTip(); todo
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!