Commit ea642215 authored by mengmeng's avatar mengmeng

线上版本--唯一性修改之前

parent 7f934a84
...@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component; ...@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
/** /**
* cjrone项目配置 * Fhjw项目配置
* *
* @author kernespring * @author kernespring
* @Date 2019/04/02 15:49 * @Date 2019/04/02 15:49
......
...@@ -18,13 +18,6 @@ import java.util.List; ...@@ -18,13 +18,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
/**
* 测试定时任务(演示Demo,可删除)
* <p>
* testTask为spring bean的名称
*
* @author zsh 408538940@qq.com
*/
@Component("caseInfoUpdateTask") @Component("caseInfoUpdateTask")
public class CaseInfoUpdateTask implements ITask { public class CaseInfoUpdateTask implements ITask {
...@@ -40,7 +33,7 @@ public class CaseInfoUpdateTask implements ITask { ...@@ -40,7 +33,7 @@ public class CaseInfoUpdateTask implements ITask {
@Override @Override
public void run(String params) { public void run(String params) {
logger.debug("TestTask定时任务正在执行,参数为:{}", params); logger.debug("caseInfoUpdateTask定时任务正在执行,参数为:{}", params);
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("flag","2"); param.put("flag","2");
......
...@@ -94,44 +94,63 @@ public class FhiwFunctionServiceImpl extends CrudServiceImpl<FhiwFunctionDao, Fh ...@@ -94,44 +94,63 @@ public class FhiwFunctionServiceImpl extends CrudServiceImpl<FhiwFunctionDao, Fh
List<Long> caseIds = fhjwCaseService.selectByCaseNum(caseNum).stream() List<Long> caseIds = fhjwCaseService.selectByCaseNum(caseNum).stream()
.map(FhjwCaseDTO::getId).collect(Collectors.toList()); .map(FhjwCaseDTO::getId).collect(Collectors.toList());
// Long caseId = fhjwCaseService.getByCaseNum(caseNum).getId(); // Long caseId = fhjwCaseService.getByCaseNum(caseNum).getId();
String roleName = roleService.get(roleId).getName();
List<FhiwFunctionDTO> dtos = new ArrayList<>();
//判断案件是否存在代理人
boolean flag = false; boolean flag = false;
//判断是否有评价权限
boolean ifComment = false;
//当事人权限,则需要判断此案件是否有代理人,有代理人则不允许评价,无代理人则可以评价 //判断人员和案件是否已经绑定,当事人、代理人需要和案件关联后才能进行操作,否则显示无权限
if("当事人".equals(roleService.get(roleId).getName())){ //律师、代表委员、监督听证则无需和案件关联也可进行评价
if("当事人".equals(roleName)||"代理人".equals(roleName)){
for (Long caseId:caseIds) { for (Long caseId:caseIds) {
logger.info("caseId:"+caseId); logger.info("caseId:"+caseId);
Map<String, Object> query = new HashMap<>(); Map<String, Object> query = new HashMap<>();
query.put("caseId",caseId); query.put("caseId",caseId);
query.put("userId",userId); query.put("userId",userId);
List<UserCaseDTO> userCases = userCaseService.list(query); List<UserCaseDTO> userCases = userCaseService.list(query);
//当事人权限,则需要判断此案件是否有代理人,有代理人则不允许评价,无代理人则可以评价
if(userCases.size()>0){ if(userCases.size()>0){
System.out.println("代理人:"+fhjwCaseService.get(caseId).getAgentName()); ifComment = true;
if(!"".equals(fhjwCaseService.get(caseId).getAgentName()) && fhjwCaseService.get(caseId).getAgentName() !=null){ if("当事人".equals(roleName)){
flag = true; String agentName = fhjwCaseService.get(caseId).getAgentName();
break; logger.info("案件ID:"+caseId+"的代理人:"+agentName);
if(StringUtils.isNotBlank(agentName) && agentName !=null){
flag = true;
break;
}
} }
} }
}
//人员和案件没有关联信息则返回权限为空
if(!ifComment){
return dtos;
}
}
/* /*
List<Long> userIds = new ArrayList<>(); // 0827版本(修改多用户评价BUG)--最后改一次系列
if("当事人".equals(roleService.get(roleId).getName())){
for (Long caseId:caseIds) {
logger.info("caseId:"+caseId);
Map<String, Object> query = new HashMap<>();
query.put("caseId",caseId);
query.put("userId",userId);
List<UserCaseDTO> userCases = userCaseService.list(query);
if(userCases.size()>0){ if(userCases.size()>0){
userIds = userCases.stream() logger.info("代理人:"+fhjwCaseService.get(caseId).getAgentName());
.map(UserCaseDTO::getUserId).collect(Collectors.toList()); if(StringUtils.isNotBlank(fhjwCaseService.get(caseId).getAgentName())
} && fhjwCaseService.get(caseId).getAgentName() !=null){
for (Long Id:userIds) {
Optional<UserRoleDTO> userRole = Optional.ofNullable(userRoleService.getRoleByUser(Id));
Long role = userRoleService.getRoleByUser(Id).getRoleId();
if("代理人".equals(roleService.get(role).getName())){
flag = true; flag = true;
break;
} }
} }
*/
} }
} }
*/
//根据是否存在代理人,判断是否添加 "我要填写评测" 的权限! //根据是否存在代理人,判断是否添加 "我要填写测评" 的权限!
Long funcId = baseDao.selectOne(new QueryWrapper<FhiwFunctionEntity>().eq("name","我要填写测评")).getId(); Long funcId = baseDao.selectOne(new QueryWrapper<FhiwFunctionEntity>().eq("name","我要填写测评")).getId();
List<Long> funIds = new ArrayList<>(); List<Long> funIds = new ArrayList<>();
if(flag){ if(flag){
...@@ -144,7 +163,7 @@ public class FhiwFunctionServiceImpl extends CrudServiceImpl<FhiwFunctionDao, Fh ...@@ -144,7 +163,7 @@ public class FhiwFunctionServiceImpl extends CrudServiceImpl<FhiwFunctionDao, Fh
funIds = fhjwRoleFunctionService.list(params).stream() funIds = fhjwRoleFunctionService.list(params).stream()
.map(FhjwRoleFunctionDTO::getFunctionId).collect(Collectors.toList()); .map(FhjwRoleFunctionDTO::getFunctionId).collect(Collectors.toList());
} }
List<FhiwFunctionDTO> dtos = new ArrayList<>();
funIds.stream().forEach(id ->{ funIds.stream().forEach(id ->{
FhiwFunctionDTO dto = get(id); FhiwFunctionDTO dto = get(id);
logger.info("拥有的权限名称:"+dto.getName()); logger.info("拥有的权限名称:"+dto.getName());
......
...@@ -69,6 +69,8 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw ...@@ -69,6 +69,8 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
//设置案件所属部门(根据承办人确定) //设置案件所属部门(根据承办人确定)
dto.setDeptId(caseDto.get(0).getDeptId()); dto.setDeptId(caseDto.get(0).getDeptId());
//设置案件ID--律师、代表委员、监督听证权限和案件没有绑定了人员则根据案件号获取第一个caseID
dto.setCaseId(caseDto.get(0).getId());
//设置人员对应的caseID(存在相同受案号,不同当事人的情况,需要人员匹配caseID) //设置人员对应的caseID(存在相同受案号,不同当事人的情况,需要人员匹配caseID)
List<Long> ids = caseDto.stream().map(FhjwCaseDTO::getId).collect(Collectors.toList()); List<Long> ids = caseDto.stream().map(FhjwCaseDTO::getId).collect(Collectors.toList());
for (Long id :ids){ for (Long id :ids){
......
...@@ -64,4 +64,4 @@ mybatis-plus: ...@@ -64,4 +64,4 @@ mybatis-plus:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
cache-enabled: false cache-enabled: false
call-setters-on-nulls: true call-setters-on-nulls: true
jdbc-type-for-null: 'null' jdbc-type-for-null: 'null'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment