| | |
| | | if (StringUtils.isBlank(request.getLeanDepartId())) { |
| | | throw new JeecgBootException("借入车间不允许为空!"); |
| | | } |
| | | if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | throw new JeecgBootException("当前设备属于此车间,不需要借用!"); |
| | | } |
| | | // if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | // throw new JeecgBootException("当前设备属于此车间,不需要借用!"); |
| | | // } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("当前用户无法添加借用记录!"); |
| | |
| | | if (StringUtils.isBlank(request.getLeanDepartId())) { |
| | | throw new JeecgBootException("借入车间不允许为空!"); |
| | | } |
| | | if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | throw new JeecgBootException("当前设备属于此车间,不需要借用!"); |
| | | } |
| | | // if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | // throw new JeecgBootException("当前设备属于此车间,不需要借用!"); |
| | | // } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("当前用户无法编辑借用记录!"); |
| | |
| | | } |
| | | variables.put("proofreading", true); |
| | | List<String> usernames = new ArrayList<>(); |
| | | usernames.add(equipment.getEquipmentManager()); |
| | | // usernames.add(equipment.getEquipmentManager()); |
| | | variables.put("NextAssignee", usernames); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("equipment_lean_out", variables); |
| | | if (result != null) { |
| | |
| | | break; |
| | | // 归还 |
| | | case WAIT_RETURN: |
| | | if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | throw new JeecgBootException("设备未分配设备管理员,无法进入下级审批!"); |
| | | } |
| | | List<String> userApprovalList = new ArrayList<>(Collections.singletonList(entity.getLeanPerson())); |
| | | userApprovalList.add(equipment.getEquipmentManager()); |
| | | // if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | // throw new JeecgBootException("设备未分配设备管理员,无法进入下级审批!"); |
| | | // } |
| | | // List<String> userApprovalList = new ArrayList<>(Collections.singletonList(entity.getLeanPerson())); |
| | | // userApprovalList.add(equipment.getEquipmentManager()); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", request.getReturnComment()); |
| | | values.put("comment", request.getReturnComment()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | // values.put("NextAssignee", userApprovalList); |
| | | request.setComment(request.getReturnComment()); |
| | | entity.setLeanEndTime(new Date()); //归还时间 |
| | | //设置entity |