Compare commits
3 Commits
afc2e0c292
...
02efbd6131
Author | SHA1 | Date |
---|---|---|
wangliwen | 02efbd6131 | |
wangliwen | 2d07184435 | |
wangliwen | 40a8d4f525 |
|
@ -787,13 +787,25 @@ public class TAbilityApplicationController {
|
||||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "oneEnded", value = "是否完成(true, false)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "resourceId", value = "资源id", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "score", value = "是否已评分(true, false)", paramType = "query", dataType = "String")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public Result<PageData<TAbilityApplicationDTO>> pageForScore(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<Map<String, Object>>> pageForScore(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
final UserDetail user = SecurityUser.getUser();
|
||||||
|
params.put("user_id", user == null ? null : user.getId());
|
||||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||||
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
List<Map<String, Object>> mapList = page.getList().stream().map(index -> {
|
||||||
|
Map<String, Object> temp = new LinkedHashMap<>();
|
||||||
|
temp.put("applyNumber", index.getApplyNumber());
|
||||||
|
temp.put("approveStatus", index.getApproveStatus());
|
||||||
|
temp.put("createDate", index.getCreateDate());
|
||||||
|
temp.put("system", index.getSystem());
|
||||||
|
temp.put("resourceId", index.getResourceId());
|
||||||
|
return temp;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
PageData<Map<String, Object>> pageData = new PageData<>(mapList, page.getTotal());
|
||||||
|
return new Result<PageData<Map<String, Object>>>().ok(pageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -56,7 +56,7 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
|
||||||
case "apply_flag":
|
case "apply_flag":
|
||||||
wrapper.eq(params.get("apply_flag") != null, "apply_flag", params.get("apply_flag").toString());
|
wrapper.eq(params.get("apply_flag") != null, "apply_flag", params.get("apply_flag").toString());
|
||||||
break;
|
break;
|
||||||
case "ended":
|
case "ended": // 过滤申请单申请状态
|
||||||
boolean ended = Boolean.valueOf(params.get("ended").toString());
|
boolean ended = Boolean.valueOf(params.get("ended").toString());
|
||||||
if (ended) {
|
if (ended) {
|
||||||
wrapper.notExists("SELECT 1 FROM t_ability_application t1 WHERE t1.apply_flag = t_ability_application.apply_flag AND approve_status = '审核中'");
|
wrapper.notExists("SELECT 1 FROM t_ability_application t1 WHERE t1.apply_flag = t_ability_application.apply_flag AND approve_status = '审核中'");
|
||||||
|
@ -72,6 +72,23 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
|
||||||
.or()
|
.or()
|
||||||
.gt("expire_date", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)));
|
.gt("expire_date", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)));
|
||||||
break;
|
break;
|
||||||
|
case "oneEnded": // 过滤单一申请状态
|
||||||
|
boolean oneEnded = Boolean.valueOf(params.get("oneEnded").toString());
|
||||||
|
if (oneEnded) {
|
||||||
|
wrapper.ne("approve_status", "审核中");
|
||||||
|
} else {
|
||||||
|
wrapper.eq("approve_status", "审核中");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "score":
|
||||||
|
boolean score = Boolean.valueOf(params.get("score").toString());
|
||||||
|
String sql = "SELECT 1 FROM tb_resource_score t1 WHERE t1.user_id = t_ability_application.user_id AND t1.resource_id = t_ability_application.resource_id";
|
||||||
|
if (score) {
|
||||||
|
wrapper.exists(sql);
|
||||||
|
} else {
|
||||||
|
wrapper.notExists(sql);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (params.containsKey("abilityprocess_v2")) {
|
if (params.containsKey("abilityprocess_v2")) {
|
||||||
|
|
Loading…
Reference in New Issue