Commit 9e6848e1 authored by cq990612's avatar cq990612

优化代码结构

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