From ac4f0d8e61c545c74f287563765179696b51b856 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 29 五月 2025 17:21:49 +0800
Subject: [PATCH] 增加排班删除功能

---
 pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java |   17 +++++++++++++++++
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrScheduleRelMapper.java   |    2 +-
 pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml               |    4 ++--
 pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java   |    5 +++++
 pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java               |    2 +-
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrScheduleRelMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrScheduleRelMapper.java
index 39efb3a..5cf745a 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrScheduleRelMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrScheduleRelMapper.java
@@ -19,7 +19,7 @@
 
     int updateByPrimaryKey(PrScheduleRel record);
 
-    void deleteByScheduleId(Long scheduleId);
+    long deleteByScheduleId(Long scheduleId);
 
     List<PrScheduleRel> selectByScheduleId(Long scheduleId);
 }
\ No newline at end of file
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml
index f032710..fd74664 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml
@@ -119,8 +119,8 @@
     where id = #{id,jdbcType=BIGINT}
   </update>
 
-  <delete id="deleteByScheduleId">
-    delete  from pr_schedule_rel where schedule_id=#{scheduleId}
+  <delete id="deleteByScheduleId" parameterType="java.lang.Long">
+    delete from pr_schedule_rel where schedule_id=#{scheduleId}
   </delete>
 
   <select id="selectByScheduleId" resultMap="BaseResultMap">
diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
index d3a2814..6cf7ff4 100644
--- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
+++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
@@ -79,7 +79,7 @@
         int count = roleSv.delete(Long.parseLong(id));
 
         if (count <= 0) {
-            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳垹闄ゅけ璐�");
         } else {
             return BaseResponseUtils.buildSuccess(true);
         }
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
index 7a26b21..6826b56 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
@@ -65,6 +65,23 @@
             return BaseResponseUtils.buildSuccess(true);
         }
     }
+    /**
+     * 鍒犻櫎
+     * @param id
+     * @return
+     */
+    @GetMapping(path="delete")
+    @SsoPowerAop(power = "10200009")
+    @Log("鍒犻櫎瑙掕壊淇℃伅")
+    public BaseResponse<Boolean> delete(String id){
+        long count = sv.delete(Long.parseLong(id));
+
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳垹闄ゅけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
 
     /**
      * 鏌ヨ浠诲姟璁″垝鍒楄〃
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
index 5cf915e..1dc32c7 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
@@ -70,6 +70,11 @@
         saveRel(schedule);
         return scheduleDao.updateByPrimaryKeySelective(schedule);
     }
+    @Transactional
+    public long delete(Long id) {
+        return this.scheduleRelDao.deleteByScheduleId(id);
+    }
+
 
     private void saveRel(PrSchedule schedule) {
         schedule.relList.forEach(rel -> validateRelData(rel, schedule));

--
Gitblit v1.8.0