Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-07 19:26:26 +08:00
commit 27e7aa8654
3 changed files with 13 additions and 14 deletions

View File

@ -692,14 +692,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
updateWrapper.lambda().eq(ResourceEntity::getId, resourceEntity.getId())
.eq(ResourceEntity::getDelFlag, ResourceEntityDelFlag.NORMAL.getFlag());
resourceDao.update(entity, updateWrapper);
// ResourceBrowseEntity browseEntity = new ResourceBrowseEntity();
// browseEntity.setResourceId(id);
// browseEntity.setUserId(SecurityUser.getUserId());
// browseEntity.setState(0);
// resourceBrowseDao.insert(browseEntity);
jdbcTemplate.update("update tb_data_resource,\n" +
"tb_data_resource_assignmark\n" +
"SET tb_data_resource.total = round(tb_data_resource_assignmark.total) WHERE tb_data_resource.id =" + id);
Integer num = jdbcTemplate.queryForObject("SELECT round(tb_data_resource_assignmark.total) FROM tb_data_resource_assignmark WHERE id =" + id, Integer.class);
String sql = String.format("update tb_data_resource SET total = %d WHERE id = %s", num.intValue(), id.toString());
jdbcTemplate.update(sql);
}

View File

@ -74,9 +74,10 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl<ResourceColle
if (collectionEntities.isEmpty()) {
resourceCollectionDao.insert(item);
jdbcTemplate.update("update tb_data_resource,\n" +
"tb_data_resource_assignmark\n" +
"SET tb_data_resource.total = round(tb_data_resource_assignmark.total) WHERE tb_data_resource.id =" + item.getResourceId());
Integer num = jdbcTemplate.queryForObject("SELECT round(tb_data_resource_assignmark.total) FROM tb_data_resource_assignmark WHERE id =" + item.getResourceId(), Integer.class);
String sql = String.format("update tb_data_resource SET total = %d WHERE id = %s", num.intValue(), item.getResourceId().toString());
jdbcTemplate.update(sql);
} else {
collectionEntities.stream().forEach(index -> {

View File

@ -33,9 +33,10 @@ public class ResourceScoreServiceImpl extends CrudServiceImpl<ResourceScoreDao,
@Override
public void save(ResourceScoreDTO dto) {
super.save(dto);
jdbcTemplate.update("update tb_data_resource,\n" +
"tb_data_resource_assignmark\n" +
"SET tb_data_resource.total = round(tb_data_resource_assignmark.total) WHERE tb_data_resource.id =" + dto.getResourceId());
Integer num = jdbcTemplate.queryForObject("SELECT round(tb_data_resource_assignmark.total) FROM tb_data_resource_assignmark WHERE id =" + dto.getResourceId(), Integer.class);
String sql = String.format("update tb_data_resource SET total = %d WHERE id = %s", num.intValue(), dto.getResourceId());
jdbcTemplate.update(sql);
}