|
|
@@ -143,15 +143,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
143
|
143
|
*/
|
|
144
|
144
|
@Override
|
|
145
|
145
|
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
|
146
|
|
- // admin查询所有案件
|
|
147
|
|
- if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
|
148
|
|
- startPage();
|
|
149
|
|
- return msCaseApplicationMapper.list(req, null);
|
|
150
|
|
- }
|
|
|
146
|
+
|
|
151
|
147
|
// 根据用户查询角色
|
|
152
|
148
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
153
|
|
- SysUser sysUser = loginUser.getUser();
|
|
154
|
|
- List<SysRole> roles = sysUser.getRoles();
|
|
|
149
|
+ // 根据id查询用户
|
|
|
150
|
+ SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
|
|
|
151
|
+ List<SysRole> roles = loginUser.getUser().getRoles();
|
|
155
|
152
|
if (CollectionUtil.isEmpty(roles)) {
|
|
156
|
153
|
throw new ServiceException("该用户未指定角色");
|
|
157
|
154
|
}
|
|
|
@@ -170,16 +167,47 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
170
|
167
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
171
|
168
|
throw new ServiceException("该角色为绑定案件流程");
|
|
172
|
169
|
}
|
|
|
170
|
+ Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
|
|
|
171
|
+ // admin查询所有案件
|
|
|
172
|
+ if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
|
|
173
|
+ MsCaseFlow caseFlow =null;
|
|
|
174
|
+ if(req.getHearDateFlag()!=null){
|
|
|
175
|
+ caseFlow = flowMap.get("caseManagement:list:mediate");
|
|
|
176
|
+ }else {
|
|
|
177
|
+ // 根据按钮权限标识符查询待选择调解员流程id
|
|
|
178
|
+ caseFlow = flowMap.get("caseManagement:list:selectmediator");
|
|
|
179
|
+ }
|
|
|
180
|
+ if(caseFlow!=null) {
|
|
|
181
|
+ req.setCaseFlowId(caseFlow.getId());
|
|
|
182
|
+ }
|
|
|
183
|
+ startPage();
|
|
|
184
|
+
|
|
|
185
|
+ return msCaseApplicationMapper.list(req, null);
|
|
|
186
|
+ }
|
|
173
|
187
|
for (SysRole role : roles) {
|
|
174
|
188
|
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
|
|
175
|
|
- if(loginUser.getDeptId()!=null) {
|
|
176
|
|
- req.setApplicationOrganId(String.valueOf(loginUser.getDeptId()));
|
|
|
189
|
+ if(sysUser.getDeptId()!=null) {
|
|
|
190
|
+ req.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
177
|
191
|
}
|
|
178
|
192
|
req.setApplicantFlag(1);
|
|
|
193
|
+ break;
|
|
|
194
|
+
|
|
179
|
195
|
}
|
|
180
|
196
|
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){
|
|
181
|
197
|
// todo 被申请人案件根据被申请人身份证号查询案件列表
|
|
182
|
198
|
req.setRespondentIdentityNum(sysUser.getIdCard());
|
|
|
199
|
+ MsCaseFlow caseFlow =null;
|
|
|
200
|
+ // 查询待调解流程id
|
|
|
201
|
+ if(req.getHearDateFlag()!=null){
|
|
|
202
|
+ caseFlow = flowMap.get("caseManagement:list:mediate");
|
|
|
203
|
+ }else {
|
|
|
204
|
+ // 根据按钮权限标识符查询待选择调解员流程id
|
|
|
205
|
+ caseFlow = flowMap.get("caseManagement:list:selectmediator");
|
|
|
206
|
+ }
|
|
|
207
|
+ if(caseFlow!=null) {
|
|
|
208
|
+ req.setCaseFlowId(caseFlow.getId());
|
|
|
209
|
+ }
|
|
|
210
|
+ break;
|
|
183
|
211
|
}
|
|
184
|
212
|
}
|
|
185
|
213
|
startPage();
|
|
|
@@ -948,7 +976,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
948
|
976
|
criteria.andIsNull("type");
|
|
949
|
977
|
}
|
|
950
|
978
|
criteria.andEqualTo("caseAppliId", vo.getId());
|
|
951
|
|
- criteria.andEqualTo("mediatorId", user.getUserId());
|
|
|
979
|
+ // criteria.andEqualTo("mediatorId", user.getUserId());
|
|
952
|
980
|
int count = msCaseMediatorMapper.selectCountByExample(example);
|
|
953
|
981
|
if (count > 0) {
|
|
954
|
982
|
// 申请人已预约,更新主表流程节点
|
|
|
@@ -2100,7 +2128,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2100
|
2128
|
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
|
|
2101
|
2129
|
userMapper.insertUser(agentUser);
|
|
2102
|
2130
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
|
2103
|
|
- } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
|
|
2131
|
+ } else if (null == agentUser.getDeptId() ) {
|
|
|
2132
|
+ // todo 未关联部门,关联部门
|
|
|
2133
|
+ agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
|
|
|
2134
|
+ userMapper.updateUser(agentUser);
|
|
|
2135
|
+ }else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
|
2104
|
2136
|
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
|
|
2105
|
2137
|
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
|
|
2106
|
2138
|
} else {
|