Merge remote-tracking branch 'origin/master'

This commit is contained in:
cwchen 2024-02-29 10:31:46 +08:00
commit eadf29d27f
11 changed files with 140 additions and 9 deletions

View File

@ -0,0 +1,34 @@
#!/bin/sh
# 找到Springboot项目对应的进程id
P_ID=$(pgrep -f "securitycontrol-auth")
# 如果该项目已经在服务器上启动则kill掉
echo "原应用程序进程id$P_ID"
if [ -z "$P_ID" ]; then
echo "==Demo service process does not exist"
else
# 尝试优雅地关闭应用程序
kill -9 "$P_ID"
wait "$P_ID" 2>/dev/null
# 检查进程是否仍在运行
if ! ps -p "$P_ID" > /dev/null; then
echo "Demo service process was terminated gracefully"
else
# 如果优雅关闭失败,则强制杀死进程
kill -9 "$P_ID"
echo "Demo service process was killed forcefully"
fi
fi
echo "授权"
# 让root用户对jar包持有读执行的权限
chmod 777 /opt/jar/hb/zhgd/jar/auth/securitycontrol-auth.jar
echo "执行"
# cd /opt/webapps/
# 目标服务器后台方式启动jar包
#nohup /usr/local/jdk-17.0.9/bin/java -jar /opt/webapps/demo4bonus-0.0.1-SNAPSHOT.jar >/dev/null 2>&1 &
nohup java -jar securitycontrol-auth.jar >/opt/jar/hb/zhgd/jar/logs/securitycontrol-auth.log 2>&1 &
echo "启动成功"

View File

@ -0,0 +1,34 @@
#!/bin/sh
# 找到Springboot项目对应的进程id
P_ID=$(pgrep -f "securitycontrol-gateway")
# 如果该项目已经在服务器上启动则kill掉
echo "原应用程序进程id$P_ID"
if [ -z "$P_ID" ]; then
echo "==Demo service process does not exist"
else
# 尝试优雅地关闭应用程序
kill -9 "$P_ID"
wait "$P_ID" 2>/dev/null
# 检查进程是否仍在运行
if ! ps -p "$P_ID" > /dev/null; then
echo "Demo service process was terminated gracefully"
else
# 如果优雅关闭失败,则强制杀死进程
kill -9 "$P_ID"
echo "Demo service process was killed forcefully"
fi
fi
echo "授权"
# 让root用户对jar包持有读执行的权限
chmod 777 /opt/jar/hb/zhgd/jar/gateway/securitycontrol-gateway.jar
echo "执行"
# cd /opt/webapps/
# 目标服务器后台方式启动jar包
#nohup /usr/local/jdk-17.0.9/bin/java -jar /opt/webapps/demo4bonus-0.0.1-SNAPSHOT.jar >/dev/null 2>&1 &
nohup java -jar securitycontrol-gateway.jar >/opt/jar/hb/zhgd/jar/logs/securitycontrol-gateway.log 2>&1 &
echo "启动成功"

View File

@ -0,0 +1,34 @@
#!/bin/sh
# 找到Springboot项目对应的进程id
P_ID=$(pgrep -f "securitycontrol-system")
# 如果该项目已经在服务器上启动则kill掉
echo "原应用程序进程id$P_ID"
if [ -z "$P_ID" ]; then
echo "==Demo service process does not exist"
else
# 尝试优雅地关闭应用程序
kill -9 "$P_ID"
wait "$P_ID" 2>/dev/null
# 检查进程是否仍在运行
if ! ps -p "$P_ID" > /dev/null; then
echo "Demo service process was terminated gracefully"
else
# 如果优雅关闭失败,则强制杀死进程
kill -9 "$P_ID"
echo "Demo service process was killed forcefully"
fi
fi
echo "授权"
# 让root用户对jar包持有读执行的权限
chmod 777 /opt/jar/hb/zhgd/jar/system/securitycontrol-system.jar
echo "执行"
# cd /opt/webapps/
# 目标服务器后台方式启动jar包
#nohup /usr/local/jdk-17.0.9/bin/java -jar /opt/webapps/demo4bonus-0.0.1-SNAPSHOT.jar >/dev/null 2>&1 &
nohup java -jar securitycontrol-system.jar >/opt/jar/hb/zhgd/jar/logs/securitycontrol-system.log 2>&1 &
echo "启动成功"

