|
|
@@ -1,13 +1,20 @@
|
|
|
package com.dk.mdm.service.mst;
|
|
|
|
|
|
+import com.dk.common.response.ResponseResultUtil;
|
|
|
+import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.model.pojo.mst.StaffPurview;
|
|
|
import com.dk.mdm.mapper.mst.StaffPurviewMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
import com.dk.common.mapper.BaseMapper;
|
|
|
+import com.dk.mdm.model.pojo.mst.StaffRight;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Service
|
|
|
@Transactional
|
|
|
public class StaffPurviewService extends BaseService<StaffPurview> {
|
|
|
@@ -20,4 +27,33 @@ public class StaffPurviewService extends BaseService<StaffPurview> {
|
|
|
@Autowired
|
|
|
private StaffPurviewMapper staffPurviewMapper;
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 获取员工权限
|
|
|
+ * @author : 姜永辉
|
|
|
+ * @date : 2024/2/26 10:36
|
|
|
+ */
|
|
|
+ public ResponseResultVO<Map<String, Object>> getStaffPurview(Map<String, Object> param) {
|
|
|
+ // 获取系统基础数据
|
|
|
+ List<Map<String, Object>> list = staffPurviewMapper.getStaffPurview(param);
|
|
|
+ Map<String, Object> objectObjectHashMap = new HashMap<>();
|
|
|
+ objectObjectHashMap.put("list", list);
|
|
|
+ return ResponseResultUtil.success(objectObjectHashMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 保存员工范围权限
|
|
|
+ * @author : 姜永辉
|
|
|
+ * @date : 2024/2/26 10:36
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = {Exception.class})
|
|
|
+ public ResponseResultVO<?> saveStaffPurview(List<StaffPurview> staffPurviews) {
|
|
|
+ staffPurviewMapper.insertOrUpdateCondition(staffPurviews);
|
|
|
+ return ResponseResultUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResponseResultVO<Boolean> delete(String id) {
|
|
|
+ return ResponseResultUtil.success(staffPurviewMapper.deleteById(new StaffRight().setStaffId(id)) > 0) ;
|
|
|
+ }
|
|
|
+
|
|
|
}
|