bug51957+51803相关修改为不校验空字段+52795认证工程师关联查询
This commit is contained in:
+1
-2
@@ -5,7 +5,6 @@ import com.jero.common.aspect.annotation.AutoLog;
|
|||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -195,7 +194,7 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
|
|||||||
@ApiOperation(value="项目库-相关人员维护表-根据projectId查询认证工程师", notes="项目库-相关人员维护表-根据projectId查询认证工程师")
|
@ApiOperation(value="项目库-相关人员维护表-根据projectId查询认证工程师", notes="项目库-相关人员维护表-根据projectId查询认证工程师")
|
||||||
@GetMapping(value = "/queryCertificationEngineer")
|
@GetMapping(value = "/queryCertificationEngineer")
|
||||||
public Result<?> queryCertificationEngineer(@RequestParam(name="projectId",required=true) String projectId){
|
public Result<?> queryCertificationEngineer(@RequestParam(name="projectId",required=true) String projectId){
|
||||||
List<SysUser> certificationEngineerList = projectRelatedPersonnelService.queryCertificationEngineer(projectId);
|
List<ProjectRelatedPersonnel> certificationEngineerList = projectRelatedPersonnelService.queryCertificationEngineer(projectId);
|
||||||
return Result.OK(certificationEngineerList);
|
return Result.OK(certificationEngineerList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ public enum ProjectTaskPlanningNameEnum {
|
|||||||
LIST_CONFIRMATION("法规清单确认"," Confirmation of regulations list"),
|
LIST_CONFIRMATION("法规清单确认"," Confirmation of regulations list"),
|
||||||
LEGAL_TASK_CONFIRMATION("法规任务确认","Regulatory task confirmation"),
|
LEGAL_TASK_CONFIRMATION("法规任务确认","Regulatory task confirmation"),
|
||||||
DESIGN_DEADLINE("设计符合性确认","Design Compliance Check"),
|
DESIGN_DEADLINE("设计符合性确认","Design Compliance Check"),
|
||||||
PREHOMO_DEADLINE("Pre-Homo确认","Pre-homo Check"),
|
PREHOMO_DEADLINE("Pre-Homo确认","Pre-Homo Check"),
|
||||||
ATTESTATION_START_TIME("认证开始","Certification start"),
|
ATTESTATION_START_TIME("认证开始","Certification start"),
|
||||||
ATTESTATION_END_TIME("认证结束"," Certification end"),
|
ATTESTATION_END_TIME("认证结束"," Certification end"),
|
||||||
VERIFY_DEADLINE("验证符合性确认截止时间","Verification compliance confirmation deadline"),
|
VERIFY_DEADLINE("验证符合性确认截止时间","Verification compliance confirmation deadline"),
|
||||||
|
|||||||
+1
-2
@@ -2,7 +2,6 @@ package com.jero.modules.project.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -87,5 +86,5 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
|
|||||||
|
|
||||||
ProjectRelatedPersonnel queryByProjectIdAndDutyTerritory(String projectId, String dutyTerritory);
|
ProjectRelatedPersonnel queryByProjectIdAndDutyTerritory(String projectId, String dutyTerritory);
|
||||||
|
|
||||||
List<SysUser> queryCertificationEngineer(String projectId);
|
List<ProjectRelatedPersonnel> queryCertificationEngineer(String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
+46
-42
@@ -11,6 +11,7 @@ import com.jero.common.util.RedisUtil;
|
|||||||
import com.jero.common.util.TokenUtils;
|
import com.jero.common.util.TokenUtils;
|
||||||
import com.jero.modules.dummy.service.impl.DummyInventoryInfoEOServiceImpl;
|
import com.jero.modules.dummy.service.impl.DummyInventoryInfoEOServiceImpl;
|
||||||
import com.jero.modules.enums.DictCodeEnum;
|
import com.jero.modules.enums.DictCodeEnum;
|
||||||
|
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
||||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||||
@@ -83,6 +84,8 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
@Lazy
|
@Lazy
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectLibraryBaseServiceImpl projectLibraryBaseService;
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -465,9 +468,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
try {
|
try {
|
||||||
String titleOne = "";
|
String titleOne = "";
|
||||||
if(CutEnum.CN.getValue().equals(cut)){
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
|
titleOne = "责任领域,法规工程师,工程接口人,认证工程师,备注";
|
||||||
}else{
|
}else{
|
||||||
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
|
titleOne = "Responsible Field,Regulation Engineer,Engineering Interface,Homologation Engineer,Comments";
|
||||||
}
|
}
|
||||||
|
|
||||||
//创建临时文件夹
|
//创建临时文件夹
|
||||||
@@ -573,10 +576,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
try {
|
try {
|
||||||
String titleOne = "";
|
String titleOne = "";
|
||||||
if (CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())) {
|
if (CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())) {
|
||||||
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
|
titleOne = "责任领域,法规工程师,工程接口人,认证工程师,备注";
|
||||||
fileOriName = "相关人员导入模板.xls";
|
fileOriName = "相关人员导入模板.xls";
|
||||||
} else {
|
} else {
|
||||||
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
|
titleOne = "Responsible Field,Regulation Engineer,Engineering Interface,Homologation Engineer,Comments";
|
||||||
fileOriName = "Import template of related personnel.xls";
|
fileOriName = "Import template of related personnel.xls";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -670,7 +673,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
String titleOne = "";
|
String titleOne = "";
|
||||||
|
|
||||||
if(CutEnum.CN.getValue().equals(cut)){
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
|
titleOne = "责任领域,法规工程师,工程接口人,认证工程师,备注";
|
||||||
explainInfo = "填写说明\n" +
|
explainInfo = "填写说明\n" +
|
||||||
"1.导入数据从第三行开始\n" +
|
"1.导入数据从第三行开始\n" +
|
||||||
"2.所有带*号的字段必须填写\n"+
|
"2.所有带*号的字段必须填写\n"+
|
||||||
@@ -679,7 +682,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
|
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
|
||||||
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
|
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
|
||||||
}else{
|
}else{
|
||||||
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
|
titleOne = "Responsible Field,Regulation Engineer,Engineering Interface,Homologation Engineer,Comments";
|
||||||
explainInfo = "filling explanation\n" +
|
explainInfo = "filling explanation\n" +
|
||||||
"1.import data starts at the third line\n" +
|
"1.import data starts at the third line\n" +
|
||||||
"2.all fields marked with * must be filled in\n"+
|
"2.all fields marked with * must be filled in\n"+
|
||||||
@@ -710,10 +713,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
Row headerRow = sheet.getRow(i);
|
Row headerRow = sheet.getRow(i);
|
||||||
boolean isBlank = dummyInventoryInfoEOService.isRowEmpty(row);
|
boolean isBlank = dummyInventoryInfoEOService.isRowEmpty(row);
|
||||||
|
|
||||||
if (row != null && !isBlank) {
|
// if (row != null && !isBlank) {
|
||||||
int columNos = headerRow.getLastCellNum();// 表头总共的列数
|
int columHeadNos = headerRow.getLastCellNum();// 表头总共的列数
|
||||||
if (columNos == 5) {//列数对
|
if (columHeadNos == 5) {//列数对
|
||||||
for (int j = 0; j < columNos; j++) {
|
for (int j = 0; j < columHeadNos; j++) {
|
||||||
Cell cell = row.getCell(j,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
Cell cell = row.getCell(j,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
if (i == 0 && !cell.getStringCellValue().equals(titleOneList.get(j))) {//检查表头
|
if (i == 0 && !cell.getStringCellValue().equals(titleOneList.get(j))) {//检查表头
|
||||||
@@ -725,31 +728,33 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if((i!=1 && columNos != 5) || (i==2 && columNos !=1)){
|
}/*else if(i!=1 && columNos != 5) {
|
||||||
if (CutEnum.CN.getValue().equals(cut)) {
|
if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
throw new JeroBootException("导入的列数不对,请检查");
|
throw new JeroBootException("导入的列数不对,请检查");
|
||||||
} else {
|
} else {
|
||||||
throw new JeroBootException("The number of imported columns is wrong. Please check!");
|
throw new JeroBootException("The number of imported columns is wrong. Please check!");
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}else{
|
// }else{
|
||||||
if (CutEnum.CN.getValue().equals(cut)) {
|
// if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
throw new JeroBootException("导入的数据不能为空,请检查");
|
// throw new JeroBootException("导入的数据不能为空,请检查");
|
||||||
} else {
|
// } else {
|
||||||
throw new JeroBootException("The imported data of cannot be empty. Please check!");
|
// throw new JeroBootException("The imported data of cannot be empty. Please check!");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (i == 1) {//校验填写说明
|
if (i == 1) {//校验填写说明
|
||||||
row = sheet.getRow(i);
|
row = sheet.getRow(i);
|
||||||
int columNos = row.getLastCellNum();
|
int columNos = row.getLastCellNum();
|
||||||
if(columNos != 1 /*|| (!row.getCell(0).getStringCellValue().equals(explainInfo))*/){
|
//if(columNos != 1 /*|| (!row.getCell(0).getStringCellValue().equals(explainInfo))*/){
|
||||||
|
for (int k = 0; k < columNos; k++){
|
||||||
|
if (k>0 && StringUtils.isNotBlank(row.getCell(k).getStringCellValue())) {
|
||||||
if (CutEnum.CN.getValue().equals(cut)) {
|
if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
throw new JeroBootException("填写说明列数不对,请严格按照模板文件导入数据");
|
throw new JeroBootException("填写说明列数不对,请严格按照模板文件导入数据");
|
||||||
}else{
|
} else {
|
||||||
throw new JeroBootException("The number of columns of filling explanation is wrong. Please import data strictly according to the template file.");
|
throw new JeroBootException("The number of columns of filling explanation is wrong. Please import data strictly according to the template file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (i > 1) {//读取数据
|
if (i > 1) {//读取数据
|
||||||
//获取每一行数据
|
//获取每一行数据
|
||||||
@@ -762,7 +767,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString());
|
projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString());
|
||||||
}else{//责任领域不能为空,报错
|
}else{//责任领域不能为空,报错
|
||||||
if(CutEnum.CN.getValue().equals(cut)){
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
throw new JeroBootException("请填写责任领域,带*的为必填.请检查第 "+ (i+1) + "行");
|
throw new JeroBootException("请填写责任领域,为必填.请检查第 "+ (i+1) + "行");
|
||||||
}else{
|
}else{
|
||||||
throw new JeroBootException("Please fill in the Responsible Field and those marked with * are required. .Please check line" + (i+1));
|
throw new JeroBootException("Please fill in the Responsible Field and those marked with * are required. .Please check line" + (i+1));
|
||||||
}
|
}
|
||||||
@@ -777,18 +782,18 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
projectRelatedPersonnel.setLawEngineerName(lawEngineerName);
|
projectRelatedPersonnel.setLawEngineerName(lawEngineerName);
|
||||||
projectRelatedPersonnel.setEngineeringInterfacePersonName(engineeringInterfacePersonName);
|
projectRelatedPersonnel.setEngineeringInterfacePersonName(engineeringInterfacePersonName);
|
||||||
projectRelatedPersonnel.setCertificationEngineerName(certificationEngineerName);
|
projectRelatedPersonnel.setCertificationEngineerName(certificationEngineerName);
|
||||||
}else if(StringUtils.isBlank(lawEngineerName) && StringUtils.isBlank(engineeringInterfacePersonName) && StringUtils.isBlank(certificationEngineerName)) {
|
}else if(StringUtils.isBlank(lawEngineerName) || StringUtils.isBlank(engineeringInterfacePersonName) || StringUtils.isBlank(certificationEngineerName)) {
|
||||||
//除了责任领域,带*的全为空->可以
|
//除了责任领域,其他的可以全为空->可以
|
||||||
projectRelatedPersonnel.setLawEngineerName("");
|
projectRelatedPersonnel.setLawEngineerName("");
|
||||||
projectRelatedPersonnel.setEngineeringInterfacePersonName("");
|
projectRelatedPersonnel.setEngineeringInterfacePersonName("");
|
||||||
projectRelatedPersonnel.setCertificationEngineerName("");
|
projectRelatedPersonnel.setCertificationEngineerName("");
|
||||||
}else {//除了责任领域,备注,有一个为空都报错
|
}/*else {//除了责任领域,备注,有一个为空都报错
|
||||||
if(CutEnum.CN.getValue().equals(cut)){
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
throw new JeroBootException("请填写必填字段内容,带*的为必填.请检查第 "+ (i+1) + "行");
|
throw new JeroBootException("请填写必填字段内容,带*的为必填.请检查第 "+ (i+1) + "行");
|
||||||
}else{
|
}else{
|
||||||
throw new JeroBootException("Please fill in the required fields marked with * .Please check line" + (i+1));
|
throw new JeroBootException("Please fill in the required fields marked with * .Please check line" + (i+1));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
String remark = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
|
String remark = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
|
||||||
if(StringUtils.isNotEmpty(row.getCell(4).toString())) {
|
if(StringUtils.isNotEmpty(row.getCell(4).toString())) {
|
||||||
@@ -1037,28 +1042,27 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUser> queryCertificationEngineer(String projectId) {
|
public List<ProjectRelatedPersonnel> queryCertificationEngineer(String projectId) {
|
||||||
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
|
||||||
List<ProjectRelatedPersonnel> list = list(queryWrapper.eq("project_id",projectId));
|
List<ProjectRelatedPersonnel> list = list(queryWrapper.eq("project_id",projectId));
|
||||||
|
|
||||||
List<String> certificationEngineerList = list.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.toList());
|
// List<String> certificationEngineerIdList = list.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.toList());
|
||||||
|
|
||||||
StringBuilder userIdBuilder=new StringBuilder();
|
//查询基础表认证工程师的值
|
||||||
List<SysUser> certificationEngineerUsers = new ArrayList<>();
|
QueryWrapper<ProjectLibraryBase> baseQueryWrapper = new QueryWrapper<>();
|
||||||
if(CollectionUtils.isNotEmpty(certificationEngineerList)){
|
List<ProjectLibraryBase> baseDataList = projectLibraryBaseService.list(baseQueryWrapper.eq("id", projectId));
|
||||||
for(String certificationEngineerId :certificationEngineerList){
|
String baseCertificationEngineer = baseDataList.get(0).getCertificationEngineer();
|
||||||
if(StringUtils.isNotBlank(certificationEngineerId)) {
|
// List<ProjectRelatedPersonnel> certificationEngineerUsers = new ArrayList<>();//认证工程师非空
|
||||||
userIdBuilder.append(certificationEngineerId).append(",");
|
|
||||||
|
if(StringUtils.isNotBlank(baseCertificationEngineer)) {
|
||||||
|
for (ProjectRelatedPersonnel projectRelatedPersonnel : list) {
|
||||||
|
if (StringUtils.isBlank(projectRelatedPersonnel.getCertificationEngineer())) {
|
||||||
|
projectRelatedPersonnel.setCertificationEngineer(baseCertificationEngineer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String userId = userIdBuilder.substring(0, userIdBuilder.toString().length() - 1);
|
|
||||||
List userIdList = Arrays.asList(userId.split(","));
|
|
||||||
userIdList.stream().distinct().collect(Collectors.toList());
|
|
||||||
QueryWrapper<SysUser> userqueryWrapper = new QueryWrapper<>();
|
|
||||||
userqueryWrapper.in("id ", userIdList);
|
|
||||||
certificationEngineerUsers = sysUserMapper.selectList(userqueryWrapper);
|
|
||||||
}
|
}
|
||||||
return certificationEngineerUsers;
|
disposeData(list);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user