Pārlūkot izejas kodu

增加文件下载功能

yanliming 1 gadu atpakaļ
vecāks
revīzija
1a76e2692e

+ 4 - 0
common/src/main/java/com/jpsoft/railroad/modules/base/entity/NetworkNotice.java

@@ -69,4 +69,8 @@ public class NetworkNotice {
 	@ApiModelProperty(value = "文件列表")
 	private List<Map> urlList;
 
+	@Transient
+	@ApiModelProperty(value = "文件地址")
+	private String urlName;
+
 		}

+ 2 - 2
common/src/main/resources/mapper/base/NetworkNotice.xml

@@ -90,8 +90,8 @@
 		]]>
 		<where>
 			del_flag = false
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			<if test="searchParams.name != null">
+				and name_ like #{searchParams.name}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 5 - 3
web/src/main/java/com/jpsoft/railroad/modules/base/controller/NetworkNoticeController.java

@@ -257,7 +257,7 @@ public class NetworkNoticeController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String name,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -273,8 +273,8 @@ public class NetworkNoticeController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
         }
 
 
@@ -296,7 +296,9 @@ public class NetworkNoticeController {
                 if (jsonArray.size() > 0) {
                     JSONObject jsonObject = JSONObject.fromObject(jsonArray.get(0));
                     String tempAddress = jsonObject.getString("url");
+                    String urlName = jsonObject.getString("name");
                     networkNotice.setUrl(tempAddress);
+                    networkNotice.setUrlName(urlName);
                 }
 
             }