|
|
@@ -145,13 +145,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
145
|
145
|
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
|
146
|
146
|
// admin查询所有案件
|
|
147
|
147
|
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
|
|
148
|
+
|
|
|
149
|
+ if(req.getHearDateFlag()!=null){
|
|
|
150
|
+ // todo 暂时写死
|
|
|
151
|
+ req.setCaseFlowId(9);
|
|
|
152
|
+ }
|
|
148
|
153
|
startPage();
|
|
|
154
|
+
|
|
149
|
155
|
return msCaseApplicationMapper.list(req, null);
|
|
150
|
156
|
}
|
|
151
|
157
|
// 根据用户查询角色
|
|
152
|
158
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
153
|
|
- SysUser sysUser = loginUser.getUser();
|
|
154
|
|
- List<SysRole> roles = sysUser.getRoles();
|
|
|
159
|
+ // 根据id查询用户
|
|
|
160
|
+ SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
|
|
|
161
|
+ List<SysRole> roles = loginUser.getUser().getRoles();
|
|
155
|
162
|
if (CollectionUtil.isEmpty(roles)) {
|
|
156
|
163
|
throw new ServiceException("该用户未指定角色");
|
|
157
|
164
|
}
|
|
|
@@ -170,21 +177,42 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
170
|
177
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
171
|
178
|
throw new ServiceException("该角色为绑定案件流程");
|
|
172
|
179
|
}
|
|
|
180
|
+ Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
|
|
|
181
|
+ List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
|
|
173
|
182
|
for (SysRole role : roles) {
|
|
174
|
183
|
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
|
|
175
|
|
- if(loginUser.getDeptId()!=null) {
|
|
176
|
|
- req.setApplicationOrganId(String.valueOf(loginUser.getDeptId()));
|
|
|
184
|
+ if(sysUser.getDeptId()!=null) {
|
|
|
185
|
+ req.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
177
|
186
|
}
|
|
178
|
187
|
req.setApplicantFlag(1);
|
|
|
188
|
+ break;
|
|
|
189
|
+
|
|
179
|
190
|
}
|
|
180
|
191
|
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){
|
|
|
192
|
+ caseStatusNames=new ArrayList<>();
|
|
181
|
193
|
// todo 被申请人案件根据被申请人身份证号查询案件列表
|
|
182
|
194
|
req.setRespondentIdentityNum(sysUser.getIdCard());
|
|
|
195
|
+ MsCaseFlow caseFlow =null;
|
|
|
196
|
+ // todo 查询待调解流程id被申请人暂时写死
|
|
|
197
|
+ if(req.getMiniProgressFlag()!=null) {
|
|
|
198
|
+ if (req.getHearDateFlag() != null) {
|
|
|
199
|
+// caseFlow = flowMap.get("caseManagement:list:mediate");
|
|
|
200
|
+ caseStatusNames.add("待调解");
|
|
|
201
|
+ } else {
|
|
|
202
|
+ // 待选择调解员
|
|
|
203
|
+ caseStatusNames.add("待选择调解员");
|
|
|
204
|
+ }
|
|
|
205
|
+ }else {
|
|
|
206
|
+ // PC端
|
|
|
207
|
+ caseStatusNames.add("待被申请人签收");
|
|
|
208
|
+ }
|
|
|
209
|
+
|
|
|
210
|
+ break;
|
|
183
|
211
|
}
|
|
184
|
212
|
}
|
|
185
|
213
|
startPage();
|
|
186
|
214
|
// 查询案件列表
|
|
187
|
|
- List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList()));
|
|
|
215
|
+ List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseStatusNames);
|
|
188
|
216
|
return caseApplicationList;
|
|
189
|
217
|
}
|
|
190
|
218
|
|
|
|
@@ -571,7 +599,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
571
|
599
|
if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){
|
|
572
|
600
|
throw new ServiceException("未找到模板");
|
|
573
|
601
|
}
|
|
574
|
|
- String templatePath = "/home/ruoyi/" + templateManage.getTemOrigPath();
|
|
|
602
|
+ String templatePath = "/home/ruoyi" + templateManage.getTemOrigPath();
|
|
575
|
603
|
templatePath=templatePath.replace("/profile","/uploadPath");
|
|
576
|
604
|
|
|
577
|
605
|
try {
|
|
|
@@ -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
|
// 申请人已预约,更新主表流程节点
|
|
|
@@ -1029,12 +1057,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1029
|
1057
|
|
|
1030
|
1058
|
// MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
|
1031
|
1059
|
// todo 返回申请人预约信息,预约信息查预约表
|
|
1032
|
|
- Example example = new Example(MsCaseMediator.class);
|
|
1033
|
|
- Example.Criteria criteria = example.createCriteria();
|
|
1034
|
|
- criteria.andIsNull("type");
|
|
1035
|
|
- criteria.andEqualTo("caseAppliId", id);
|
|
1036
|
1060
|
// criteria.andEqualTo("mediatorId", SecurityUtils.getUserId());
|
|
1037
|
|
- MsCaseMediator msCaseMediator = msCaseMediatorMapper.selectOneByExample(example);
|
|
|
1061
|
+ MsCaseMediator msCaseMediator = msCaseMediatorMapper.selectLastApplicant(id);
|
|
1038
|
1062
|
if(msCaseMediator==null){
|
|
1039
|
1063
|
return AjaxResult.success(result);
|
|
1040
|
1064
|
}
|
|
|
@@ -2100,7 +2124,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2100
|
2124
|
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
|
|
2101
|
2125
|
userMapper.insertUser(agentUser);
|
|
2102
|
2126
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
|
2103
|
|
- } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
|
|
2127
|
+ } else if (null == agentUser.getDeptId() ) {
|
|
|
2128
|
+ // todo 未关联部门,关联部门
|
|
|
2129
|
+ agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
|
|
|
2130
|
+ userMapper.updateUser(agentUser);
|
|
|
2131
|
+ }else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
|
2104
|
2132
|
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
|
|
2105
|
2133
|
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
|
|
2106
|
2134
|
} else {
|