Compare commits

...

3 Commits

Author SHA1 Message Date
wangliwen 02efbd6131 Merge branch 'master' into docker_package 2023-01-09 16:26:02 +08:00
wangliwen 2d07184435 Merge branch 'dev' 2023-01-09 16:25:53 +08:00
wangliwen 40a8d4f525 按照是否评分分页查询申请个人申请 2023-01-09 16:00:54 +08:00
2 changed files with 34 additions and 5 deletions

View File

@ -787,13 +787,25 @@ public class TAbilityApplicationController {
@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, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "resourceId", value = "资源id", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "oneEnded", value = "是否完成(true, false)", 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);
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);
}
}

View File

@ -56,7 +56,7 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
case "apply_flag":
wrapper.eq(params.get("apply_flag") != null, "apply_flag", params.get("apply_flag").toString());
break;
case "ended":
case "ended": // 过滤申请单申请状态
boolean ended = Boolean.valueOf(params.get("ended").toString());
if (ended) {
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()
.gt("expire_date", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)));
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")) {