Kaynağa Gözat

部门数据权限

wangchangsheng 1 yıl önce
ebeveyn
işleme
a272fc1fd3

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptResponsibilityController.java

@@ -140,7 +140,7 @@ public class DeptResponsibilityController {
 	public R planValueList(
 		@RequestParam(value = "id", required = false) String  id,
 		@RequestParam(value = "dept", required = false) String dept) {
-		DeptResponsibilityResDTO resDTO = deptResponsibilityService.getByidAndInfo(id, dept);
+		DeptResponsibilityResDTO resDTO = deptResponsibilityService.getByidAndInfo(id, dept, request);
 		return R.ok().data(resDTO);
 	}
 

+ 4 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/IndicatorController.java

@@ -10,6 +10,8 @@ import com.ims.eval.entity.Indicator;
 import com.ims.eval.service.IIndicatorDictionaryService;
 import com.ims.eval.service.IIndicatorService;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -25,6 +27,7 @@ import java.util.List;
  * @author wang
  * @since 2023-02-26
  */
+@Slf4j
 @RestController
 @RequestMapping("//indicator")
 public class IndicatorController {
@@ -171,6 +174,7 @@ public class IndicatorController {
 				return R.error().data("保存失败!");
 			}
 		} catch (CustomException e){
+			log.error("错误",e);
 			return R.customError(e.getMessage()).data("失败!");
 		}
 	}

+ 15 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/controller/ResponsibilityIndicatorInfoController.java

@@ -7,9 +7,12 @@ import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IResponsibilityIndicatorInfoService;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 import java.util.Map;
 
@@ -23,6 +26,7 @@ import java.util.Map;
  * @author wang
  * @since 2023-03-08
  */
