Browse Source

20240417_sun

15143018065 1 year ago
parent
commit
11d775eef0

+ 13 - 2
ruoyi-modules/mz-lnst/src/main/java/com/ruoyi/lnst/service/impl/LnstYgServiceImpl.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.lnst.domain.LnstYg;
 import com.ruoyi.lnst.mapper.LnstYgMapper;
+import com.ruoyi.lnst.mapper.ZwywLrJbxxMapper;
 import com.ruoyi.lnst.service.ILnstYgService;
 import com.ruoyi.system.api.RemoteUserService;
 import com.ruoyi.system.api.domain.SysUser;
@@ -18,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -39,6 +39,9 @@ public class LnstYgServiceImpl implements ILnstYgService
     @Autowired
     private SysDeptJlMapper sysDeptJlMapper;
 
+    @Autowired
+    private ZwywLrJbxxMapper zwywLrJbxxMapper;
+
     /**
      * 查询养老食堂_员工
      *
@@ -135,7 +138,15 @@ public class LnstYgServiceImpl implements ILnstYgService
     @Override
     public int deleteLnstYgByIds(String[] ids)
     {
-        return lnstYgMapper.deleteBatchIds(Arrays.asList(ids));
+        int res = 0;
+        for (String id: ids) {
+            LnstYg yg = lnstYgMapper.selectById(id);
+            if (ObjectUtils.isNotEmpty(yg)) {
+                zwywLrJbxxMapper.deleteUser(yg.getUserId());
+                lnstYgMapper.deleteById(id);
+            }
+        }
+        return res;
     }
 
     private String getXb(String sfzh) {