View File

@ -43,7 +43,7 @@ public class SelectController extends BaseController {
}
@ApiOperation(value = "字典下拉选")
@PostMapping("getDictList")
public AjaxResult getDictList(Integer code){
public AjaxResult getDictList(String code){
return service.getDictList(code);
}

View File

@ -51,5 +51,5 @@ public interface ISelectMapper {
* @param code
* @return
*/
List<TreeNode> getDictList(@Param("code") Integer code);
List<TreeNode> getDictList(@Param("code") String code);
}

View File

@ -46,5 +46,5 @@ public interface ISelectService {
* @param code
* @return
*/
AjaxResult getDictList(Integer code);
AjaxResult getDictList(String code);
}

View File

@ -7,6 +7,7 @@ import com.securitycontrol.entity.system.vo.SelectVo;
import com.securitycontrol.entity.system.vo.TreeNode;
import com.securitycontrol.system.base.mapper.ISelectMapper;
import com.securitycontrol.system.base.service.ISelectService;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
@ -80,9 +81,10 @@ public class SelectServiceImpl implements ISelectService {
* @return
*/
@Override
public AjaxResult getDictList(Integer code) {
public AjaxResult getDictList(String code) {
List<TreeNode> groupList = new ArrayList<>();
try {
List<TreeNode> list = mapper.getDictList(code);
if (CollectionUtils.isNotEmpty(list)) {
// 创建树形结构数据集合作为参数

View File

@ -61,4 +61,10 @@ public interface DictMapper {
* @return
*/
DictVo getDetails(String id);
/**
* 修改子节点编码
* @param dto
*/
void updateChildCode(DictVo dto);
}

View File

@ -84,6 +84,14 @@ public class DictServiceImpl implements DictService {
@Override
public Result<String> updateDict(DictVo dto) {
try{
//查询数据
DictVo vo=mapper.getDetails(dto.getDictId().toString());
if(vo==null){
return Result.fail("数据不存在");
}
if(vo.getDictCode().equals(dto.getPidCode())){
return Result.fail("父节点不能是自己");
}
if(dto.getPidCode()==null){
dto.setPidCode(0);
}
@ -92,6 +100,8 @@ public class DictServiceImpl implements DictService {
return res;
}
int num=mapper.updateDict(dto);
vo.setPidCode(dto.getDictCode());
mapper.updateChildCode(vo);
if(num>0){
return Result.ok("修改成功");
}

View File

@ -8,9 +8,7 @@ import com.securitycontrol.entity.system.dto.OrgDto;
import com.securitycontrol.entity.system.vo.OrgVo;
import com.securitycontrol.system.mapper.OrgMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;
import sun.plugin.util.UIUtil;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -104,8 +102,15 @@ public class OrgServiceImpl implements OrgService{
@Override
public Result<String> updateOrg(OrgVo dto) {
try{
OrgVo orgVo=mapper.getDetails(dto.getOrgId());
if(orgVo==null){
return Result.fail("数据不存在");
}
if(orgVo.getOrgId().equals(dto.getPId())){
return Result.fail("父节点不能是自己");
}
if(StringHelper.isEmpty(dto.getOrgId())){
return Result.ok("主键不能为空");
return Result.fail("主键不能为空");
}
if(StringHelper.isEmpty(dto.getPId())){
dto.setPId("0");

View File

@ -61,13 +61,19 @@
<!--修改-->
<update id="updateDict">
update sys_dict
set dict_code=#{dictCode},dict_name=#{dictName},dict_sort=#{dictValue},remarks=#{remarks}
set dict_code=#{dictCode},dict_name=#{dictName},dict_sort=#{dictValue},remarks=#{remarks},p_code=#{pidCode}
where dict_id=#{dictId};
</update>
<update id="updateChildCode">
update sys_dict
set p_code=#{pidCode}
where p_code=#{dictCode};
</update>
<!--删除-->
<delete id="delDict">
update sys_dict
set p_code=1
set del_flag=1
where dict_id=#{dictId};
</delete>
</mapper>