| | |
| | | return R.ok( erpProcurementService.detailProcurement(clinicSupplierId, user, id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "采购详情--仓库角色专用") |
| | | @GetMapping(value = "/detailProcurementWarehouse/{id}") |
| | | public R<DetailProcurementVO> detailProcurementWarehouse(@PathVariable String id) { |
| | | |
| | | @ApiOperation(value = "采购详情--发货(仓库角色)") |
| | | @PostMapping(value = "/detailProcurementSend/{id}") |
| | | public R<?> detailProcurementSend(@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()) |
| | | if(roleType == 4){ |
| | | // 供应商 |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | clinicSupplierId = crmClinic.getId(); |
| | | clinicSupplierId=crmSupplier.getId(); |
| | | } |
| | | |
| | | return R.ok( erpProcurementService.detailProcurementWarehouse(clinicSupplierId, user, id)); |
| | | erpProcurementService.detailProcurementSend(clinicSupplierId, user, id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // @ApiOperation(value = "采购详情--仓库角色专用") |
| | | // @GetMapping(value = "/detailProcurementWarehouse/{id}") |
| | | // public R<DetailProcurementVO> detailProcurementWarehouse(@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(); |
| | | // } |
| | | // |
| | | // return R.ok( erpProcurementService.detailProcurementWarehouse(clinicSupplierId, user, id)); |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | ArrayList<DetailProcurementNextVO> detailProcurementNextVOS = new ArrayList<>(); |
| | | List<TErpProcurement> list1 = erpProcurementService.list(new LambdaQueryWrapper<TErpProcurement>().eq(TErpProcurement::getStatus, 1).orderByDesc(TErpProcurement::getCreateTime)); |
| | | List<TErpProcurement> list1 = erpProcurementService.list(new LambdaQueryWrapper<TErpProcurement>().eq(TErpProcurement::getClinicId, clinicSupplierId).eq(TErpProcurement::getStatus, 1).orderByDesc(TErpProcurement::getCreateTime)); |
| | | if(list1.isEmpty()){ |
| | | return R.ok(detailProcurementNextVOS); |
| | | } |
| | |
| | | tCrmChangePoints.setChangeValue(points); |
| | | crmChangePointsService.save(tCrmChangePoints); |
| | | |
| | | branch.setUserPoints(branch.getUserPoints()+points); |
| | | crmBranchService.updateById(branch); |
| | | |
| | | |
| | | // 分佣 |
| | | BigDecimal commission = branch.getMoneyCommission().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_DOWN).multiply(payMoney).setScale(2, RoundingMode.HALF_UP); |
| | |
| | | tCrmChangePoints.setChangeReason(1); |
| | | tCrmChangePoints.setChangeValue(points); |
| | | crmChangePointsService.save(tCrmChangePoints); |
| | | salesperson.setUserPoints(salesperson.getUserPoints()+points); |
| | | crmSalespersonService.updateById(salesperson); |
| | | |
| | | |
| | | |