From cf404ad1401f38488db6fa610fc5ce7dcf9eec84 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期一, 13 十月 2025 11:13:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java
index eca7072..3164da2 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java
@@ -182,6 +182,24 @@
         return R.ok( erpProcurementService.detailProcurement(clinicSupplierId, user, 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 == 4){
+            // 供应商
+            TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class)
+                    .eq(TCrmSupplier::getUserId, user.getUserId())
+                    .last("LIMIT 1"));
+            clinicSupplierId=crmSupplier.getId();
+        }
+        erpProcurementService.detailProcurementSend(clinicSupplierId, user, id);
+        return R.ok();
+    }
+
 //    @ApiOperation(value = "采购详情--仓库角色专用")
 //    @GetMapping(value = "/detailProcurementWarehouse/{id}")
 //    public R<DetailProcurementVO> detailProcurementWarehouse(@PathVariable String id) {
@@ -216,7 +234,7 @@
             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);
         }
@@ -364,6 +382,9 @@
             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);
@@ -389,6 +410,8 @@
             tCrmChangePoints.setChangeReason(1);
             tCrmChangePoints.setChangeValue(points);
             crmChangePointsService.save(tCrmChangePoints);
+            salesperson.setUserPoints(salesperson.getUserPoints()+points);
+            crmSalespersonService.updateById(salesperson);
 
 
 

--
Gitblit v1.7.1