工作组添加验证
This commit is contained in:
+26
@@ -13,6 +13,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.contract.entity.PayIncomeContract;
|
||||
import com.jero.contract.service.IPayIncomeContractService;
|
||||
@@ -31,6 +32,7 @@ import com.jero.util.AmountUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
@@ -108,6 +110,30 @@ public class PayWorkingGroupController extends JeroController<PayWorkingGroup, I
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验登陆人是否可以操作工作组
|
||||
*
|
||||
* @param id 工作组id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "工作组项目-校验登陆人是否可以操作工作组")
|
||||
@ApiOperation(value="工作组项目-列表查询", notes="工作组项目-校验登陆人是否可以操作工作组")
|
||||
@GetMapping(value = "/checkoutOperation")
|
||||
public Result<?> checkoutOperation(@RequestParam("id") String id) {
|
||||
if(StringUtils.isBlank(id)){
|
||||
throw new JeroBootException("工作组id不能为空!");
|
||||
}
|
||||
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(id);
|
||||
if(Objects.isNull(payWorkingGroup)){
|
||||
throw new JeroBootException("工作组为空!");
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
|
||||
return Result.error("不可操作!");
|
||||
}
|
||||
return Result.OK("可操作!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 收入合同-根据成员单位列表查询
|
||||
|
||||
Reference in New Issue
Block a user