Commit 1c7b0ede by chenweisong

更新

parent 8d92466c
...@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@Api(description = "模板 控制器") @Api(description = "模板 控制器")
......
...@@ -136,8 +136,8 @@ public class TaskController { ...@@ -136,8 +136,8 @@ public class TaskController {
public ApiResponse createTask(@RequestBody TaskForm form) { public ApiResponse createTask(@RequestBody TaskForm form) {
CommonValidator.notEmpty(form.getName(), "名称不能为空"); CommonValidator.notEmpty(form.getName(), "名称不能为空");
CommonValidator.notNull(form.getType(), "类型不能为空"); CommonValidator.notNull(form.getType(), "类型不能为空");
CommonValidator.isTrue(form.getExcels() != null && form.getExcels().size() != 0, "补录模板不能为空"); CommonValidator.isTrue(form.getExcels() != null && form.getExcels().size() != 0, "补录模板不能为空");
// 创建人 为 manager // 创建人 为 manager
User admin = getAdmin(); User admin = getAdmin();
form.setUser(admin); form.setUser(admin);
......
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.dao.ActivityDao; import com.keymobile.rest.dao.ActivityDao;
import com.keymobile.rest.model.Activity; import com.keymobile.rest.model.Activity;
import com.keymobile.rest.vo.TaskForm;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
...@@ -11,7 +9,6 @@ import org.springframework.data.domain.Pageable; ...@@ -11,7 +9,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.Timestamp;
@Service @Service
public class ActivityService { public class ActivityService {
......
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.dao.*; import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.DataInfo; import com.keymobile.rest.model.DataInfo;
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 java.sql.Timestamp;
@Service @Service
public class DataInfoService { public class DataInfoService {
......
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.dao.GroupDao; import com.keymobile.rest.dao.GroupDao;
import com.keymobile.rest.dao.UserDao;
import com.keymobile.rest.model.Group; import com.keymobile.rest.model.Group;
import com.keymobile.rest.model.RecordScope;
import com.keymobile.rest.model.User;
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 javax.annotation.PostConstruct;
import java.util.List; import java.util.List;
@Service @Service
...@@ -17,27 +13,6 @@ public class GroupService { ...@@ -17,27 +13,6 @@ public class GroupService {
@Autowired @Autowired
private GroupDao groupDao; private GroupDao groupDao;
@Autowired
private UserDao userDao;
@PostConstruct
private void init() {
List<Group> groupList = groupDao.findAll();
groupList.forEach(group -> {
List<User> userList = userDao.findAllByGroupId(group.getId());
if (userList.size() == 0) {
String groupName = group.getName();
User user = new User();
user.setGroup(group);
user.setUsername(groupName);
userDao.save(user);
user.setUsername(groupName + "员工" + user.getId());
userDao.save(user);
}
});
}
public List<Group> findAllByParentId(long parentId) { public List<Group> findAllByParentId(long parentId) {
return groupDao.findAllByParentId(parentId); return groupDao.findAllByParentId(parentId);
} }
......
...@@ -5,7 +5,6 @@ import com.keymobile.rest.model.Process; ...@@ -5,7 +5,6 @@ import com.keymobile.rest.model.Process;
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 java.util.List;
@Service @Service
public class ProcessService { public class ProcessService {
......
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.dao.*; import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.Template; import com.keymobile.rest.model.Template;
import com.keymobile.rest.vo.ExcelForm;
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 java.sql.Timestamp;
import java.util.List; import java.util.List;
@Service @Service
......
...@@ -13,7 +13,6 @@ public class UserService { ...@@ -13,7 +13,6 @@ public class UserService {
@Autowired @Autowired
private UserDao userDao; private UserDao userDao;
public List<User> findAllByUsername(String username) { public List<User> findAllByUsername(String username) {
return userDao.findAllByUsername(username); return userDao.findAllByUsername(username);
} }
......
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