代码提交
This commit is contained in:
parent
a5a948034a
commit
58033ce671
|
|
@ -2,6 +2,7 @@ package com.bonus.web.service.impl;
|
|||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysDept;
|
||||
import com.bonus.common.core.domain.entity.SysRole;
|
||||
import com.bonus.web.controller.tool.TreeBuilder;
|
||||
import com.bonus.web.domain.*;
|
||||
import com.bonus.web.mapper.TransferApplyMapper;
|
||||
|
|
@ -94,14 +95,21 @@ public class TransferApplyServiceImpl implements TransferApplyService {
|
|||
|
||||
@Override
|
||||
public AjaxResult audit(TransferApplyDto dto) {
|
||||
dto.setAuditUser(getLoginUser().getUserId().toString());
|
||||
dto.setAuditUserName(getLoginUser().getUsername());
|
||||
Integer i = transferApplyMapper.audit(dto);
|
||||
if (i > 0) {
|
||||
transferApplyMapper.addTransferAuditRecord(dto);
|
||||
return AjaxResult.success("审核成功");
|
||||
List<SysRole> roles = getLoginUser().getUser().getRoles();
|
||||
boolean isArchivist = roles.stream()
|
||||
.anyMatch(role -> "档案管理员".equals(role.getRoleName()));
|
||||
if (isArchivist) {
|
||||
dto.setAuditUser(getLoginUser().getUserId().toString());
|
||||
dto.setAuditUserName(getLoginUser().getUsername());
|
||||
Integer i = transferApplyMapper.audit(dto);
|
||||
if (i > 0) {
|
||||
transferApplyMapper.addTransferAuditRecord(dto);
|
||||
return AjaxResult.success("审核成功");
|
||||
}
|
||||
return AjaxResult.error("审核失败");
|
||||
} else {
|
||||
return AjaxResult.error("您没有权限审核");
|
||||
}
|
||||
return AjaxResult.error("审核失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,11 +32,15 @@ public class SystemConfigServiceImpl implements ISystemConfigService {
|
|||
|
||||
@Override
|
||||
public AjaxResult add(SystemConfig config) {
|
||||
Integer add = systemConfigMapper.add(config);
|
||||
if (add > 0) {
|
||||
return AjaxResult.success("添加成功");
|
||||
} else {
|
||||
return AjaxResult.error("添加失败");
|
||||
try {
|
||||
Integer add = systemConfigMapper.add(config);
|
||||
if (add > 0) {
|
||||
return AjaxResult.success("添加成功");
|
||||
} else {
|
||||
return AjaxResult.error("添加失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("配置编码不可重复");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -52,6 +56,9 @@ public class SystemConfigServiceImpl implements ISystemConfigService {
|
|||
|
||||
@Override
|
||||
public AjaxResult del(SystemConfig config) {
|
||||
if (config.getId() <= 4) {
|
||||
return AjaxResult.error("该配置不可删除");
|
||||
}
|
||||
Integer del = systemConfigMapper.del(config);
|
||||
if (del > 0) {
|
||||
return AjaxResult.success("删除成功");
|
||||
|
|
|
|||
Loading…
Reference in New Issue