Explorar o código

修改了统计文物, 加一个浏览量接口

wuweihao %!s(int64=4) %!d(string=hai) anos
pai
achega
f0b31e7d70

+ 3 - 5
zhoushan-system-api/src/main/java/com/fdage/controller/CollectionController.java

@@ -208,17 +208,15 @@ public class CollectionController {
     }
 
 
-    @RequestMapping("/importCollection")
+    @PostMapping("/importCollection")
     @ResponseBody
-    @ApiOperation("导入文物数据")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "file", value = "文件流", dataType = "String")})
+    @ApiOperation("导入文物Excel")
     public AjaxJson importCollection(@RequestParam("file") MultipartFile file){
         if(file == null){
             return AjaxJson.failure("参数不能为空");
         }
         String fileName = System.currentTimeMillis() + "_" +  file.getOriginalFilename();
-        log.info("导入文物数据地址:" + fileName);
+        log.info("导入文件保存地址:" + fileName);
         boolean flag = FileUtil.upload(file, uploadPath, fileName);
 
         if(!flag){

+ 5 - 5
zhoushan-system-api/src/main/java/com/fdage/controller/InformationController.java

@@ -33,7 +33,7 @@ import java.util.List;
 @Controller
 @RequestMapping("/zhoushan/information")
 @Slf4j
-@Api(tags = "资讯管理模块")
+@Api(tags = "轮播管理模块")
 public class InformationController {
 
     @Autowired
@@ -44,7 +44,7 @@ public class InformationController {
 
     @PostMapping("addInformation")
     @ResponseBody
-    @WebControllerLog(description = "资讯管理-新增资讯")
+    @WebControllerLog(description = "轮播管理-新增资讯")
     @ApiOperation("新增资讯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "name", value = "资讯名称", dataType = "String"),
@@ -72,7 +72,7 @@ public class InformationController {
 
     @PostMapping("updateInformation")
     @ResponseBody
-    @WebControllerLog(description = "资讯管理-修改资讯")
+    @WebControllerLog(description = "轮播管理-修改资讯")
     @ApiOperation("修改资讯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "id", dataType = "String"),
@@ -102,7 +102,7 @@ public class InformationController {
 
     @PostMapping("deleteInformation")
     @ResponseBody
-    @WebControllerLog(description = "资讯管理-删除资讯")
+    @WebControllerLog(description = "轮播管理-删除资讯")
     @ApiOperation("删除资讯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "id", dataType = "String")})
@@ -119,7 +119,7 @@ public class InformationController {
 
     @PostMapping("list")
     @ResponseBody
-    @WebControllerLog(description = "资讯管理-获取资讯列表")
+    @WebControllerLog(description = "轮播管理-获取资讯列表")
     @ApiOperation("获取资讯列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "type", value = "资讯类型,0表示海报,1表示视频", dataType = "String"),

BIN=BIN
zhoushan-system-api/src/main/resources/static/collection/importData.xlsx


+ 3 - 1
zhoushan-system-dao/src/main/resources/mapper/base/TbCollectionMapper.xml

@@ -29,12 +29,13 @@
     <result column="description" jdbcType="LONGVARCHAR" property="description" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, name, type_id, time_id, num, discovery_time, repair_time, venue, pic, unity_pic, unity_url, model_url, content_url,
+    id, name, type_id, time_id, num, dir_code, icon, discovery_time, repair_time, venue, pic, unity_pic, unity_url, model_url, content_url,
     state, create_time, like_num, open_num, search_num, download_num
   </sql>
   <sql id="Blob_Column_List">
     description
   </sql>
+
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
@@ -43,6 +44,7 @@
     from tb_collection
     where id = #{id,jdbcType=BIGINT}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from tb_collection
     where id = #{id,jdbcType=BIGINT}

+ 3 - 2
zhoushan-system-service/src/main/java/com/fdage/service/impl/CollectionServiceImpl.java

@@ -148,7 +148,8 @@ public class CollectionServiceImpl implements ICollectionService {
                 if(i == 0){
                     continue;
                 }
-                if(cellList.size() < 7){
+//                if(cellList.size() < 7){
+                if(cellList.size() < 6){
                     return AjaxJson.failure("导入数据根式不正常");
                 }
                 if(StringUtil.isEmpty(cellList.get(0).toString().trim()) ||
@@ -238,7 +239,7 @@ public class CollectionServiceImpl implements ICollectionService {
         }
 
         // 拦截非法文件
-        List<String> legalSuffix = Arrays.asList("obj","png");
+        List<String> legalSuffix = Arrays.asList("obj","png","ab");
         String originalFilename = file.getOriginalFilename();
         String suffix = StringUtils.substringAfterLast(originalFilename, ".");
         suffix = StringUtils.lowerCase(suffix);