wuweihao před 5 roky
rodič
revize
82919e3777

+ 7 - 0
README.md

@@ -20,4 +20,11 @@
     
     http://192.168.0.44:8100/doc.html
     192.1680.44:8100/test/test.html
+    
+    
+    web-ui:
+    http://192.168.0.44:8100/dist/index.html
+    
+    外网映射:
+    http://face3d.4dage.com:8100/
     

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

@@ -1,4 +1,4 @@
-server.port=8083
+server.port=8100
 
 spring.profiles.active=dev
 

+ 6 - 0
museum_dao/src/main/java/com/museum/dao/DownloadMapper.java

@@ -6,6 +6,7 @@ import com.museum.domain.entity.DownloadEntity;
 import com.museum.domain.request.PageRequest;
 import com.museum.domain.response.DownloadResponse;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.SelectProvider;
 import org.springframework.stereotype.Component;
 
@@ -18,4 +19,9 @@ public interface DownloadMapper extends IBaseMapper<DownloadEntity, Long> {
 
     @SelectProvider(type = DownloadProvider.class, method = "findBySearchKey")
     List<DownloadResponse> search(PageRequest param, Long applyId, Long auditId);
+
+    @Select("select z.id, z.name, z.reason, z.create_time, z.type, u.user_name, z.file_ids, z.status from tb_download z " +
+            "left join tb_user u on z.apply_id = u.id " +
+            "where z.rec_status = 'A' and z.id = #{id}")
+    DownloadResponse rFindById(Long id);
 }

+ 2 - 0
museum_service/src/main/java/com/museum/service/DownloadService.java

@@ -17,4 +17,6 @@ public interface DownloadService extends IBaseService<DownloadEntity, Long> {
 //    List<PartDownloadResponse> search(PageRequest param);
 
     List<DownloadResponse> search(PageRequest param, Long applyId, Long auditId);
+
+    DownloadResponse rFindById(Long id);
 }

+ 3 - 0
museum_service/src/main/java/com/museum/service/UserService.java

@@ -3,6 +3,7 @@ package com.museum.service;
 
 import com.museum.domain.entity.UserEntity;
 import com.museum.domain.request.PageRequest;
+import com.museum.domain.request.UserRequest;
 
 import java.util.List;
 
@@ -19,5 +20,7 @@ public interface UserService extends IBaseService<UserEntity, Long> {
     UserEntity findByPhone(String phone);
 
 
+
+
     List<UserEntity> findBySearchKey(PageRequest param);
 }

+ 5 - 0
museum_service/src/main/java/com/museum/service/impl/DownloadServiceImpl.java

@@ -32,5 +32,10 @@ public class DownloadServiceImpl extends IBaseServiceImpl<DownloadEntity, Long>
     public List<DownloadResponse> search(PageRequest param, Long applyId, Long auditId) {
         return entityMapper.search(param, applyId, auditId);
     }
+
+    @Override
+    public DownloadResponse rFindById(Long id) {
+        return entityMapper.rFindById(id);
+    }
 }
 

+ 3 - 2
museum_web/src/main/java/com/museum/web/controller/DownloadController.java

@@ -94,12 +94,13 @@ public class DownloadController extends BaseController {
     @ApiOperation("详情")
     @GetMapping("detail/{id}")
     public Result detail(@PathVariable Long id) {
-        DownloadEntity entity = downloadService.findById(id);
+//        DownloadEntity entity = downloadService.findById(id);
+        DownloadResponse entity = downloadService.rFindById(id);
         if (entity == null) {
             log.error("对象不存在: {}", id);
             return Result.failure("对象不存在");
         }
-
+//        List<FileEntity> files = fileService.findByIds(entity.getFileIds());
         List<FileEntity> files = fileService.findByIds(entity.getFileIds());
         HashMap<Object, Object> map = new HashMap<>();
         map.put("obj", entity);

+ 3 - 1
museum_web/src/main/java/com/museum/web/controller/PartController.java

@@ -18,6 +18,7 @@ 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.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -111,7 +112,8 @@ public class PartController extends BaseController {
 
         // 查找文件
         String fileIds = entity.getFileIds();
-        List<FileEntity> files  = (fileIds != null) ? fileService.findByIds(fileIds) : new ArrayList<>();
+        // findByIds注意判断空值
+        List<FileEntity> files  = StringUtils.isNotBlank(fileIds) ? fileService.findByIds(fileIds) : new ArrayList<>();
 
         HashMap<String, Object> resultMap = new HashMap<>();
         resultMap.put("part", partResponse);

+ 11 - 2
museum_web/src/main/java/com/museum/web/controller/RoamController.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
 import com.museum.common.util.Result;
 import com.museum.domain.entity.PartEntity;
 import com.museum.domain.entity.RoamEntity;
+import com.museum.domain.entity.TypeEntity;
 import com.museum.domain.request.*;
 import com.museum.domain.response.RoamResponse;
 import com.museum.service.PartService;
@@ -83,14 +84,22 @@ public class RoamController extends BaseController {
 
     @ApiOperation("详情")
     @GetMapping("detail/{id}")
-    public Result<RoamEntity> detail(@PathVariable Long id) {
+    public Result<RoamResponse> detail(@PathVariable Long id) {
         RoamEntity entity = roamService.findById(id);
 
         if (entity == null) {
             log.error("对象不存在: {}", id);
             return Result.failure("对象不存在");
         }
-        return Result.success(entity);
+
+        RoamResponse roamResponse = new RoamResponse();
+        BeanUtils.copyProperties(entity, roamResponse);
+
+        TypeEntity typeEntity = typeService.findById(entity.getTypeId());
+        String typeName = typeEntity != null ? typeEntity.getName() : "";
+        roamResponse.setTypeName(typeName);
+
+        return Result.success(roamResponse);
     }
 
     @WebControllerLog(description = "部件管理-删除")