|
@@ -8,7 +8,6 @@ import com.webstudio.staticize.service.StaticizeService;
|
8
|
8
|
import io.swagger.annotations.Api;
|
9
|
9
|
import io.swagger.annotations.ApiOperation;
|
10
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
|
-import org.springframework.util.CollectionUtils;
|
12
|
11
|
import org.springframework.web.bind.annotation.*;
|
13
|
12
|
|
14
|
13
|
import java.util.ArrayList;
|
|
@@ -128,16 +127,22 @@ public class StaticizeController {
|
128
|
127
|
//seo
|
129
|
128
|
map.put("TDK",getSeo("news"));
|
130
|
129
|
//最近三篇新闻
|
131
|
|
- List<News> recentlyNewsList = staticizeService.getNewsByParm(null, 1, null);
|
|
130
|
+ List<News> recentlyNewsList = staticizeService.getNewsByParm(null, 1, null, null,"index");
|
132
|
131
|
map.put("recentlyNewsList", recentlyNewsList);
|
133
|
132
|
//按全部、新闻分类 分类
|
134
|
|
- List<Map> newsIndexList = staticizeService.getNewsIndex();
|
|
133
|
+ List<Map> newsIndexList = staticizeService.getNewsIndex(null);
|
135
|
134
|
map.put("columnList", newsIndexList);
|
136
|
135
|
//分类别分页
|
137
|
136
|
for (Map newsIndex : newsIndexList) {
|
138
|
137
|
//页面名称 = news + 分类code + 当前页数
|
139
|
138
|
String columnCode = (String) newsIndex.get("columnCode");
|
140
|
139
|
map.put("columnCode", columnCode);
|
|
140
|
+ //详情跳转拼接code
|
|
141
|
+ String dirCode = "";
|
|
142
|
+ if (!columnCode.equals("全部")){
|
|
143
|
+ dirCode = columnCode;
|
|
144
|
+ }
|
|
145
|
+ map.put("dirCode",dirCode);
|
141
|
146
|
//当前在哪个分类下
|
142
|
147
|
Integer sort = (Integer) newsIndex.get("sort");
|
143
|
148
|
List<News> newsList1 = (List<News>) newsIndex.get("newsList");
|
|
@@ -309,6 +314,7 @@ public class StaticizeController {
|
309
|
314
|
map.put("template", "join.ftl");
|
310
|
315
|
try {
|
311
|
316
|
staticizeService.pushHtml(map, "");
|
|
317
|
+ staticizeService.updatePushStatus(null, "vacancy", "vacancy_");
|
312
|
318
|
return AjaxResult.success("发布成功");
|
313
|
319
|
}catch (Exception e){
|
314
|
320
|
return AjaxResult.error("发布失败"+e.getMessage());
|
|
@@ -340,41 +346,45 @@ public class StaticizeController {
|
340
|
346
|
@ApiOperation(value = "招标文件", httpMethod = "GET")
|
341
|
347
|
public AjaxResult joinList(){
|
342
|
348
|
try {
|
343
|
|
- Map map = getFooter();
|
344
|
|
- //seo
|
345
|
|
- map.put("TDK",getSeo("joinList"));
|
346
|
|
- //招标文件
|
347
|
|
- List<BiddingDocument> bdList1 = staticizeService.getBiddingDocument(null);
|
348
|
|
- Integer totalPage = 0;//总页数
|
349
|
|
- if ((bdList1.size() % 10) > 0) {
|
350
|
|
- totalPage = (bdList1.size() / 10) + 1;
|
351
|
|
- } else {
|
352
|
|
- totalPage = bdList1.size() / 10;
|
353
|
|
- }
|
354
|
|
- List<BiddingDocument> bdList2 = new ArrayList<>();
|
355
|
|
- for (int i = 0; i < bdList1.size(); i++) {
|
356
|
|
- bdList2.add(bdList1.get(i));
|
357
|
|
- //每页10条
|
358
|
|
- if (i % 10 == 9 || i == bdList1.size() - 1) {
|
359
|
|
- map.put("bdList", bdList2);
|
360
|
|
- //当前页
|
361
|
|
- map.put("currentPage", (i / 10) + 1);
|
362
|
|
- //总页数
|
363
|
|
- map.put("totalPage", totalPage);
|
364
|
|
- // html名字 = joinList + 当前页数
|
365
|
|
- map.put("fileName", "joinList" + ((i / 10) + 1));
|
366
|
|
- // 模板
|
367
|
|
- map.put("template", "joinList.ftl");
|
368
|
|
- staticizeService.pushHtml(map, "");
|
369
|
|
- bdList2.clear();
|
370
|
|
- }
|
371
|
|
- }
|
|
349
|
+ biddingDocumentDetail(null);
|
372
|
350
|
return AjaxResult.success("发布成功");
|
373
|
351
|
}catch (Exception e){
|
374
|
352
|
return AjaxResult.error("发布失败"+e.getMessage());
|
375
|
353
|
}
|
376
|
354
|
}
|
377
|
355
|
|
|
356
|
+ private void joinList1() throws Exception {
|
|
357
|
+ Map map = getFooter();
|
|
358
|
+ //seo
|
|
359
|
+ map.put("TDK",getSeo("joinList"));
|
|
360
|
+ //招标文件
|
|
361
|
+ List<BiddingDocument> bdList1 = staticizeService.getBiddingDocument(null);
|
|
362
|
+ Integer totalPage = 0;//总页数
|
|
363
|
+ if ((bdList1.size() % 10) > 0) {
|
|
364
|
+ totalPage = (bdList1.size() / 10) + 1;
|
|
365
|
+ } else {
|
|
366
|
+ totalPage = bdList1.size() / 10;
|
|
367
|
+ }
|
|
368
|
+ List<BiddingDocument> bdList2 = new ArrayList<>();
|
|
369
|
+ for (int i = 0; i < bdList1.size(); i++) {
|
|
370
|
+ bdList2.add(bdList1.get(i));
|
|
371
|
+ //每页10条
|
|
372
|
+ if (i % 10 == 9 || i == bdList1.size() - 1) {
|
|
373
|
+ map.put("bdList", bdList2);
|
|
374
|
+ //当前页
|
|
375
|
+ map.put("currentPage", (i / 10) + 1);
|
|
376
|
+ //总页数
|
|
377
|
+ map.put("totalPage", totalPage);
|
|
378
|
+ // html名字 = joinList + 当前页数
|
|
379
|
+ map.put("fileName", "joinList" + ((i / 10) + 1));
|
|
380
|
+ // 模板
|
|
381
|
+ map.put("template", "joinList.ftl");
|
|
382
|
+ staticizeService.pushHtml(map, "");
|
|
383
|
+ bdList2.clear();
|
|
384
|
+ }
|
|
385
|
+ }
|
|
386
|
+ }
|
|
387
|
+
|
378
|
388
|
|
379
|
389
|
@GetMapping("/articleDetail")
|
380
|
390
|
@ApiOperation(value = "文章详情", httpMethod = "GET")
|
|
@@ -402,35 +412,53 @@ public class StaticizeController {
|
402
|
412
|
private boolean newsDetail(String uuid){
|
403
|
413
|
try {
|
404
|
414
|
Map map = getFooter();
|
405
|
|
- List<News> list = staticizeService.getNewsList(uuid);
|
406
|
|
- for (int i = 0; i < list.size(); i++) {
|
407
|
|
- News news = list.get(i);
|
408
|
|
- map.put("article", news);
|
409
|
|
- map.put("type", "news");
|
410
|
|
- //判断是否有上一页
|
411
|
|
- Map otherMap = new HashMap();
|
412
|
|
- if (list.size() > 1){
|
413
|
|
-
|
414
|
|
- if (i == 0 && list.size() > 1){
|
415
|
|
- otherMap.put("nextNew",list.get(1));
|
416
|
|
- }else {
|
417
|
|
- otherMap.put("upNew",list.get(i-1));
|
418
|
|
- if (i < list.size()-1){
|
419
|
|
- otherMap.put("nextNew",list.get(i+1));
|
|
415
|
+ //全部新闻
|
|
416
|
+ List<Map> newsMap = staticizeService.getNewsIndex(uuid);
|
|
417
|
+ for (Map newMap:
|
|
418
|
+ newsMap) {
|
|
419
|
+ String columnName = (String) newMap.get("columnName");
|
|
420
|
+ String columnCode = (String) newMap.get("columnCode");
|
|
421
|
+ //不同分类生成不同的文件夹
|
|
422
|
+ String childPath = "";
|
|
423
|
+ if (columnName.equals("全部")){
|
|
424
|
+ childPath = "newsDetail";
|
|
425
|
+ }else {
|
|
426
|
+ childPath = "newsDetail" + columnCode;
|
|
427
|
+ }
|
|
428
|
+ List<News> list = (List<News>) newMap.get("newsList");
|
|
429
|
+ //生成各分类下的详情页
|
|
430
|
+ for (int i = 0; i < list.size(); i++) {
|
|
431
|
+ News news = list.get(i);
|
|
432
|
+ map.put("article", news);
|
|
433
|
+ map.put("type", "news");
|
|
434
|
+ //判断是否有上一页
|
|
435
|
+ Map otherMap = new HashMap();
|
|
436
|
+ if (list.size() > 1){
|
|
437
|
+
|
|
438
|
+ if (i == 0 && list.size() > 1){
|
|
439
|
+ otherMap.put("nextNew",list.get(1));
|
|
440
|
+ }else {
|
|
441
|
+ otherMap.put("upNew",list.get(i-1));
|
|
442
|
+ if (i < list.size()-1){
|
|
443
|
+ otherMap.put("nextNew",list.get(i+1));
|
|
444
|
+ }
|
|
445
|
+
|
420
|
446
|
}
|
421
|
447
|
|
|
448
|
+ }else if (list.size() == 1){
|
|
449
|
+ getUpDownNews(news,otherMap,columnName);
|
422
|
450
|
}
|
|
451
|
+ map.put("otherNews",otherMap);
|
|
452
|
+ // html名字
|
|
453
|
+ map.put("fileName", news.getUuid());
|
|
454
|
+ // 模板
|
|
455
|
+ map.put("template", "articleDetails.ftl");
|
423
|
456
|
|
424
|
|
- }else if (list.size() == 1){
|
425
|
|
- getUpDownNews(news,otherMap);
|
|
457
|
+ staticizeService.pushHtml(map, childPath);
|
|
458
|
+ if (columnName.equals("全部")) {
|
|
459
|
+ staticizeService.updatePushStatus(news.getUuid(), "news", "news_");
|
|
460
|
+ }
|
426
|
461
|
}
|
427
|
|
- map.put("otherNews",otherMap);
|
428
|
|
- // html名字
|
429
|
|
- map.put("fileName", news.getUuid());
|
430
|
|
- // 模板
|
431
|
|
- map.put("template", "articleDetails.ftl");
|
432
|
|
- staticizeService.pushHtml(map, "newsDetail");
|
433
|
|
- staticizeService.updatePushStatus(news.getUuid(), "news", "news_");
|
434
|
462
|
}
|
435
|
463
|
|
436
|
464
|
index();//首页
|
|
@@ -441,10 +469,13 @@ public class StaticizeController {
|
441
|
469
|
}
|
442
|
470
|
}
|
443
|
471
|
|
444
|
|
- private void getUpDownNews(News news, Map otherMap) {
|
|
472
|
+ private void getUpDownNews(News news, Map otherMap, String columnName) {
|
445
|
473
|
Map param = new HashMap();
|
446
|
474
|
param.put("uuid",news.getUuid());
|
447
|
|
- param.put("column",news.getColumn());
|
|
475
|
+ if (!columnName.equals("全部")){
|
|
476
|
+ param.put("column",news.getColumn());
|
|
477
|
+ }
|
|
478
|
+
|
448
|
479
|
param.put("date",news.getDate());
|
449
|
480
|
param.put("type",1);//下一个
|
450
|
481
|
News next = staticizeService.getNewsByParam(param);
|
|
@@ -517,7 +548,7 @@ public class StaticizeController {
|
517
|
548
|
staticizeService.pushHtml(map, "biddingDocumentDetail");
|
518
|
549
|
staticizeService.updatePushStatus(bd.getUuid(), "bidding_document", "bidding_");
|
519
|
550
|
}
|
520
|
|
- joinList();//招标文件列表页
|
|
551
|
+ joinList1();//招标文件列表页
|
521
|
552
|
join();//加入中泽
|
522
|
553
|
return true;
|
523
|
554
|
}catch (Exception e){
|