Merge branch 'develop_master' into 'FOTON'
Develop master See merge request LiuChao/foton-slrs-system-rest!355
This commit is contained in:
+41
-39
@@ -318,53 +318,55 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
wrapper.eq("sort_key", sortKey);
|
||||
Page<SarLawsDetailedList> pageRes = new Page<>(page, pageSize);
|
||||
IPage<SarLawsDetailedList> userIPage = sarLawsDetailedListDao.selectPage(pageRes, wrapper);
|
||||
if ("1".equals(sortKey)) {
|
||||
Map<String, Object> map = iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list = userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1 : list) {
|
||||
if (StringUtils.isNotBlank(list1.getCountryArea()) && list1.getCountryArea().contains(",")) {
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
if ( userIPage.getRecords().size()>0){
|
||||
if ("1".equals(sortKey)) {
|
||||
Map<String, Object> map = iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list = userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1 : list) {
|
||||
if (StringUtils.isNotBlank(list1.getCountryArea()) && list1.getCountryArea().contains(",")) {
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("value");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("value");
|
||||
builder.append(s + ",");
|
||||
if (map1.get("value").equals(list1.getCountryArea())) {
|
||||
list1.setCountryArea(map1.get("value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(list1.getCountryArea())) {
|
||||
list1.setCountryArea(map1.get("value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
|
||||
+4
-4
@@ -118,11 +118,11 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
List<SarPublicIdeaAll> data=new ArrayList<>();
|
||||
if (!StringUtils.isEmpty(cid)){
|
||||
if (null!=type) {
|
||||
// if (null!=type) {
|
||||
data = sarPublicIdeaAllDao.getPublicAllIdea(cid, type);
|
||||
}else {
|
||||
data = sarPublicIdeaAllDao.getPublicAllIdeaExport(cid,type);
|
||||
}
|
||||
// }else {
|
||||
// data = sarPublicIdeaAllDao.getPublicAllIdeaExport(cid,type);
|
||||
// }
|
||||
}
|
||||
List<GetExcelDto> standExcel=new ArrayList<>();
|
||||
List<GetExcelDto2> standExcel2=new ArrayList<>();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarUrl.dao.TsUrlDao;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionBatchVO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -60,6 +61,13 @@ public class TsUserController extends BaseController<TsUser> {
|
||||
return tsUserService.setPosition(userPositionVO);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("配置岗位")
|
||||
@PostMapping("/positionBatch")
|
||||
public ResponseMessage<Object> setPositionBatch(@Valid @RequestBody UserPositionBatchVO userPositionVO){
|
||||
return tsUserService.setPositionBatch(userPositionVO);
|
||||
}
|
||||
|
||||
@ApiOperation("查询当前登录用户权限")
|
||||
@GetMapping("/menu")
|
||||
public ResponseMessage<List<SarMenu>> getMenu(){
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface TsUserDao extends BaseMapper<TsUser> {
|
||||
* @param positionId:岗位ID
|
||||
*/
|
||||
@Insert("insert into ts_user_position (user_id,position_id) values (#{userId},#{positionId})")
|
||||
void addPosition(String userId, String positionId);
|
||||
void addPosition(@Param("userId") String userId,@Param("positionId")String positionId);
|
||||
|
||||
/**
|
||||
* 解绑岗位
|
||||
@@ -40,7 +40,7 @@ public interface TsUserDao extends BaseMapper<TsUser> {
|
||||
* @param positionId:岗位ID
|
||||
*/
|
||||
@Delete("delete from ts_user_position where user_id=#{userId} and position_id=#{positionId}")
|
||||
void delPosition(String userId, String positionId);
|
||||
void delPosition(@Param("userId")String userId, @Param("positionId")String positionId);
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询用户及其岗位
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.slrs.sarUser.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UserPositionBatchVO {
|
||||
@NotNull(message = "userId不能为空")
|
||||
private List<String> userId;
|
||||
@NotNull(message = "positionIds不能为空")
|
||||
private List<String> positionIds;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionBatchVO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -44,6 +45,8 @@ public interface ITsUserService extends IService<TsUser> {
|
||||
*/
|
||||
ResponseMessage<Object> setPosition(UserPositionVO userPositionVO);
|
||||
|
||||
ResponseMessage<Object> setPositionBatch(UserPositionBatchVO userPositionVO);
|
||||
|
||||
/**
|
||||
* 查询当前登录的用户权限
|
||||
* @return List<SarMenu>
|
||||
|
||||
+43
-4
@@ -11,11 +11,8 @@ import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.adc.da.slrs.sarUser.entity.SyncUser;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.entity.*;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
@@ -144,6 +141,48 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 配置岗位
|
||||
* @param userPositionVO2:用户、岗位ID
|
||||
* @return ResponseMessage<Object>
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResponseMessage<Object> setPositionBatch(UserPositionBatchVO userPositionVO2) {
|
||||
|
||||
boolean flag=true;
|
||||
|
||||
for (String s:userPositionVO2.getUserId()) {
|
||||
UserPositionVO userPositionVO=new UserPositionVO();
|
||||
userPositionVO.setUserId(s);
|
||||
userPositionVO.setPositionIds(userPositionVO2.getPositionIds());
|
||||
TsUser tsUser=tsUserDao.selectById(userPositionVO.getUserId());
|
||||
if(tsUser==null){
|
||||
flag=false;
|
||||
}
|
||||
List<String> oldPositionIds=tsUserDao.selectPositionIds(userPositionVO.getUserId());
|
||||
Map<String,List<String>> ids= ListUtil.difList(userPositionVO.getPositionIds(),oldPositionIds);
|
||||
List<String> insertIds=ids.get("insert");
|
||||
List<String> deleteIds=ids.get("delete");
|
||||
if(insertIds!=null&&insertIds.size()>0){
|
||||
for(String positionId:insertIds){
|
||||
tsUserDao.addPosition(userPositionVO.getUserId(),positionId);
|
||||
}
|
||||
}
|
||||
if(deleteIds!=null&&deleteIds.size()>0){
|
||||
for(String positionId:deleteIds){
|
||||
tsUserDao.delPosition(userPositionVO.getUserId(),positionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
return Result.success();
|
||||
}else {
|
||||
return Result.error("用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录的用户权限
|
||||
* @return List<SarMenu>
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@
|
||||
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStatus != null">
|
||||
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
AND library.project_status = #{qu.projectStatus}
|
||||
</if>
|
||||
<if test="qu.currentNode != null">
|
||||
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
|
||||
Reference in New Issue
Block a user