手术申请服务接口实现 - OperationApplyImpl
/**
-
@Classname 马志豪
-
@Description TODO
-
@Version 1.0.0
-
@Date 2023/10/12 19:10
-
@Created by 86176 */ @Service public class OperationApplyImpl implements OperationApplyService {
@Resource private OperationApplyMapper operationApplyMapper;
@Resource private MdmRoleService mdmRoleService;
@Override public List<Map<String, String>> reqNode(String userId) { return operationApplyMapper.reqNode(userId); }
@Override public Result queryOperationPower(List
operationIds) { String userId = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest() .getHeader('zuul_id'); //userId ='7543d9b2a9044742bf7253715a4c8a3b'; List<Map<String,String>> operationList = operationApplyMapper.queryOperationPower(operationIds,userId); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('('); if (ListUtils.isNotBlank(operationList)){ for (Map<String, String> stringMap : operationList) { stringBuilder.append(stringMap.get('operName')+','); } stringBuilder.append(')您已有这些手术的权限或者已经添加申请提交,请重新选择'); return ResultGenerator.genFailedResult(stringBuilder.toString()); } return ResultGenerator.genOkResult(); } @Override public Result delete(String operationApplyId) { operationApplyMapper.delete(operationApplyId); return ResultGenerator.genOkResult(); }
@Override public Result save(List
sysOperationApply) { String userId = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest() .getHeader('zuul_id'); userId ='5e6419470b764ee59c2f9484724bae77'; List operationIds = new ArrayList<>(); for (SysOperationApply operationApply : sysOperationApply) { operationIds.add(operationApply.getOperationId()); } List<Map<String,String>> operationList = operationApplyMapper.queryOperationPower(operationIds,userId); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('('); if (ListUtils.isNotBlank(operationList)){ for (Map<String, String> stringMap : operationList) { stringBuilder.append(stringMap.get('operName')+','); } stringBuilder.append(')您已有这些手术的权限或者已经添加申请提交,请重新选择'); return ResultGenerator.genFailedResult(stringBuilder.toString()); } operationApplyMapper.saveOperation(sysOperationApply); return ResultGenerator.genOkResult(); } @Override public Result operNode(String queryString, String startTime, String endTime, String areaId, String reqDeptId, String operStatus, Integer page, Integer pageSize) { List
list = new ArrayList<>(); if (StringUtils.isNotBlank(queryString)){ list = operationApplyMapper.queryUserByString(queryString); } PageHelper.startPage(page,pageSize); List<Map<String,String>> operNodeList = operationApplyMapper.operNode(list,queryString,startTime,endTime,areaId,reqDeptId,operStatus); return ResultGenerator.genOkResult(operNodeList); } @Override public Result getOperation(String zuul_id,String queryString,Integer page, Integer pageSize) { String deptId = operationApplyMapper.getOperation(zuul_id); PageHelper.startPage(page,pageSize); List<Map<String,String>> operationList = operationApplyMapper.getOperationList(deptId,queryString); return ResultGenerator.genOkResult(operationList); }
@Override public Result update(List
sysOperationApplies) { operationApplyMapper.updateOperation(sysOperationApplies); //当审批通过后,调用对应的mdm添加手术权限的接口 List operationDeptDTOS = new ArrayList<>(); for (SysOperationApply sysOperationApply : sysOperationApplies) { String deptId = operationApplyMapper.getOperation(sysOperationApply.getReqUserId()); OperationDeptDTO operationDeptDTO = new OperationDeptDTO(); operationDeptDTO.setChecked('1'); operationDeptDTO.setDeptId(deptId); operationDeptDTO.setOperationDictId(sysOperationApply.getOperationId()); operationDeptDTO.setUserId(sysOperationApply.getReqUserId()); operationDeptDTOS.add(operationDeptDTO); } Result result = mdmRoleService.addUserOperAuth(operationDeptDTOS); return ResultGenerator.genOkResult(); } }
原文地址: https://www.cveoy.top/t/topic/pgNV 著作权归作者所有。请勿转载和采集!