* 'dev' of http://221.0.232.152:9393/ability-center/share-platform:
  文案调整
  processForm/tabilityapplication/my_page 接口摄像头特殊处理
This commit is contained in:
huangweixiong 2022-07-13 10:47:43 +08:00
commit 99822463e7
3 changed files with 27 additions and 5 deletions

View File

@ -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,28 @@ 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);
List<TAbilityApplicationDTO> list =
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())) {
if (dtos.size() > 1) {
index.setSystem("视频资源申请:(" + index.getSystem() + "" + dtos.size() + "个摄像头)");
} else {
index.setSystem("视频资源申请:" + index.getSystem());
}
return;
}
});
}
return index;
}).collect(Collectors.toList());
page.setList(list);
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
}
@ -139,7 +162,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:

View File

@ -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;
}

View File

@ -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);
}