瀏覽代碼

删除营期

三七 1 周之前
父節點
當前提交
47bf3d7da0

+ 10 - 10
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsController.java

@@ -107,14 +107,14 @@ public class SopUserLogsController extends BaseController
     }
 
 
-//    /**
-//     * 删除sopUserLogs
-//     */
-//    @PreAuthorize("@ss.hasPermi('qwSop:sopUserLogs:remove')")
-//    @Log(title = "sopUserLogs", businessType = BusinessType.DELETE)
-//	@DeleteMapping("/{ids}")
-//    public AjaxResult remove(@PathVariable Long[] ids)
-//    {
-//        return toAjax(sopUserLogsService.deleteSopUserLogsByIds(ids));
-//    }
+    /**
+     * 删除sopUserLogs
+     */
+    @PreAuthorize("@ss.hasPermi('qwSop:sopUserLogs:remove')")
+    @Log(title = "删除sopUserLogs", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(sopUserLogsService.deleteSopUserLogsByIds(ids));
+    }
 }

+ 5 - 1
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsInfoMapper.java

@@ -96,7 +96,11 @@ public interface SopUserLogsInfoMapper {
     @DataSource(DataSourceType.SOP)
     int deleteSopUserLogsInfoBySopIds(@Param("sopIds") String[] sopIds);
 
-
+    /**
+     * 批量删除
+     */
+    @DataSource(DataSourceType.SOP)
+    int deleteSopUserLogsInfoByUserLogsIds(@Param("userLogsIds") String[] userLogsIds);
     /**
      * 根据ID修改记录
      * @return 影响行数

+ 3 - 0
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java

@@ -26,6 +26,9 @@ public interface SopUserLogsMapper {
     @DataSource(DataSourceType.SOP)
     public int deleteSopUserLogsById(String id);
 
+    @DataSource(DataSourceType.SOP)
+    public int deleteSopUserLogsByIds(String[] ids);
+
     @DataSource(DataSourceType.SOP)
     public int insertSopUserLogsByDate(@Param("data") SopUserLogsParamByDate logsParamByDate);
 

+ 1 - 0
fs-service/src/main/java/com/fs/sop/service/ISopUserLogsService.java

@@ -15,6 +15,7 @@ public interface ISopUserLogsService {
 
     public int insertSopUserLogsByDate(SopUserLogsParamByDate logsParamByDate);
 
+    public int deleteSopUserLogsByIds(String[] ids);
 //    public int updateSopUserLogsDistinct(SopUserLogs sopUserLogs);
 
 //    public int updateSopUserLogsDistinctByList(SopUserLogsArray userLogsArray);

+ 8 - 0
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java

@@ -120,6 +120,14 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         return sopUserLogsMapper.insertSopUserLogsByDate(logsParamByDate);
     }
 
+    @Override
+    public int deleteSopUserLogsByIds(String[] ids) {
+        //删除营期详情用户
+        sopUserLogsInfoMapper.deleteSopUserLogsInfoByUserLogsIds(ids);
+
+        return sopUserLogsMapper.deleteSopUserLogsByIds(ids);
+    }
+
 
 //    @Override
 //    public int updateSopUserLogsDistinct(SopUserLogs sopUserLogs) {

+ 9 - 0
fs-service/src/main/resources/mapper/sop/SopUserLogsInfoMapper.xml

@@ -172,6 +172,15 @@
             and external_id = #{data.externalId}
     </delete>
 
+    <delete id="deleteSopUserLogsInfoByUserLogsIds" parameterType="map">
+        DELETE FROM sop_user_logs_info  WHERE user_logs_id IN
+        <foreach item="userLogsId" index="index" collection="userLogsIds"
+                 open="(" separator="," close=")">
+            #{userLogsId}
+        </foreach>
+    </delete>
+
+
 
     <!-- 根据ID查询单条记录 -->
     <select id="selectById" parameterType="String" resultMap="SopUserLogsInfoResult">

+ 7 - 0
fs-service/src/main/resources/mapper/sop/SopUserLogsMapper.xml

@@ -50,6 +50,13 @@
         DELETE FROM sop_user_logs  WHERE id = #{id}
     </delete>
 
+    <delete id="deleteSopUserLogsByIds" parameterType="String">
+        delete from sop_user_logs where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
     <insert id="insertSopUserLogsByDate" parameterType="com.fs.sop.params.SopUserLogsParamByDate" useGeneratedKeys="false" >
         insert into sop_user_logs
         <trim prefix="(" suffix=")" suffixOverrides=",">