Org->RtsOrgProject
This commit is contained in:
parent
dace38e27c
commit
e3ff068d5c
@ -1,13 +1,22 @@
|
||||
package club.joylink.rtss.controller.org;
|
||||
|
||||
import club.joylink.rtss.dao.org.OrgProjectDao;
|
||||
import club.joylink.rtss.entity.org.OrgProject;
|
||||
import club.joylink.rtss.services.org.IOrgProjectService;
|
||||
import club.joylink.rtss.services.org.OrgService;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.org.CompanyVO;
|
||||
import club.joylink.rtss.vo.client.org.OrgProjectVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织-项目关系管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/org")
|
||||
public class OrgProjectController {
|
||||
@ -30,4 +39,31 @@ public class OrgProjectController {
|
||||
public void signInOrg(@PathVariable Long orgId, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
orgProjectService.signInOrg(orgId, loginInfo);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private OrgProjectDao orgProjectDao;
|
||||
@Autowired
|
||||
private OrgService orgService;
|
||||
|
||||
/**
|
||||
* 旧数据处理(用完删除)
|
||||
*/
|
||||
@PostMapping("/oldData/handle")
|
||||
public void oldDataHandle() {
|
||||
OrgProject orgProject = new OrgProject();
|
||||
orgProject.setCreateTime(LocalDateTime.now());
|
||||
orgProject.setCreatorId(1L);
|
||||
List<CompanyVO> orgs = orgService.queryAllTopOrg();
|
||||
for (CompanyVO org : orgs) {
|
||||
List<String> projectCodes = org.getProjectCodes();
|
||||
if (!CollectionUtils.isEmpty(projectCodes)) {
|
||||
for (String projectCode : projectCodes) {
|
||||
orgProject.setId(null);
|
||||
orgProject.setOrgId(org.getId());
|
||||
orgProject.setProjectCode(projectCode);
|
||||
orgProjectDao.insert(orgProject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user