|
@@ -3,15 +3,9 @@ package com.hssx.cloudmodel.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
-import com.hssx.cloudmodel.entity.Company;
|
|
|
|
-import com.hssx.cloudmodel.entity.Project;
|
|
|
|
-import com.hssx.cloudmodel.entity.ProjectUser;
|
|
|
|
-import com.hssx.cloudmodel.entity.User;
|
|
|
|
|
|
+import com.hssx.cloudmodel.entity.*;
|
|
import com.hssx.cloudmodel.entity.vo.ProjectVO;
|
|
import com.hssx.cloudmodel.entity.vo.ProjectVO;
|
|
-import com.hssx.cloudmodel.mapper.CompanyMapper;
|
|
|
|
-import com.hssx.cloudmodel.mapper.ProjectMapper;
|
|
|
|
-import com.hssx.cloudmodel.mapper.ProjectUserMapper;
|
|
|
|
-import com.hssx.cloudmodel.mapper.UserMapper;
|
|
|
|
|
|
+import com.hssx.cloudmodel.mapper.*;
|
|
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;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
@@ -24,6 +18,7 @@ import javax.jws.soap.SOAPBinding;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Spliterator;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -44,9 +39,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
UserMapper userMapper;
|
|
UserMapper userMapper;
|
|
@Autowired
|
|
@Autowired
|
|
CompanyMapper companyMapper;
|
|
CompanyMapper companyMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ CustomCompanyMapper customCompanyMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg addAndUpdateProject(Project project, Integer flag, User user,String userIds) {
|
|
|
|
|
|
+ public HttpRespMsg addAndUpdateProject(Project project, Integer flag, User user,String userIds,String customerCompanyIds,String customerCompanyNames) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
if(user != null){
|
|
if(user != null){
|
|
QueryWrapper<Project> qw = new QueryWrapper<>();
|
|
QueryWrapper<Project> qw = new QueryWrapper<>();
|
|
@@ -70,11 +67,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
project.setOwnerCompany(user.getCompanyId());
|
|
project.setOwnerCompany(user.getCompanyId());
|
|
project.setOwnerCompanyName(company.getCompanyName());
|
|
project.setOwnerCompanyName(company.getCompanyName());
|
|
project.setProjectNo("YMXM"+seq);
|
|
project.setProjectNo("YMXM"+seq);
|
|
- project.setCreatorId(user.getId());
|
|
|
|
- project.setCreator(user.getUsername());
|
|
|
|
projectMapper.insert(project);
|
|
projectMapper.insert(project);
|
|
- //分配人员
|
|
|
|
- this.handOutProject(project, userIds);
|
|
|
|
|
|
+ //添加生产方关联公司
|
|
|
|
+ if(customerCompanyIds != null && !"".equals(customerCompanyIds) && customerCompanyNames != null && !"".equals(customerCompanyNames)){
|
|
|
|
+ List<Integer> ides = ListUtil.convertIntegerIdsArrayToList(customerCompanyIds);
|
|
|
|
+ String[] split = customerCompanyNames.split(",");
|
|
|
|
+ int index = 0;
|
|
|
|
+ for(String cusCompany:split){
|
|
|
|
+ CustomCompany customCompany = new CustomCompany();
|
|
|
|
+ customCompany.setCompanyId(ides.get(index));
|
|
|
|
+ customCompany.setCompanyName(cusCompany);
|
|
|
|
+ customCompany.setProjectId(project.getId());
|
|
|
|
+ customCompanyMapper.insert(customCompany);
|
|
|
|
+ index++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else if(flag == 1){
|
|
}else if(flag == 1){
|
|
projectMapper.updateById(project);
|
|
projectMapper.updateById(project);
|
|
@@ -166,4 +173,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
msg.data = vo;
|
|
msg.data = vo;
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg getUserListByCompanyIds(String companyIds) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ if(!"".equals(companyIds) && companyIds != null){
|
|
|
|
+ List<Integer> ids = ListUtil.convertIntegerIdsArrayToList("companyIds");
|
|
|
|
+ msg.data = userMapper.selectList(new QueryWrapper<User>().in("company_id",ids));
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
}
|
|
}
|