+@Slf4j
 @RestController
 @RequestMapping("//responsibility-indicator-info")
 public class ResponsibilityIndicatorInfoController {
@@ -32,6 +36,10 @@ public class ResponsibilityIndicatorInfoController {
 	@Autowired
 	private IResponsibilityIndicatorInfoService responsibilityIndicatorInfoService;
 
+
+	@Autowired
+	private HttpServletRequest request;
+
 	/**
 	 *
 	 * @param deptResponsibilityIds 目标责任书id
@@ -42,8 +50,13 @@ public class ResponsibilityIndicatorInfoController {
 	public R planValueList(
 				  @RequestParam(value = "deptResponsibilityIds", required = false) List<String> deptResponsibilityIds,
 				  @RequestParam(value = "dept", required = false) String dept) {
-		Map list = responsibilityIndicatorInfoService.planValueList(deptResponsibilityIds, dept);
-		return R.ok().data(list);
+		try {
+			Map list = responsibilityIndicatorInfoService.planValueList(deptResponsibilityIds, dept,request);
+			return R.ok().data(list);
+		} catch (CustomException e) {
+			e.printStackTrace();
+			return R.customError(e.getMessage());
+		}
 	}
 
 

+ 78 - 78
ims-service/ims-eval/src/main/java/com/ims/eval/entity/Myuser.java

@@ -21,86 +21,86 @@ public class Myuser extends Model {
     private static final long serialVersionUID = 1L;
 
     private String id;
-
-    private String name;
-
-    private String mainPosName;
-
+//
+//    private String name;
+//
+////    private String mainPosName;
+//
     private String deptName;
-
-    private String orgId;
-
-    private String orgName;
-
-    private String unitId;
-
-    private String unitName;
-
-    private Boolean admin;
-
-    private Integer age;
-
-    private String companyId;
-
-    private String createBy;
-
-    private String createDate;
-
-    private String dbName;
-
-    private String delFlag;
-
-    private String deptId;
-
-    private String education;
-
-    private String email;
-
-    private String faceimageUrl;
-
-    private String gender;
-
-    private String isNewRecord;
-
-    private String loginFlag;
-
-    private String loginIp;
-
+//
+//    private String orgId;
+////
+////    private String orgName;
+////
+//    private String unitId;
+//
+//    private String unitName;
+//
+//    private Boolean admin;
+//
+//    private Integer age;
+//
+//    private String companyId;
+//
+//    private String createBy;
+//
+//    private String createDate;
+//
+//    private String dbName;
+//
+//    private String delFlag;
+//
+//    private String deptId;
+//
+//    private String education;
+//
+//    private String email;
+//
+//    private String faceimageUrl;
+//
+//    private String gender;
+//
+//    private String isNewRecord;
+//
+//    private String loginFlag;
+//
+//    private String loginIp;
+//
     private String loginName;
-
-    private String mainPosCode;
-
-    private String mainposId;
-
-    private String mobile;
-
-    private String nation;
-
-    private String no;
-
-    private String oldLoginIp;
-
-    private double partyCost;
-
-    private String phone;
-
-    private String photo;
-
-    private String posCode;
-
-    private String remarks;
-
-    private String residence;
-
-    private String roleNames;
-
-    private String token;
-
-    private String updateBy;
-
-    private Date updateDate;
-
-    private String userType;
+//
+//    private String mainPosCode;
+//
+//    private String mainposId;
+//
+//    private String mobile;
+//
+//    private String nation;
+//
+//    private String no;
+//
+//    private String oldLoginIp;
+//
+//    private double partyCost;
+//
+//    private String phone;
+//
+//    private String photo;
+//
+//    private String posCode;
+//
+//    private String remarks;
+//
+//    private String residence;
+//
+//    private String roleNames;
+//
+//    private String token;
+//
+//    private String updateBy;
+//
+//    private Date updateDate;
+//
+//    private String userType;
 
 
 }

+ 5 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/ResponsibilityIndicatorInfoResDTO.java

@@ -116,5 +116,10 @@ public class ResponsibilityIndicatorInfoResDTO {
 	 */
 	private String state;
 
+	/**
+	 * 修改标记
+	 */
+	private Boolean updateMark;
+
 
 }

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IDeptResponsibilityService.java

@@ -26,7 +26,7 @@ public interface IDeptResponsibilityService extends IService<DeptResponsibility>
 
 	boolean generateResponsibility(String orgEvalRuleId);
 
-	DeptResponsibilityResDTO getByidAndInfo(String id, String dept);
+	DeptResponsibilityResDTO getByidAndInfo(String id, String dept,HttpServletRequest request);
 
 
 	List<Map> targetValueeport(String id, String dept, HttpServletRequest request);

+ 2 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IResponsibilityIndicatorInfoService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
 import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 import java.util.Map;
 
@@ -21,7 +22,7 @@ import java.util.Map;
 public interface IResponsibilityIndicatorInfoService extends IService<ResponsibilityIndicatorInfo> {
 
 
-	Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept);
+	Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept, HttpServletRequest request);
 
 	Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> finishValueList(List<String> deptResponsibilityIds, String dept);
 

