Browse Source

更新日志

wuweihao 5 năm trước cách đây
mục cha
commit
ad2fc5fb88
44 tập tin đã thay đổi với 1386 bổ sung423 xóa
  1. 1 1
      gis_application/src/main/resources/application-dev.properties
  2. 1 1
      gis_application/src/main/resources/application-sit.properties
  3. 0 2
      gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  4. 8 0
      gis_common/src/main/java/com/gis/common/util/FileUtils.java
  5. 27 0
      gis_domain/src/main/java/com/gis/domain/dto/AuditDto.java
  6. 5 0
      gis_domain/src/main/java/com/gis/domain/dto/CommentRequest.java
  7. 2 2
      gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java
  8. 64 0
      gis_domain/src/main/java/com/gis/domain/dto/RegisterDto.java
  9. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/ResetPasswordDto.java
  10. 3 0
      gis_domain/src/main/java/com/gis/domain/dto/UserDto.java
  11. 20 0
      gis_domain/src/main/java/com/gis/domain/dto/UserPageDateDto.java
  12. 3 0
      gis_domain/src/main/java/com/gis/domain/po/CommentEntity.java
  13. 3 0
      gis_domain/src/main/java/com/gis/domain/po/FileEntity.java
  14. 2 2
      gis_domain/src/main/java/com/gis/domain/po/FodderEntity.java
  15. 2 2
      gis_domain/src/main/java/com/gis/domain/po/GoodsEntity.java
  16. 2 2
      gis_domain/src/main/java/com/gis/domain/po/SysUserEntity.java
  17. 3 0
      gis_domain/src/main/java/com/gis/domain/vo/CommentVo.java
  18. 2 2
      gis_domain/src/main/java/com/gis/domain/vo/GoodsVo.java
  19. 32 0
      gis_domain/src/main/java/com/gis/domain/vo/WebGoodsVo.java
  20. 0 7
      gis_mapper/src/main/java/com/gis/mapper/FileMapper.java
  21. 4 0
      gis_mapper/src/main/java/com/gis/mapper/SlideshowMapper.java
  22. 9 5
      gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  23. 1 1
      gis_mapper/src/main/java/com/gis/mapper/provider/SpiritProvider.java
  24. 49 0
      gis_mapper/src/main/java/com/gis/mapper/provider/UserProvider.java
  25. 1 0
      gis_service/src/main/java/com/gis/service/SlideshowService.java
  26. 5 2
      gis_service/src/main/java/com/gis/service/SysUserService.java
  27. 5 0
      gis_service/src/main/java/com/gis/service/impl/SlideshowServiceImpl.java
  28. 9 11
      gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java
  29. 4 0
      gis_service/src/main/java/com/gis/service/util/CommentTree.java
  30. 2 0
      gis_service/src/main/java/com/gis/service/util/CommentTreeUtil.java
  31. 14 7
      gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java
  32. 302 299
      gis_web/src/main/java/com/gis/web/controller/ApiController.java
  33. 23 2
      gis_web/src/main/java/com/gis/web/controller/CommentController.java
  34. 3 0
      gis_web/src/main/java/com/gis/web/controller/FodderController.java
  35. 54 1
      gis_web/src/main/java/com/gis/web/controller/GoodsController.java
  36. 24 6
      gis_web/src/main/java/com/gis/web/controller/NewsController.java
  37. 480 4
      gis_web/src/main/java/com/gis/web/controller/SceneController.java
  38. 24 5
      gis_web/src/main/java/com/gis/web/controller/SlideshowController.java
  39. 25 5
      gis_web/src/main/java/com/gis/web/controller/SpiritController.java
  40. 9 3
      gis_web/src/main/java/com/gis/web/controller/SysUserController.java
  41. 115 42
      gis_web/src/main/java/com/gis/web/controller/WebController.java
  42. 2 2
      gis_web/src/main/java/com/gis/web/shiro/MyRealm.java
  43. 0 7
      gis_web/src/main/java/com/gis/web/shiro/ShiroConfig.java
  44. 21 0
      gis_web/src/test/java/com/gis/web/controller/SceneControllerTest.java

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

@@ -50,7 +50,7 @@ spring.redis.jedis.pool.max-wait=-1ms
 #log
 logging.path=E:/javaProject/army_cms_log
 logging.config=classpath:logback-spring.xml
-logging.level.com.fdkanfang=debug
+logging.level.com.gis=debug
 
 # \u672C\u5730\u4FDD\u5B58\u8DEF\u5F84
 file.path=F:\\test\\ngin\\

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

@@ -50,7 +50,7 @@ spring.redis.jedis.pool.max-wait=-1ms
 #log
 logging.path=/root/user/army_cms_log
 logging.config=classpath:logback-spring.xml
-logging.level.com.fdkanfang=debug
+logging.level.com.gis=debug
 
 # \u672C\u5730\u4FDD\u5B58\u8DEF\u5F84
 file.path=/root/user/army_cms_data/

+ 0 - 2
gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java

@@ -22,7 +22,6 @@ public class CommonInterceptor implements HandlerInterceptor {
         if(!request.getRequestURI().contains("/static/") && !request.getRequestURI().contains("/sendUserInfo")
                 && !request.getRequestURI().contains(".json") && !request.getRequestURI().contains(".png")
                 && !request.getRequestURI().contains(".html") && !request.getRequestURI().contains(".mp3")){
-//            log.warn("start : {}", request.getRequestURI());
         }
 
 
@@ -48,7 +47,6 @@ public class CommonInterceptor implements HandlerInterceptor {
         if(!request.getRequestURI().contains("/static/") && !request.getRequestURI().contains("/sendUserInfo")
                 && !request.getRequestURI().contains(".json") && !request.getRequestURI().contains(".png")
                 && !request.getRequestURI().contains(".html") && !request.getRequestURI().contains(".mp3")){
-//            log.warn("end : {}", request.getRequestURI());
         }
     }
 

+ 8 - 0
gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -2,7 +2,9 @@ package com.gis.common.util;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.URLUtil;
+import com.gis.common.exception.BaseRuntimeException;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.util.ResourceUtils;
@@ -77,6 +79,12 @@ public class FileUtils {
         String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
 
         String fileName = file.getOriginalFilename();
+
+//        if (Validator.hasChinese(fileName)) {
+//            log.error("文件名不能有中文字符: {}", fileName);
+//            throw new BaseRuntimeException("文件名不能有中文字符:" + fileName);
+//        }
+
         String suffix = StringUtils.substringAfterLast(fileName, ".");
         String newName = time  + "."  +suffix;
         savePath = savePath  + newName;

+ 27 - 0
gis_domain/src/main/java/com/gis/domain/dto/AuditDto.java

@@ -0,0 +1,27 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class AuditDto {
+
+    @NotNull(message = "id不能为空")
+    @ApiModelProperty(value = "id" , required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @NotNull(message = "类型不能为空")
+    @ApiModelProperty(value = "审核状态:3:审核不通过,4:审核通过" , required = true)
+    private Integer status;
+
+
+}

+ 5 - 0
gis_domain/src/main/java/com/gis/domain/dto/CommentRequest.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 /**
  * Created by owen on 2020/5/9 0009 12:20
@@ -20,4 +21,8 @@ public class CommentRequest {
 
     @ApiModelProperty(value = "父级id")
     private Long parentId;
+
+//    @NotNull(message = "显示设置不能为空")
+//    @ApiModelProperty(value = "是否显示,1:是, 0:否", required = true)
+//    private Integer display;
 }

+ 2 - 2
gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java

@@ -23,8 +23,8 @@ public class FodderDto {
     @ApiModelProperty(value = "类型:1:图片, 2:视频" , required = true)
     private Integer type;
 
-    @ApiModelProperty(value = "高清图url")
-    private String img;
+    @ApiModelProperty(value = "文件url")
+    private String fileUrl;
 
     @ApiModelProperty(value = "缩略图url")
     private String thumb;

+ 64 - 0
gis_domain/src/main/java/com/gis/domain/dto/RegisterDto.java

@@ -0,0 +1,64 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ * 游客注册
+ */
+@Data
+public class RegisterDto {
+
+    @NotBlank(message = "真实姓名不能为空")
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+
+    @NotBlank(message = "身份证号(军号)不能为空")
+    @ApiModelProperty(value = "身份证号(军号)", required = true)
+    private String userName;
+
+    @NotBlank(message = "昵称不能为空")
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    @NotNull(message = "性别不能为空")
+    @ApiModelProperty(value = "性别 0:男  1:女")
+    private Integer sex;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+//    @NotBlank(message = "单位不能为空")
+//    @ApiModelProperty(value = "单位")
+//    private String unit;
+
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    @ApiModelProperty(value = "登录密码")
+    private String password;
+
+    @ApiModelProperty(value = "确认密码")
+    private String verifyPassword;
+
+//    @NotNull(message = "启用状态不能为空")
+//    @ApiModelProperty(value = "状态 1:启用  0:停用 ")
+//    private Integer status;
+
+//    @ApiModelProperty(value = "高清图url")
+//    private String img;
+//
+//    @ApiModelProperty(value = "缩略图url")
+//    private String thumb;
+
+
+//    @NotNull(message = "角色不能为空")
+//    @ApiModelProperty(value = "角色,sys_admin:系统管理员,sys_high:高级管理员, sys_normal:普通管理员, sys_visitor:游客" ,required = true)
+//    private String role;
+
+}

+ 21 - 0
gis_domain/src/main/java/com/gis/domain/dto/ResetPasswordDto.java

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class ResetPasswordDto {
+
+    @NotBlank(message = "注册姓名不能为空")
+    @ApiModelProperty(value = "姓名",  required = true)
+    private String realName;
+
+    @NotBlank(message = "身份证号不能为空")
+    @ApiModelProperty(value = "身份证号",  required = true)
+    private String userName;
+}

+ 3 - 0
gis_domain/src/main/java/com/gis/domain/dto/UserDto.java

@@ -43,6 +43,9 @@ public class UserDto {
     @ApiModelProperty(value = "单位")
     private String unit;
 
+    @ApiModelProperty(value = "地址")
+    private String address;
+
     @NotNull(message = "启用状态不能为空")
     @ApiModelProperty(value = "状态 1:启用  0:停用 ")
     private Integer status;

+ 20 - 0
gis_domain/src/main/java/com/gis/domain/dto/UserPageDateDto.java

@@ -0,0 +1,20 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class UserPageDateDto extends PageDateDto {
+
+    @ApiModelProperty(value = "角色,sys_admin:系统管理员,sys_high:高级管理员, sys_normal:普通管理员, sys_visitor:游客")
+    private String role;
+
+
+
+
+}

+ 3 - 0
gis_domain/src/main/java/com/gis/domain/po/CommentEntity.java

@@ -33,6 +33,9 @@ public class CommentEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "父级id")
     private Long parentId;
 
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
 
 
 

+ 3 - 0
gis_domain/src/main/java/com/gis/domain/po/FileEntity.java

@@ -34,5 +34,8 @@ public class FileEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "外键id")
     private String fkId;
 
+    @ApiModelProperty(value = "模块类型")
+    private String type;
+
 
 }

+ 2 - 2
gis_domain/src/main/java/com/gis/domain/po/FodderEntity.java

@@ -21,8 +21,8 @@ public class FodderEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "类型:1:图片, 2:视频")
     private Integer type;
 
