Merge branch 'fix_20240122_UAT' into 'master'
Fix 20240122 uat See merge request laws-nio/laws-weilai!370
This commit is contained in:
+5
@@ -18,4 +18,9 @@ public interface TodoCenterMapper {
|
|||||||
Integer countSdtDre(@Param("userName") String userName);
|
Integer countSdtDre(@Param("userName") String userName);
|
||||||
|
|
||||||
Integer countState(@Param("manifestId") String manifestId);
|
Integer countState(@Param("manifestId") String manifestId);
|
||||||
|
|
||||||
|
int listForTodoCenter(@Param("state") String state,
|
||||||
|
@Param("userId") String userId,
|
||||||
|
@Param("userName") String userName,
|
||||||
|
@Param("projectStatus") String projectStatus);
|
||||||
}
|
}
|
||||||
|
|||||||
+36
@@ -54,4 +54,40 @@
|
|||||||
select id from params_collect_manifest where params_manifest_id = #{manifestId} and state in('7','8')
|
select id from params_collect_manifest where params_manifest_id = #{manifestId} and state in('7','8')
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listForTodoCenter" resultType="java.lang.Integer">
|
||||||
|
select count(*) from(
|
||||||
|
select
|
||||||
|
pm.id as id,
|
||||||
|
pm.title as title,
|
||||||
|
pm.state as state,
|
||||||
|
pm.project_version_id as project_id,
|
||||||
|
pm.create_time as create_time,
|
||||||
|
pm.version as version,
|
||||||
|
concat(pni.project_name,'-',pyni.year_name,'-',plb.target_market,'-',pm.project_version) as project_name,
|
||||||
|
plb.project_status
|
||||||
|
from params_manifest pm
|
||||||
|
left join project_library_base as plb on plb.id = pm.project_version_id
|
||||||
|
left join project_name_info as pni on plb.project_name_id = pni.id
|
||||||
|
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
|
||||||
|
where plb.project_status !=#{projectStatus}
|
||||||
|
) tmp_tb
|
||||||
|
where 1=1 and state = #{state}
|
||||||
|
and id in(
|
||||||
|
SELECT pm.id AS pm FROM params_manifest pm
|
||||||
|
JOIN ( SELECT id FROM
|
||||||
|
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||||
|
FROM
|
||||||
|
project_library_base a
|
||||||
|
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||||
|
WHERE user_id = #{userId}) a ON pm.project_version_id = a.id
|
||||||
|
|
||||||
|
UNION
|
||||||
|
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
|
||||||
|
|
||||||
|
UNION
|
||||||
|
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE dre = #{userName} and state in('4','7')
|
||||||
|
)
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+43
-23
@@ -1,18 +1,25 @@
|
|||||||
package com.jero.modules.system.service.impl;
|
package com.jero.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.constant.CacheConstant;
|
import com.jero.common.constant.CacheConstant;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
|
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.common.system.vo.DictModel;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.util.oConvertUtils;
|
import com.jero.common.util.oConvertUtils;
|
||||||
import com.jero.modules.system.entity.SysPermission;
|
import com.jero.modules.system.entity.SysPermission;
|
||||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||||
import com.jero.modules.system.mapper.*;
|
import com.jero.modules.system.enums.DicCodeEnum;
|
||||||
|
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
||||||
|
import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||||
|
import com.jero.modules.system.mapper.SysPermissionMapper;
|
||||||
|
import com.jero.modules.system.mapper.SysRolePermissionMapper;
|
||||||
|
import com.jero.modules.system.mapper.TodoCenterMapper;
|
||||||
import com.jero.modules.system.model.TreeModel;
|
import com.jero.modules.system.model.TreeModel;
|
||||||
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||||
import com.jero.modules.system.service.ISysPermissionService;
|
import com.jero.modules.system.service.ISysPermissionService;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
@@ -27,6 +34,7 @@ import java.util.Date;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -41,7 +49,7 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysPermissionMapper sysPermissionMapper;
|
private SysPermissionMapper sysPermissionMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysPermissionDataRuleService permissionDataRuleService;
|
private ISysPermissionDataRuleService permissionDataRuleService;
|
||||||
|
|
||||||
@@ -57,6 +65,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TodoCenterMapper todoCenterMapper;
|
private TodoCenterMapper todoCenterMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDictService sysDictService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TreeModel> queryListByParentId(String parentId) {
|
public List<TreeModel> queryListByParentId(String parentId) {
|
||||||
return sysPermissionMapper.queryListByParentId(parentId);
|
return sysPermissionMapper.queryListByParentId(parentId);
|
||||||
@@ -96,10 +107,10 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
//删除部门角色授权
|
//删除部门角色授权
|
||||||
sysDepartRolePermissionMapper.deleteByMap(map);
|
sysDepartRolePermissionMapper.deleteByMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据父id删除其关联的子节点数据
|
* 根据父id删除其关联的子节点数据
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void removeChildrenBy(String parentId) {
|
public void removeChildrenBy(String parentId) {
|
||||||
@@ -134,7 +145,7 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 逻辑删除
|
* 逻辑删除
|
||||||
*/
|
*/
|
||||||
@@ -197,7 +208,7 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
}
|
}
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
this.updateById(sysPermission);
|
this.updateById(sysPermission);
|
||||||
|
|
||||||
//如果当前菜单的父菜单变了,则需要修改新父菜单和老父菜单的,叶子节点状态
|
//如果当前菜单的父菜单变了,则需要修改新父菜单和老父菜单的,叶子节点状态
|
||||||
String pid = sysPermission.getParentId();
|
String pid = sysPermission.getParentId();
|
||||||
if((oConvertUtils.isNotEmpty(pid) && !pid.equals(p.getParentId())) || oConvertUtils.isEmpty(pid)&&oConvertUtils.isNotEmpty(p.getParentId())) {
|
if((oConvertUtils.isNotEmpty(pid) && !pid.equals(p.getParentId())) || oConvertUtils.isEmpty(pid)&&oConvertUtils.isNotEmpty(p.getParentId())) {
|
||||||
@@ -210,10 +221,10 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
this.sysPermissionMapper.setMenuLeaf(p.getParentId(), 1);
|
this.sysPermissionMapper.setMenuLeaf(p.getParentId(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -230,7 +241,7 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
query.eq(SysPermissionDataRule::getPermissionId, id);
|
query.eq(SysPermissionDataRule::getPermissionId, id);
|
||||||
int countValue = this.permissionDataRuleService.count(query);
|
int countValue = this.permissionDataRuleService.count(query);
|
||||||
if(countValue > 0) {
|
if(countValue > 0) {
|
||||||
this.permissionDataRuleService.remove(query);
|
this.permissionDataRuleService.remove(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,21 +279,30 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
@Override
|
@Override
|
||||||
public boolean judgeToDo() {
|
public boolean judgeToDo() {
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||||
int count = todoCenterMapper.countSdtDre(loginUser.getUsername());
|
// int count = todoCenterMapper.countSdtDre(loginUser.getUsername());
|
||||||
if (count > 0) {
|
// if (count > 0) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<String> manifestIdList = todoCenterMapper.listInfoHomo(loginUser.getId(),"收集中");
|
||||||
|
// if(CollectionUtil.isNotEmpty(manifestIdList)) {
|
||||||
|
// for (int i = 0; i < manifestIdList.size(); i++) {
|
||||||
|
// int coutState = todoCenterMapper.countState(manifestIdList.get(i));
|
||||||
|
// if (coutState > 0) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<DictModel> projectStatus = sysDictService.queryDictItemsByCode(DicCodeEnum.PROJECT_STATUS.getCode());
|
||||||
|
projectStatus = projectStatus.stream().filter(e-> YesOrNoEnum.CANCEL.getName().equals(e.getText())).collect(Collectors.toList());
|
||||||
|
String state = "收集中";
|
||||||
|
String userId = loginUser.getId();
|
||||||
|
String userName = loginUser.getUsername();
|
||||||
|
int count = todoCenterMapper.listForTodoCenter(state, userId, userName, projectStatus.get(0).getValue());
|
||||||
|
if(count > 0){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> manifestIdList = todoCenterMapper.listInfoHomo(loginUser.getId(),"收集中");
|
|
||||||
if(CollectionUtil.isNotEmpty(manifestIdList)) {
|
|
||||||
for (int i = 0; i < manifestIdList.size(); i++) {
|
|
||||||
int coutState = todoCenterMapper.countState(manifestIdList.get(i));
|
|
||||||
if (coutState > 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -166,13 +166,13 @@
|
|||||||
pm.id as id,
|
pm.id as id,
|
||||||
pm.title as title,
|
pm.title as title,
|
||||||
pm.state as state,
|
pm.state as state,
|
||||||
pm.project_id as project_id,
|
pm.project_version_id as project_id,
|
||||||
pm.create_time as create_time,
|
pm.create_time as create_time,
|
||||||
pm.version as version,
|
pm.version as version,
|
||||||
concat(pni.project_name,'-',pyni.year_name,'-',plb.target_market,'-',pm.project_version) as project_name,
|
concat(pni.project_name,'-',pyni.year_name,'-',plb.target_market,'-',pm.project_version) as project_name,
|
||||||
plb.project_status
|
plb.project_status
|
||||||
from params_manifest pm
|
from params_manifest pm
|
||||||
left join project_library_base as plb on plb.id = pm.project_id
|
left join project_library_base as plb on plb.id = pm.project_version_id
|
||||||
left join project_name_info as pni on plb.project_name_id = pni.id
|
left join project_name_info as pni on plb.project_name_id = pni.id
|
||||||
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
|
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
|
||||||
) tmp_tb
|
) tmp_tb
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
FROM
|
FROM
|
||||||
project_library_base a
|
project_library_base a
|
||||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
WHERE user_id = #{userId}) a ON pm.project_version_id = a.id
|
||||||
|
|
||||||
UNION
|
UNION
|
||||||
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
|
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
|
||||||
|
|||||||
Reference in New Issue
Block a user