修改权限改造引起的bug

This commit is contained in:
xuwenbo
2020-05-15 22:56:27 +08:00
parent 81fd601687
commit 9594d2b04e
12 changed files with 171 additions and 10 deletions

64
shell/jar-run2.sh Normal file
View File

@ -0,0 +1,64 @@
#cription: 启动重启server服务
#端口号根据此端口号确定PID
PORT=767
#启动命令所在目录
HOME='/home/sszn/task-agc'
#查询出监听了test.jar端口TCP协议的程序
pid=$(ps -ef | grep gdw-agc-task-1.0.0.0.jar | grep -v grep | awk '{print $2}')
start(){
echo "start running cloud-core ............... "
if [ -n "$pid" ]; then
echo "server already start,pid:$pid"
echo "pid:$pid agc-job port:$PORT 服务已经在运行了,请停止后再 执行 sh run.sh start "
return 0
fi
#进入命令所在目录
cd $HOME
# 启动服务控制台日志输出到nohup.out文件中
nohup java -jar gdw-agc-task-1.0.0.0.jar >> /home/sszn/task-agc/log/agc-$(date +%Y-%m-%d).log 2>&1 &
echo "running success agc-job port:$PORT"
echo "agc-job port:$PORT 服务启动成功 ..... "
}
stop(){
echo "stopping running cloud-core ............... "
if [ -z "$pid" ]; then
echo "not find program on port:$PORT"
echo "agc-job port:$PORT 服务已经被关闭了请执行 sh run.sh start "
return 0
fi
#结束程序使用讯号2如果不行可以尝试讯号9强制结束
kill -9 $pid
rm -rf $pid
echo "kill program use signal 2,pid:$pid"
}
status(){
if [ -z "$pid" ]; then
echo "not find program on port:$PORT"
else
echo "program is running,pid:$pid"
fi
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 0
esac

1
shell/log.sh Normal file
View File

@ -0,0 +1 @@
tail -f nohup.out

1
shell/start.sh Normal file
View File

@ -0,0 +1 @@
nohup java -jar yshop-api-2.0.jar --spring.profiles.active=prod &

7
shell/stop.sh Normal file
View File

@ -0,0 +1,7 @@
PID=$(ps -ef | grep yshop-api-2.0.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ];then
echo Application is already stopped
else
echo kill $PID
kill $PID
fi

81
shell/yshop.sh Normal file
View File

@ -0,0 +1,81 @@
#!/usr/bin/env bash
INPUT=$2
FILE_PATH=`readlink -f ${INPUT}`
SERVICE=${INPUT##*/}
SERVICE_NAME=${SERVICE%.*}
DEPLOY_DIR=`pwd`
JVM_OPTS="-server -Xms64m -Xmx128m"
if [[ "$1" = "" ]];
then
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
exit 1
fi
if [[ "$SERVICE" = "" ]];
then
echo -e "\033[0;31m 未输入应用名 \033[0m"
exit 1
fi
LOGS_DIR="$DEPLOY_DIR/logs/$SERVICE_NAME"
echo "$LOGS_DIR"
if [[ ! -d "$LOGS_DIR" ]]; then
mkdir -p ${LOGS_DIR}
fi
LOG_PATH="$LOGS_DIR/stdout.out"
pid=0
start()
{
checkPid
if [[ ! -n "$pid" ]]; then
BUILD_ID=dontKillMe nohup java ${JVM_OPTS} -jar ${FILE_PATH} >> ${LOG_PATH} 2>&1 &
echo "$SERVICE_NAME is starting you can check the $LOG_PATH"
else
echo "$SERVICE_NAME is runing PID: $pid"
fi
}
checkPid()
{
pid=`ps -ef |grep ${FILE_PATH} |grep -v grep |awk '{print $2}'`
}
stop()
{
checkPid
if [[ ! -n "$pid" ]]; then
echo "$SERVICE_NAME not runing"
else
echo "$SERVICE_NAME stop..."
kill -9 ${pid}
fi
}
restart()
{
stop
sleep 2
start
}
status()
{
checkPid
if [[ ! -n "$pid" ]]; then
echo "$SERVICE_NAME not runing"
else
echo "$SERVICE_NAME runing PID: $pid"
fi
}
case $1 in
start) start;;
stop) stop;;
restart) restart;;
status) status;;
*) echo "require start|stop|restart|status" ;;
esac

View File

@ -33,7 +33,6 @@ public class Dept implements Serializable {
/** 名称 */
@NotBlank
private String name;

View File

@ -47,7 +47,6 @@ public class DictDetail implements Serializable {
/** 字典id */
@TableId
private Long dictId;

View File

@ -21,6 +21,5 @@ public class DictDetailQueryCriteria{
@Query(type = Query.Type.INNER_LIKE)
private String label;
@Query(propName = "name",joinName = "dict")
private String dictName;
}

View File

@ -66,7 +66,8 @@ public class DictDetailServiceImpl extends BaseServiceImpl<DictDetailMapper, Dic
@Override
//@Cacheable
public List<DictDetail> queryAll(DictDetailQueryCriteria criteria){
return baseMapper.selectList(QueryHelpPlus.getPredicate(DictDetail.class, criteria));
List<DictDetail> list = baseMapper.selectDictDetailList(criteria.getLabel(),criteria.getDictName());
return list;
}

View File

@ -289,7 +289,6 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
* @param resources /
*/
@Override
@CacheEvict(allEntries = true)
public void update(Menu resources) {
if(resources.getId().equals(resources.getPid())) {
throw new BadRequestException("上级不能为自己");
@ -315,6 +314,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
}
}
menu.setId(resources.getId());
menu.setName(resources.getName());
menu.setComponent(resources.getComponent());
menu.setPath(resources.getPath());
@ -327,6 +327,6 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
menu.setComponentName(resources.getComponentName());
menu.setPermission(resources.getPermission());
menu.setType(resources.getType());
this.save(menu);
this.saveOrUpdate(menu);
}
}

View File

@ -67,7 +67,6 @@ import java.util.stream.Collectors;
*/
@Service
@AllArgsConstructor
@CacheConfig(cacheNames = "role")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implements RoleService {
@ -77,7 +76,6 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
private final DeptMapper deptMapper;
@Override
@Cacheable
public Map<String, Object> queryAll(RoleQueryCriteria criteria, Pageable pageable) {
getPage(pageable);
PageInfo<Role> page = new PageInfo<>(queryAll(criteria));
@ -89,9 +87,13 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
@Override
@Cacheable
public List<Role> queryAll(RoleQueryCriteria criteria){
return baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria));
List<Role> roleList = baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria));
for (Role role : roleList) {
role.setMenus(menuMapper.findMenuByRoleId(role.getId()));
role.setDepts(deptMapper.findDeptByRoleId(role.getId()));
}
return roleList;
}

View File

@ -10,9 +10,14 @@ package co.yixiang.modules.system.service.mapper;
import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.system.domain.DictDetail;
import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author hupeng
* @date 2020-05-14
@ -21,4 +26,6 @@ import org.springframework.stereotype.Repository;
@Mapper
public interface DictDetailMapper extends CoreMapper<DictDetail> {
@Select("<script>SELECT t.* from dict_detail d LEFT JOIN dict t on d.dict_id = t.id where 1=1 <if test = \"label !=null\" > and d.label LIKE concat('%', #{label}, '%') </if> <if test = \"dictName != ''||dictName !=null\" > AND t.name = #{dictName} order by t.sort asc</if></script>")
List<DictDetail> selectDictDetailList(@Param("label") String label,@Param("dictName") String dictName);
}