|
@@ -197,19 +197,23 @@ public class MetadataClassificationServiceImpl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean updateMetadata(List<MetadataClassificationVO> vos) {
|
|
|
+ public boolean updateMetadata(MetadataClassificationVO vo) {
|
|
|
try {
|
|
|
BladeUser user = AuthUtil.getUser();
|
|
|
StringBuilder sqlBuild = new StringBuilder();
|
|
|
sqlBuild.append("update u_metadata_file set ");
|
|
|
- for (MetadataClassificationVO key : vos) {
|
|
|
- if (key.getFileId() != null) {
|
|
|
- sqlBuild.append(" " + key.getFieldKey() + " = '" + key.getKeyValue() + "' , ");
|
|
|
+ for (MetadataClassificationVO key : vo.getList()) {
|
|
|
+ if (key.getFileId() != null && key.getKeyValue() != null && key.getKeyValue() != "") {
|
|
|
+ if(key.getFieldType().equals("4")){
|
|
|
+ sqlBuild.append(" " + key.getFieldKey() + " = " + key.getKeyValue() + " , ");
|
|
|
+ }else {
|
|
|
+ sqlBuild.append(" " + key.getFieldKey() + " = '" + key.getKeyValue() + "' , ");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
sqlBuild.append(" update_user = '" + user.getUserId() + "' , ");
|
|
|
sqlBuild.append(" update_time = '" + DateUtil.formatDateTime(new Date()) + "' ");
|
|
|
- sqlBuild.append(" where file_id = " + vos.get(0).getFileId());
|
|
|
+ sqlBuild.append(" where file_id = " + vo.getList().get(0).getFileId());
|
|
|
jdbcTemplate.execute(sqlBuild.toString());
|
|
|
} catch (DataAccessException e) {
|
|
|
e.printStackTrace();
|