Merge branch 'develop_master' into FOTON

This commit is contained in:
super_liu
2022-01-22 08:26:29 +08:00
11 changed files with 180 additions and 13 deletions
@@ -18,7 +18,7 @@ public class ActDefineStartMap {
map.put("2","standardSurveyWorkFlow");
map.put("3","StandAskForOpinion");
map.put("4","standardregulatoryinventory");
map.put("5","projectEvaluationProcess");
map.put("5","projectEvaluationNewProcess");
map.put("6","Projectcomplianceassessment");
@@ -73,6 +73,17 @@ public class TsInstitutionController extends BaseController<TsInstitution> {
return Result.success(tsUserIPage);
}
/**
* 查询机构下所有的机构人员
* @return ResponseMessage<List<TsUser>>
*/
@ApiOperation("查询机构的人员")
@PostMapping("/userUnderInstitution")
public ResponseMessage<IPage<TsUser>> userUnderInstitution(TsUser tsUser){
return Result.success(tsUserService.getAllUsers(tsUser));
}
@ApiOperation("导入机构数据")
@PostMapping("/import")
public ResponseMessage<Object> importInstitution() throws Exception {
@@ -346,14 +346,17 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
//标准评估流程 查询项目群接口
@GetMapping("/queryProjectGroup")
@ApiOperation("查询项目群")
public ResponseMessage queryProjectGroup(SarStandProjectLibrary sarStandProjectLibrary){
return Result.success( sarStandProjectLibraryService.queryProjectGroup(sarStandProjectLibrary));
public ResponseMessage queryProjectGroup(@RequestParam(defaultValue = "1", value = "current")int current,
@RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
SarStandProjectLibrary sarStandProjectLibrary){
return Result.success( sarStandProjectLibraryService.queryProjectGroup(current,pageSize,sarStandProjectLibrary));
}
//标准评估流程根据项目群查项目接口
@GetMapping("/queryProjects")
@ApiOperation("查询项目群下的项目")
public ResponseMessage queryProjects(SarStandProjectLibrary sarStandProjectLibrary){
return Result.success( sarStandProjectLibraryService.queryProjects(sarStandProjectLibrary));
public ResponseMessage queryProjects(@RequestParam(defaultValue = "1", value = "current")int current,
@RequestParam(defaultValue = "10", value = "PageSize") int pageSize,SarStandProjectLibrary sarStandProjectLibrary){
return Result.success( sarStandProjectLibraryService.queryProjects(current,pageSize,sarStandProjectLibrary));
}
@@ -33,7 +33,9 @@ public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLib
void deleteByProjectId(@Param("projectId")String projectId);
List<String> selectListByids(@Param("ids") List<String> ids);
List<SarStandProjectLibrary> queryProjectGroup(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
List<SarStandProjectLibrary> queryProjectGroup(@Param("current")int current,@Param("size")int size,@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
Integer queryProjectGroupCount(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
List<SarStandProjectLibrary> queryProjects(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary,@Param("groups")List<String> strings);
List<SarStandProjectLibrary> queryProjects(@Param("current")int current,@Param("size")int size,@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary,@Param("groups")List<String> strings);
Integer queryProjectsCount(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary,@Param("groups")List<String> strings);
}
@@ -29,8 +29,8 @@ public interface SarStandProjectLibraryService {
void batchInsertAdd(@Param("ids") List<StandProjectRelationDto> list);
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
public Head AnalysisJsonAndStorage(String jsonStr);
public List<SarStandProjectLibrary> queryProjectGroup(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
public IPage<SarStandProjectLibrary> queryProjectGroup(@Param("current")int current,@Param("size")int size, @Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
public List<SarStandProjectLibrary> queryProjects(@Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
public IPage<SarStandProjectLibrary> queryProjects(@Param("current")int current,@Param("size")int size, @Param("sarStandProjectLibrary") SarStandProjectLibrary sarStandProjectLibrary);
}
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -127,12 +128,19 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
}
@Override
public List<SarStandProjectLibrary> queryProjectGroup(SarStandProjectLibrary sarStandProjectLibrary) {
return sarStandProjectLibraryDao.queryProjectGroup(sarStandProjectLibrary);
public IPage<SarStandProjectLibrary> queryProjectGroup(int current,int size,SarStandProjectLibrary sarStandProjectLibrary) {
List<SarStandProjectLibrary> sarStandProjectLibraries=sarStandProjectLibraryDao.queryProjectGroup(current,size,sarStandProjectLibrary);
Integer total=sarStandProjectLibraryDao.queryProjectGroupCount(sarStandProjectLibrary);
Page<SarStandProjectLibrary> page=new Page<>();
page.setRecords(sarStandProjectLibraries);
page.setTotal(total);
page.setCurrent(current);
page.setSize(size);
return page;
}
@Override
public List<SarStandProjectLibrary> queryProjects(SarStandProjectLibrary sarStandProjectLibrary) {
public IPage<SarStandProjectLibrary> queryProjects(int current,int size, SarStandProjectLibrary sarStandProjectLibrary) {
List<String> ids=new ArrayList<>();
if (null!=sarStandProjectLibrary.getProjectGroup() && !"".equals(sarStandProjectLibrary.getProjectGroup())){
if (sarStandProjectLibrary.getProjectGroup().contains(",")){
@@ -141,7 +149,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
ids.add(sarStandProjectLibrary.getProjectGroup());
}
}
return sarStandProjectLibraryDao.queryProjects(sarStandProjectLibrary,ids);
IPage<SarStandProjectLibrary> sarStandProjectLibraryIPage=new Page<>();
List<SarStandProjectLibrary> sarStandProjectLibraries=sarStandProjectLibraryDao.queryProjects(current,size,sarStandProjectLibrary,ids);
Integer total=sarStandProjectLibraryDao.queryProjectsCount(sarStandProjectLibrary,ids);
sarStandProjectLibraryIPage.setTotal(total);
sarStandProjectLibraryIPage.setCurrent(current);
sarStandProjectLibraryIPage.setSize(size);
sarStandProjectLibraryIPage.setRecords(sarStandProjectLibraries);
return sarStandProjectLibraryIPage;
}
@Override
@@ -49,7 +49,11 @@ public interface TsUserDao extends BaseMapper<TsUser> {
*/
List<TsUser> getUserAndPositionPage(@Param("start")Integer start, @Param("end")Integer end,@Param("TsUser") TsUser tsUser);
List<TsUser> userUnderInstitution(@Param("start")Integer start, @Param("end")Integer end,@Param("TsUser") TsUser tsUser,@Param("ids") List<String> ids);
Integer getUserAndPositionCount(@Param("TsUser") TsUser tsUser);
Integer userUnderInstitutionCount(@Param("TsUser") TsUser tsUser,@Param("ids") List<String> ids);
/**
* 通过岗位Id列表查询用户ID列表
* @param positionIds:岗位ID列表
@@ -83,4 +83,6 @@ public interface ITsUserService extends IService<TsUser> {
List<UpDTO> selectByName(String name);
List<UpDTO> selectNameById(List<String> strings,String type);
IPage<TsUser> getAllUsers(TsUser tsUser);
}
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarUser.service.impl;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.login.util.UserUtils;
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
import com.adc.da.slrs.sarMenu.entity.SarMenu;
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
import com.adc.da.slrs.sarPosition.dao.TsPositionDao;
@@ -47,6 +49,8 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
@Autowired
private TsUserDao tsUserDao;
@Autowired
private ITsUserService tsUserService;
@Autowired
private ITsPositionService tsPositionService;
@Autowired
@Lazy
@@ -59,6 +63,8 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
private SyncUserService syncUserService;
@Autowired
private TsPositionDao tsPositionDao;
@Autowired
private ITsInstitutionService tsInstitutionService;
public void deleteUser(){
@@ -364,4 +370,40 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
});
return result;
}
@Override
public IPage<TsUser> getAllUsers(TsUser tsUser) {
List<String> ids=new ArrayList<>();
ids.add(tsUser.getInstitutionId());
List<String> middle=new ArrayList<>();
middle.addAll(ids);
boolean flag=true;
while (flag){
QueryWrapper<TsInstitution> queryWrapper=new QueryWrapper<>();
queryWrapper.in("parent_id",middle);
List<TsInstitution> tsmiddle=tsInstitutionService.list(queryWrapper);
if (tsmiddle.size()>0){
tsmiddle.forEach(tsInstitution -> {
middle.add(tsInstitution.getId());
});
middle.removeAll(ids);
ids.addAll(middle);
}else {
tsmiddle.forEach(tsInstitution -> {
middle.add(tsInstitution.getId());
});
middle.removeAll(ids);
ids.addAll(middle);
flag=false;
}
}
Page<TsUser> tsUserPage = new Page<>();
tsUserPage.setCurrent(tsUser.getCurrent());
tsUserPage.setSize(tsUser.getSize());
tsUserPage.setRecords(tsUserDao.userUnderInstitution((tsUser.getCurrent()-1)*tsUser.getSize(),tsUser.getSize(),tsUser,ids));
tsUserPage.setTotal(tsUserDao.userUnderInstitutionCount(tsUser,ids));
return tsUserPage;
}
}
@@ -381,6 +381,24 @@
<if test="sarStandProjectLibrary.categoryName != null and sarStandProjectLibrary.categoryName != ''">
and sar_stand_project_library.category_name=#{sarStandProjectLibrary.categoryName}
</if>
limit ${(current-1) * size},${size}
</select>
<select id="queryProjectGroupCount"
resultType="java.lang.Integer">
select count(a.project_group) from (
select distinct
sar_stand_project_library.project_group,sar_stand_project_library.management_host_name,sar_stand_project_library.category_name,sar_stand_project_library.development_host_name
from sar_stand_project_library
where 1=1
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
</if>
<if test="sarStandProjectLibrary.developmentHostName != null and sarStandProjectLibrary.developmentHostName != ''">
and sar_stand_project_library.development_host_name=#{sarStandProjectLibrary.developmentHostName}
</if>
<if test="sarStandProjectLibrary.categoryName != null and sarStandProjectLibrary.categoryName != ''">
and sar_stand_project_library.category_name=#{sarStandProjectLibrary.categoryName}
</if> )a
</select>
<select id="queryProjects"
resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
@@ -405,5 +423,31 @@
#{item}
</foreach>
</if>
limit ${(current-1) * size},${size}
</select>
<select id="queryProjectsCount"
resultType="java.lang.Integer">
select count(sar_stand_project_library.id) from sar_stand_project_library
left join ts_user on ts_user.USID = sar_stand_project_library.project_manager
where 1=1
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
</if>
<if test="sarStandProjectLibrary.developmentHostName != null and sarStandProjectLibrary.developmentHostName != ''">
and sar_stand_project_library.development_host_name=#{sarStandProjectLibrary.developmentHostName}
</if>
<if test="sarStandProjectLibrary.categoryName != null and sarStandProjectLibrary.categoryName != ''">
and sar_stand_project_library.category_name=#{sarStandProjectLibrary.categoryName}
</if>
<if test="sarStandProjectLibrary.projectStatus != null and sarStandProjectLibrary.projectStatus != ''">
and sar_stand_project_library.project_status=#{sarStandProjectLibrary.projectStatus}
</if>
<if test="null != groups and groups.size()>0">
and sar_stand_project_library.project_group in
<foreach collection="groups" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
@@ -48,6 +48,49 @@
limit #{start},#{end}
</select>
<select id="userUnderInstitution" parameterType="com.adc.da.slrs.sarUser.entity.TsUser" resultMap="UserPosition">
select u.*,p.id p_id,p.name p_name from ts_user u
left join ts_user_position up
on u.usid=up.user_id
left join ts_position p
on up.position_id=p.id
where 1=1
<if test="TsUser.uname != null and TsUser.uname != '' ">
and u.uname like concat('%',#{TsUser.uname},'%')
</if>
<if test="TsUser.email != null and TsUser.email != '' ">
and u.email like concat('%',#{TsUser.email},'%')
</if>
<if test=" null != ids and ids.size()> 0">
and INSTITUTION_ID in
<foreach item="id" collection="ids" open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
limit #{start},#{end}
</select>
<select id="userUnderInstitutionCount" resultType="java.lang.Integer">
select count(u.USID) from ts_user u
left join ts_user_position up
on u.usid=up.user_id
left join ts_position p
on up.position_id=p.id
where 1=1
<if test="TsUser.uname != null and TsUser.uname != '' ">
and u.uname like concat('%',#{TsUser.uname},'%')
</if>
<if test="TsUser.email != null and TsUser.email != '' ">
and u.email like concat('%',#{TsUser.email},'%')
</if>
<if test=" null != ids and ids.size()> 0">
and INSTITUTION_ID in
<foreach item="id" collection="ids" open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
</select>
<select id="getUserAndPositionCount" parameterType="com.adc.da.slrs.sarUser.entity.TsUser" resultType="java.lang.Integer">
select count(u.USID) from ts_user u
left join ts_user_position up