-    @ApiModelProperty(value = "高清图url")
-    private String img;
+    @ApiModelProperty(value = "文件url")
+    private String fileUrl;
 
     @ApiModelProperty(value = "缩略图url")
     private String thumb;

+ 2 - 2
gis_domain/src/main/java/com/gis/domain/po/GoodsEntity.java

@@ -32,8 +32,8 @@ public class GoodsEntity extends BaseEntity implements Serializable {
     private Integer viewCount;
 
 
-//    @ApiModelProperty(value = "是否显示,1:是, 0:否")
-//    private Integer display;
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
 
     @ApiModelProperty(value = "提交用户Id")
     private Long submitId;

+ 2 - 2
gis_domain/src/main/java/com/gis/domain/po/SysUserEntity.java

@@ -39,8 +39,8 @@ public class SysUserEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "单位")
     private String unit;
 
-//    @ApiModelProperty(value = "部门id")
-//    private Long deptId;
+    @ApiModelProperty(value = "地址")
+    private String address;
 
 //    @ApiModelProperty(value = "超级管理员,1:是, 0:否")
 //    private Integer sysManager;

+ 3 - 0
gis_domain/src/main/java/com/gis/domain/vo/CommentVo.java

@@ -33,6 +33,9 @@ public class CommentVo extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "父级id")
     private Long parentId;
 
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
 
 
 

+ 2 - 2
gis_domain/src/main/java/com/gis/domain/vo/GoodsVo.java

@@ -13,8 +13,8 @@ public class GoodsVo extends BaseEntity {
     @ApiModelProperty(value = "标题" )
     private String title;
 
-    @ApiModelProperty(value = "高清图url")
-    private String img;
+//    @ApiModelProperty(value = "高清图url")
+//    private String img;
 
     @ApiModelProperty(value = "缩略图url")
     private String thumb;

+ 32 - 0
gis_domain/src/main/java/com/gis/domain/vo/WebGoodsVo.java

@@ -0,0 +1,32 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class WebGoodsVo extends BaseEntity {
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件url")
+    private String fileUrl;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "类型:1:图片, 2:视频,3:模型")
+    private Integer type;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+
+}

+ 0 - 7
gis_mapper/src/main/java/com/gis/mapper/FileMapper.java

@@ -2,12 +2,8 @@ package com.gis.mapper;
 
 
 import com.gis.domain.po.FileEntity;
-import com.gis.mapper.provider.FileProvider;
-import com.gis.mapper.provider.SpiritProvider;
 import org.apache.ibatis.annotations.*;
-import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.stereotype.Component;
-import sun.awt.SunHints;
 
 import java.util.List;
 
