Commit ea642215 authored by mengmeng's avatar mengmeng

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

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