Browse Source

更新- 展示端过滤不显示的数据

wuweihao 4 years ago
parent
commit
ae27791895

+ 1 - 1
gis_application/src/main/resources/application.properties

@@ -2,7 +2,7 @@ server.port=8110
 
 spring.profiles.active=dev
 
-# ÏîÄ¿Ãû³Æ
+# \uFFFD\uFFFD\u013F\uFFFD\uFFFD\uFFFD\uFFFD
 project.name=cms_army_macao
 
 # \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E

+ 1 - 1
gis_mapper/src/main/java/com/gis/mapper/FodderMapper.java

@@ -17,5 +17,5 @@ import java.util.List;
 public interface FodderMapper extends IBaseMapper<FodderEntity, Long> {
 
     @SelectProvider(type = FodderProvider.class, method = "search")
-    List<FodderEntity> search(FodderPageDto param);
+    List<FodderEntity> search(FodderPageDto param , Integer display);
 }

+ 1 - 11
gis_mapper/src/main/java/com/gis/mapper/KnowledgeMapper.java

@@ -18,15 +18,5 @@ public interface KnowledgeMapper extends IBaseMapper<KnowledgeEntity, Long> {
     @SelectProvider(type = KnowledgeProvider.class, method = "search")
     List<KnowledgeVo> search(PageDateDto param);
 
-////    @Select("select * from tb_goods where rec_status = 'A' AND display = 1 and status = 4 and type = #{type} and year = #{year} order by create_time desc")
-////    List<GoodsVo> findDisplay(Integer type, Integer year);
-//
-//    @SelectProvider(type = GoodsProvider.class, method = "findDisplay")
-//    List<GoodsVo> findDisplay(KnowledgePageDateDto param);
-//
-//    @Update("update tb_goods set view_count = view_count + 1 where id = #{id} ")
-//    void setView(Long id);
-//
-//    @Select("select year from tb_goods where rec_status = 'A' and type = #{type} and status = 4 and year is not null order by year asc")
-//    Set<Integer> getYear(Integer type);
+
 }

+ 5 - 1
gis_mapper/src/main/java/com/gis/mapper/provider/FodderProvider.java

