fix source_agree_file 排序问题

master
luoyang 5 years ago
parent 623ec31c91
commit d6074bc055

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.2.83</version> <version>1.2.84</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -40,6 +40,8 @@ public interface ClientFilesMapper {
List<JSONObject> findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name); List<JSONObject> findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name);
JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId);
void deleteByClientAndFileId(@Param("file_id") String file_id); void deleteByClientAndFileId(@Param("file_id") String file_id);
void deleteAggreeByClientId(@Param("client_id") int file_id); void deleteAggreeByClientId(@Param("client_id") int file_id);

@ -242,6 +242,8 @@ public interface ClientManager {
JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker);
void deleteAuthFiles(String fileId); void deleteAuthFiles(String fileId);
void deleteAuthFilesByAdmin(String fileId); void deleteAuthFilesByAdmin(String fileId);

@ -3353,6 +3353,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileJson; return fileJson;
} }
@Override
public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject sourceFile = clientFilesMapper.getSourceAgreeFilesByClientId(client.getIntValue("client_id"));
sourceFile.put(sourceFile.getString("file_name"), sourceFile.getString("file_value"));
return sourceFile;
}
@Override @Override
public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) { public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -3382,7 +3393,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileJson; return fileJson;
} }
@Override @Override
public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) { public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -3414,8 +3424,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
;
@Override @Override
public void deleteAuthFiles(String fileId) { public void deleteAuthFiles(String fileId) {
JSONObject file = clientFilesMapper.findFileById(fileId); JSONObject file = clientFilesMapper.findFileById(fileId);

@ -538,7 +538,7 @@ public class PartnerManageController {
@ManagerMapping(value = "/{clientMoniker}/file/source_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) @ManagerMapping(value = "/{clientMoniker}/file/source_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getSourceAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public JSONObject getSourceAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getAuthFiles(manager, clientMoniker); return clientManager.getSourceAgreeFiles(manager, clientMoniker);
} }
@ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})

@ -13,6 +13,12 @@
update sys_files set is_valid = 0 update sys_files set is_valid = 0
where file_id = #{file_id} where file_id = #{file_id}
</select> </select>
<select id="getSourceAgreeFilesByClientId" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_files
where client_id = #{client_id}
and file_name = 'source_agree_file'
order by last_update_date desc limit 1
</select>
<select id="deleteAggreeByClientId" resultType="com.alibaba.fastjson.JSONObject"> <select id="deleteAggreeByClientId" resultType="com.alibaba.fastjson.JSONObject">
update sys_files set is_valid = 0 update sys_files set is_valid = 0
where client_id = #{client_id} where client_id = #{client_id}

Loading…
Cancel
Save