查看bug修复

pull/5/head
liujun 2023-12-22 17:41:36 +08:00
parent 93679092de
commit 8be39e14d3
2 changed files with 15 additions and 3 deletions

View File

@ -38,15 +38,19 @@ public class ApiXgfUserController extends BaseController {
@RequestMapping(value = "/approvalApplication")
@ResponseBody
public Object approvalApplication() throws Exception {
Map<String, Object> response = new HashMap<String, Object>();
try {
PageData request = this.getPageData();
xgfUserService.approvalApplication(request);
Map<String, Object> response = new HashMap<String, Object>();
response.put("result", "response");
response.put("result", "success");
response.put("code","0");
return response;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常");
response.put("result", "error");
response.put("code","9999");
response.put("msg", e.getMessage());
return response;
}
}
}

View File

@ -120,11 +120,19 @@ public class XgfUserServiceImpl implements XgfUserService {
@Override
public void approvalApplication(PageData request) throws Exception {
List<String> list = Arrays.asList(request.getString("xgf_user_ids").split(","));
PageData condition = new PageData();
condition.put("XGF_USER_IDS", list);
List<PageData> entities = xgfUserMapper.listByIds(condition);
/* 校验所有数据是否都是正常状态 */
if (entities.stream().anyMatch(n -> !"2".equals(n.getString("STATUS")))) {
String name = entities.stream().filter(n -> !"2".equals(n.getString("STATUS"))).map( n -> n.getString("NAME")).collect(Collectors.joining(","));
throw new RuntimeException("用户[" + name + "]在系统流程中无法被打回");
}
for (PageData x : entities) {
x.put("VALID_FLAG", "0");
x.put("STATUS", "1");