Commit 86a84fc7 authored by cq990612's avatar cq990612

优化代码结构

parent 9c1c5984
...@@ -245,7 +245,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService { ...@@ -245,7 +245,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
} }
if (!PROJECT.equals(type) && !BUSINESS_OPPORTUNITY.equals(type)) { if (!PROJECT.equals(type) && !BUSINESS_OPPORTUNITY.equals(type)) {
dto.setManagerName(workUserService.getById(workTypeService.getByDeptId(workUserService.getById(dto.getUserId()).getDeptId()).get(0).getManagerId()).getName()); dto.setManagerName(workUserService.getById(workTypeService.getByDeptId(workUserService.getById(dto.getUserId()).getDeptId()).get(0).getManagerId()).getName());
} }
// 设置状态 // 设置状态
if (null == dto.getStatus() || 0 == dto.getStatus()) { if (null == dto.getStatus() || 0 == dto.getStatus()) {
...@@ -267,7 +266,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService { ...@@ -267,7 +266,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if (2 == dto.getStatus() || 5 == dto.getStatus()) { if (2 == dto.getStatus() || 5 == dto.getStatus()) {
continue; continue;
} }
BeanUtils.copyProperties(workTimeOrder, dto); BeanUtils.copyProperties(workTimeOrder, dto);
addList.add(workTimeOrder); addList.add(workTimeOrder);
} }
...@@ -441,19 +439,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService { ...@@ -441,19 +439,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
WorkUser user = workUserService.getById(userId); WorkUser user = workUserService.getById(userId);
if (0 != user.getLevel()) { if (0 != user.getLevel()) {
QueryWrapper<WorkTimeOrder> wrapper = new QueryWrapper<>(); QueryWrapper<WorkTimeOrder> wrapper = new QueryWrapper<>();
if (null != type) {
for (ProjectTypeEnum value : ProjectTypeEnum.values()) {
if (!value.getReviewer().equals(3)) {
continue;
}
if (value.getType().equals(type)) {
wrapper.eq("dept_id", user.getDeptId());
}
}
}
wrapper.in("status", COMPLETED, RE_SUBMIT); wrapper.in("status", COMPLETED, RE_SUBMIT);
wrapper.eq(type != null, "type", type); wrapper.eq(type != null, "type", type);
wrapper.eq(type != null, "dept_id", user.getDeptId());
wrapper.eq(projectId != null, "project_id", projectId); wrapper.eq(projectId != null, "project_id", projectId);
wrapper.orderByDesc("work_day"); wrapper.orderByDesc("work_day");
List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectList(wrapper); List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectList(wrapper);
...@@ -723,7 +711,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService { ...@@ -723,7 +711,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
} }
// 判断工单是否合法
private void isEmpty(WorkTimeOrderDto dto) { private void isEmpty(WorkTimeOrderDto dto) {
int size = 0; int size = 0;
......
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