+ 10 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IUserService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.ims.eval.entity.Myuser;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -45,6 +46,15 @@ public interface IUserService extends IService<Myuser> {
 	Myuser getSysUser(String code);
 
 	/**
+	 * 根据头信息
+	 * @param request
+	 * @return
+	 */
+	Myuser getSysUser(HttpServletRequest request);
+
+
+
+	/**
 	 * 通过token获取code
 	 *
 	 * @param token

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptResponsibilityServiceImpl.java

@@ -230,10 +230,10 @@ public class DeptResponsibilityServiceImpl extends ServiceImpl<DeptResponsibilit
 	}
 
 	@Override
-	public DeptResponsibilityResDTO getByidAndInfo(String id, String dept) {
+	public DeptResponsibilityResDTO getByidAndInfo(String id, String dept,HttpServletRequest request) {
 		DeptResponsibilityResDTO resDTO = baseMapper.selectById(id);
 
-		Map<String, List<ResponsibilityIndicatorInfoResDTO>> map = responsibilityIndicatorInfoService.planValueList(Arrays.asList(id), dept);
+		Map<String, List<ResponsibilityIndicatorInfoResDTO>> map = responsibilityIndicatorInfoService.planValueList(Arrays.asList(id), dept,request);
 		if(null != resDTO){
 			resDTO.setMap(map);
 		}

+ 1 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/IndicatorDictionaryServiceImpl.java

@@ -60,6 +60,7 @@ public class IndicatorDictionaryServiceImpl extends ServiceImpl<IndicatorDiction
 		if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {
 			QueryWrapper<IndicatorDictionary> qw = new QueryWrapper<>();
 			qw.lambda().eq(IndicatorDictionary::getIndicatorId, entity.getIndicatorId());
+			qw.lambda().eq(IndicatorDictionary::getChildCode, entity.getChildCode());
 			qw.lambda().eq(IndicatorDictionary::getOptionCode, entity.getOptionCode());
 			List<IndicatorDictionary> list = baseMapper.selectList(qw);
 			if (null != list && list.size() > 0) {

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/IndicatorServiceImpl.java

@@ -159,7 +159,7 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
 			for (IndicatorDictionary i : dto2.getList()) {
 				if (null != i && (null == i.getId() || "".equals(i.getId().trim()))) {
 					QueryWrapper<IndicatorDictionary> qw = new QueryWrapper<>();
-					qw.lambda().eq(IndicatorDictionary::getIndicatorId, i.getIndicatorId());
+					qw.lambda().eq(IndicatorDictionary::getIndicatorId, dto.getId());
 					qw.lambda().eq(IndicatorDictionary::getChildCode, dto2.getChildCode());
 					qw.lambda().eq(IndicatorDictionary::getOptionCode, i.getOptionCode());
 					List<IndicatorDictionary> list2 = indicatorDictionaryMapper.selectList(qw);

+ 0 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -1,16 +1,11 @@
 package com.ims.eval.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ims.common.utils.StringUtils;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.IndicatorDictionary;
 import com.ims.eval.entity.OrganizationEvaluationInfo;
 import com.ims.eval.dao.OrganizationEvaluationInfoMapper;
-import com.ims.eval.entity.ResponsibilityIndicatorInfo;
-import com.ims.eval.entity.dto.request.OrganizationEvaluationInfoUpdateDTO;
-import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
 import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
-import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 import com.ims.eval.service.ICalculateIndicatorItemInfoService;
 import com.ims.eval.service.IIndicatorDictionaryService;
 import com.ims.eval.service.IOrganizationEvaluationInfoService;

+ 15 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/ResponsibilityIndicatorInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.ims.eval.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.DataDictionary;
+import com.ims.eval.entity.Myuser;
 import com.ims.eval.entity.ResponsibilityIndicatorInfo;
 import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
 import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
@@ -10,9 +11,12 @@ import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
 import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 import com.ims.eval.service.IResponsibilityIndicatorInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ims.eval.service.IUserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -30,11 +34,20 @@ import java.util.stream.Collectors;
 public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<ResponsibilityIndicatorInfoMapper, ResponsibilityIndicatorInfo> implements IResponsibilityIndicatorInfoService {
 
 
+	@Autowired
+	private IUserService userService;
 
 	@Override
-	public Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept) {
-		List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.listByresponsibilityId(deptResponsibilityIds,dept,"ZRMB");//默认获取指定的怎目标
+	public Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept, HttpServletRequest request) {
 
+		Myuser myuser = userService.getSysUser(request);
+		if(null == myuser){
+			throw new CustomException("暂无权限");
+		}
+		List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.listByresponsibilityId(deptResponsibilityIds,dept,"ZRMB");//默认获取指定的怎目标
+		list.stream().forEach(i->{
+			i.setUpdateMark(i.getDeptName().equals(myuser.getDeptName()));
+		});
 		Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> map  = list.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getIsQuantified));
 		map.put("quantifiedList", map.remove("是"));
 		map.put("nonQuantifiedList", map.remove("否"));

Dosya farkı çok büyük olduğundan ihmal edildi
+ 32 - 7
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/UserServiceImpl.java