processForm/tabilityapplication/my_page 接口摄像头特殊处理
This commit is contained in:
parent
9426860495
commit
31cdc17236
|
@ -29,6 +29,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
@ -82,6 +83,22 @@ public class TAbilityApplicationController {
|
|||
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页
|
||||
params.put("user_id", user == null ? null : user.getId());
|
||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||
page.getList().stream().map(index -> {
|
||||
List<TAbilityApplicationDTO> dtos =
|
||||
tAbilityApplicationService.getByInstanceId(index.getInstanceId());
|
||||
if (!dtos.isEmpty()) {
|
||||
dtos.stream()
|
||||
.limit(1l)
|
||||
.forEach(dto -> {
|
||||
BeanUtils.copyProperties(dto, index);
|
||||
if (StringUtils.isNotEmpty(index.getCameraList())) {
|
||||
index.setSystem("申请摄像头列表:" + index.getSystem() + " 等,共" + dtos.size() + "个");
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return index;
|
||||
}).collect(Collectors.toList());
|
||||
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
@ -139,7 +156,6 @@ public class TAbilityApplicationController {
|
|||
break;
|
||||
case TSINGTAO: { // 大数据局
|
||||
camera = (List<Object>) resourceService.getApplyCameraList(Long.valueOf(tAbilityApplicationDTOList.get(0).getInstanceId()));
|
||||
// camera = tAbilityApplicationDTOList.stream().filter(tAbilityApplicationDTO -> StringUtils.isNotEmpty(tAbilityApplicationDTO.getCameraList())).map(index_ -> jdbcTemplate.queryForObject("SELECT * FROM t_camera_channel WHERE idt_camera_channel = " + index_.getResourceId(), Map.class)).filter(index_ -> !index_.isEmpty()).collect(Collectors.toList());
|
||||
}
|
||||
break;
|
||||
case BAOTOU:
|
||||
|
|
|
@ -32,11 +32,11 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
|
|||
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
|
||||
switch (index) { //
|
||||
case "abilityprocess_v2":
|
||||
wrapper.select("DISTINCT apply_flag ,id ,`user` ,phone ,unit ,area ,system ,scene ,basis ,attachment ,instance_id ,user_id ,enclosure ,title ,application_system ,application_scene ,application_background ,effect_wish ,apply_number ,resource_owner_dept ,del_flag");
|
||||
wrapper.select("DISTINCT apply_flag ,instance_id");
|
||||
wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag");
|
||||
wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "instance_id");
|
||||
wrapper.groupBy(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag")
|
||||
.groupBy("id");
|
||||
.groupBy("instance_id");
|
||||
break;
|
||||
case "user_id":
|
||||
wrapper.eq(params.get("user_id") != null, "user_id", Long.valueOf(params.get("user_id").toString()));
|
||||
|
@ -46,7 +46,7 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
|
|||
break;
|
||||
}
|
||||
});
|
||||
wrapper.orderByDesc("id");
|
||||
wrapper.orderByDesc("instance_id"); // 流程排序
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ public class TokenServiceImpl extends BaseServiceImpl<TokenDao, TokenEntity> imp
|
|||
private final static int EXPIRE = 3600 * 12;
|
||||
|
||||
@Override
|
||||
@Cacheable(value = getByTokenKey, key = "#p1")
|
||||
@Cacheable(value = getByTokenKey, key = "#p0")
|
||||
public TokenEntity getByToken(String token) {
|
||||
return baseDao.getByToken(token);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue