Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage
This commit is contained in:
+42
-2
@@ -2,6 +2,7 @@ package com.jero.modules.project.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||
@@ -13,7 +14,15 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -46,7 +55,11 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
|
||||
@RequiresPermissions("projectRelatedPersonnel:page")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> map) {
|
||||
List<ProjectRelatedPersonnel> pageList= projectRelatedPersonnelService.queryPageList((String) map.get("projectId"));
|
||||
List<ProjectRelatedPersonnel> pageList= projectRelatedPersonnelService.queryPageList((String) map.get("projectId"),
|
||||
(String) map.get("dutyTerritory"),
|
||||
(String) map.get("lawEngineer"),
|
||||
(String) map.get("engineeringInterfacePerson"),
|
||||
(String) map.get("certificationEngineer"));
|
||||
return Result.OK((String)map.get("cut"),pageList);
|
||||
}
|
||||
/**
|
||||
@@ -205,4 +218,31 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
|
||||
List<ProjectRelatedPersonnel> certificationEngineerList = projectRelatedPersonnelService.queryCertificationEngineer(projectId);
|
||||
return Result.OK(certificationEngineerList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置
|
||||
* @param projectRelatedPersonnel
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批量设置")
|
||||
@ApiOperation(value="批量设置", notes="批量设置")
|
||||
@PostMapping(value = "/setBatch")
|
||||
public Result<?> setBatch(@RequestBody ProjectRelatedPersonnel projectRelatedPersonnel) {
|
||||
String cut = projectRelatedPersonnel.getCut();
|
||||
try {
|
||||
projectRelatedPersonnelService.setBatch(projectRelatedPersonnel);
|
||||
} catch (Exception e) {
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.error("批量设置失败!");
|
||||
}else{
|
||||
return Result.error("Batch set success");
|
||||
}
|
||||
}
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.OK("批量设置成功");
|
||||
}else{
|
||||
return Result.OK("Batch set success");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -90,4 +90,8 @@ public class ProjectRelatedPersonnel implements Serializable {
|
||||
/**中英切换标志*/
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
}
|
||||
|
||||
//批量设置传参ids
|
||||
@TableField(exist = false)
|
||||
private String ids;
|
||||
}
|
||||
|
||||
+6
-1
@@ -14,7 +14,12 @@ import java.util.List;
|
||||
*/
|
||||
public interface ProjectRelatedPersonnelMapper extends BaseMapper<ProjectRelatedPersonnel> {
|
||||
|
||||
List<ProjectRelatedPersonnel> queryPageList(@Param("projectId") String projectId,String dictCode);
|
||||
List<ProjectRelatedPersonnel> queryPageList(@Param("projectId") String projectId,
|
||||
String dictCode,
|
||||
@Param("dutyTerritory") String dutyTerritory,
|
||||
@Param("lawEngineer") String lawEngineer,
|
||||
@Param("engineeringInterfacePerson") String engineeringInterfacePerson,
|
||||
@Param("certificationEngineer") String certificationEngineer);
|
||||
|
||||
List<ProjectRelatedPersonnel> queryById(@Param("id")String id);
|
||||
}
|
||||
|
||||
+13
-1
@@ -42,6 +42,18 @@
|
||||
<if test="projectId != null and projectId != ''">
|
||||
prp.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="dutyTerritory != null and dutyTerritory != ''">
|
||||
AND prp.duty_territory=#{dutyTerritory}
|
||||
</if>
|
||||
<if test="lawEngineer != null and lawEngineer != ''">
|
||||
AND prp.law_engineer like concat(concat('%',#{lawEngineer}),'%')
|
||||
</if>
|
||||
<if test="engineeringInterfacePerson != null and engineeringInterfacePerson != ''">
|
||||
AND prp.engineering_interface_person like concat(concat('%',#{engineeringInterfacePerson}),'%')
|
||||
</if>
|
||||
<if test="certificationEngineer != null and certificationEngineer != ''">
|
||||
AND prp.certification_engineer like concat(concat('%',#{certificationEngineer}),'%')
|
||||
</if>
|
||||
AND sd.dict_code = #{dictCode}
|
||||
</where>
|
||||
ORDER BY sdi.item_text ASC
|
||||
@@ -57,4 +69,4 @@
|
||||
</where>
|
||||
order by prp.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
+3
-1
@@ -67,7 +67,7 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
|
||||
*/
|
||||
List<ProjectRelatedPersonnel> queryList();
|
||||
|
||||
List<ProjectRelatedPersonnel> queryPageList(String projectId);
|
||||
List<ProjectRelatedPersonnel> queryPageList(String projectId,String dutyTerritory,String lawEngineer,String engineeringInterfacePerson,String certificationEngineer);
|
||||
|
||||
Map<String,Object> queryPersonByProjectId(String projectId, String dutyTerritory);
|
||||
|
||||
@@ -88,4 +88,6 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
|
||||
ProjectRelatedPersonnel queryByProjectIdAndDutyTerritory(String projectId, String dutyTerritory);
|
||||
|
||||
List<ProjectRelatedPersonnel> queryCertificationEngineer(String projectId);
|
||||
|
||||
void setBatch(ProjectRelatedPersonnel projectRelatedPersonnel);
|
||||
}
|
||||
|
||||
+1
-1
@@ -6400,7 +6400,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
}
|
||||
//相关人员名单中取法规工程师
|
||||
List<ProjectRelatedPersonnel> projectRelatedPersonnels = projectRelatedPersonnelService.queryPageList(projectLibraryId);
|
||||
List<ProjectRelatedPersonnel> projectRelatedPersonnels = projectRelatedPersonnelService.queryPageList(projectLibraryId,null,null,null,null);
|
||||
List<String> lawEngineerNameList = new ArrayList<>();
|
||||
if(projectRelatedPersonnels.size() != 0){
|
||||
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnels) {
|
||||
|
||||
+67
-13
@@ -34,7 +34,14 @@ import org.apache.poi.hssf.usermodel.HSSFRichTextString;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -48,7 +55,14 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -183,26 +197,45 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectRelatedPersonnel> queryPageList(String projectId) {
|
||||
public List<ProjectRelatedPersonnel> queryPageList(String projectId,
|
||||
String dutyTerritoryTemp,
|
||||
String lawEngineer,
|
||||
String engineeringInterfacePerson,
|
||||
String certificationEngineer) {
|
||||
//查询数据
|
||||
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectId,DictCodeEnum.DUTY_TERRITORY.getValue());
|
||||
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectId,
|
||||
DictCodeEnum.DUTY_TERRITORY.getValue(),
|
||||
dutyTerritoryTemp,
|
||||
lawEngineer,
|
||||
engineeringInterfacePerson,
|
||||
certificationEngineer);
|
||||
//查询数据里的责任领域
|
||||
List<String> dutyTerritory = result.stream().map(e -> e.getDutyTerritory()).collect(Collectors.toList());
|
||||
//查标签内容里的责任领域数据
|
||||
List<String> sysDictItemValueList = sysDictItemMapper.selectItemValueByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
|
||||
//没有数据->新增所有责任领域,查询
|
||||
if(result.size() != sysDictItemValueList.size()){
|
||||
if(StringUtils.isBlank(dutyTerritoryTemp)
|
||||
&& StringUtils.isBlank(lawEngineer)
|
||||
&& StringUtils.isBlank(engineeringInterfacePerson)
|
||||
&& StringUtils.isBlank(certificationEngineer)){
|
||||
if(result.size() != sysDictItemValueList.size()){
|
||||
|
||||
//更新相关人员表里的责任领域数据
|
||||
if (CollectionUtils.isNotEmpty(sysDictItemValueList)) {
|
||||
for (String sysDictItemValue : sysDictItemValueList) {
|
||||
if(!dutyTerritory.contains(sysDictItemValue)) {
|
||||
setDutyTerritoryValue(sysDictItemValue, projectId);
|
||||
//更新相关人员表里的责任领域数据
|
||||
if (CollectionUtils.isNotEmpty(sysDictItemValueList)) {
|
||||
for (String sysDictItemValue : sysDictItemValueList) {
|
||||
if(!dutyTerritory.contains(sysDictItemValue)) {
|
||||
setDutyTerritoryValue(sysDictItemValue, projectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
//重新查询列表
|
||||
result = projectRelatedPersonnelMapper.queryPageList(projectId,
|
||||
DictCodeEnum.DUTY_TERRITORY.getValue(),
|
||||
dutyTerritoryTemp,
|
||||
lawEngineer,
|
||||
engineeringInterfacePerson,
|
||||
certificationEngineer);
|
||||
}
|
||||
//重新查询列表
|
||||
result = projectRelatedPersonnelMapper.queryPageList(projectId,DictCodeEnum.DUTY_TERRITORY.getValue());
|
||||
}
|
||||
disposeData(result);
|
||||
return result;
|
||||
@@ -456,7 +489,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
records = queryById(id);
|
||||
}
|
||||
}else{
|
||||
records=queryPageList(projectId);
|
||||
records=queryPageList(projectId,null,null,null,null);
|
||||
}
|
||||
//id无值,传全部
|
||||
disposeDutyTerritory(records,cut);
|
||||
@@ -1180,4 +1213,25 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBatch(ProjectRelatedPersonnel projectRelatedPersonnel) {
|
||||
List<ProjectRelatedPersonnel> projectRelatedPersonnelList = new ArrayList<>();
|
||||
for (String id : projectRelatedPersonnel.getIds().split(",")) {
|
||||
ProjectRelatedPersonnel projectRelatedPersonnelTemp = new ProjectRelatedPersonnel();
|
||||
projectRelatedPersonnelTemp.setId(id);
|
||||
projectRelatedPersonnelTemp.setUpdateTime(new Date());
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(projectRelatedPersonnel.getLawEngineer())){
|
||||
projectRelatedPersonnelTemp.setLawEngineer(projectRelatedPersonnel.getLawEngineer());
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(projectRelatedPersonnel.getEngineeringInterfacePerson())){
|
||||
projectRelatedPersonnelTemp.setEngineeringInterfacePerson(projectRelatedPersonnel.getEngineeringInterfacePerson());
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(projectRelatedPersonnel.getCertificationEngineer())){
|
||||
projectRelatedPersonnelTemp.setCertificationEngineer(projectRelatedPersonnel.getCertificationEngineer());
|
||||
}
|
||||
projectRelatedPersonnelList.add(projectRelatedPersonnelTemp);
|
||||
}
|
||||
this.updateBatchById(projectRelatedPersonnelList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user