Commit 76662d31 authored by xianhu's avatar xianhu
Browse files

Solved the bugs that when editted file in resource center online, don't update...

Solved the bugs that when editted file in resource center online, don't update the time and size of the file
parent 929399e8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -569,6 +569,7 @@ public class ResourcesService extends BaseService {
     * @param resourceId
     * @return
     */
    @Transactional(value = "TransactionManager",rollbackFor = Exception.class)
    public Result updateResourceContent(int resourceId, String content) {
        Result result = new Result();

@@ -597,6 +598,10 @@ public class ResourcesService extends BaseService {
            }
        }

        resource.setSize(content.getBytes().length);
        resource.setUpdateTime(new Date());
        resourcesMapper.update(resource);

        User user = userMapper.queryDetailsById(resource.getUserId());
        String tenantCode = tenantMapper.queryById(user.getTenantId()).getTenantCode();

+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ public class ResourceMapperProvider {
      SET("`alias` = #{resource.alias}");
      SET("`desc` = #{resource.desc}");
      SET("`update_time` = #{resource.updateTime}");
      SET("`size` = #{resource.size}");
      WHERE("`id` = #{resource.id}");
    }}.toString();
  }