@@ -16,9 +12,6 @@ import java.util.List;
 @Mapper
 public interface FileMapper extends IBaseMapper<FileEntity, Long> {
 
-//    @Modifying
-//    @Update(value = "UPDATE tb_file SET fk_id = #{fkId} WHERE id in ( #{ids} )")
-//    void setFkIdByIds(String ids, String fkId);
 
     @Update(value = "update tb_file set fk_id = #{fkId}, type = #{type} where id = #{id} ")
     void setFkIdByIds(String id, Long fkId, String type);

+ 4 - 0
gis_mapper/src/main/java/com/gis/mapper/SlideshowMapper.java

@@ -6,6 +6,7 @@ import com.gis.domain.po.SlideshowEntity;
 import com.gis.domain.vo.SlideshowVo;
 import com.gis.mapper.provider.SlideshowProvider;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.SelectProvider;
 import org.springframework.stereotype.Component;
 
@@ -17,4 +18,7 @@ public interface SlideshowMapper extends IBaseMapper<SlideshowEntity, Long> {
 
     @SelectProvider(type = SlideshowProvider.class, method = "search")
     List<SlideshowVo> search(SlideshowPageDateDto param, Long userId);
+
+    @Select("SELECT * FROM tb_slideshow where status = #{status} and display = #{display} and rec_status = 'A'")
+    List<SlideshowVo> showDisplay(Integer status, Integer display);
 }

+ 9 - 5
gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java

@@ -1,24 +1,28 @@
 package com.gis.mapper;
 
 
+import com.gis.domain.dto.UserPageDateDto;
 import com.gis.domain.po.SysUserEntity;
+import com.gis.mapper.provider.UserProvider;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.SelectProvider;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 @Component
 @Mapper
 public interface SysUserMapper extends IBaseMapper<SysUserEntity, Long> {
 
-//    @SelectProvider(type = UserProvider.class, method = "findAllBySearchKey")
-//    List<UserResponse> findAllBySearchKey(String searchKey);
 
     @Select(value = "select * from sys_user where rec_status = 'A' AND user_name= #{userName}")
     SysUserEntity findByUserName(String userName);
 
     @Select(value = "select * from sys_user where rec_status = 'A' AND phone = #{phone}")
     SysUserEntity findByPhone(String phone);
-//
-//    @SelectProvider(type = UserProvider.class, method = "findBySearchKey")
-//    List<UserEntity> findBySearchKey(String searchKey);
+
+    @SelectProvider(type = UserProvider.class, method = "search")
+    List<SysUserEntity> search(UserPageDateDto param);
+
 }

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

@@ -13,7 +13,7 @@ public class SpiritProvider {
 
     public String search(SpiritPageDateDto param, Long userId){
         StringBuffer sql = new StringBuffer(
-                "select a.id, a.title, a.unit, a.img, a.thumb, a.display, a.view_count, a.status, a.reason, a.create_time, a.update_time," +
+                "select a.id, a.title, a.unit, a.img, a.thumb, a.display, a.content, a.view_count, a.status, a.reason, a.create_time, a.update_time," +
                         "a.submit_id, b.real_name as submit_name from tb_spirit a left join sys_user b on b.id = a.submit_id where a.rec_status = 'A' ");
 
         if(StringUtils.isNotBlank(param.getStartTime()) ){

+ 49 - 0
gis_mapper/src/main/java/com/gis/mapper/provider/UserProvider.java

@@ -0,0 +1,49 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.dto.UserPageDateDto;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2020/6/13 0013 10:56
+ */
+@Log4j2
+public class UserProvider {
+
+
+    public String search(UserPageDateDto param){
+        StringBuffer sql = new StringBuffer(
+                "select * from sys_user where rec_status = 'A' ");
+
+        if(StringUtils.isNotBlank(param.getStartTime()) ){
+
+            sql.append(" and create_time >= ").append("'").append(param.getStartTime()).append("'");
+
+        }
+
+        if (StringUtils.isNotBlank(param.getEndTime())) {
+            sql.append(" and create_time <= ").append("'").append(param.getEndTime()).append("'");
+        }
+
+        String searchKey = param.getSearchKey();
+        if(StringUtils.isNotBlank(searchKey)){
+            sql.append(" and ( real_name like '%").append(searchKey).append("%' )");
+        }
+
+        String roleKey = param.getRole();
+        if (StringUtils.isNotBlank(roleKey)) {
+            sql.append(" and role = '").append(roleKey).append("'");
+        }
+
+
+
+        sql.append(" order by create_time desc");
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+
+
+
+
+}

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

@@ -17,4 +17,5 @@ public interface SlideshowService extends IBaseService<SlideshowEntity, Long> {
     List<SlideshowVo> search(SlideshowPageDateDto param, Long userId);
 
 
+    List<SlideshowVo> showDisplay(Integer status, Integer display);
 }

+ 5 - 2
gis_service/src/main/java/com/gis/service/SysUserService.java

@@ -1,19 +1,22 @@
 package com.gis.service;
 
 
+import com.gis.domain.dto.UserPageDateDto;
 import com.gis.domain.po.SysUserEntity;
 
+import java.util.List;
+
 
 /**
  * Created by owen on 2020/3/11 0011 16:14
  */
 public interface SysUserService extends IBaseService<SysUserEntity, Long> {
 
-//    List<UserResponse> findAllBySearchKey(PageDto param);
 
     SysUserEntity findByUserName(String userName);
 
     SysUserEntity findByPhone(String phone);
 
-//    List<UserEntity> findBySearchKey(PageRequest param);
+    List<SysUserEntity> search(UserPageDateDto param);
+
 }

+ 5 - 0
gis_service/src/main/java/com/gis/service/impl/SlideshowServiceImpl.java

@@ -31,4 +31,9 @@ public class SlideshowServiceImpl extends IBaseServiceImpl<SlideshowEntity, Long
     public List<SlideshowVo> search(SlideshowPageDateDto param, Long userId) {
         return entityMapper.search(param, userId);
     }
+
+    @Override
+    public List<SlideshowVo> showDisplay(Integer status, Integer display) {
+        return entityMapper.showDisplay(status, display);
+    }
 }

+ 9 - 11
gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java

@@ -1,5 +1,6 @@
 package com.gis.service.impl;
 
+import com.gis.domain.dto.UserPageDateDto;
 import com.gis.domain.po.SysUserEntity;
 import com.gis.mapper.IBaseMapper;
 import com.gis.mapper.SysUserMapper;
@@ -7,6 +8,8 @@ import com.gis.service.SysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /**
  * Created by owen on 2020/3/11 0011 16:16
@@ -22,12 +25,6 @@ public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> im
         return this.entityMapper;
     }
 
-//    @Override
-//    public List<UserResponse> findAllBySearchKey(PageDto param) {
-//        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-//        return entityMapper.findAllBySearchKey(param.getSearchKey());
-//    }
-
     @Override
     public SysUserEntity findByUserName(String userName) {
         return entityMapper.findByUserName(userName);
@@ -37,11 +34,12 @@ public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> im
     public SysUserEntity findByPhone(String phone) {
         return entityMapper.findByPhone(phone);
     }
-//
-//    @Override
-//    public List<UserEntity> findBySearchKey(PageRequest param) {
-//        return entityMapper.findBySearchKey(param.getSearchKey());
-//    }
+
+    @Override
+    public List<SysUserEntity> search(UserPageDateDto param) {
+        return entityMapper.search(param);
+    }
+
 
 
 }

+ 4 - 0
gis_service/src/main/java/com/gis/service/util/CommentTree.java

@@ -19,10 +19,14 @@ public class CommentTree {
 
     private Date createTime;
 
+    private Date updateTime;
+
     private String nickName;
 
     private String unit;
 
+    private Integer display;
+
 
     // 子菜单/或按钮
     private List<CommentTree> children;

+ 2 - 0
gis_service/src/main/java/com/gis/service/util/CommentTreeUtil.java

@@ -19,8 +19,10 @@ public class CommentTreeUtil {
             treeGrid.setMsg(n.getMsg());
             treeGrid.setRealName(n.getRealName());
             treeGrid.setCreateTime(n.getCreateTime());
+            treeGrid.setUpdateTime(n.getUpdateTime());
             treeGrid.setUnit(n.getUnit());
             treeGrid.setNickName(n.getNickName());
+            treeGrid.setDisplay(n.getDisplay());
 
 
             if (n.getParentId() != null) {

+ 14 - 7
gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java

@@ -40,19 +40,26 @@ public class WebLogAspect {
     @Before("controllerLog()") //在切入点的方法run之前要干的
     public void logBeforeController(JoinPoint joinPoint) throws Exception {
 
-        // 获取token
-        String token = request.getHeader("token");
-        Long userId = null;
-        if (token != null) {
-            userId = JwtUtil.getUserId(token);
-        }
-
         // 记录下请求内容
         log.warn("start : {}" , request.getRequestURI());
         log.info("request Method : {}" , request.getMethod());
         log.info("request IP : {}" , request.getRemoteAddr());
         log.info("request Args : {}" , Arrays.toString(joinPoint.getArgs()));
 
+        // 获取token
+        String token = request.getHeader("token");
+//        log.info( request.getRequestURI());
+        // 排查登录接口
+        boolean contains = request.getRequestURI().contains("/admin/login");
+        if (contains) {
+            return;
+        }
+
+
+        Long userId = null;
+        if (token != null) {
+            userId = JwtUtil.getUserId(token);
+        }
 
 
         String description = getControllerLogDescription(joinPoint);

+ 302 - 299
gis_web/src/main/java/com/gis/web/controller/ApiController.java

@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ResourceUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
@@ -36,6 +37,7 @@ import java.util.Map;
 /**
  * Created by owen on 2020/6/10 0010 10:44
  */
+@ApiIgnore
 @Log4j2
 @Api(tags = "场景")
 @RestController
@@ -47,21 +49,21 @@ public class ApiController extends BaseController {
     private SceneService sceneService;
 
 
-    @ApiOperation("获取场景码")
-    @PostMapping("testJson")
-    public Result testJson(String a) {
-        String sceneCode = RandomUtils.randowString(9);
-        sceneCode = "ar_" +sceneCode;
-
-        // 创建token,过期24h,
-        String token = JwtUtil.createJWT(TOKEN_EXPIRE, TypeCode.TOKEN_API_KEY);
-
-        HashMap<Object, Object> reuslt = new HashMap<>();
-        reuslt.put("sceneCode", sceneCode);
-        reuslt.put("token", token);
-
-        return Result.success(reuslt);
-    }
+//    @ApiOperation("获取场景码")
+//    @PostMapping("testJson")
+//    public Result testJson(String a) {
+//        String sceneCode = RandomUtils.randowString(9);
+//        sceneCode = "ar_" +sceneCode;
+//
+//        // 创建token,过期24h,
+//        String token = JwtUtil.createJWT(TOKEN_EXPIRE, TypeCode.TOKEN_API_KEY);
+//
+//        HashMap<Object, Object> reuslt = new HashMap<>();
+//        reuslt.put("sceneCode", sceneCode);
+//        reuslt.put("token", token);
+//
+//        return Result.success(reuslt);
+//    }
 
 
     /**
@@ -71,169 +73,169 @@ public class ApiController extends BaseController {
      * @param request
      * @return
      */
-    @ApiOperation("box视频上传")
-    @PostMapping("uploadBox")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "sceneCode", value = "场景码", required = true),
-            @ApiImplicitParam(name = "param", value = "Map传参", required = true),
-    })
-
-    public Result uploadBox(@RequestParam Map<String, MultipartFile> param, String sceneCode, HttpServletRequest request) throws IOException {
-
-        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
-        if (entity == null) {
-            log.error("对象不存在:{}", sceneCode);
-            return Result.failure("场景码不存在");
-        }
-
-        // 保存位置(箭头函数传参,需要定义final, 使用时需要赋值使用)
-        String basePath = entity.getPath();
-        final String saveBasePath = basePath + "/boxVideo/";
-
-        // box视频信息
-        JSONArray overlaysArray = new JSONArray();
-
-        param.forEach((key, file)->{
-
-            if (StringUtils.isBlank(key)) {
-                log.error("key值不能为空");
-                return;
-            }
-
-            if (file == null) {
-                log.error("文件不能为空");
-                return;
-            }
-
-            String fileName = file.getOriginalFilename();
-
-
-
-            JSONObject keyJson = JSONObject.parseObject(key);
-
-            // 给相对路径,tomcat配置静态资源让前端读取
-            // http://192.168.0.44:8101/data/ar_I4Ef2SS4y/boxVideo/20180201_101827.mp4
-            String boxVideoPath = "/data/" + entity.getSceneCode()+ "/boxVideo/" + fileName;
-//            log.info("boxVideoPath: {}", boxVideoPath);
-
-            // 添加视频参数到overlayJaon
-            keyJson.put("file", boxVideoPath);
-            overlaysArray.add(keyJson);
-
-
-            // final值需要赋值使用
-            String filePath = saveBasePath;
-
-            filePath += fileName;
-            log.info("filePath: {}", filePath);
-            try {
-//                FileUtils.upload(file, filePath);
-                FileUtil.writeFromStream(file.getInputStream(), filePath);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
-        });
-
-        JSONObject dataJson = new JSONObject();
-        dataJson.put("overlays", overlaysArray);
-
-        // 创建data2.js文件
-        String saveDataJsonPath = basePath + "/data2.js";
-        log.info("data2.js path :{}", saveDataJsonPath);
-        FileUtil.writeUtf8String(dataJson.toJSONString(), saveDataJsonPath);
-        log.info("data2.js创建完成");
-
-        return Result.success(entity.getWebSite());
-    }
-
-
-
-
-
-    @ApiOperation(value = "Map表单上传多文件,指定保存路径,需要用postman测试", notes = "自定义上传位置")
-    @PostMapping("uploads")
-    public Result uploads(@RequestParam Map<String, MultipartFile> param, String sceneTitle, String sceneCode, HttpServletRequest request) throws Exception {
-        String token = request.getHeader("token");
-        if (token == null) {
-            log.error("token header is null");
-            return Result.failure("token header is null");
-        }
-
-        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
-        if (entity != null) {
-            log.error("场景码已存在,请更换新场景码: {}", sceneCode);
-            return Result.failure("场景码已存在,请更换新场景码");
-        }
-
-        Boolean verify = JwtUtil.isVerify(token, TypeCode.TOKEN_API_KEY);
-        if (!verify) {
-            log.error("api token 无效");
-            return Result.failure("token 无效");
-        }
-
-        param.forEach((path, file)->{
-
-            if (StringUtils.isBlank(path)) {
-                log.error("保存路径不能为空");
-            }
-
-            if (file == null) {
-                log.error("文件不能为空");
-                throw new BaseRuntimeException("文件为空");
-            }
-
-            path = FILE_PATH + path;
-            log.info("savePath: {}", path);
-            try {
-//                FileUtils.upload(file, path);
-                FileUtil.writeFromStream(file.getInputStream(), path);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
-        });
-
-
-
-        entity = new SceneEntity();
-        entity.setSceneCode(sceneCode);
-        entity.setPath(FILE_PATH + sceneCode);
-        entity.setSceneTitle(sceneTitle);
-        entity.setUpdateTime(new Date());
-
-
-
-
-        // 调用算法切图片转换
-        String cmd = ConstantCmd.SLICE_SKYBOX + entity.getPath();
-        log.info("cmd:{}", cmd);
-        CreateObjUtil.callshell(cmd);
-        log.info("算法切片完成");
-
-
-        // 调用算法将obj转txt
-        String objCmd = ConstantCmd.OBJ_TO_TXT + entity.getPath();
-        log.info("objCmd:{}", objCmd);
-        CreateObjUtil.callshell(objCmd);
-        log.info("算法obj转txt完成");
-
-
-        // 转换文件
-        convert(entity.getPath(), sceneCode, sceneTitle);
-        log.info("文件转换完成");
-
-        // 场景url
-        String webSite = SERVER_DOMAIN + "SuperTwo/index.html?m=" + sceneCode;
-        log.info("webSite: {}", webSite);
-
-
-        entity.setWebSite(webSite);
-        sceneService.save(entity);
-
-
-        return Result.success(entity.getWebSite());
-    }
+//    @ApiOperation("box视频上传")
+//    @PostMapping("uploadBox")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "sceneCode", value = "场景码", required = true),
+//            @ApiImplicitParam(name = "param", value = "Map传参", required = true),
+//    })
+//
+//    public Result uploadBox(@RequestParam Map<String, MultipartFile> param, String sceneCode, HttpServletRequest request) throws IOException {
+//
+//        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
+//        if (entity == null) {
+//            log.error("对象不存在:{}", sceneCode);
+//            return Result.failure("场景码不存在");
+//        }
+//
+//        // 保存位置(箭头函数传参,需要定义final, 使用时需要赋值使用)
+//        String basePath = entity.getPath();
+//        final String saveBasePath = basePath + "/boxVideo/";
+//
+//        // box视频信息
+//        JSONArray overlaysArray = new JSONArray();
+//
+//        param.forEach((key, file)->{
+//
+//            if (StringUtils.isBlank(key)) {
+//                log.error("key值不能为空");
+//                return;
+//            }
+//
+//            if (file == null) {
+//                log.error("文件不能为空");
+//                return;
+//            }
+//
+//            String fileName = file.getOriginalFilename();
+//
+//
+//
+//            JSONObject keyJson = JSONObject.parseObject(key);
+//
+//            // 给相对路径,tomcat配置静态资源让前端读取
+//            // http://192.168.0.44:8101/data/ar_I4Ef2SS4y/boxVideo/20180201_101827.mp4
+//            String boxVideoPath = "/data/" + entity.getSceneCode()+ "/boxVideo/" + fileName;
+////            log.info("boxVideoPath: {}", boxVideoPath);
+//
+//            // 添加视频参数到overlayJaon
+//            keyJson.put("file", boxVideoPath);
+//            overlaysArray.add(keyJson);
+//
+//
+//            // final值需要赋值使用
+//            String filePath = saveBasePath;
+//
+//            filePath += fileName;
+//            log.info("filePath: {}", filePath);
+//            try {
+////                FileUtils.upload(file, filePath);
+//                FileUtil.writeFromStream(file.getInputStream(), filePath);
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            }
+//
+//        });
+//
+//        JSONObject dataJson = new JSONObject();
+//        dataJson.put("overlays", overlaysArray);
+//
+//        // 创建data2.js文件
+//        String saveDataJsonPath = basePath + "/data2.js";
+//        log.info("data2.js path :{}", saveDataJsonPath);
+//        FileUtil.writeUtf8String(dataJson.toJSONString(), saveDataJsonPath);
+//        log.info("data2.js创建完成");
+//
+//        return Result.success(entity.getWebSite());
+//    }
+
+
+
+
+
+//    @ApiOperation(value = "Map表单上传多文件,指定保存路径,需要用postman测试", notes = "自定义上传位置")
+//    @PostMapping("uploads")
+//    public Result uploads(@RequestParam Map<String, MultipartFile> param, String sceneTitle, String sceneCode, HttpServletRequest request) throws Exception {
+////        String token = request.getHeader("token");
+////        if (token == null) {
+////            log.error("token header is null");
+////            return Result.failure("token header is null");
+////        }
+//
+//        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
+//        if (entity != null) {
+//            log.error("场景码已存在,请更换新场景码: {}", sceneCode);
+//            return Result.failure("场景码已存在,请更换新场景码");
+//        }
+//
+////        Boolean verify = JwtUtil.isVerify(token, TypeCode.TOKEN_API_KEY);
+////        if (!verify) {
+////            log.error("api token 无效");
+////            return Result.failure("token 无效");
+////        }
+//
+//        param.forEach((path, file)->{
+//
+//            if (StringUtils.isBlank(path)) {
+//                log.error("保存路径不能为空");
+//            }
+//
+//            if (file == null) {
+//                log.error("文件不能为空");
+//                throw new BaseRuntimeException("文件为空");
+//            }
+//
+//            path = FILE_PATH + path;
+//            log.info("savePath: {}", path);
+//            try {
+////                FileUtils.upload(file, path);
+//                FileUtil.writeFromStream(file.getInputStream(), path);
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            }
+//
+//        });
+//
+//
+//
+//        entity = new SceneEntity();
+//        entity.setSceneCode(sceneCode);
+//        entity.setPath(FILE_PATH + sceneCode);
+//        entity.setSceneTitle(sceneTitle);
+//        entity.setUpdateTime(new Date());
+//
+//
+//
+//
+//        // 调用算法切图片转换
+//        String cmd = ConstantCmd.SLICE_SKYBOX + entity.getPath();
+//        log.info("cmd:{}", cmd);
+//        CreateObjUtil.callshell(cmd);
+//        log.info("算法切片完成");
+//
+//
+//        // 调用算法将obj转txt
+//        String objCmd = ConstantCmd.OBJ_TO_TXT + entity.getPath();
+//        log.info("objCmd:{}", objCmd);
+//        CreateObjUtil.callshell(objCmd);
+//        log.info("算法obj转txt完成");
+//
+//
+//        // 转换文件
+//        convert(entity.getPath(), sceneCode, sceneTitle);
+//        log.info("文件转换完成");
+//
+//        // 场景url
+//        String webSite = SERVER_DOMAIN + "SuperTwo/index.html?m=" + sceneCode;
+//        log.info("webSite: {}", webSite);
+//
+//
+//        entity.setWebSite(webSite);
+//        sceneService.save(entity);
+//
+//
+//        return Result.success(entity.getWebSite());
+//    }
 
 
 
@@ -253,11 +255,11 @@ public class ApiController extends BaseController {
         sceneCode = "ar_" +sceneCode;
 
         // 创建token,过期24h,
-        String token = JwtUtil.createJWT(TOKEN_EXPIRE, TypeCode.TOKEN_API_KEY);
+//        String token = JwtUtil.createJWT(TOKEN_EXPIRE, TypeCode.TOKEN_API_KEY);
 
         HashMap<Object, Object> reuslt = new HashMap<>();
         reuslt.put("sceneCode", sceneCode);
-        reuslt.put("token", token);
+//        reuslt.put("token", token);
 
         return Result.success(reuslt);
     }
@@ -289,35 +291,35 @@ public class ApiController extends BaseController {
     }
 
 
-    /**
-     * 文件转换
-     * @param sceneCode
-     * @throws Exception
-     */
-    private void convert(String basePath, String sceneCode, String sceneTitle) throws Exception {
-
-        // 将result文件夹的upload.json是否存在,并处理业务逻辑
-        checkUploadJson(basePath);
-
-
-        if(!FileUtil.exist(basePath+"/vision.txt")){
-            log.error("文件不存在: " + basePath+"/vision.txt");
-            Result.failure("文件不存在: " + basePath+"/vision.txt");
-        }
-
-        // 2.vision.txt转vision.modeldata
-        CreateObjUtil.convertTxtToVisionmodeldata(basePath+"/vision.txt", basePath+"/vision.modeldata");
-        log.info("vision.modeldata转换完成");
-
-        // 3. 生成一个空的data2.js, 里面是一个空的json
-        FileUtil.writeUtf8String("{}",basePath+"/data2.js");
-        log.info("data2.js创建完成");
-
-        // 4. 创建someData.json, 修改sid值为场景码目录
-        createSomeData(basePath, sceneCode, sceneTitle);
-
-
-    }
+//    /**
+//     * 文件转换
+//     * @param sceneCode
+//     * @throws Exception
+//     */
+//    private void convert(String basePath, String sceneCode, String sceneTitle) throws Exception {
+//
+//        // 将result文件夹的upload.json是否存在,并处理业务逻辑
+//        checkUploadJson(basePath);
+//
+//
+//        if(!FileUtil.exist(basePath+"/vision.txt")){
+//            log.error("文件不存在: " + basePath+"/vision.txt");
+//            Result.failure("文件不存在: " + basePath+"/vision.txt");
+//        }
+//
+//        // 2.vision.txt转vision.modeldata
+//        CreateObjUtil.convertTxtToVisionmodeldata(basePath+"/vision.txt", basePath+"/vision.modeldata");
+//        log.info("vision.modeldata转换完成");
+//
+//        // 3. 生成一个空的data2.js, 里面是一个空的json
+//        FileUtil.writeUtf8String("{}",basePath+"/data2.js");
+//        log.info("data2.js创建完成");
+//
+//        // 4. 创建someData.json, 修改sid值为场景码目录
+//        createSomeData(basePath, sceneCode, sceneTitle);
+//
+//
+//    }
 
 
     @Test
@@ -327,35 +329,35 @@ public class ApiController extends BaseController {
     }
 
 
-    /**
-     * 创建someData.json
-     */
-    private static void createSomeData(String basePath, String sceneCode, String sceneTitle) throws IOException {
-        String path = ResourceUtils.getURL("classpath:").getPath();
-        path = path + "data/someData.json";
-        log.info("path: {}", path);
-        String os = FileUtil.readUtf8String(path);
-        JSONObject jsonObject = JSONObject.parseObject(os);
-        JSONObject model = jsonObject.getJSONObject("model");
-
-
-        // 更新images json
-        JSONArray imagesJson = updateImagesData(sceneCode);
-        model.put("images", imagesJson);
-
-        // 修改sid值
-        model.put("sid", sceneCode);
-        model.put("name", sceneTitle);
-
-        // 更新json
-        jsonObject.put("model", model);
-
-
-        FileUtil.writeUtf8String(jsonObject.toJSONString(), basePath+"/someData.json");
-
-        log.info("someData.json创建完成");
-
-    }
+//    /**
+//     * 创建someData.json
+//     */
+//    private static void createSomeData(String basePath, String sceneCode, String sceneTitle) throws IOException {
+//        String path = ResourceUtils.getURL("classpath:").getPath();
+//        path = path + "data/someData.json";
+//        log.info("path: {}", path);
+//        String os = FileUtil.readUtf8String(path);
+//        JSONObject jsonObject = JSONObject.parseObject(os);
+//        JSONObject model = jsonObject.getJSONObject("model");
+//
+//
+//        // 更新images json
+//        JSONArray imagesJson = updateImagesData(sceneCode);
+//        model.put("images", imagesJson);
+//
+//        // 修改sid值
+//        model.put("sid", sceneCode);
+//        model.put("name", sceneTitle);
+//
+//        // 更新json
+//        jsonObject.put("model", model);
+//
+//
+//        FileUtil.writeUtf8String(jsonObject.toJSONString(), basePath+"/someData.json");
+//
+//        log.info("someData.json创建完成");
+//
+//    }
 
     public static void main(String[] args) throws IOException {
         String path = "F:\\test\\army\\upload.json";
@@ -368,67 +370,67 @@ public class ApiController extends BaseController {
     }
 
 
-    /**
-     * 创建images.json
-     * 如果数据格式有变动,要作出响应的修改
-     */
-    private static JSONArray updateImagesData(String sceneCode) throws IOException {
-        String resourceUrl = FileUtils.getResourceUrl("data/images.json");
-        String os = FileUtil.readUtf8String(resourceUrl);
-        JSONObject imageObject = JSONObject.parseObject(os);
-        imageObject.put("sid", sceneCode);
-
-        JSONArray imagesArray = new JSONArray();
-        imagesArray.set(0, imageObject);
-
-        return imagesArray;
-    }
-
-    /**
-     * 检查upload.json文件是否存在,执行业务逻辑
-     */
-    private static void checkUploadJson(String basePath) throws Exception {
-        String uploadJsonPath = basePath + "/results/upload.json";
-//        String uploadJsonPath = "F:\\test\\army\\upload.json";
-        boolean isUploadJsonPath = FileUtil.isFile(uploadJsonPath);
-        if (!isUploadJsonPath) {
-            log.error("算法的upload.json不存在");
-            throw new BaseRuntimeException(5000, "算法的upload.json不存在");
-
-        }
-        // 判断upload.json文件是否都存在
-        String os = FileUtil.readUtf8String(uploadJsonPath);
-        JSONObject imageObject = JSONObject.parseObject(os);
-
-        // json数组
-        JSONArray jsonArray = imageObject.getJSONArray("upload");
-        for (int i = 0; i < jsonArray.size(); i++) {
-            JSONObject jsonObject = jsonArray.getJSONObject(i);
-            String fileName = jsonObject.getString("file");
-            String filePath = basePath + "/results/" + fileName;
-
-            boolean isFilePath = FileUtil.isFile(filePath);
-            if (!isFilePath) {
-                log.error("算法的upload.json数据文件:  {}", filePath );
-                throw new BaseRuntimeException(5000, "算法的upload.json数据文件不存在");
-
-            }
-
-            String suffix = StringUtils.substringAfterLast(filePath, ".");
-            // 把图片复制到指定目录(dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high)
-            if ("jpg".equals(suffix)) {
-                FileUtil.copy(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k_texture_jpg_high/" + fileName, true);
-            }
-
-            // 将modeldata.txt转xxx.dam
-            if ("txt".equals(suffix)) {
-                CreateObjUtil.convertTxtToDam(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k.dam");
-                log.info("dam转换完成");
-
-            }
-
-        }
-    }
+//    /**
+//     * 创建images.json
+//     * 如果数据格式有变动,要作出响应的修改
+//     */
+//    private static JSONArray updateImagesData(String sceneCode) throws IOException {
+//        String resourceUrl = FileUtils.getResourceUrl("data/images.json");
+//        String os = FileUtil.readUtf8String(resourceUrl);
+//        JSONObject imageObject = JSONObject.parseObject(os);
+//        imageObject.put("sid", sceneCode);
+//
+//        JSONArray imagesArray = new JSONArray();
+//        imagesArray.set(0, imageObject);
+//
+//        return imagesArray;
+//    }
+
+//    /**
+//     * 检查upload.json文件是否存在,执行业务逻辑
+//     */
+//    private static void checkUploadJson(String basePath) throws Exception {
+//        String uploadJsonPath = basePath + "/results/upload.json";
+////        String uploadJsonPath = "F:\\test\\army\\upload.json";
+//        boolean isUploadJsonPath = FileUtil.isFile(uploadJsonPath);
+//        if (!isUploadJsonPath) {
+//            log.error("算法的upload.json不存在");
+//            throw new BaseRuntimeException(5000, "算法的upload.json不存在");
+//
+//        }
+//        // 判断upload.json文件是否都存在
+//        String os = FileUtil.readUtf8String(uploadJsonPath);
+//        JSONObject imageObject = JSONObject.parseObject(os);
+//
+//        // json数组
+//        JSONArray jsonArray = imageObject.getJSONArray("upload");
+//        for (int i = 0; i < jsonArray.size(); i++) {
+//            JSONObject jsonObject = jsonArray.getJSONObject(i);
+//            String fileName = jsonObject.getString("file");
+//            String filePath = basePath + "/results/" + fileName;
+//
+//            boolean isFilePath = FileUtil.isFile(filePath);
+//            if (!isFilePath) {
+//                log.error("算法的upload.json数据文件:  {}", filePath );
+//                throw new BaseRuntimeException(5000, "算法的upload.json数据文件不存在");
+//
+//            }
+//
+//            String suffix = StringUtils.substringAfterLast(filePath, ".");
+//            // 把图片复制到指定目录(dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high)
+//            if ("jpg".equals(suffix)) {
+//                FileUtil.copy(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k_texture_jpg_high/" + fileName, true);
+//            }
+//
+//            // 将modeldata.txt转xxx.dam
+//            if ("txt".equals(suffix)) {
+//                CreateObjUtil.convertTxtToDam(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k.dam");
+//                log.info("dam转换完成");
+//
+//            }
+//
+//        }
+//    }
 
 
     @Test
@@ -534,6 +536,7 @@ public class ApiController extends BaseController {
 //            data2Json.put("overlays", overlays);
         }
 
+        // 热点
         String hots = param.getHots();
         if (hots != null) {
             data2Json.put("hots", JSONObject.parseObject(hots));

+ 23 - 2
gis_web/src/main/java/com/gis/web/controller/CommentController.java

@@ -5,6 +5,7 @@ import com.gis.domain.dto.PageDateDto;
 import com.gis.domain.po.CommentEntity;
 import com.gis.domain.dto.CommentRequest;
 import com.gis.domain.dto.PageDto;
+import com.gis.domain.po.GoodsEntity;
 import com.gis.domain.vo.CommentVo;
 import com.gis.service.CommentService;
 import com.gis.service.util.CommentTree;
@@ -13,6 +14,7 @@ import com.gis.web.aop.WebControllerLog;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresRoles;
 import org.springframework.beans.BeanUtils;
@@ -26,6 +28,7 @@ import java.util.List;
 /**
  * Created by owen on 2020/5/8 0008 9:54
  */
+@Log4j2
 @Api(tags = "留言管理")
 @RestController
 @RequestMapping("manage/comment")
@@ -35,7 +38,7 @@ public class CommentController extends BaseController {
     private CommentService commentService;
 
 
-    @RequiresRoles(value = {"sys_admin", "sys_high", "sys_normal"}, logical = Logical.OR)
+//    @RequiresRoles(value = {"sys_admin", "sys_high", "sys_normal"}, logical = Logical.OR)
     @ApiOperation("树型列表")
     @PostMapping("list")
     public Result<CommentVo> list(@RequestBody PageDateDto param) {
@@ -93,6 +96,8 @@ public class CommentController extends BaseController {
         entity.setRealName(getSysUser().getRealName());
         entity.setNickName(getSysUser().getNickName());
         entity.setUnit(getSysUser().getUnit());
+        // 默认不显示
+        entity.setDisplay(0);
         commentService.save(entity);
 
         return Result.success();
@@ -100,7 +105,7 @@ public class CommentController extends BaseController {
 
 
     @WebControllerLog(description = "留言管理-删除留言")
-    @RequiresRoles(value = {"sys_admin", "sys_high", "sys_normal"}, logical = Logical.OR)
+//    @RequiresRoles(value = {"sys_admin", "sys_high", "sys_normal"}, logical = Logical.OR)
     @ApiOperation("删除")
     @GetMapping("removes/{ids}")
     public Result detail(@PathVariable String ids) {
@@ -110,4 +115,20 @@ public class CommentController extends BaseController {
     }
 
 
+    @WebControllerLog(description = "精品典藏-是否显示")
+    @ApiOperation("是否显示")
+    @GetMapping("display/{id}/{display}")
+    public Result display(@PathVariable Long id, @PathVariable Integer display) {
+        CommentEntity entity = commentService.findById(id);
+        if (entity == null) {
+            log.error("对象id不存在 : {}", id);
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setDisplay(display);
+        commentService.update(entity);
+        return Result.success();
+    }
+
+
 }

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

@@ -4,6 +4,7 @@ import com.gis.common.util.Result;
 import com.gis.domain.dto.FodderDto;
 import com.gis.domain.dto.FodderPageDto;
 import com.gis.domain.po.FodderEntity;
+import com.gis.domain.po.NewsEntity;
 import com.gis.service.FodderService;
 import com.gis.web.aop.WebControllerLog;
 import com.github.pagehelper.PageInfo;
@@ -100,4 +101,6 @@ public class FodderController extends BaseController {
 
 
 
+
+
 }

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

@@ -2,6 +2,7 @@ package com.gis.web.controller;
 
 import com.gis.common.constant.TypeCode;
 import com.gis.common.util.Result;
+import com.gis.domain.dto.AuditDto;
 import com.gis.domain.dto.GoodsDto;
 import com.gis.domain.dto.GoodsPageDateDto;
 import com.gis.domain.po.FileEntity;
@@ -19,6 +20,7 @@ import org.apache.shiro.authz.annotation.RequiresRoles;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import tk.mybatis.mapper.entity.Condition;
 
 import javax.validation.Valid;
 import java.util.Date;
@@ -65,6 +67,8 @@ public class GoodsController extends BaseController {
         if (param.getId() == null) {
             entity = new GoodsEntity();
             BeanUtils.copyProperties(param, entity);
+            // 默认值279
+            entity.setStatus(1);
             goodsService.save(entity);
 
 
@@ -139,8 +143,21 @@ public class GoodsController extends BaseController {
         }
 
 
-        List<FileEntity> fileList = fileService.findByFkId(TypeCode.FILE_GOODS + id);
+//        List<FileEntity> fileList = fileService.findByFkId(TypeCode.FILE_GOODS + id);
 
+        String modelType = null;
+        if (entity.getType() == 1) {
+            modelType = TypeCode.MODEL_GOODS_IMG;
+        } else if (entity.getType() == 2) {
+            modelType = TypeCode.MODEL_GOODS_VIDEO;
+        } else if (entity.getType() == 3) {
+            modelType = TypeCode.MODEL_GOODS_MODEL;
+        }
+
+        Condition condition = new Condition(FileEntity.class);
+        condition.and().andEqualTo("fkId", id);
+        condition.and().andEqualTo("type", modelType);
+        List<FileEntity> fileList  = fileService.findAll(condition);
 
         HashMap<Object, Object> result = new HashMap<>();
         result.put("entity", entity);
@@ -149,6 +166,42 @@ public class GoodsController extends BaseController {
         return Result.success(result);
     }
 
+    @WebControllerLog(description = "精品典藏-是否显示")
+    @ApiOperation("是否显示")
+    @GetMapping("display/{id}/{display}")
+    public Result display(@PathVariable Long id, @PathVariable Integer display) {
+        GoodsEntity entity = goodsService.findById(id);
+        if (entity == null) {
+            log.error("对象id不存在 : {}", id);
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setDisplay(display);
+        goodsService.update(entity);
+        return Result.success();
+    }
+
+    @WebControllerLog(description = "精品典藏-审核")
+    @ApiOperation("审核")
+    @PostMapping("audit")
+    public Result audit(@Valid @RequestBody AuditDto param) {
+        GoodsEntity entity = goodsService.findById(param.getId());
+        if (entity == null) {
+            log.error("对象id不存在 : {}", param.getId());
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setStatus(param.getStatus());
+        entity.setAuditId(getTokenUserId());
+        entity.setReason(param.getReason());
+        goodsService.update(entity);
+        return Result.success();
+    }
+
+
 
 
 }
+
+
+

+ 24 - 6
gis_web/src/main/java/com/gis/web/controller/NewsController.java

@@ -1,6 +1,7 @@
 package com.gis.web.controller;
 
 import com.gis.common.util.Result;
+import com.gis.domain.dto.AuditDto;
 import com.gis.domain.po.NewsEntity;
 import com.gis.domain.dto.NewsPageDateRequest;
 import com.gis.domain.dto.NewsRequest;
@@ -89,7 +90,7 @@ public class NewsController extends BaseController {
     @WebControllerLog(description = "史馆动态-删除")
     @ApiOperation("删除")
     @GetMapping("removes/{ids}")
-    public Result detail(@PathVariable String ids) {
+    public Result removes(@PathVariable String ids) {
 
         List<NewsEntity> entities = newsService.findByIds(ids);
         for (NewsEntity entity: entities) {
@@ -104,16 +105,17 @@ public class NewsController extends BaseController {
 
     @WebControllerLog(description = "史馆动态-审核")
     @ApiOperation("审核")
-    @GetMapping("audit/{id}/{status}")
-    public Result audit(@PathVariable Long id, @PathVariable Integer status) {
-        NewsEntity entity = newsService.findById(id);
+    @PostMapping("audit")
+    public Result audit(@Valid @RequestBody AuditDto param) {
+        NewsEntity entity = newsService.findById(param.getId());
         if (entity == null) {
-            log.error("对象id不存在 : {}", id);
+            log.error("对象id不存在 : {}", param.getId());
             return Result.failure("对象id不存在");
         }
 
-        entity.setStatus(status);
+        entity.setStatus(param.getStatus());
         entity.setAuditId(getTokenUserId());
+        entity.setReason(param.getReason());
         newsService.update(entity);
         return Result.success();
     }
@@ -131,5 +133,21 @@ public class NewsController extends BaseController {
     }
 
 
+    @WebControllerLog(description = "史馆动态-是否显示")
+    @ApiOperation("是否显示")
+    @GetMapping("display/{id}/{display}")
+    public Result display(@PathVariable Long id, @PathVariable Integer display) {
+        NewsEntity entity = newsService.findById(id);
+        if (entity == null) {
+            log.error("对象id不存在 : {}", id);
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setDisplay(display);
+        newsService.update(entity);
+        return Result.success();
+    }
+
+
 
 }

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

@@ -1,8 +1,16 @@
 package com.gis.web.controller;
 
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.Validator;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.gis.common.exception.BaseRuntimeException;
+import com.gis.common.proto.constant.ConstantCmd;
+import com.gis.common.proto.constant.ConstantFileName;
+import com.gis.common.proto.util.CreateObjUtil;
+import com.gis.common.util.FileUtils;
+import com.gis.common.util.RandomUtils;
 import com.gis.common.util.Result;
 import com.gis.domain.dto.PageDto;
 import com.gis.domain.dto.SceneDataDto;
@@ -13,16 +21,22 @@ import com.gis.web.aop.WebControllerLog;
 import com.github.pagehelper.PageInfo;
 import com.github.xiaoymin.knife4j.annotations.ApiSort;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresRoles;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.ResourceUtils;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
-import java.util.Date;
-import java.util.List;
+import java.io.IOException;
+import java.util.*;
 
 
 /**
@@ -31,7 +45,6 @@ import java.util.List;
 @RequiresRoles(value = {"sys_admin", "sys_high", "sys_normal"}, logical = Logical.OR)
 @Log4j2
 @Api(tags = "大场景")
-@ApiSort(value = 2)
 @RestController
 @RequestMapping("manage/scene")
 public class SceneController extends BaseController {
@@ -53,6 +66,11 @@ public class SceneController extends BaseController {
         return Result.success(page);
     }
 
+    /**
+     * 应用程序部门需要用到
+     * @param param
+     * @return
+     */
     @ApiOperation("场景编辑")
     @PostMapping("edit")
     public Result edit(@Valid @RequestBody SceneDataDto param) {
@@ -178,7 +196,7 @@ public class SceneController extends BaseController {
     @WebControllerLog(description = "大场景-删除")
     @ApiOperation("场景删除")
     @GetMapping("removes/{ids}")
-    public Result detail(@PathVariable String ids) {
+    public Result removes(@PathVariable String ids) {
         List<SceneEntity> entities = sceneService.findByIds(ids);
         for (SceneEntity entity: entities) {
             entity.setRecStatus("I");
@@ -223,5 +241,463 @@ public class SceneController extends BaseController {
         return Result.success();
     }
 
+    /************************************** 应用程序项目部接口 **************************************/
+
+    /**
+     *  map的key值是json参数,value是文件
+     * @param param
+     * @param sceneCode
+     * @param request
+     * @return
+     */
+    @ApiOperation(value = "box视频上传", notes = "自定义上传位置,文件名需要验证中文字符")
+    @PostMapping("uploadBox")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "sceneCode", value = "场景码", required = true),
+            @ApiImplicitParam(name = "param", value = "Map传参", required = true),
+    })
+
+    public Result uploadBox(@RequestParam Map<String, MultipartFile> param, String sceneCode, HttpServletRequest request) throws IOException {
+
+        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
+        if (entity == null) {
+            log.error("对象不存在:{}", sceneCode);
+            return Result.failure("场景码不存在");
+        }
+
+        // 保存位置(箭头函数传参,需要定义final, 使用时需要赋值使用)
+        String basePath = entity.getPath();
+        final String saveBasePath = basePath + "/boxVideo/";
+
+        // box视频信息
+        JSONArray overlaysArray = new JSONArray();
+
+        param.forEach((key, file)->{
+
+            if (StringUtils.isBlank(key)) {
+                log.error("key值不能为空");
+                throw new BaseRuntimeException("key值不能为空");
+            }
+
+            if (file == null) {
+                log.error("文件不能为空");
+                throw new BaseRuntimeException("文件不能为空");
+            }
+
+            String fileName = file.getOriginalFilename();
+
+            if (Validator.hasChinese(fileName)) {
+                log.error("文件名不能有中文字符: {}", fileName);
+                throw new BaseRuntimeException("文件名不能有中文字符");
+            }
+
+
+
+            JSONObject keyJson = JSONObject.parseObject(key);
+
+            // 给相对路径,tomcat配置静态资源让前端读取
+            // http://192.168.0.44:8101/data/ar_I4Ef2SS4y/boxVideo/20180201_101827.mp4
+            String boxVideoPath = "/data/" + entity.getSceneCode()+ "/boxVideo/" + fileName;
+//            log.info("boxVideoPath: {}", boxVideoPath);
+
+            // 添加视频参数到overlayJaon
+            keyJson.put("file", boxVideoPath);
+            overlaysArray.add(keyJson);
+
+
+            // final值需要赋值使用
+            String filePath = saveBasePath;
+
+            filePath += fileName;
+            log.info("filePath: {}", filePath);
+            try {
+//                FileUtils.upload(file, filePath);
+                FileUtil.writeFromStream(file.getInputStream(), filePath);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        });
+
+        JSONObject dataJson = new JSONObject();
+        dataJson.put("overlays", overlaysArray);
+
+        // 创建data2.js文件
+        String saveDataJsonPath = basePath + "/data2.js";
+        log.info("data2.js path :{}", saveDataJsonPath);
+        FileUtil.writeUtf8String(dataJson.toJSONString(), saveDataJsonPath);
+        log.info("data2.js创建完成");
+
+        return Result.success(entity.getWebSite());
+    }
+
+
+    /**
+     * 创建场景
+     * @param param
+     * @param sceneTitle
+     * @param sceneCode
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @ApiOperation(value = "Map表单上传多文件,指定保存路径,需要用postman测试", notes = "自定义上传位置,文件名需要验证中文字符")
+    @PostMapping("uploads")
+    public Result uploads(@RequestParam Map<String, MultipartFile> param, String sceneTitle, String sceneCode, HttpServletRequest request) throws Exception {
+
+
+        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
+        if (entity != null) {
+            log.error("场景码已存在,请更换新场景码: {}", sceneCode);
+            return Result.failure("场景码已存在,请更换新场景码");
+        }
+
+
+        param.forEach((path, file)->{
+
+            if (StringUtils.isBlank(path)) {
+                log.error("保存路径不能为空");
+                throw new BaseRuntimeException("保存路径不能为空");
+            }
+
+            if (file == null) {
+                log.error("文件不能为空");
+                throw new BaseRuntimeException("文件为空");
+            }
+            String fileName = file.getOriginalFilename();
+            if (Validator.hasChinese(fileName)) {
+                log.error("文件名不能有中文字符: {}", fileName);
+                throw new BaseRuntimeException("文件名不能有中文字符:" + fileName);
+            }
+
+            path = FILE_PATH + path;
+            log.info("savePath: {}", path);
+            try {
+//                FileUtils.upload(file, path);
+                FileUtil.writeFromStream(file.getInputStream(), path);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        });
+
+
+
+        entity = new SceneEntity();
+        entity.setSceneCode(sceneCode);
+        entity.setPath(FILE_PATH + sceneCode);
+        entity.setSceneTitle(sceneTitle);
+        entity.setUpdateTime(new Date());
+
+
+
+
+        // 调用算法切图片转换
+        String cmd = ConstantCmd.SLICE_SKYBOX + entity.getPath();
+        log.info("cmd:{}", cmd);
+        CreateObjUtil.callshell(cmd);
+        log.info("算法切片完成");
+
+
+        // 调用算法将obj转txt
+        String objCmd = ConstantCmd.OBJ_TO_TXT + entity.getPath();
+        log.info("objCmd:{}", objCmd);
+        CreateObjUtil.callshell(objCmd);
+        log.info("算法obj转txt完成");
+
+
+        // 转换文件
+        convert(entity.getPath(), sceneCode, sceneTitle);
+        log.info("文件转换完成");
+
+        // 场景url
+        String webSite = SERVER_DOMAIN + "SuperTwo/index.html?m=" + sceneCode;
+        log.info("webSite: {}", webSite);
+
+
+        entity.setWebSite(webSite);
+        sceneService.save(entity);
+
+
+        return Result.success(entity.getWebSite());
+    }
+
+
+    /**
+     * 文件转换
+     * @param sceneCode
+     * @throws Exception
+     */
+    private void convert(String basePath, String sceneCode, String sceneTitle) throws Exception {
+
+        // 将result文件夹的upload.json是否存在,并处理业务逻辑
+        checkUploadJson(basePath);
+
+
+        if(!FileUtil.exist(basePath+"/vision.txt")){
+            log.error("文件不存在: " + basePath+"/vision.txt");
+            Result.failure("文件不存在: " + basePath+"/vision.txt");
+        }
+
+        // 2.vision.txt转vision.modeldata
+        CreateObjUtil.convertTxtToVisionmodeldata(basePath+"/vision.txt", basePath+"/vision.modeldata");
+        log.info("vision.modeldata转换完成");
+
+        // 3. 生成一个空的data2.js, 里面是一个空的json
+        FileUtil.writeUtf8String("{}",basePath+"/data2.js");
+        log.info("data2.js创建完成");
+
+        // 4. 创建someData.json, 修改sid值为场景码目录
+        createSomeData(basePath, sceneCode, sceneTitle);
+
+
+    }
+
+    /**
+     * 检查upload.json文件是否存在,执行业务逻辑
+     */
+    private static void checkUploadJson(String basePath) throws Exception {
+        String uploadJsonPath = basePath + "/results/upload.json";
+//        String uploadJsonPath = "F:\\test\\army\\upload.json";
+        boolean isUploadJsonPath = FileUtil.isFile(uploadJsonPath);
+        if (!isUploadJsonPath) {
+            log.error("算法的upload.json不存在");
+            throw new BaseRuntimeException(5000, "算法的upload.json不存在");
+
+        }
+        // 判断upload.json文件是否都存在
+        String os = FileUtil.readUtf8String(uploadJsonPath);
+        JSONObject imageObject = JSONObject.parseObject(os);
+
+        // json数组
+        JSONArray jsonArray = imageObject.getJSONArray("upload");
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject jsonObject = jsonArray.getJSONObject(i);
+            String fileName = jsonObject.getString("file");
+            String filePath = basePath + "/results/" + fileName;
+
+            boolean isFilePath = FileUtil.isFile(filePath);
+            if (!isFilePath) {
+                log.error("算法的upload.json数据文件:  {}", filePath );
+                throw new BaseRuntimeException(5000, "算法的upload.json数据文件不存在");
+
+            }
+
+            String suffix = StringUtils.substringAfterLast(filePath, ".");
+            // 把图片复制到指定目录(dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high)
+            if ("jpg".equals(suffix)) {
+                FileUtil.copy(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k_texture_jpg_high/" + fileName, true);
+            }
+
+            // 将modeldata.txt转xxx.dam
+            if ("txt".equals(suffix)) {
+                CreateObjUtil.convertTxtToDam(filePath, basePath+"/" + ConstantFileName.modelUUID+"_50k.dam");
+                log.info("dam转换完成");
+
+            }
+
+        }
+    }
+
+    /**
+     * 创建someData.json
+     */
+    private static void createSomeData(String basePath, String sceneCode, String sceneTitle) throws IOException {
+        String path = ResourceUtils.getURL("classpath:").getPath();
+        path = path + "data/someData.json";
+        log.info("path: {}", path);
+        String os = FileUtil.readUtf8String(path);
+        JSONObject jsonObject = JSONObject.parseObject(os);
+        JSONObject model = jsonObject.getJSONObject("model");
+
+
+        // 更新images json
+        JSONArray imagesJson = updateImagesData(sceneCode);
+        model.put("images", imagesJson);
+
+        // 修改sid值
+        model.put("sid", sceneCode);
+        model.put("name", sceneTitle);
+
+        // 更新json
+        jsonObject.put("model", model);
+
+
+        FileUtil.writeUtf8String(jsonObject.toJSONString(), basePath+"/someData.json");
+
+        log.info("someData.json创建完成");
+
+    }
+
+    /**
+     * 创建images.json
+     * 如果数据格式有变动,要作出响应的修改
+     */
+    private static JSONArray updateImagesData(String sceneCode) throws IOException {
+        String resourceUrl = FileUtils.getResourceUrl("data/images.json");
+        String os = FileUtil.readUtf8String(resourceUrl);
+        JSONObject imageObject = JSONObject.parseObject(os);
+        imageObject.put("sid", sceneCode);
+
+        JSONArray imagesArray = new JSONArray();
+        imagesArray.set(0, imageObject);
+
+        return imagesArray;
+    }
+
+
+    @ApiOperation(value = "上传", notes = "编辑场景使用,根据场景码位置上传(应用程序项目、web),自定义上传位置,文件名需要验证中文字符")
+    @PostMapping(value = "upload/{sceneCode}", consumes = {"multipart/form-data"})
+    public Result upload(MultipartFile file , @PathVariable String sceneCode) throws IOException {
+
+        if (file == null) {
+            log.error("文件不能为空");
+            return Result.failure("文件不能为空");
+        }
+
+        SceneEntity entity = sceneService.findBySceneCode(sceneCode);
+        if (entity == null) {
+            log.error("场景不存在: {}", sceneCode);
+            return Result.failure("场景不存在");
+        }
+
+        String fileName = file.getOriginalFilename();
+
+        if (Validator.hasChinese(fileName)) {
+            log.error("文件名不能有中文字符: {}", fileName);
+            return Result.failure("文件名不能有中文字符:" + fileName);
+        }
+
+        String savePath = entity.getPath() + "/edit/" + fileName;
+        FileUtil.writeFromStream(file.getInputStream(), savePath);
+
+        Object urlPath = SERVER_DOMAIN + "data/" + sceneCode + "/edit/" + fileName;
+        log.info("文件写入成功: {}", urlPath);
+
+        // 返回前端数据
+        return Result.success(urlPath);
+
+    }
+
+    /**
+     * 一般运用于新的场景添加热点。跟前端的编辑添加热点有点不一样,功能比较单一
+     * 参数只用:hots、sceneCode
+     * @return
+     */
+    @ApiOperation(value = "编辑热点(应用程序项目部)", notes = "应用程序项目部编辑场景热点")
+    @PostMapping("editHots")
+    public Result editHots(@Valid @RequestBody SceneDataDto param){
+
+        SceneEntity entity = sceneService.findBySceneCode(param.getSceneCode());
+        if (entity == null) {
+            log.error("场景不存在 : {}", param.getSceneCode());
+            return Result.failure("场景不存在");
+        }
+
+        // 处理data2.js
+        String data2Path = entity.getPath() + "/data2.js";
+        boolean file = FileUtil.isFile(data2Path);
+        if (!file) {
+            log.error("data2.js文件不存在");
+            return Result.failure("data2.js文件不存在");
+        }
+
+        String data2 = FileUtil.readUtf8String(data2Path);
+        JSONObject data2Json = JSONObject.parseObject(data2);
+
+        String hots = param.getHots();
+        if (hots != null) {
+            // 获取所有key
+            JSONObject hotJson = JSONObject.parseObject(hots);
+
+            Set<String> strings = hotJson.keySet();
+            for (String key: strings) {
+                JSONObject subJson = hotJson.getJSONObject(key);
+//                String url  = "https://www.4dmodel.com/SuperTwo/hot_online/index.html?m=" + key;
+                String url  = SERVER_DOMAIN + "SuperTwo/hot_online/index.html?m=" + key;
+                // 将link 添加进去
+                subJson.put("link", url);
+            }
+            data2Json.put("hots", hotJson);
+        }
+
+        // 删除旧data2.js
+        FileUtil.del(data2Path);
+        // 写入新data2.js
+        FileUtil.writeUtf8String(data2Json.toJSONString(), data2Path);
+        log.info("新data2.js写入完成");
+
+        //处理data.js 文件
+        editDataJs(entity, hots);
+
+
+        return Result.success();
+    }
+
+
+    /**
+     * 处理data.js 文件
+     */
+    private void editDataJs(SceneEntity entity, String hots )  {
+
+        // 因为data.js只是热点信息,所以直接创建上传oss
+        JSONObject dataJsJson = new JSONObject();
+        if (hots != null) {
+            dataJsJson = JSONObject.parseObject(hots);
+
+            Set<String> strings = dataJsJson.keySet();
+            for (String key: strings) {
+                JSONObject subJson = dataJsJson.getJSONObject(key);
+                JSONObject infoAttribute = subJson.getJSONObject("infoAttribute");
+                if (infoAttribute != null) {
+                    Set<String> infoKey = infoAttribute.keySet();
+
+                    for (String s: infoKey) {
+                        Object val = null;
+                        // 添加到第一层, 空值不添加
+                        if ("images".equals(s) || "styleImg".equals(s) || "model".equals(s) || "video".equals(s) || "iframe".equals(s)) {
+                            JSONArray jsonArray = infoAttribute.getJSONArray(s);
+                            if (jsonArray.size() == 0) {
+                                continue;
+                            }
+                            val = jsonArray;
+
+                        } else {
+                            String a = infoAttribute.getString(s);
+                            if (StringUtils.isBlank(a)){
+                                continue;
+                            }
+                            val = a;
+                        }
+
+
+                        subJson.put(s, val);
+                    }
+
+                }
+
+                // 删除infoAttribute
+                subJson.remove("infoAttribute");
+
+            }
+
+        }
+        String dataPath = entity.getPath() + entity.getSceneCode() + "/hot/js/data.js";
+        FileUtil.writeUtf8String(dataJsJson.toJSONString(), dataPath);
+
+        log.info("新data.js写入完成: {}", dataPath);
+
+
+    }
+
+    @ApiOperation("获取场景码")
+    @GetMapping("getSceneCode")
+    public Result getSceneCode() {
+        String sceneCode = RandomUtils.randowString(9);
+        sceneCode = "ar_" +sceneCode;
+        return Result.success((Object) sceneCode);
+    }
+
+
 
 }

+ 24 - 5
gis_web/src/main/java/com/gis/web/controller/SlideshowController.java

@@ -1,8 +1,10 @@
 package com.gis.web.controller;
 
 import com.gis.common.util.Result;
+import com.gis.domain.dto.AuditDto;
 import com.gis.domain.dto.SlideshowDto;
 import com.gis.domain.dto.SlideshowPageDateDto;
+import com.gis.domain.po.NewsEntity;
 import com.gis.domain.po.SlideshowEntity;
 import com.gis.domain.po.SysUserEntity;
 import com.gis.domain.vo.SlideshowVo;
@@ -103,18 +105,20 @@ public class SlideshowController extends BaseController {
     }
 
 
+
     @WebControllerLog(description = "轮播图管理-审核")
     @ApiOperation("审核")
-    @GetMapping("audit/{id}/{status}")
-    public Result audit(@PathVariable Long id, @PathVariable Integer status) {
-        SlideshowEntity entity = slideshowService.findById(id);
+    @PostMapping("audit")
+    public Result audit(@Valid @RequestBody AuditDto param) {
+        SlideshowEntity entity = slideshowService.findById(param.getId());
         if (entity == null) {
-            log.error("对象id不存在 : {}", id);
+            log.error("对象id不存在 : {}", param.getId());
             return Result.failure("对象id不存在");
         }
 
-        entity.setStatus(status);
+        entity.setStatus(param.getStatus());
         entity.setAuditId(getTokenUserId());
+        entity.setReason(param.getReason());
         slideshowService.update(entity);
         return Result.success();
     }
@@ -146,6 +150,21 @@ public class SlideshowController extends BaseController {
         return Result.success();
     }
 
+    @WebControllerLog(description = "轮播图管理-是否显示")
+    @ApiOperation("是否显示")
+    @GetMapping("display/{id}/{display}")
+    public Result display(@PathVariable Long id, @PathVariable Integer display) {
+        SlideshowEntity entity = slideshowService.findById(id);
+        if (entity == null) {
+            log.error("对象id不存在 : {}", id);
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setDisplay(display);
+        slideshowService.update(entity);
+        return Result.success();
+    }
+
 
 
 }

+ 25 - 5
gis_web/src/main/java/com/gis/web/controller/SpiritController.java

@@ -1,7 +1,9 @@
 package com.gis.web.controller;
 
 import com.gis.common.util.Result;
+import com.gis.domain.dto.AuditDto;
 import com.gis.domain.dto.SpiritPageDateDto;
+import com.gis.domain.po.SlideshowEntity;
 import com.gis.domain.po.SpiritEntity;
 import com.gis.domain.dto.SpiritRequest;
 import com.gis.domain.po.SysUserEntity;
@@ -102,18 +104,20 @@ public class SpiritController extends BaseController {
     }
 
 
+
     @WebControllerLog(description = "特有精神-审核")
     @ApiOperation("审核")
-    @GetMapping("audit/{id}/{status}")
-    public Result audit(@PathVariable Long id, @PathVariable Integer status) {
-        SpiritEntity entity = spiritService.findById(id);
+    @PostMapping("audit")
+    public Result audit(@Valid @RequestBody AuditDto param) {
+        SpiritEntity entity = spiritService.findById(param.getId());
         if (entity == null) {
-            log.error("对象id不存在 : {}", id);
+            log.error("对象id不存在 : {}", param.getId());
             return Result.failure("对象id不存在");
         }
 
-        entity.setStatus(status);
+        entity.setStatus(param.getStatus());
         entity.setAuditId(getTokenUserId());
+        entity.setReason(param.getReason());
         spiritService.update(entity);
         return Result.success();
     }
@@ -130,6 +134,22 @@ public class SpiritController extends BaseController {
         return Result.success(entity);
     }
 
+    @WebControllerLog(description = "特有精神-是否显示")
+    @ApiOperation("是否显示")
+    @GetMapping("display/{id}/{display}")
+    public Result display(@PathVariable Long id, @PathVariable Integer display) {
+        SpiritEntity entity = spiritService.findById(id);
+        if (entity == null) {
+            log.error("对象id不存在 : {}", id);
+            return Result.failure("对象id不存在");
+        }
+
+        entity.setDisplay(display);
+        spiritService.update(entity);
+        return Result.success();
+    }
+
+
 
 
 }

+ 9 - 3
gis_web/src/main/java/com/gis/web/controller/SysUserController.java

@@ -3,11 +3,13 @@ package com.gis.web.controller;
 
 import com.gis.common.util.PasswordUtils;
 import com.gis.common.util.Result;
+import com.gis.domain.dto.UserPageDateDto;
 import com.gis.domain.po.SysUserEntity;
 import com.gis.domain.dto.PageDto;
 import com.gis.domain.dto.PasswordRequest;
 import com.gis.domain.dto.UserDto;
 import com.gis.service.SysUserService;
+import com.gis.web.aop.WebControllerLog;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -45,13 +47,14 @@ public class SysUserController extends BaseController {
     @RequiresRoles(value = {"sys_admin"}, logical = Logical.OR)
     @ApiOperation("用户列表")
     @PostMapping("list")
-    public Result<SysUserEntity> list(@RequestBody PageDto param) {
+    public Result<SysUserEntity> list(@RequestBody UserPageDateDto param) {
         startPage(param);
-        PageInfo<SysUserEntity> page = new PageInfo<>(userService.findAll());
+        PageInfo<SysUserEntity> page = new PageInfo<>(userService.search(param));
         return Result.success(page);
     }
 
-    @RequiresRoles(value = {"sys_admin"}, logical = Logical.OR)
+    @WebControllerLog(description = "用户管理-修改用户")
+//    @RequiresRoles(value = {"sys_admin"}, logical = Logical.OR)
     @ApiOperation("新增/修改用户信息")
     @PostMapping("save")
     public Result save(@Valid @RequestBody UserDto param) {
@@ -93,6 +96,7 @@ public class SysUserController extends BaseController {
         return Result.success(user);
     }
 
+    @WebControllerLog(description = "用户管理-修改密码")
     @ApiOperation("修改密码")
     @PostMapping("updatePwd")
     public Result updatePwd(@Valid @RequestBody PasswordRequest param) {
@@ -112,6 +116,7 @@ public class SysUserController extends BaseController {
         return Result.success();
     }
 
+    @WebControllerLog(description = "用户管理-重置密码")
     @RequiresRoles(value = {"sys_admin"}, logical = Logical.OR)
     @ApiOperation("重置密码")
     @GetMapping("resetPass/{id}")
@@ -129,6 +134,7 @@ public class SysUserController extends BaseController {
         return Result.success();
     }
 
+    @WebControllerLog(description = "用户管理-启用、停用、注销账户")
     @RequiresRoles(value = {"sys_admin"}, logical = Logical.OR)
     @ApiOperation("启用、停用、注销账户")
     @GetMapping("setStatus/{id}/{status}")

+ 115 - 42
gis_web/src/main/java/com/gis/web/controller/WebController.java

@@ -1,9 +1,8 @@
 package com.gis.web.controller;
 
 
-import cn.hutool.core.io.FileUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.gis.common.util.FileUtils;
+import com.gis.common.constant.TypeCode;
+import com.gis.common.util.PasswordUtils;
 import com.gis.common.util.Result;
 import com.gis.domain.dto.*;
 import com.gis.domain.po.*;
@@ -17,14 +16,15 @@ import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
-import org.apache.shiro.authz.annotation.Logical;
-import org.apache.shiro.authz.annotation.RequiresRoles;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
 
 import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -63,6 +63,9 @@ public class WebController extends BaseController {
     @Autowired
     private CommentService commentService;
 
+    @Autowired
+    private SysUserService sysUserService;
+
     @ApiOperation("导航栏")
     @GetMapping("navigation")
     public Result navigation() {
@@ -107,22 +110,25 @@ public class WebController extends BaseController {
     @GetMapping("slideshow")
     public Result slideshow() {
 
-        SlideshowPageDateDto param = new SlideshowPageDateDto();
-        param.setStatus(4);
-        param.setPageSize(10);
-        startPage(param);
-        PageInfo<SlideshowVo> page = new PageInfo<>(slideshowService.search(param, null));
-        return Result.success(page);
+//        SlideshowPageDateDto param = new SlideshowPageDateDto();
+//        param.setStatus(4);
+//        param.setPageSize(10);
+//        startPage(param);
+//        PageInfo<SlideshowVo> page = new PageInfo<>(slideshowService.search(param, null));
+
+        Integer status = 4;
+        Integer display = 1;
+
+        List<SlideshowVo> show = slideshowService.showDisplay(status, display);
+        return Result.success(show);
     }
 
 
     @ApiOperation("史馆动态-新闻")
-    @GetMapping("news")
-    public Result news() {
+    @PostMapping("news")
+    public Result news(@RequestBody NewsPageDateRequest param ) {
 
-        NewsPageDateRequest param = new NewsPageDateRequest();
         param.setStatus(4);
-        param.setPageSize(10);
         param.setType("news");
 
         startPage(param);
@@ -133,12 +139,11 @@ public class WebController extends BaseController {
 
 
     @ApiOperation("史馆动态-公告")
-    @GetMapping("notice")
-    public Result notice() {
+    @PostMapping("notice")
+    public Result notice(NewsPageDateRequest param) {
 
-        NewsPageDateRequest param = new NewsPageDateRequest();
         param.setStatus(4);
-        param.setPageSize(10);
+//        param.setPageSize(10);
         param.setType("notice");
 
         startPage(param);
@@ -166,16 +171,47 @@ public class WebController extends BaseController {
 
 
 
-    @ApiOperation(value = "精品典藏", notes = "type:类型:1:图片, 2:视频,3:模型")
-    @GetMapping("goods/{type}")
-    public Result<GoodsVo> goodsList(@PathVariable Integer type) {
-        GoodsPageDateDto param = new GoodsPageDateDto();
-        param.setType(type);
-        param.setStatus(4);
-        param.setPageSize(5);
+    @ApiOperation(value = "精品典藏")
+    @PostMapping("goods")
+    public Result<WebGoodsVo> goodsList(@Valid @RequestBody GoodsPageDateDto param) {
+
         startPage(param);
+        param.setStatus(4);
+
+        List<WebGoodsVo> result = new ArrayList<>();
+
+        List<GoodsVo> searchs = goodsService.search(param);
+        for (GoodsVo entity : searchs) {
+            String modelType = null;
+            if (entity.getType() == 1) {
+                modelType = TypeCode.MODEL_GOODS_IMG;
+            } else if (entity.getType() == 2) {
+                modelType = TypeCode.MODEL_GOODS_VIDEO;
+            } else if (entity.getType() == 3) {
+                modelType = TypeCode.MODEL_GOODS_MODEL;
+            }
+
+            Condition condition = new Condition(FileEntity.class);
+            condition.and().andEqualTo("fkId", entity.getId());
+            condition.and().andEqualTo("type", modelType);
+            // 只有一条记录是显示的
+            condition.and().andEqualTo("cover", 1);
+            List<FileEntity> fileList  = fileService.findAll(condition);
+
+            WebGoodsVo vo = new WebGoodsVo();
+            if (fileList.size() > 0) {
+                FileEntity fileEntity = fileList.get(0);
+                BeanUtils.copyProperties(entity, vo);
+                vo.setFileName(fileEntity.getFileName());
+                vo.setFileUrl(fileEntity.getUrlPath());
+
+                result.add(vo);
 
-        PageInfo<GoodsVo> page = new PageInfo<>(goodsService.search(param));
+            }
+
+        }
+
+        PageInfo<WebGoodsVo> page = new PageInfo<>(result);
         return Result.success(page);
     }
 
@@ -217,27 +253,64 @@ public class WebController extends BaseController {
 
 
 
+    @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(),"用户注册","新增用户"));
 
-//    public static void main(String[] args) throws IOException {
-//        String resourceUrl = FileUtils.getResourceUrl("data/smokeing.json");
-//
-//        String data = FileUtil.readUtf8String(resourceUrl);
-//
-//        JSONObject jsonObject = JSONObject.parseObject(data);
-//
-//        JSONObject reportedJaon = jsonObject.getJSONObject("reported");
-//        String batteryPower = reportedJaon.getString("batteryPower");
-//        log.info("batteryPower:{}", batteryPower);
-//        String replace = batteryPower.replace("%", "");
-//        Integer power = Integer.valueOf(replace);
-//        System.out.println(power);
-//    }
 
 
+        return Result.success();
+    }
+
+
+    @ApiOperation("找回密码")
+    @PostMapping("resetPassword")
+    public Result resetPassword(@Valid @RequestBody ResetPasswordDto param) {
 
+        SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
 
+        if (entity == null) {
+            log.error("该身份证号不存在: {}", param.getUserName());
+            return Result.failure("信息有误");
+        }
 
+        if (!entity.getRealName().equals(param.getRealName())) {
+            log.error("姓名不一致: {}", param.getRealName());
+            return Result.failure("信息有误");
+        }
 
+        entity.setPassword(PasswordUtils.encrypt(param.getUserName(), "123456", PasswordUtils.getStaticSalt()));
+        entity.setUpdateTime(new Date());
+        sysUserService.save(entity);
+
+        // 保存操作日志
+        saveLog(new LogEntity(entity.getId(),"用户管理","找回密码"));
+
+        Object password = "123456";
+        return Result.success(password);
+    }
 
 
 }

+ 2 - 2
gis_web/src/main/java/com/gis/web/shiro/MyRealm.java

@@ -65,8 +65,8 @@ public class MyRealm extends AuthorizingRealm {
         SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
 
 
-        SysRoleEntity roleEntity = sysRoleService.findUserRoleByUserId(dbUserEntity.getId());
-        Assert.notNull(roleEntity, "用户角色不存在");
+//        SysRoleEntity roleEntity = sysRoleService.findUserRoleByUserId(dbUserEntity.getId());
+//        Assert.notNull(roleEntity, "用户角色不存在");
         // 设置角色、权限
 //        if (dbUserEntity.getSysManager() == 1) {
 //            simpleAuthorizationInfo.addRole("sys_admin");

+ 0 - 7
gis_web/src/main/java/com/gis/web/shiro/ShiroConfig.java

@@ -1,8 +1,5 @@
 package com.gis.web.shiro;
 
-import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.alibaba.fastjson.support.config.FastJsonConfig;
-import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
 import lombok.extern.log4j.Log4j2;
 import org.apache.shiro.mgt.DefaultSessionStorageEvaluator;
 import org.apache.shiro.mgt.DefaultSubjectDAO;
@@ -11,16 +8,12 @@ import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSource
 import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
 import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
 import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
-import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.DependsOn;
-import org.springframework.http.MediaType;
 
 import javax.servlet.Filter;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 @Log4j2

+ 21 - 0
gis_web/src/test/java/com/gis/web/controller/SceneControllerTest.java

@@ -0,0 +1,21 @@
+package com.gis.web.controller;
+
+import cn.hutool.core.lang.Validator;
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.core.util.StrUtil;
+import org.junit.Test;
+
+
+/**
+ * Created by owen on 2020/8/4 0004 18:02
+ */
+public class SceneControllerTest {
+
+    @Test
+    public void testChinese(){
+        String path = "xxxxxxxsssss.jpg";
+        boolean b = Validator.hasChinese(path);
+        System.out.println(b);
+    }
+
+}