Commit 9e6848e1 authored by cq990612's avatar cq990612

优化代码结构

parent 7e4dc613
...@@ -14,11 +14,12 @@ import cn.wisenergy.service.WorkTypeService; ...@@ -14,11 +14,12 @@ import cn.wisenergy.service.WorkTypeService;
import cn.wisenergy.service.utils.UserRoleLevelUtils; import cn.wisenergy.service.utils.UserRoleLevelUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -176,7 +177,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService { ...@@ -176,7 +177,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
/*if (null == workHoliday.getDayType()) { /*if (null == workHoliday.getDayType()) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL); throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}*/ }*/
if (StringUtils.isEmpty(workHoliday.getDes())) { if (StringUtils.isBlank(workHoliday.getDes())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL); throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
} }
if (workHoliday.getDayStart().compareTo(workHoliday.getDayEnd()) > 0) { if (workHoliday.getDayStart().compareTo(workHoliday.getDayEnd()) > 0) {
......
...@@ -219,7 +219,7 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -219,7 +219,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if (null == rank) { if (null == rank) {
rank = level.getRank(); rank = level.getRank();
} }
if (null != rank && rank<level.getRank()) { if (null != rank && rank < level.getRank()) {
rank = level.getRank(); rank = level.getRank();
} }
} }
...@@ -335,8 +335,8 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -335,8 +335,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange.setReason(modifyProjectVo.getStartTimeReason()); workProjectChange.setReason(modifyProjectVo.getStartTimeReason());
workProjectChanges.add(workProjectChange); workProjectChanges.add(workProjectChange);
} }
if (null != modifyProjectVo.getEndTime()) if (null != modifyProjectVo.getEndTime()) {
{WorkProjectChange workProjectChange = new WorkProjectChange(); WorkProjectChange workProjectChange = new WorkProjectChange();
workProjectChange.setProjectId(modifyProjectVo.getProjectId()); workProjectChange.setProjectId(modifyProjectVo.getProjectId());
workProjectChange.setModifyTime(new Date()); workProjectChange.setModifyTime(new Date());
workProjectChange.setChangeType(4); workProjectChange.setChangeType(4);
...@@ -392,8 +392,8 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -392,8 +392,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if (null == createProjectVo) { if (null == createProjectVo) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL); throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
} }
if (null == createProjectVo.getManagerId() || null == createProjectVo.getStartTime() || null == createProjectVo.getEndTime() || null == createProjectVo.getOaProjectId() || null == createProjectVo.getWorkTime() || null == createProjectVo.getCostBudget() || if (null == createProjectVo.getManagerId() || null == createProjectVo.getStartTime() || null == createProjectVo.getEndTime() || StringUtils.isBlank(createProjectVo.getOaProjectId()) || null == createProjectVo.getWorkTime() || null == createProjectVo.getCostBudget() ||
null == createProjectVo.getProjectName() || CollectionUtils.isEmpty(createProjectVo.getUserIds()) || null == createProjectVo.getDeptId()) { StringUtils.isBlank(createProjectVo.getProjectName()) || CollectionUtils.isEmpty(createProjectVo.getUserIds()) || null == createProjectVo.getDeptId()) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL); throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
} }
if (createProjectVo.getStartTime().compareTo(createProjectVo.getEndTime()) > 0) { if (createProjectVo.getStartTime().compareTo(createProjectVo.getEndTime()) > 0) {
......
...@@ -26,8 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,8 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.apache.commons.lang.StringUtils;
import java.util.*; import java.util.*;
import static java.util.Collections.*; import static java.util.Collections.*;
...@@ -122,7 +122,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService { ...@@ -122,7 +122,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
@Override @Override
public SubtotalDto getSubtotalReport(Integer userId, Date workDay) { public SubtotalDto getSubtotalReport(Integer userId, Date workDay) {
log.info("WorkTimeOrderServiceImpl[]getSubtotalReport[]input.param.userId:{},workDay:{}" + userId, workDay); log.info("WorkTimeOrderServiceImpl[]getSubtotalReport[]input.param.userId:{},workDay:{}" + userId, workDay);
if (null == userId || StringUtils.isEmpty(workDay)) { if (null == userId || null == workDay) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL); throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
} }
......
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