|
@@ -2,6 +2,7 @@ package com.hssx.cloudmodel.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.hssx.cloudmodel.entity.Project;
|
|
import com.hssx.cloudmodel.entity.Project;
|
|
|
|
+import com.hssx.cloudmodel.entity.ProjectUser;
|
|
import com.hssx.cloudmodel.mapper.ProjectMapper;
|
|
import com.hssx.cloudmodel.mapper.ProjectMapper;
|
|
import com.hssx.cloudmodel.service.ProjectService;
|
|
import com.hssx.cloudmodel.service.ProjectService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -11,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -25,6 +28,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ProjectMapper projectMapper;
|
|
ProjectMapper projectMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ ProjectUser projectUser;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg addAndUpdateProject(Project project, Integer flag) {
|
|
public HttpRespMsg addAndUpdateProject(Project project, Integer flag) {
|
|
@@ -55,9 +60,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg handOutProject(Project project, String userIds) {
|
|
public HttpRespMsg handOutProject(Project project, String userIds) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
if(userIds != null && userIds != ""){
|
|
if(userIds != null && userIds != ""){
|
|
- ListUtil.convertLongIdsArrayToList(userIds);
|
|
|
|
|
|
+ List<String> list = ListUtil.convertLongIdsArrayToList(userIds);
|
|
|
|
+ if(list().size()>0){
|
|
|
|
+ for(String id:list){
|
|
|
|
+ ProjectUser projectUser = new ProjectUser();
|
|
|
|
+ projectUser.setId(Integer.parseInt(id));
|
|
|
|
+ projectUser.setProjectId(project.getId());
|
|
|
|
+ projectUser.insert();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ msg.setError("用户id不能为null和空");
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return msg;
|
|
}
|
|
}
|
|
}
|
|
}
|