| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除采购") |
| | | @DeleteMapping(value = "/delProcurement/{id}") |
| | | public R<String> delProcurement(@PathVariable String id) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String clinicSupplierId=null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | TErpProcurement tErpProcurement = erpProcurementService.getById(id); |
| | | if(tErpProcurement.getClinicId().equals(clinicSupplierId)){ |
| | | erpProcurementService.removeById( id); |
| | | return R.ok(); |
| | | }else { |
| | | return R.fail("无权限"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |