|
@@ -3,6 +3,8 @@ package com.ghsc.partybuild.service.impl;
|
|
|
import com.ghsc.partybuild.mapper.*;
|
|
|
import com.ghsc.partybuild.model.*;
|
|
|
import com.ghsc.partybuild.service.CheckDataService;
|
|
|
+import com.ghsc.partybuild.service.UserService;
|
|
|
+import com.ghsc.partybuild.util.StringUtils;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -29,11 +31,21 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
@Autowired
|
|
|
PtCheckquestionMapper checkquestionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ CfUsersCQuery cfUsersCQuery;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ UserService userService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ StringUtils stringUtils;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public PageInfo<HashMap<String, Object>> getCheckNameList(int pageIndex, int pageSize, Integer year, Integer quarter, String dzzdm, String checkUserName, String partyCode, Integer recordStatus) {
|
|
|
|
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
|
- List<HashMap<String, Object>> list = checkdataCQuery.selectCheckNameList(year, quarter, dzzdm, checkUserName, partyCode, recordStatus);
|
|
|
+ List<HashMap<String, Object>> list = checkdataCQuery.selectCheckNameList(year, quarter, dzzdm, checkUserName, partyCode, recordStatus, null);
|
|
|
|
|
|
PageInfo<HashMap<String, Object>> result = new PageInfo(list);
|
|
|
|
|
@@ -68,6 +80,17 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
checkpartyMapper.insertSelective(it);
|
|
|
});
|
|
|
assetrCheckScore(item.getYear(),item.getQuarter(),item.getCheckuserid(),item.getCheckusername(),checkPartyList);
|
|
|
+ // 查询选择的用户是否有检查人员权限
|
|
|
+ List<HashMap<String, Object>> userInfo = cfUsersCQuery.selectUserAllByUserID(item.getCheckuserid());
|
|
|
+ if (!userInfo.isEmpty()) {
|
|
|
+ // 查询该用户是否绑定了检查人员角色
|
|
|
+ List<HashMap<String, Object>> roleList = cfUsersCQuery.GetRoleByUserId(item.getCheckuserid());
|
|
|
+ HashMap<String, Object> jcRole = roleList.stream().filter(it -> it.get("ROLEID").equals("27f0fd61-3107-486f-9240-4f9ef909103e")).findFirst().orElse(null);
|
|
|
+ if (jcRole == null) {
|
|
|
+ // 没有检查人员角色的,绑定一个
|
|
|
+ userService.saveUserRoleList("27f0fd61-3107-486f-9240-4f9ef909103e", item.getCheckuserid(), false);
|
|
|
+ }
|
|
|
+ }
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@@ -114,6 +137,10 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
ckExp.or().andNameidIn(nameIdList);
|
|
|
checknamelistMapper.deleteByExample(ckExp);
|
|
|
|
|
|
+ PtCheckdataExample cdExp = new PtCheckdataExample();
|
|
|
+ cdExp.or().andDataidIn(nameIdList);
|
|
|
+ CheckdataMapper.deleteByExample(cdExp);
|
|
|
+
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@@ -130,7 +157,7 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
@Override
|
|
|
public HashMap<String, Object> getCheckName(String id) {
|
|
|
|
|
|
- List<HashMap<String, Object>> list = checkdataCQuery.selectCheckNameList(null, null, null, null, null, null);
|
|
|
+ List<HashMap<String, Object>> list = checkdataCQuery.selectCheckNameList(null, null, null, null, null, null, null);
|
|
|
|
|
|
HashMap<String, Object> item = list.stream().filter(x -> x.get("nameid").toString().equals(id)).findFirst().orElse(null);
|
|
|
|
|
@@ -138,10 +165,25 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PageInfo<HashMap<String, Object>> getCheckDataList(int pageIndex, int pageSize, Integer year, String dzzdm, String remark) {
|
|
|
-
|
|
|
+ public PageInfo<HashMap<String, Object>> getCheckDataList(int pageIndex, int pageSize, Integer year, String dzzdm, String remark, String roleID, String userid) {
|
|
|
+ // 如果是核查人员,只允许查询用户核查名单中存在的组织的材料数据
|
|
|
+ String dzzdmInStr = null;
|
|
|
+ if (!stringUtils.IsNullOrEmpty(roleID) && roleID.equals("27f0fd61-3107-486f-9240-4f9ef909103e")) {
|
|
|
+ List<HashMap<String, Object>> checkNameList = checkdataCQuery.selectCheckNameList(null, null, null, null, null, null, userid);
|
|
|
+ // 获取党组织代码
|
|
|
+ List<String> distinctDzzdmList = checkNameList.stream()
|
|
|
+ .map(item -> item.get("partcodes"))
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(Object::toString).distinct().collect(Collectors.toList());
|
|
|
+ if (!distinctDzzdmList.isEmpty()) {
|
|
|
+ // 拼接in查询条件
|
|
|
+ dzzdmInStr = distinctDzzdmList.stream()
|
|
|
+ .map(s -> "'" + s.replace("'", "''") + "'")
|
|
|
+ .collect(Collectors.joining(",", "", ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
|
- List<HashMap<String, Object>> list = checkdataCQuery.selectCheckDataList(year, dzzdm, remark);
|
|
|
+ List<HashMap<String, Object>> list = checkdataCQuery.selectCheckDataList(year, dzzdm, remark, dzzdmInStr);
|
|
|
|
|
|
PageInfo<HashMap<String, Object>> result = new PageInfo(list);
|
|
|
|
|
@@ -181,10 +223,25 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PageInfo<HashMap<String, Object>> getCheckScoreList(int pageIndex, int pageSize, Integer year, Integer quarter, String dzzdm, String checkUserName, Float minScore,Float maxScore,Integer recordStatus,String checkuserid) {
|
|
|
-
|
|
|
+ public PageInfo<HashMap<String, Object>> getCheckScoreList(int pageIndex, int pageSize, Integer year, Integer quarter, String dzzdm, String checkUserName, Float minScore,Float maxScore,Integer recordStatus,String checkuserid, String roleID, String userid) {
|
|
|
+ // 如果是核查人员,只允许查询用户核查名单中存在的组织的材料数据
|
|
|
+ String dzzdmInStr = null;
|
|
|
+ if (!stringUtils.IsNullOrEmpty(roleID) && roleID.equals("27f0fd61-3107-486f-9240-4f9ef909103e")) {
|
|
|
+ List<HashMap<String, Object>> checkNameList = checkdataCQuery.selectCheckNameList(null, null, null, null, null, null, userid);
|
|
|
+ // 获取党组织代码
|
|
|
+ List<String> distinctDzzdmList = checkNameList.stream()
|
|
|
+ .map(item -> item.get("partcodes"))
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(Object::toString).distinct().collect(Collectors.toList());
|
|
|
+ if (!distinctDzzdmList.isEmpty()) {
|
|
|
+ // 拼接in查询条件
|
|
|
+ dzzdmInStr = distinctDzzdmList.stream()
|
|
|
+ .map(s -> "'" + s.replace("'", "''") + "'")
|
|
|
+ .collect(Collectors.joining(",", "", ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
|
- List<HashMap<String, Object>> list = checkdataCQuery.selectCheckScoreList( year, quarter, dzzdm, checkUserName, minScore, maxScore, recordStatus,checkuserid);
|
|
|
+ List<HashMap<String, Object>> list = checkdataCQuery.selectCheckScoreList( year, quarter, dzzdm, checkUserName, minScore, maxScore, recordStatus,checkuserid,dzzdmInStr);
|
|
|
|
|
|
PageInfo<HashMap<String, Object>> result = new PageInfo(list);
|
|
|
|