@@ -12,7 +12,7 @@ import org.apache.commons.lang3.StringUtils;
 public class FodderProvider {
 
 
-    public String search(FodderPageDto param){
+    public String search(FodderPageDto param, Integer display){
         StringBuffer sql = new StringBuffer(
                 "select * from tb_fodder where rec_status = 'A' ");
 
@@ -26,6 +26,10 @@ public class FodderProvider {
             sql.append(" and type = ").append(type);
         }
 
+        if (display != null){
+            sql.append(" and display = ").append(display);
+        }
+
         String category = param.getCategory();
         if (StringUtils.isNotBlank(category)) {
             sql.append(" and category = ").append(category);

+ 1 - 1
gis_service/src/main/java/com/gis/service/FodderService.java

@@ -14,7 +14,7 @@ import java.util.List;
  * Created by owen on 2020/3/11 0011 16:14
  */
 public interface FodderService extends IBaseService<FodderEntity, Long> {
-    List<FodderEntity> search(FodderPageDto param);
+    List<FodderEntity> search(FodderPageDto param, Integer display);
 
 
 //    List<SpiritVo> search(SpiritPageDateDto param);

+ 2 - 2
gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -25,8 +25,8 @@ public  class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> imp
     }
 
     @Override
-    public List<FodderEntity> search(FodderPageDto param) {
-        return entityMapper.search(param);
+    public List<FodderEntity> search(FodderPageDto param, Integer display) {
+        return entityMapper.search(param, display);
     }
 
 

+ 1 - 1
gis_web/src/main/java/com/gis/web/controller/FodderController.java

@@ -53,7 +53,7 @@ public class FodderController extends BaseController {
 
         startPage(param);
 
-        PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param));
+        PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param, null));
         return Result.success(page);
     }
 

+ 21 - 21
gis_web/src/main/java/com/gis/web/controller/SceneController.java

@@ -114,22 +114,22 @@ public class SceneController extends BaseController {
     /**
      * 只有一个场景是显示状态
      */
-    @ApiOperation("场景显示")
-    @GetMapping("display/{id}/{type}")
-    public Result display(@PathVariable Long id, @PathVariable String type) {
-        SceneEntity entity = sceneService.findById(id);
-        if (entity == null) {
-            log.error("对象id不存在 : {}", id);
-            return Result.failure("对象id不存在");
-        }
-
-        // 把所有禁止
-        sceneMapper.setDisableByType(type);
-        // 开启对应id
-        sceneMapper.setDisplay(id);
-
-        return Result.success();
-    }
+//    @ApiOperation("场景显示")
+//    @GetMapping("display/{id}/{type}")
+//    public Result display(@PathVariable Long id, @PathVariable String type) {
+//        SceneEntity entity = sceneService.findById(id);
+//        if (entity == null) {
+//            log.error("对象id不存在 : {}", id);
+//            return Result.failure("对象id不存在");
+//        }
+//
+//        // 把所有禁止
+//        sceneMapper.setDisableByType(type);
+//        // 开启对应id
+//        sceneMapper.setDisplay(id);
+//
+//        return Result.success();
+//    }
 
 
 
@@ -149,10 +149,10 @@ public class SceneController extends BaseController {
         }
 
         String fileName = file.getOriginalFilename();
-        String suffix = StringUtils.substringAfterLast(fileName, ".");
+//        String suffix = StringUtils.substringAfterLast(fileName, ".");
 
         // 转小写
-        suffix =  StringUtils.lowerCase(suffix);
+//        suffix =  StringUtils.lowerCase(suffix);
 
 
         // 去除特殊符号
@@ -165,15 +165,15 @@ public class SceneController extends BaseController {
 //        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
 
         // 重命名
-        fileName = pinyinName + "." + suffix;
+//        fileName = pinyinName + "." + suffix;
         String basePath = configConstant.serverBasePath + sceneCode;
-        String savePath = basePath + "/edit/" + fileName;
+        String savePath = basePath + "/edit/" + pinyinName;
         log.info("文件保存位置:" + savePath);
         FileUtil.writeFromStream(file.getInputStream(), savePath);
 
 //        Object urlPath = SERVER_DOMAIN + "data/" + sceneCode + "/edit/" + fileName;
 //        Object urlPath = FILE_ADDRESS + sceneCode + "/edit/" + fileName;
-        Object urlPath = configConstant.serverUrlPrefix + sceneCode + "/edit/" + fileName;
+        Object urlPath = configConstant.serverUrlPrefix + sceneCode + "/edit/" + pinyinName;
 
         log.info("文件写入成功: {}", urlPath);
 

+ 77 - 75
gis_web/src/main/java/com/gis/web/controller/WebController.java

@@ -59,42 +59,31 @@ public class WebController extends BaseController {
     private FodderService fodderService;
 
 
-    @ApiOperation("留言")
-    @PostMapping("comment")
-    public Result comment(@Valid @RequestBody CommentRequest param) {
 
-        CommentEntity entity = new CommentEntity();
-        BeanUtils.copyProperties(param, entity);
-        // 默认不显示
-        entity.setDisplay(0);
-        commentService.save(entity);
 
-        return Result.success();
-    }
 
+//    @ApiOperation("搜索")
+//    @PostMapping("search")
+//    public Result<NewsVo> search(@RequestBody PageDto param) {
+//        startPage(param);
+//        PageInfo<NewsVo> page = new PageInfo<>(newsService.webSearch(param));
+//        return Result.success(page);
+//    }
 
-    @ApiOperation("搜索")
-    @PostMapping("search")
-    public Result<NewsVo> search(@RequestBody PageDto param) {
-        startPage(param);
-        PageInfo<NewsVo> page = new PageInfo<>(newsService.webSearch(param));
-        return Result.success(page);
-    }
-
-
-
-    @ApiOperation("获取访问量")
-    @GetMapping("count")
-    public Result count() {
 
-        ViewEntity entity = new ViewEntity();
-        entity.setIp(request.getRemoteAddr());
-        entity.setPath(request.getRequestURI());
-        viewService.save(entity);
 
-        long count = viewService.count();
-        return Result.success(count);
-    }
+//    @ApiOperation("获取访问量")
+//    @GetMapping("count")
+//    public Result count() {
+//
+//        ViewEntity entity = new ViewEntity();
+//        entity.setIp(request.getRemoteAddr());
+//        entity.setPath(request.getRequestURI());
+//        viewService.save(entity);
+//
+//        long count = viewService.count();
+//        return Result.success(count);
+//    }
 
 
 
@@ -103,7 +92,7 @@ public class WebController extends BaseController {
     public Result<FodderEntity> list(@RequestBody FodderPageDto param) {
 
         startPage(param);
-        PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param));
+        PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param, 1));
         return Result.success(page);
     }
 
@@ -118,26 +107,26 @@ public class WebController extends BaseController {
     }
 
 
-    @ApiOperation(value = "数字史馆-场景")
-    @GetMapping("scene")
-    public Result scene() {
-        Condition condition = new Condition(SceneEntity.class);
-        condition.and().andEqualTo("display", 1);
-        List<SceneEntity> all = sceneService.findAll(condition);
-        return Result.success(all);
-    }
-
+//    @ApiOperation(value = "数字史馆-场景")
+//    @GetMapping("scene")
+//    public Result scene() {
+//        Condition condition = new Condition(SceneEntity.class);
+//        condition.and().andEqualTo("display", 1);
+//        List<SceneEntity> all = sceneService.findAll(condition);
+//        return Result.success(all);
+//    }
 
-    @ApiOperation(value = "数字史馆-视频")
-    @GetMapping("video")
-    public Result video() {
 
-        Condition condition = new Condition(VideoEntity.class);
-        condition.and().andEqualTo("display", 1);
-        List<VideoEntity> all = videoService.findAll(condition);
-
-        return Result.success(all);
-    }
+//    @ApiOperation(value = "数字史馆-视频")
+//    @GetMapping("video")
+//    public Result video() {
+//
+//        Condition condition = new Condition(VideoEntity.class);
+//        condition.and().andEqualTo("display", 1);
+//        List<VideoEntity> all = videoService.findAll(condition);
+//
+//        return Result.success(all);
+//    }
 
 
     @ApiOperation("留言列表")
@@ -153,38 +142,51 @@ public class WebController extends BaseController {
         return Result.success(page);
     }
 
+    @ApiOperation("留言")
+    @PostMapping("comment")
+    public Result comment(@Valid @RequestBody CommentRequest param) {
 
-
-    @ApiOperation("用户注册")
-    @PostMapping("register")
-    public Result register(@Valid @RequestBody RegisterDto param) {
-
-        if (!param.getPassword().equals(param.getVerifyPassword())) {
-            log.error("确认密码不一致");
-            return Result.failure("确认密码不一致");
-        }
-
-        SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
-        if (entity != null) {
-            log.error("该身份证号已注册: {}", param.getUserName());
-            return Result.failure("该身份证号已注册");
-        }
-
-        entity = new SysUserEntity();
+        CommentEntity entity = new CommentEntity();
         BeanUtils.copyProperties(param, entity);
+        // 默认不显示
+        entity.setDisplay(0);
+        commentService.save(entity);
 
-        entity.setPassword(PasswordUtils.encrypt(param.getUserName(), param.getPassword(), PasswordUtils.getStaticSalt()));
-        entity.setStatus(1);
-        entity.setRole("sys_visitor");
-        sysUserService.save(entity);
-
-        // 保存操作日志
-        saveLog(new LogEntity(entity.getId(),"用户注册","新增用户"));
+        return Result.success();
+    }
 
 
 
-        return Result.success();
-    }
+//    @ApiOperation("用户注册")
+//    @PostMapping("register")
+//    public Result register(@Valid @RequestBody RegisterDto param) {
+//
+//        if (!param.getPassword().equals(param.getVerifyPassword())) {
+//            log.error("确认密码不一致");
+//            return Result.failure("确认密码不一致");
+//        }
+//
+//        SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
+//        if (entity != null) {
+//            log.error("该身份证号已注册: {}", param.getUserName());
+//            return Result.failure("该身份证号已注册");
+//        }
+//
+//        entity = new SysUserEntity();
+//        BeanUtils.copyProperties(param, entity);
+//
+//        entity.setPassword(PasswordUtils.encrypt(param.getUserName(), param.getPassword(), PasswordUtils.getStaticSalt()));
+//        entity.setStatus(1);
+//        entity.setRole("sys_visitor");
+//        sysUserService.save(entity);
+//
+//        // 保存操作日志
+//        saveLog(new LogEntity(entity.getId(),"用户注册","新增用户"));
+//
+//
+//
+//        return Result.success();
+//    }
 
 
     @ApiOperation("找回密码")