Browse Source

修改众测资源的more

git 5 years ago
parent
commit
fd63ff65bb

+ 1 - 1
core/src/main/java/com/mooctest/crowd/domain/domainobject/Resource.java

@@ -21,7 +21,7 @@ public class Resource {
     private String unitWork;
     private String standard;
     private String unit;
-    private String state;
+    private int state;
     private Timestamp startTime;
     private String personnel;
     private String remarks;

+ 1 - 1
core/src/main/java/com/mooctest/crowd/domain/model/ResourcePO.java

@@ -48,7 +48,7 @@ public class ResourcePO {
     private String unit;
 
     @Column(name = "R_STATE")
-    private String state;
+    private int state;
 
     @Column(name = "R_DATE")
     private Timestamp startTime;

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/data/vo/ResourceVO.java

@@ -26,7 +26,7 @@ public class ResourceVO implements Serializable {
     private String unitWork;
     private String standard;
     private String unit;
-    private String state;
+    private int state;
     private Timestamp startTime;
     private String personnel;
     private String remarks;

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/mediator/ViewMediator.java

@@ -100,5 +100,5 @@ public interface ViewMediator {
 
     TechnicalArticlesDTO  updateRanking(long id);
 
-    List<ResourceVO>  getTestResource();
+    List<ResourceVO>  getResource();
 }

+ 14 - 2
site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java

@@ -1003,16 +1003,28 @@ public class WebMediatorImpl implements ViewMediator {
     }
 
     @Override
-    public List<ResourceVO> getTestResource() {
+    public List<ResourceVO> getResource() {
         List<ResourceVO> resourceVOList = new ArrayList<>();
         resourceDao.findAll().forEach(resourcePO -> {
             ResourceVO resourceVO = new ResourceVO();
             resourceVO.setCode(resourcePO.getCode());
+            resourceVO.setName(resourcePO.getName());
             Optional<ResourceTypePO> type = resourceTypeDao.findByCode(resourcePO.getType());
             resourceVO.setType(type.get().getName());
+            resourceVO.setQuantity(resourcePO.getQuantity());
+            resourceVO.setPhotoUrl(resourcePO.getPhotoUrl());
+            resourceVO.setDescription(resourcePO.getDescription());
+            resourceVO.setScene(resourcePO.getScene());
+            resourceVO.setUnitWork(resourcePO.getUnitWork());
+            resourceVO.setStandard(resourcePO.getStandard());
+            resourceVO.setUnit(resourcePO.getUnit());
+            resourceVO.setState(resourcePO.getState());
+            resourceVO.setStartTime(resourcePO.getStartTime());
+            resourceVO.setPersonnel(resourcePO.getPersonnel());
+            resourceVO.setRemarks(resourcePO.getRemarks());
             resourceVOList.add(resourceVO);
         });
-        List<ResourceVO> results = resourceVOList.stream().distinct().collect(Collectors.toList());
+        List<ResourceVO> results=resourceVOList.stream().sorted(Comparator.comparing(ResourceVO::getStartTime).reversed()).collect(Collectors.toList());
         return results;
     }
 

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/service/impl/CommonServiceImpl.java

@@ -109,7 +109,7 @@ public class CommonServiceImpl implements CommonService {
 
     @Override
     public List<ResourceVO> getResource() {
-        List<ResourceVO>  resourceVOList  =viewMediator.getTestResource();
+        List<ResourceVO>  resourceVOList  =viewMediator.getResource();
         return resourceVOList;
     }
 }