Browse Source

Merge remote-tracking branch 'origin/dev'

# Conflicts:
#	src/main/java/com/izouma/jmrh/domain/Message.java
#	src/main/java/com/izouma/jmrh/repo/ResourceSupplyAndDemandRepo.java
#	src/main/java/com/izouma/jmrh/service/AuditHistoryService.java
#	src/main/java/com/izouma/jmrh/service/MessageService.java
#	src/main/java/com/izouma/jmrh/service/OrgInfoService.java
#	src/main/java/com/izouma/jmrh/web/AuditHistoryController.java
#	src/main/java/com/izouma/jmrh/web/BaseController.java
#	src/main/java/com/izouma/jmrh/web/MessageController.java
#	src/main/java/com/izouma/jmrh/web/OrgInfoController.java
#	src/main/java/com/izouma/jmrh/web/ResourceSupplyAndDemandController.java
xiongzhu 4 years ago
parent
commit
2f27250056
100 changed files with 3496 additions and 1926 deletions
  1. 28 0
      src/main/java/com/izouma/jmrh/converter/ContactConverter.java
  2. 29 0
      src/main/java/com/izouma/jmrh/converter/JSONObjectConverter.java
  3. 29 0
      src/main/java/com/izouma/jmrh/converter/OrgInfoConverter.java
  4. 0 25
      src/main/java/com/izouma/jmrh/domain/CommunicationRecord.java
  5. 21 0
      src/main/java/com/izouma/jmrh/domain/Contact.java
  6. 28 24
      src/main/java/com/izouma/jmrh/domain/Conversation.java
  7. 0 23
      src/main/java/com/izouma/jmrh/domain/Differ.java
  8. 29 11
      src/main/java/com/izouma/jmrh/domain/DockingRecord.java
  9. 25 30
      src/main/java/com/izouma/jmrh/domain/Message.java
  10. 0 44
      src/main/java/com/izouma/jmrh/domain/NotificationMessage.java
  11. 2 2
      src/main/java/com/izouma/jmrh/domain/OrgInfo.java
  12. 79 0
      src/main/java/com/izouma/jmrh/dto/ConversationDTO.java
  13. 47 0
      src/main/java/com/izouma/jmrh/dto/MessageDTO.java
  14. 15 2
      src/main/java/com/izouma/jmrh/dto/SndDTO.java
  15. 19 0
      src/main/java/com/izouma/jmrh/enums/ConversationType.java
  16. 16 0
      src/main/java/com/izouma/jmrh/enums/DockingRole.java
  17. 18 0
      src/main/java/com/izouma/jmrh/enums/DockingStatus.java
  18. 5 11
      src/main/java/com/izouma/jmrh/enums/MessageType.java
  19. 1 1
      src/main/java/com/izouma/jmrh/repo/CollectRepo.java
  20. 0 13
      src/main/java/com/izouma/jmrh/repo/CommunicationRecordRepo.java
  21. 28 9
      src/main/java/com/izouma/jmrh/repo/ConversationRepo.java
  22. 0 9
      src/main/java/com/izouma/jmrh/repo/DifferRepo.java
  23. 7 3
      src/main/java/com/izouma/jmrh/repo/DockingRecordRepo.java
  24. 29 2
      src/main/java/com/izouma/jmrh/repo/MessageRepo.java
  25. 0 8
      src/main/java/com/izouma/jmrh/repo/NotificationMessageRepo.java
  26. 11 1
      src/main/java/com/izouma/jmrh/repo/ResourceSupplyAndDemandRepo.java
  27. 2 21
      src/main/java/com/izouma/jmrh/security/WebSecurityConfig.java
  28. 12 21
      src/main/java/com/izouma/jmrh/service/AuditHistoryService.java
  29. 17 27
      src/main/java/com/izouma/jmrh/service/CommentService.java
  30. 0 14
      src/main/java/com/izouma/jmrh/service/CommunicationRecordService.java
  31. 142 45
      src/main/java/com/izouma/jmrh/service/ConversationService.java
  32. 7 0
      src/main/java/com/izouma/jmrh/service/DockingRecordService.java
  33. 95 3
      src/main/java/com/izouma/jmrh/service/MessageService.java
  34. 0 14
      src/main/java/com/izouma/jmrh/service/NotificationMessageService.java
  35. 3 12
      src/main/java/com/izouma/jmrh/service/OrgInfoService.java
  36. 3 0
      src/main/java/com/izouma/jmrh/service/PostService.java
  37. 136 34
      src/main/java/com/izouma/jmrh/service/ResourceSupplyAndDemandService.java
  38. 1 1
      src/main/java/com/izouma/jmrh/web/ArticleController.java
  39. 4 6
      src/main/java/com/izouma/jmrh/web/AuditHistoryController.java
  40. 25 272
      src/main/java/com/izouma/jmrh/web/BaseController.java
  41. 3 3
      src/main/java/com/izouma/jmrh/web/CollectController.java
  42. 0 84
      src/main/java/com/izouma/jmrh/web/CommunicationRecordController.java
  43. 29 22
      src/main/java/com/izouma/jmrh/web/ConversationController.java
  44. 3 2
      src/main/java/com/izouma/jmrh/web/DataTypeController.java
  45. 13 25
      src/main/java/com/izouma/jmrh/web/DockingRecordController.java
  46. 44 56
      src/main/java/com/izouma/jmrh/web/MessageController.java
  47. 0 60
      src/main/java/com/izouma/jmrh/web/NotificationMessageController.java
  48. 7 13
      src/main/java/com/izouma/jmrh/web/OrgInfoController.java
  49. 34 115
      src/main/java/com/izouma/jmrh/web/ResourceSupplyAndDemandController.java
  50. 0 185
      src/main/java/com/izouma/jmrh/web/UtilBaseController.java
  51. BIN
      src/main/jmrh/src/assets/top_nav.png
  52. BIN
      src/main/jmrh/src/assets/xiaoxi_icon_xitong.png
  53. 1 1
      src/main/jmrh/src/components/announcement.vue
  54. 4 4
      src/main/jmrh/src/components/enterprise/financingRelease.vue
  55. 12 8
      src/main/jmrh/src/components/enterprise/financingRequire.vue
  56. 1 1
      src/main/jmrh/src/components/enterprise/listSupplyDemand.vue
  57. 4 4
      src/main/jmrh/src/components/enterprise/productRelease.vue
  58. 12 6
      src/main/jmrh/src/components/enterprise/productRequire.vue
  59. 11 5
      src/main/jmrh/src/components/enterprise/techRelease.vue
  60. 16 7
      src/main/jmrh/src/components/enterprise/techRequier.vue
  61. 38 29
      src/main/jmrh/src/components/interact/insert.vue
  62. 8 6
      src/main/jmrh/src/components/interact/official.vue
  63. 11 6
      src/main/jmrh/src/components/interact/problem.vue
  64. 14 13
      src/main/jmrh/src/components/interact/topic.vue
  65. 137 0
      src/main/jmrh/src/components/message/chatInfo.vue
  66. 110 0
      src/main/jmrh/src/components/message/msgPopups.vue
  67. 1 1
      src/main/jmrh/src/components/news/hot.vue
  68. 2 2
      src/main/jmrh/src/components/news/qusetion.vue
  69. 1 1
      src/main/jmrh/src/components/news/topic.vue
  70. 91 23
      src/main/jmrh/src/components/resource/financingRelease.vue
  71. 75 17
      src/main/jmrh/src/components/resource/financingRequire.vue
  72. 83 13
      src/main/jmrh/src/components/resource/productRelease.vue
  73. 63 17
      src/main/jmrh/src/components/resource/productRequire.vue
  74. 16 11
      src/main/jmrh/src/components/resource/recommendToU.vue
  75. 56 14
      src/main/jmrh/src/components/resource/techRelease.vue
  76. 63 18
      src/main/jmrh/src/components/resource/techRequire.vue
  77. 38 7
      src/main/jmrh/src/mixins/pageableTable.js
  78. 2 2
      src/main/jmrh/src/plugins/http.js
  79. 57 6
      src/main/jmrh/src/router/index.js
  80. 126 6
      src/main/jmrh/src/views/Index.vue
  81. 34 1
      src/main/jmrh/src/views/article.vue
  82. 56 21
      src/main/jmrh/src/views/enterprise.vue
  83. 72 30
      src/main/jmrh/src/views/home.vue
  84. 21 13
      src/main/jmrh/src/views/interactDetail.vue
  85. 65 25
      src/main/jmrh/src/views/interactDetail2.vue
  86. 2 2
      src/main/jmrh/src/views/login/attest.vue
  87. 93 0
      src/main/jmrh/src/views/messageCenter/chat.vue
  88. 117 0
      src/main/jmrh/src/views/messageCenter/giveLike.vue
  89. 170 0
      src/main/jmrh/src/views/messageCenter/message.vue
  90. 138 0
      src/main/jmrh/src/views/messageCenter/messageCenter.vue
  91. 120 0
      src/main/jmrh/src/views/messageCenter/messageDetails.vue
  92. 117 0
      src/main/jmrh/src/views/messageCenter/reply.vue
  93. 1 1
      src/main/jmrh/src/views/mine/base.vue
  94. 90 175
      src/main/jmrh/src/views/mine/docking.vue
  95. 3 3
      src/main/jmrh/src/views/mine/editInfo.vue
  96. 2 2
      src/main/jmrh/src/views/mine/editPassword.vue
  97. 66 42
      src/main/jmrh/src/views/mine/interactive.vue
  98. 73 54
      src/main/jmrh/src/views/mine/myCollection.vue
  99. 114 54
      src/main/jmrh/src/views/mine/release.vue
  100. 43 22
      src/main/jmrh/src/views/mine/releaseDetails.vue

+ 28 - 0
src/main/java/com/izouma/jmrh/converter/ContactConverter.java

@@ -0,0 +1,28 @@
+package com.izouma.jmrh.converter;
+
+import com.alibaba.fastjson.JSON;
+import com.izouma.jmrh.domain.Contact;
+import lombok.extern.slf4j.Slf4j;
+
+import javax.persistence.AttributeConverter;
+
+@Slf4j
+public class ContactConverter implements AttributeConverter<Contact, String> {
+    @Override
+    public String convertToDatabaseColumn(Contact contact) {
+        if (contact != null) {
+            return JSON.toJSONString(contact);
+        }
+        return null;
+    }
+
+    @Override
+    public Contact convertToEntityAttribute(String s) {
+        try {
+            return JSON.parseObject(s, Contact.class);
+        } catch (Exception e) {
+            log.error("parse json error", e);
+        }
+        return null;
+    }
+}

+ 29 - 0
src/main/java/com/izouma/jmrh/converter/JSONObjectConverter.java

@@ -0,0 +1,29 @@
+package com.izouma.jmrh.converter;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.izouma.jmrh.domain.Contact;
+import lombok.extern.slf4j.Slf4j;
+
+import javax.persistence.AttributeConverter;
+
+@Slf4j
+public class JSONObjectConverter implements AttributeConverter<JSONObject, String> {
+    @Override
+    public String convertToDatabaseColumn(JSONObject jsonObject) {
+        if (jsonObject != null) {
+            return jsonObject.toJSONString();
+        }
+        return null;
+    }
+
+    @Override
+    public JSONObject convertToEntityAttribute(String s) {
+        try {
+            return JSON.parseObject(s);
+        } catch (Exception e) {
+            log.error("parse json error", e);
+        }
+        return null;
+    }
+}

+ 29 - 0
src/main/java/com/izouma/jmrh/converter/OrgInfoConverter.java

@@ -0,0 +1,29 @@
+package com.izouma.jmrh.converter;
+
+import com.alibaba.fastjson.JSON;
+import com.izouma.jmrh.domain.Contact;
+import com.izouma.jmrh.domain.OrgInfo;
+import lombok.extern.slf4j.Slf4j;
+
+import javax.persistence.AttributeConverter;
+
+@Slf4j
+public class OrgInfoConverter implements AttributeConverter<OrgInfo, String> {
+    @Override
+    public String convertToDatabaseColumn(OrgInfo orgInfo) {
+        if (orgInfo != null) {
+            return JSON.toJSONString(orgInfo);
+        }
+        return null;
+    }
+
+    @Override
+    public OrgInfo convertToEntityAttribute(String s) {
+        try {
+            return JSON.parseObject(s, OrgInfo.class);
+        } catch (Exception e) {
+            log.error("parse json error", e);
+        }
+        return null;
+    }
+}

+ 0 - 25
src/main/java/com/izouma/jmrh/domain/CommunicationRecord.java

@@ -1,25 +0,0 @@
-package com.izouma.jmrh.domain;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.persistence.Entity;
-
-@ApiModel("沟通记录")
-@Entity
-@Data
-public class CommunicationRecord extends BaseEntity {
-
-    @ApiModelProperty("发送人")
-    private Long userId;
-
-    private String nickname;
-
-    private String avatar;
-    
-    @ApiModelProperty("内容")
-    private String content;
-    @ApiModelProperty("对接记录")
-    private Long conversationId;
-}

+ 21 - 0
src/main/java/com/izouma/jmrh/domain/Contact.java

@@ -0,0 +1,21 @@
+package com.izouma.jmrh.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Contact {
+
+    private String orgName;
+
+    private String contactName;
+
+    private String contactPhone;
+
+    private String email;
+}

+ 28 - 24
src/main/java/com/izouma/jmrh/domain/Conversation.java

@@ -1,45 +1,49 @@
 package com.izouma.jmrh.domain;
 
-import com.izouma.jmrh.enums.ConversationStatus;
+import com.izouma.jmrh.converter.ContactConverter;
+import com.izouma.jmrh.enums.ConversationType;
+import com.izouma.jmrh.enums.DockingRole;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import javax.persistence.*;
+import java.time.LocalDateTime;
 
 @Data
 @Entity
-@ApiModel("对接记录")
+@Table(indexes = {@Index(columnList = "sessionId")}, uniqueConstraints = @UniqueConstraint(columnNames = {"userId", "sessionId"}))
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel("对话")
 public class Conversation extends BaseEntity {
 
-    @ApiModelProperty(name = "对接人")
-    private Long conversationUserId;
+    private String sessionId;
 
-    @ApiModelProperty(name = "单位名称")
-    private String orgName;
+    private Long userId;
 
-    @ApiModelProperty(name = "联系人")
-    private String contact;
+    private Long toUserId;
 
-    @ApiModelProperty(name = "联系方式")
-    private String phone;
+    private Long orgId;
 
-    @ApiModelProperty(name = "对接描述")
-    private String description;
+    @Column(columnDefinition = "TEXT")
+    @Convert(converter = ContactConverter.class)
+    private Contact contact;
 
-    @ApiModelProperty("对接状态")
-    @Enumerated(EnumType.STRING)
-    private ConversationStatus status;
-
-    @ApiModelProperty("对接人可见")
-    private boolean publisherVisible;
+//    @ManyToOne(fetch = FetchType.LAZY)
+//    @JoinColumn(name = "orgId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+//    @NotFound(action = NotFoundAction.IGNORE)
+//    private OrgInfo orgInfo;
 
-    @ApiModelProperty("对发布者可见")
-    private boolean userVisible;
+    @Enumerated(EnumType.STRING)
+    @ApiModelProperty("对话类型")
+    private ConversationType type;
 
-    @ApiModelProperty("资源供需")
-    @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "resourceSupplyAndDemandId")
-    private ResourceSupplyAndDemand resourceSupplyDemand;
+    private LocalDateTime lastUpdate;
 
+    private String lastMessage;
 }

+ 0 - 23
src/main/java/com/izouma/jmrh/domain/Differ.java

@@ -1,23 +0,0 @@
-package com.izouma.jmrh.domain;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.persistence.*;
-@Data
-@Entity
-@ApiModel("点赞(差)")
-public class Differ {
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private Long id;
-
-    @ApiModelProperty(name = "点赞人" )
-    @OneToOne
-    @JoinColumn(name = "userId")
-    private User user;
-
-    @ApiModelProperty(name = "评论" )
-    private Long commentId;
-}

+ 29 - 11
src/main/java/com/izouma/jmrh/domain/DockingRecord.java

@@ -1,21 +1,39 @@
 package com.izouma.jmrh.domain;
 
+import com.izouma.jmrh.converter.ContactConverter;
+import com.izouma.jmrh.enums.DockingRole;
+import com.izouma.jmrh.enums.DockingStatus;
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import javax.persistence.*;
 
 @Data
 @Entity
-@ApiModel("对接沟通记录")
-public class DockingRecord extends BaseEntity{
-    @OneToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "userId")
-    @ApiModelProperty("发送人")
-    private User user;
-    @ApiModelProperty("内容")
-    private String content;
-    @ApiModelProperty("消息Id")
-    private Long dockingRecordId;
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel("对接记录")
+public class DockingRecord extends BaseEntity {
+
+    private Long userId;
+
+    private Long orgId;
+
+    private Long sndId;
+
+    private Long conversationId;
+
+    @Column(columnDefinition = "TEXT")
+    @Convert(converter = ContactConverter.class)
+    private Contact contact;
+
+    @Enumerated(EnumType.STRING)
+    private DockingStatus status;
+
+    @Enumerated(EnumType.STRING)
+    private DockingRole role;
 }

+ 25 - 30
src/main/java/com/izouma/jmrh/domain/Message.java

@@ -1,47 +1,42 @@
 package com.izouma.jmrh.domain;
 
-import io.swagger.annotations.ApiModelProperty;
+import javax.persistence.*;
+
+import com.izouma.jmrh.enums.MessageType;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.NoArgsConstructor;
 
-import javax.persistence.*;
 import java.util.List;
 
-
-@Entity
 @Data
+@Entity
+@Table(indexes = {@Index(columnList = "sessionId")})
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel("对接记录")
 public class Message extends BaseEntity {
-    @ApiModelProperty(name = "对接人")
-    @Transient
-    private Long userId;
-    @OneToOne
-    @JoinColumn(name = "userId")
-    private User user;
 
-    @ApiModelProperty(name = "发布人")
-    @OneToOne
-    @JoinColumn(name = "myUserId")
-    private User myUser;
-    
+    private Long userId;
 
-    @ApiModelProperty(name = "单位名称")
-    private String orgName;
+    private Long toUserId;
 
-    @ApiModelProperty(name = "联系人")
-    private String userName;
+    private String sessionId;
 
-    @ApiModelProperty(name = "联系方式")
-    private String userPhone;
+    @Column(columnDefinition = "TEXT")
+    private String content;
 
-    @ApiModelProperty(name = "对接描述")
-    private String description;
+    @Enumerated(EnumType.STRING)
+    private MessageType type;
 
-    @ApiModelProperty(name = "状态")
-    private Long state;
+    @Column(name = "is_read")
+    private boolean read;
 
-    @ApiModelProperty(name = "判断,对接记录被(1发布人,2对接人,0未删除)删除")
-    private Long onExist = 0L;
+    private Long commentId;
 
-    @OneToMany
-    @JoinColumn(name = "dockingRecordId")
-    List<DockingRecord> recordList;
+    private Long postId;
 }

+ 0 - 44
src/main/java/com/izouma/jmrh/domain/NotificationMessage.java

@@ -1,44 +0,0 @@
-package com.izouma.jmrh.domain;
-
-import com.izouma.jmrh.enums.MessageType;
-import com.izouma.jmrh.enums.Reading;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-
-@Data
-@Entity
-@ApiModel("通知消息")
-public class NotificationMessage extends BaseEntity {
-    Long conversationId;
-
-    @ApiModelProperty("接收人")
-    private Long recipientId;
-
-    @ApiModelProperty("标题")
-    private String name;
-
-    @ApiModelProperty("发送人")
-    private Long senderId;
-
-    @ApiModelProperty("发送人名称")
-    private String senderName;
-
-    @ApiModelProperty("发送人头像")
-    private String senderAvatar;
-
-    @ApiModelProperty("内容")
-    private String content;
-
-    @ApiModelProperty("是否阅读")
-    @Enumerated(EnumType.STRING)
-    private Reading reading;
-
-    @ApiModelProperty("消息类型")
-    @Enumerated(EnumType.STRING)
-    private MessageType messageType;
-}

+ 2 - 2
src/main/java/com/izouma/jmrh/domain/OrgInfo.java

@@ -44,8 +44,8 @@ public class OrgInfo extends BaseEntity {
     @ApiModelProperty("企业介绍")
     private String intro;
 
-    @ApiModelProperty("企业LOGE")
-    private String loge;
+    @ApiModelProperty("企业logo")
+    private String logo;
 
     @ApiModelProperty("营业执照")
     private String license;

+ 79 - 0
src/main/java/com/izouma/jmrh/dto/ConversationDTO.java

@@ -0,0 +1,79 @@
+package com.izouma.jmrh.dto;
+
+import com.izouma.jmrh.domain.Contact;
+import com.izouma.jmrh.domain.Conversation;
+import com.izouma.jmrh.domain.OrgInfo;
+import com.izouma.jmrh.domain.User;
+import com.izouma.jmrh.enums.ConversationType;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import java.time.LocalDateTime;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class ConversationDTO {
+    private Long id;
+
+    private String sessionId;
+
+    private Long userId;
+
+    private Long toUserId;
+
+    private Long orgId;
+
+    private Contact contact;
+
+    private ConversationType type;
+
+    private LocalDateTime lastUpdate;
+
+    private String lastMessage;
+
+    private OrgInfo orgInfo;
+
+    private String title;
+
+    private String icon;
+
+    private long unread;
+
+    public ConversationDTO(Conversation conversation, long unread, OrgInfo orgInfo, User to) {
+        BeanUtils.copyProperties(conversation, this);
+        this.unread = unread;
+        this.orgInfo = orgInfo;
+        switch (type) {
+            case DOCKING:
+                title = orgInfo.getOrgName();
+                icon = StringUtils.isEmpty(orgInfo.getLogo())
+                        ? "https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/image/2021-03-04-17-34-09WoHLRdSP.png"
+                        : orgInfo.getLogo();
+                break;
+            case PUBLISH:
+                title = to.getNickname();
+                icon = to.getAvatar();
+                break;
+            case SYS:
+                title = "系统消息";
+                icon = "https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/application/icon/conversation_icon_sys.png";
+                break;
+            case LIKE:
+                title = "点赞";
+                icon = "https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/application/icon/conversation_icon_like.png";
+                break;
+            case COMMENT:
+                title = "回复";
+                icon = "https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/application/icon/conversation_icon_comment.png";
+                break;
+        }
+    }
+}

+ 47 - 0
src/main/java/com/izouma/jmrh/dto/MessageDTO.java

@@ -0,0 +1,47 @@
+package com.izouma.jmrh.dto;
+
+import com.izouma.jmrh.domain.Comment;
+import com.izouma.jmrh.domain.Message;
+import com.izouma.jmrh.domain.Post;
+import com.izouma.jmrh.enums.MessageType;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import java.time.LocalDateTime;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MessageDTO {
+    private Long id;
+
+    private Long userId;
+
+    private Long toUserId;
+
+    private String sessionId;
+
+    private String content;
+
+    private MessageType type;
+
+    private boolean read;
+
+    private Long commentId;
+
+    private Long postId;
+
+    private LocalDateTime createdAt;
+
+    private Post post;
+
+    private Comment comment;
+
+    public MessageDTO(Message message, Post post, Comment comment) {
+        BeanUtils.copyProperties(message, this);
+        this.post = post;
+        this.comment = comment;
+    }
+}

+ 15 - 2
src/main/java/com/izouma/jmrh/dto/SndDTO.java

@@ -1,14 +1,18 @@
 package com.izouma.jmrh.dto;
 
+import com.izouma.jmrh.domain.DockingRecord;
 import com.izouma.jmrh.domain.OrgInfo;
 import com.izouma.jmrh.domain.ResSnDProperty;
+import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
 import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.enums.ConversationStatus;
+import com.izouma.jmrh.enums.DockingStatus;
 import com.izouma.jmrh.enums.ResSnDType;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
 
 import java.time.LocalDateTime;
 import java.util.List;
@@ -18,7 +22,7 @@ import java.util.List;
 @NoArgsConstructor
 @Builder
 public class SndDTO {
-    private Long   id;
+    private Long id;
 
     private String name;
 
@@ -50,5 +54,14 @@ public class SndDTO {
 
     private Integer count;
 
-    private ConversationStatus conversationStatus;
+    private DockingStatus dockingStatus;
+
+    private Long conversationId;
+
+    public SndDTO(ResourceSupplyAndDemand snd, DockingRecord dockingRecord) {
+        BeanUtils.copyProperties(snd, this);
+        if (dockingRecord != null) {
+            dockingStatus = dockingRecord.getStatus();
+        }
+    }
 }

+ 19 - 0
src/main/java/com/izouma/jmrh/enums/ConversationType.java

@@ -0,0 +1,19 @@
+package com.izouma.jmrh.enums;
+
+public enum ConversationType {
+    PUBLISH("发布方"),
+    DOCKING("对接方"),
+    SYS("系统消息"),
+    LIKE("点赞"),
+    COMMENT("回复");
+
+    private final String description;
+
+    ConversationType(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 16 - 0
src/main/java/com/izouma/jmrh/enums/DockingRole.java

@@ -0,0 +1,16 @@
+package com.izouma.jmrh.enums;
+
+public enum DockingRole {
+    PUBLISH("发布方"),
+    DOCKING("对接方");
+
+    private final String description;
+
+    DockingRole(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 18 - 0
src/main/java/com/izouma/jmrh/enums/DockingStatus.java

@@ -0,0 +1,18 @@
+package com.izouma.jmrh.enums;
+
+public enum DockingStatus {
+    PENDING("等待对接"),
+    IN_PROGRESS("正在对接"),
+    SUCCESS("对接成功"),
+    FAIL("对接失败");
+
+    private final String description;
+
+    DockingStatus(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 5 - 11
src/main/java/com/izouma/jmrh/enums/MessageType.java

@@ -1,25 +1,19 @@
 package com.izouma.jmrh.enums;
 
 public enum MessageType {
-    SYSTEM_MESSAGE("系统消息", "SYSTEM_MESSAGE"),
-    CONVERSATION_MESSAGE("对接消息", "CONVERSATION_MESSAGE"),
-    COMMENT_MESSAGE("评论消息", "COMMENT_MESSAGE"),
-    LIKE_RECORD_MESSAGE("点赞消息", "LIKE_RECORD_MESSAGE");
+    TEXT("文本"),
+    SND("供需信息"),
+    LIKE("点赞"),
+    COMMENT("回复");
 
     private final String description;
-    private String name;
 
-    MessageType(String description, String name) {
+    MessageType(String description) {
         this.description = description;
-        this.name = name;
     }
 
     public String getDescription() {
         return description;
     }
-
-    public String getName() {
-        return name;
-    }
 }
 

+ 1 - 1
src/main/java/com/izouma/jmrh/repo/CollectRepo.java

@@ -15,7 +15,7 @@ public interface CollectRepo extends JpaRepository<Collect, Long>, JpaSpecificat
 
     @Modifying
     @Transactional
-    void deleteAllByUserIdAndSndId(Long userId, Iterable<Long> ids);
+    void deleteAllByUserIdAndSndIdIn(Long userId, Iterable<Long> ids);
 
     Collect findByUserIdAndSndId(Long userId, Long sndId);
 }

+ 0 - 13
src/main/java/com/izouma/jmrh/repo/CommunicationRecordRepo.java

@@ -1,13 +0,0 @@
-package com.izouma.jmrh.repo;
-
-import com.izouma.jmrh.domain.CommunicationRecord;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-import java.util.List;
-
-public interface CommunicationRecordRepo extends JpaRepository<CommunicationRecord, Long>, JpaSpecificationExecutor<CommunicationRecord> {
-    List<CommunicationRecord> findByConversationId(Long conversationId);
-
-    List<CommunicationRecord> findByConversationIdAndUserId(Long conversationId, Long userId);
-}

+ 28 - 9
src/main/java/com/izouma/jmrh/repo/ConversationRepo.java

@@ -2,14 +2,19 @@ package com.izouma.jmrh.repo;
 
 import com.izouma.jmrh.domain.Conversation;
 import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
+import com.izouma.jmrh.dto.ConversationDTO;
 import com.izouma.jmrh.enums.ConversationStatus;
+import com.izouma.jmrh.enums.DockingRole;
+import com.izouma.jmrh.enums.Exist;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Optional;
 
 public interface ConversationRepo extends JpaRepository<Conversation, Long>, JpaSpecificationExecutor<Conversation> {
     @Transactional
@@ -17,14 +22,28 @@ public interface ConversationRepo extends JpaRepository<Conversation, Long>, Jpa
     @Query(value = "update conversation set status = :#{#conversationStatus.name} where id =:#{#id}", nativeQuery = true)
     Integer updateStatus(ConversationStatus conversationStatus, Long id);
 
-    List<Conversation> findByResourceSupplyDemandAndUserVisible(ResourceSupplyAndDemand resourceSupplyDemand, boolean userVisible);
-
-    List<Conversation> findByResourceSupplyDemandAndPublisherVisible(ResourceSupplyAndDemand resourceSupplyDemand, boolean publisherVisible);
-
-    Conversation findByResourceSupplyDemandAndConversationUserId(ResourceSupplyAndDemand resourceSupplyDemand, Long conversationUserId);
-
-    Conversation findByResourceSupplyDemandAndPublisherVisibleAndConversationUserId(ResourceSupplyAndDemand resourceSupplyDemand, boolean publisherVisible, Long conversationUserId);
-
-    Conversation findByResourceSupplyDemandAndUserVisibleAndConversationUserId(ResourceSupplyAndDemand resourceSupplyDemand, boolean userVisible, Long conversationUserId);
+    Conversation findFirstByUserIdAndToUserIdOrderByIdDesc(Long userId, Long toUserId);
 
+    @Transactional
+    @Modifying
+    @Query("update Conversation c set c.lastUpdate = ?2, c.lastMessage = ?3 where c.sessionId = ?1")
+    void updateConversation(String sessionId, LocalDateTime time, String lastMessage);
+
+    List<Conversation> findByUserIdOrderByLastUpdateDesc(Long userId);
+
+    @Query("select new com.izouma.jmrh.dto.ConversationDTO(c, count(m.id), o, u2) from Conversation c " +
+            "left join Message m on m.sessionId = c.sessionId and m.toUserId = ?1 and m.read = false " +
+            "left join OrgInfo o on c.orgId = o.id " +
+            "left join User u2 on c.toUserId = u2.id " +
+            "where c.userId = ?1 " +
+            "group by c.id order by c.lastUpdate desc")
+    List<ConversationDTO> my(Long userId);
+
+    @Query("select new com.izouma.jmrh.dto.ConversationDTO(c, count(m.id), o, u2) from Conversation c " +
+            "left join Message m on m.sessionId = c.sessionId and m.toUserId = ?1 and m.read = false " +
+            "left join OrgInfo o on c.orgId = o.id " +
+            "left join User u2 on c.toUserId = u2.id " +
+            "where c.id = ?1 " +
+            "group by c.id")
+    Optional<ConversationDTO> get(Long id);
 }

+ 0 - 9
src/main/java/com/izouma/jmrh/repo/DifferRepo.java

@@ -1,9 +0,0 @@
-package com.izouma.jmrh.repo;
-
-import com.izouma.jmrh.domain.Differ;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-public interface DifferRepo extends JpaRepository<Differ, Long>, JpaSpecificationExecutor<Differ> {
-    Differ findByCommentIdAndUserId(Long commentId,Long userId);
-}

+ 7 - 3
src/main/java/com/izouma/jmrh/repo/DockingRecordRepo.java

@@ -1,12 +1,16 @@
 package com.izouma.jmrh.repo;
 
 import com.izouma.jmrh.domain.DockingRecord;
-import com.izouma.jmrh.domain.User;
+import com.izouma.jmrh.enums.DockingRole;
+import com.izouma.jmrh.enums.DockingStatus;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
-import java.util.List;
 
 public interface DockingRecordRepo extends JpaRepository<DockingRecord, Long>, JpaSpecificationExecutor<DockingRecord> {
-List<DockingRecord> findDockingRecordByUserAndDockingRecordId(User user, Long id);
+    DockingRecord findFirstByUserIdAndSndIdAndRoleAndStatusInOrderByIdDesc(Long userId, Long sndId, DockingRole role, Iterable<DockingStatus> status);
+
+    DockingRecord findFirstByUserIdAndSndIdAndRoleOrderByIdDesc(Long userId, Long sndId, DockingRole role);
+
+    DockingRecord findFirstByUserIdAndSndIdAndStatusInOrderByIdDesc(Long userId, Long sndId, Iterable<DockingStatus> status);
 }

+ 29 - 2
src/main/java/com/izouma/jmrh/repo/MessageRepo.java

@@ -1,7 +1,10 @@
 package com.izouma.jmrh.repo;
 
 import com.izouma.jmrh.domain.Message;
-import org.springframework.data.annotation.Transient;
+import com.izouma.jmrh.dto.MessageDTO;
+import com.izouma.jmrh.enums.MessageType;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
@@ -12,6 +15,30 @@ import javax.transaction.Transactional;
 public interface MessageRepo extends JpaRepository<Message, Long>, JpaSpecificationExecutor<Message> {
     @Transactional
     @Modifying
-    @Query(value = "update message set state = :#{#message.state} where id =:#{#message.id}",nativeQuery = true)
+    @Query(value = "update message set state = :#{#message.state} where id =:#{#message.id}", nativeQuery = true)
     Integer updateStatus(Message message);
+
+    @Transactional
+    @Modifying
+    @Query("update Message m set m.read = true where m.sessionId = ?1 and m.toUserId = ?2")
+    void readAll(String sessionId, Long toUserId);
+
+    @Transactional
+    @Modifying
+    @Query("update Message m set m.read = true where m.toUserId = ?1")
+    void readAll(Long toUserId);
+
+    @Query("select new com.izouma.jmrh.dto.MessageDTO(m, p, c) from Message m " +
+            "left join Post p on m.postId = p.id " +
+            "left join Comment c on m.commentId = c.id " +
+            "where m.sessionId = ?1 and m.type = ?2 order by m.createdAt desc")
+    Page<MessageDTO> all(String sessionId, MessageType type, Pageable pageable);
+
+    @Query("select new com.izouma.jmrh.dto.MessageDTO(m, p, c) from Message m " +
+            "left join Post p on m.postId = p.id " +
+            "left join Comment c on m.commentId = c.id " +
+            "where m.sessionId = ?1 order by m.createdAt desc")
+    Page<MessageDTO> all(String sessionId, Pageable pageable);
+
+    long countByToUserIdAndReadFalse(Long toUserId);
 }

+ 0 - 8
src/main/java/com/izouma/jmrh/repo/NotificationMessageRepo.java

@@ -1,8 +0,0 @@
-package com.izouma.jmrh.repo;
-
-import com.izouma.jmrh.domain.NotificationMessage;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-public interface NotificationMessageRepo extends JpaRepository<NotificationMessage, Long>, JpaSpecificationExecutor<NotificationMessage> {
-}

+ 11 - 1
src/main/java/com/izouma/jmrh/repo/ResourceSupplyAndDemandRepo.java

@@ -1,6 +1,8 @@
 package com.izouma.jmrh.repo;
 
 import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
+import com.izouma.jmrh.dto.SndDTO;
+import com.izouma.jmrh.enums.DockingRole;
 import com.izouma.jmrh.enums.ResSnDType;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
@@ -33,5 +35,13 @@ public interface ResourceSupplyAndDemandRepo extends JpaRepository<ResourceSuppl
     @Query("select r from ResourceSupplyAndDemand r join Collect c on c.sndId = r.id where c.userId = ?1")
     Page<ResourceSupplyAndDemand> myCollect(Long userId, Pageable pageable);
 
-    long countByAndOrgIdAndType(Long orgId, ResSnDType resSnDType);
+    @Query("select new com.izouma.jmrh.dto.SndDTO(s, d) from DockingRecord d " +
+            "join ResourceSupplyAndDemand s on d.sndId = s.id " +
+            "where d.userId = ?1 and d.role = ?2 group by s.id order by d.createdAt desc")
+    Page<SndDTO> myDockingSnd(Long userId, DockingRole role, Pageable pageable);
+
+    @Query("select new com.izouma.jmrh.dto.SndDTO(s, d) from DockingRecord d " +
+            "join ResourceSupplyAndDemand s on d.sndId = s.id " +
+            "where d.userId = ?1 and d.role = ?2 and s.type in ?3 group by s.id order by d.createdAt desc")
+    Page<SndDTO> myDockingSnd(Long userId, DockingRole role, Iterable<ResSnDType> types, Pageable pageable);
 }

+ 2 - 21
src/main/java/com/izouma/jmrh/security/WebSecurityConfig.java

@@ -84,27 +84,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/user/updatePassWordTo").permitAll()
                 .antMatchers("/user/updatePhone").permitAll()
                 .antMatchers("/product/count").permitAll()
-                .antMatchers("/requirement/count").permitAll()
-                .antMatchers("/requirement/all").permitAll()
-                .antMatchers("/requirement/get/*").permitAll()
-                .antMatchers("/productNeed/all").permitAll()
-                .antMatchers("/productNeed/get/*").permitAll()
-                .antMatchers("/requirement/all").permitAll()
-                .antMatchers("/requirement/get/*").permitAll()
-                .antMatchers("/financingNeeds/all").permitAll()
-                .antMatchers("/financingNeeds/get/*").permitAll()
-                .antMatchers("/product/all").permitAll()
-                .antMatchers("/product/get/*").permitAll()
-                .antMatchers("/artProduct/all").permitAll()
-                .antMatchers("/artProduct/get/*").permitAll()
-                .antMatchers("/tresource/all").permitAll()
-                .antMatchers("/tresource/get/*").permitAll()
-                .antMatchers("/productNeed/all").permitAll()
-                .antMatchers("/productNeed/get/*").permitAll()
-                .antMatchers("/question/**").permitAll()
-                .antMatchers("/topic/**").permitAll()
-                .antMatchers("/resourceSupplyAndDemand/all/*").permitAll()
-                .antMatchers("/resourceSupplyAndDemand/getMyAll/*").permitAll()
+                .antMatchers("/resourceSupplyAndDemand/all").permitAll()
+                .antMatchers("/resourceSupplyAndDemand/allDTO").permitAll()
                 .antMatchers("/dataType/**").permitAll()
                 .antMatchers("/orgInfo/save").permitAll()
                 .antMatchers("/orgInfo/getAllCount/*").permitAll()

+ 12 - 21
src/main/java/com/izouma/jmrh/service/AuditHistoryService.java

@@ -5,7 +5,6 @@ import com.izouma.jmrh.enums.MessageType;
 import com.izouma.jmrh.enums.Reading;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.*;
-import com.izouma.jmrh.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -13,45 +12,37 @@ import org.springframework.stereotype.Service;
 @AllArgsConstructor
 public class AuditHistoryService {
 
-    private ArticleRepo articleRepo;
-    private OrgInfoRepo orgInfoRepo;
+    private ArticleRepo                 articleRepo;
+    private OrgInfoRepo                 orgInfoRepo;
     private ResourceSupplyAndDemandRepo resourceSupplyAndDemandRepo;
-    private PostRepo postRepo;
-    private NotificationMessageRepo notificationMessageRepo;
+    private PostRepo                    postRepo;
 
 
     public AuditHistory updateState(AuditHistory auditHistory) {
-        NotificationMessage message = new NotificationMessage();
-        message.setMessageType(MessageType.SYSTEM_MESSAGE);
-        String content = new String();
         User user = new User();
         if (auditHistory.getArticle() != null) {
             articleRepo.updateStateById(auditHistory.getArticle());
         } else if (auditHistory.getOrgInfo() != null) {
-            OrgInfo orgInfo = orgInfoRepo.findById(auditHistory.getOrgInfo().getId()).orElseThrow(new BusinessException("无记录"));
+            OrgInfo orgInfo = orgInfoRepo.findById(auditHistory.getOrgInfo().getId())
+                    .orElseThrow(new BusinessException("无记录"));
             auditHistory.setTitle(orgInfo.getOrgName());
             user.setId(orgInfo.getUserId());
-
-            content = orgInfo.getOrgName();
+            auditHistory.setMyUser(user);
             orgInfoRepo.updateStateById(auditHistory.getOrgInfo());
         } else if (auditHistory.getResourceSupplyAndDemand() != null) {
-            ResourceSupplyAndDemand resourceSupplyAndDemand = resourceSupplyAndDemandRepo.findById(auditHistory.getResourceSupplyAndDemand().getId()).orElseThrow(new BusinessException("无记录"));
-            content = resourceSupplyAndDemand.getName();
+            ResourceSupplyAndDemand resourceSupplyAndDemand = resourceSupplyAndDemandRepo
+                    .findById(auditHistory.getResourceSupplyAndDemand().getId())
+                    .orElseThrow(new BusinessException("无记录"));
             user.setId(resourceSupplyAndDemand.getPublishersId());
-
+            auditHistory.setMyUser(user);
             resourceSupplyAndDemandRepo.updateStatusById(auditHistory.getResourceSupplyAndDemand());
         } else if (auditHistory.getPost() != null) {
             Post post = postRepo.findById(auditHistory.getPost().getId()).orElseThrow(new BusinessException("无记录"));
-            content = post.getTitle();
             user.setId(post.getUserId());
+            auditHistory.setMyUser(user);
             post.setStatus(auditHistory.getPost().getStatus());
             postRepo.save(post);
         }
-        message.setRecipientId(user.getId());
-        message.setSenderId(SecurityUtils.getAuthenticatedUser().getId());
-        message.setContent(content);
-        message.setReading(Reading.UN_READ);
-        notificationMessageRepo.save(message);
         return auditHistory;
     }
-}
+}

+ 17 - 27
src/main/java/com/izouma/jmrh/service/CommentService.java

@@ -3,12 +3,13 @@ package com.izouma.jmrh.service;
 import com.izouma.jmrh.domain.*;
 import com.izouma.jmrh.dto.CommentDTO;
 import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.enums.MessageType;
 import com.izouma.jmrh.enums.OrgStatus;
 import com.izouma.jmrh.enums.PostType;
-import com.izouma.jmrh.enums.Reading;
 import com.izouma.jmrh.exception.BusinessException;
-import com.izouma.jmrh.repo.*;
+import com.izouma.jmrh.repo.CommentRepo;
+import com.izouma.jmrh.repo.LikeRecordRepo;
+import com.izouma.jmrh.repo.PostRepo;
+import com.izouma.jmrh.repo.UserRepo;
 import com.izouma.jmrh.security.Authority;
 import com.izouma.jmrh.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
@@ -28,11 +29,11 @@ import static com.izouma.jmrh.web.BaseController.toSpecification;
 @AllArgsConstructor
 public class CommentService {
 
-    private CommentRepo commentRepo;
-    private PostRepo postRepo;
+    private CommentRepo    commentRepo;
+    private PostRepo       postRepo;
     private LikeRecordRepo likeRecordRepo;
-    private UserRepo userRepo;
-    private NotificationMessageRepo notificationMessageRepo;
+    private UserRepo       userRepo;
+    private MessageService messageService;
 
     public Comment create(Comment record) {
         Post post = postRepo.findById(record.getPostId()).orElseThrow(new BusinessException("帖子不存在"));
@@ -53,18 +54,13 @@ public class CommentService {
         post.setCommentNum(post.getCommentNum() + 1);
         postRepo.save(post);
         record.setUserId(SecurityUtils.getAuthenticatedUser().getId());
-        NotificationMessage notificationMessage = new NotificationMessage();
-        notificationMessage.setMessageType(MessageType.COMMENT_MESSAGE);
-        notificationMessage.setReading(Reading.UN_READ);
-        notificationMessage.setSenderId(SecurityUtils.getAuthenticatedUser().getId());
-        notificationMessage.setSenderName(SecurityUtils.getAuthenticatedUser().getNickname());
-        notificationMessage.setSenderAvatar(SecurityUtils.getAuthenticatedUser().getAvatar());
-        notificationMessage.setRecipientId(post.getUserId());
-        notificationMessage.setName(post.getTitle());
-        notificationMessage.setContent(record.getContent());
-        notificationMessageRepo.save(notificationMessage);
-        return commentRepo.save(record);
+        record = commentRepo.save(record);
 
+        if (!post.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
+            messageService.sendCommentMsg(SecurityUtils.getAuthenticatedUser().getId(), post.getUserId(), record, post);
+        }
+
+        return record;
     }
 
     public void del(Long id) {
@@ -83,6 +79,7 @@ public class CommentService {
 
     public void like(Long commentId, boolean dislike) {
         Comment comment = commentRepo.findById(commentId).orElseThrow(new BusinessException("无记录"));
+        Post post = postRepo.findById(comment.getPostId()).orElseThrow(new BusinessException("无记录"));
         LikeRecord likeRecord = likeRecordRepo
                 .findByCommentIdAndUserId(commentId, SecurityUtils.getAuthenticatedUser().getId());
         if (likeRecord == null) {
@@ -96,6 +93,8 @@ public class CommentService {
                 comment.setDislikeNum(comment.getDislikeNum() + 1);
             } else {
                 comment.setLikeNum(comment.getLikeNum() + 1);
+                messageService.sendLikeMsg(SecurityUtils.getAuthenticatedUser().getId(), comment.getUserId(),
+                        "comment", post, comment);
             }
         } else {
             if (dislike == likeRecord.isDislike()) {
@@ -117,15 +116,6 @@ public class CommentService {
                 likeRecordRepo.save(likeRecord);
             }
         }
-        NotificationMessage notificationMessage = new NotificationMessage();
-        notificationMessage.setMessageType(MessageType.LIKE_RECORD_MESSAGE);
-        notificationMessage.setReading(Reading.UN_READ);
-        notificationMessage.setSenderId(SecurityUtils.getAuthenticatedUser().getId());
-        notificationMessage.setRecipientId(comment.getUserId());
-        notificationMessage.setSenderName(SecurityUtils.getAuthenticatedUser().getNickname());
-        notificationMessage.setSenderAvatar(SecurityUtils.getAuthenticatedUser().getAvatar());
-        notificationMessage.setContent(comment.getContent());
-        notificationMessageRepo.save(notificationMessage);
         commentRepo.save(comment);
     }
 

+ 0 - 14
src/main/java/com/izouma/jmrh/service/CommunicationRecordService.java

@@ -1,14 +0,0 @@
-package com.izouma.jmrh.service;
-
-import com.izouma.jmrh.domain.CommunicationRecord;
-import com.izouma.jmrh.repo.CommunicationRecordRepo;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-@Service
-@AllArgsConstructor
-public class CommunicationRecordService {
-
-    private CommunicationRecordRepo communicationRecordRepo;
-
-}

+ 142 - 45
src/main/java/com/izouma/jmrh/service/ConversationService.java

@@ -1,62 +1,159 @@
 package com.izouma.jmrh.service;
 
-import com.izouma.jmrh.domain.Conversation;
-import com.izouma.jmrh.domain.NotificationMessage;
-import com.izouma.jmrh.domain.User;
-import com.izouma.jmrh.enums.ConversationStatus;
-import com.izouma.jmrh.enums.MessageType;
-import com.izouma.jmrh.enums.Reading;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.izouma.jmrh.domain.*;
+import com.izouma.jmrh.dto.ConversationDTO;
+import com.izouma.jmrh.enums.*;
 import com.izouma.jmrh.exception.BusinessException;
-import com.izouma.jmrh.repo.ConversationRepo;
-import com.izouma.jmrh.repo.NotificationMessageRepo;
-import com.izouma.jmrh.utils.ObjUtils;
-import com.izouma.jmrh.utils.SecurityUtils;
+import com.izouma.jmrh.repo.*;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang.ArrayUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.*;
+import java.util.stream.Collectors;
+
 @Service
 @AllArgsConstructor
 public class ConversationService {
+    private ConversationRepo            conversationRepo;
+    private DockingRecordRepo           dockingRecordRepo;
+    private UserRepo                    userRepo;
+    private ResourceSupplyAndDemandRepo resourceSupplyAndDemandRepo;
+    private MessageRepo                 messageRepo;
+    private MessageService              messageService;
+    private OrgInfoRepo                 orgInfoRepo;
+
+    public void create(Long userId, Long sndId, String orgName, String contactName, String contactPhone,
+                       String email, String content) {
+        User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
+        ResourceSupplyAndDemand snd = resourceSupplyAndDemandRepo.findById(sndId)
+                .orElseThrow(new BusinessException("供需不存在"));
+        if (userId.equals(snd.getPublishersId())) {
+            throw new BusinessException("不能和自己对接");
+        }
+        Contact contact = new Contact(orgName, contactName, contactPhone, email);
+        String sessionId = snd.getPublishersId() > userId ?
+                (userId + "-" + snd.getPublishersId()) : (snd.getPublishersId() + "-" + userId);
+
 
-    private ConversationRepo conversationRepo;
-    private NotificationMessageRepo notificationMessageRepo;
+        Conversation conversationFrom = conversationRepo
+                .findFirstByUserIdAndToUserIdOrderByIdDesc(userId, snd.getPublishersId());
+        if (conversationFrom == null) {
+            conversationFrom = Conversation.builder()
+                    .sessionId(sessionId)
+                    .userId(userId)
+                    .toUserId(snd.getPublishersId())
+                    .orgId(snd.getOrgId())
+                    .contact(contact)
+                    .type(ConversationType.DOCKING)
+                    .build();
+        }
+        conversationFrom.setOrgId(snd.getOrgId());
+        conversationFrom.setContact(contact);
+        conversationRepo.save(conversationFrom);
+
+        Conversation conversationTo = conversationRepo
+                .findFirstByUserIdAndToUserIdOrderByIdDesc(snd.getPublishersId(), userId);
+        if (conversationTo == null) {
+            conversationTo = Conversation.builder()
+                    .sessionId(sessionId)
+                    .userId(snd.getPublishersId())
+                    .toUserId(userId)
+                    .orgId(snd.getOrgId())
+                    .contact(contact)
+                    .type(ConversationType.PUBLISH)
+                    .build();
+        }
+        conversationTo.setContact(contact);
+        conversationTo.setOrgId(snd.getOrgId());
+        conversationRepo.save(conversationTo);
 
+        messageService.send(userId, snd.getPublishersId(), sessionId, MessageType.TEXT, content);
+        messageService.send(userId, snd.getPublishersId(), sessionId, MessageType.SND, JSON.toJSONString(snd));
 
-    public Conversation create(Conversation record) {
-        User user = SecurityUtils.getAuthenticatedUser();
-        if (record.getId() != null) {
-            Conversation orig = conversationRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            return conversationRepo.save(orig);
+        DockingRecord dockingRecordFrom = dockingRecordRepo
+                .findFirstByUserIdAndSndIdAndRoleAndStatusInOrderByIdDesc(userId, sndId, DockingRole.DOCKING,
+                        Arrays.asList(DockingStatus.PENDING, DockingStatus.IN_PROGRESS));
+        if (dockingRecordFrom == null) {
+            dockingRecordFrom = DockingRecord.builder()
+                    .userId(userId)
+                    .orgId(snd.getOrgId())
+                    .sndId(sndId)
+                    .role(DockingRole.DOCKING)
+                    .status(DockingStatus.PENDING)
+                    .build();
         }
-        Conversation conversation = conversationRepo.findByResourceSupplyDemandAndConversationUserId(record.getResourceSupplyDemand(), user.getId());
-        if (conversation != null) {
-            //对接终止状态恢复对接
-            if (conversation.getStatus().equals(ConversationStatus.TERMINATION)) {
-                ObjUtils.merge(conversation, record);
-                conversation.setStatus(ConversationStatus.CONDUCTED);
-                conversation.setPublisherVisible(true);
-                conversation.setUserVisible(true);
-                return conversationRepo.save(conversation);
-            } else {
-                throw new BusinessException("不能重复对接");
+        dockingRecordFrom.setConversationId(conversationFrom.getId());
+        dockingRecordFrom.setContact(contact);
+        dockingRecordRepo.save(dockingRecordFrom);
+
+        DockingRecord dockingRecordTo = dockingRecordRepo
+                .findFirstByUserIdAndSndIdAndRoleAndStatusInOrderByIdDesc(snd
+                                .getPublishersId(), sndId, DockingRole.PUBLISH,
+                        Arrays.asList(DockingStatus.PENDING, DockingStatus.IN_PROGRESS));
+        if (dockingRecordTo == null) {
+            dockingRecordTo = DockingRecord.builder()
+                    .userId(snd.getPublishersId())
+                    .orgId(snd.getOrgId())
+                    .sndId(sndId)
+                    .role(DockingRole.PUBLISH)
+                    .status(DockingStatus.PENDING)
+                    .build();
+        }
+        dockingRecordTo.setConversationId(conversationTo.getId());
+        dockingRecordTo.setContact(contact);
+        dockingRecordRepo.save(dockingRecordTo);
+    }
+
+    public ConversationDTO get(Long id) {
+        return conversationRepo.get(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    public List<ConversationDTO> my(Long userId) {
+        try {
+            conversationRepo.saveAll(Arrays.asList(Conversation.builder()
+                            .sessionId("like-" + userId)
+                            .userId(userId)
+                            .type(ConversationType.LIKE)
+                            .build(),
+                    Conversation.builder()
+                            .sessionId("comment-" + userId)
+                            .userId(userId)
+                            .type(ConversationType.COMMENT)
+                            .build(),
+                    Conversation.builder()
+                            .sessionId("sys-" + userId)
+                            .userId(userId)
+                            .type(ConversationType.SYS)
+                            .build()
+            ));
+        } catch (Exception ignored) {
+        }
+        Map<Integer, ConversationDTO> head = new HashMap<>();
+        List<ConversationDTO> list = conversationRepo.my(userId);
+        Iterator<ConversationDTO> it = list.iterator();
+        while (it.hasNext()) {
+            ConversationDTO dto = it.next();
+            if (dto.getType() == ConversationType.LIKE) {
+                it.remove();
+                head.put(0, dto);
+            } else if (dto.getType() == ConversationType.COMMENT) {
+                it.remove();
+                head.put(1, dto);
+            } else if (dto.getType() == ConversationType.SYS) {
+                it.remove();
+                head.put(2, dto);
+            }
+            if (head.size() == 3) {
+                break;
             }
         }
-        NotificationMessage notificationMessage = new NotificationMessage();
-        record.setConversationUserId(SecurityUtils.getAuthenticatedUser().getId());
-        conversation.setPublisherVisible(true);
-        conversation.setUserVisible(true);
-        record.setStatus(ConversationStatus.AWAIT);
-        Conversation save = conversationRepo.save(record);
-        //添加通知消息
-        notificationMessage.setReading(Reading.UN_READ);
-        notificationMessage.setMessageType(MessageType.CONVERSATION_MESSAGE);
-        notificationMessage.setContent(record.getResourceSupplyDemand().getName());
-        notificationMessage.setRecipientId(record.getResourceSupplyDemand().getPublishersId());
-        notificationMessage.setSenderId(save.getConversationUserId());
-        notificationMessage.setSenderName(SecurityUtils.getAuthenticatedUser().getNickname());
-        notificationMessage.setSenderAvatar(SecurityUtils.getAuthenticatedUser().getAvatar());
-        notificationMessage.setConversationId(save.getId());
-        return save;
+        list.addAll(0, head.entrySet().stream()
+                .sorted(Map.Entry.comparingByKey())
+                .map(Map.Entry::getValue)
+                .collect(Collectors.toList()));
+        return list;
     }
 }

+ 7 - 0
src/main/java/com/izouma/jmrh/service/DockingRecordService.java

@@ -1,6 +1,8 @@
 package com.izouma.jmrh.service;
 
 import com.izouma.jmrh.domain.DockingRecord;
+import com.izouma.jmrh.enums.DockingStatus;
+import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.DockingRecordRepo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
@@ -11,4 +13,9 @@ public class DockingRecordService {
 
     private DockingRecordRepo dockingRecordRepo;
 
+    public DockingRecord updateStatue(Long id, DockingStatus status) {
+        DockingRecord dockingRecord = dockingRecordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        dockingRecord.setStatus(status);
+        return dockingRecordRepo.save(dockingRecord);
+    }
 }

+ 95 - 3
src/main/java/com/izouma/jmrh/service/MessageService.java

@@ -1,15 +1,107 @@
 package com.izouma.jmrh.service;
 
-import com.izouma.jmrh.repo.MessageRepo;
+import com.izouma.jmrh.domain.*;
+import com.izouma.jmrh.dto.MessageDTO;
+import com.izouma.jmrh.enums.MessageType;
+import com.izouma.jmrh.enums.PostType;
+import com.izouma.jmrh.exception.BusinessException;
+import com.izouma.jmrh.repo.*;
+import com.izouma.jmrh.utils.JsonUtils;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.util.Optional;
+
 @Service
 @Slf4j
 @AllArgsConstructor
 public class MessageService {
-    private MessageRepo messageRepo;
+    private MessageRepo      messageRepo;
+    private ConversationRepo conversationRepo;
+    private UserRepo         userRepo;
+
+    public Page<MessageDTO> all(String sessionId, MessageType type, Pageable pageable) {
+        if (type != null) {
+            return messageRepo.all(sessionId, type, pageable);
+        }
+        return messageRepo.all(sessionId, pageable);
+    }
+
+    public void readAll(Long userId, String sessionId) {
+        if (StringUtils.isNotEmpty(sessionId)) {
+            messageRepo.readAll(sessionId, userId);
+        } else {
+            messageRepo.readAll(userId);
+        }
+    }
+
+    public void send(Long userId, Long toUserId, String sessionId, MessageType type, String content) {
+        String lastMessage;
+        switch (type) {
+            case TEXT:
+                lastMessage = content.length() > 20 ? content.substring(0, 20) + "……" : content;
+                break;
+            case SND:
+                lastMessage = "[资源供需]";
+                break;
+            default:
+                lastMessage = "";
+        }
+        conversationRepo.updateConversation(sessionId, LocalDateTime.now(), lastMessage);
+        messageRepo.save(Message.builder()
+                .userId(userId)
+                .toUserId(toUserId)
+                .sessionId(sessionId)
+                .type(type)
+                .content(content)
+                .read(false)
+                .build());
+    }
+
+    public void sendCommentMsg(Long fromUserId, Long toUserId, Comment comment, Post post) {
+        User user = userRepo.findById(fromUserId).orElseThrow(new BusinessException("用户不存在"));
+        String sessionId = "comment-" + toUserId;
+        conversationRepo.updateConversation(sessionId, LocalDateTime.now(), "");
+        messageRepo.save(Message.builder()
+                .userId(null)
+                .toUserId(toUserId)
+                .sessionId(sessionId)
+                .type(MessageType.COMMENT)
+                .postId(post.getId())
+                .content(new JsonUtils.Builder()
+                        .add("nickname", post.getType() == PostType.OFFICIAL ? "官方平台" : user.getNickname())
+                        .add("avatar", post.getType() == PostType.OFFICIAL
+                                ? "https://jxjmrh.oss-cn-hangzhou.aliyuncs.com/application/icon/guan.png"
+                                : user.getAvatar())
+                        .add("message", comment.getContent())
+                        .build())
+                .read(false)
+                .build());
+    }
 
-    
+    public void sendLikeMsg(Long fromUserId, Long toUserId, String type, Post post, Comment comment) {
+        User user = userRepo.findById(fromUserId).orElseThrow(new BusinessException("用户不存在"));
+        String sessionId = "like-" + toUserId;
+        conversationRepo.updateConversation(sessionId, LocalDateTime.now(), "");
+        messageRepo.save(Message.builder()
+                .userId(null)
+                .toUserId(toUserId)
+                .sessionId(sessionId)
+                .type(MessageType.LIKE)
+                .postId(Optional.ofNullable(post).map(BaseEntity::getId).orElse(null))
+                .commentId(Optional.ofNullable(comment).map(BaseEntity::getId).orElse(null))
+                .content(new JsonUtils.Builder()
+                        .add("nickname", user.getNickname())
+                        .add("avatar", user.getAvatar())
+                        .add("message", comment == null ? "赞了我的话题" : "赞了我的回复")
+                        .add("type", type)
+                        .build())
+                .read(false)
+                .build());
+    }
 }

+ 0 - 14
src/main/java/com/izouma/jmrh/service/NotificationMessageService.java

@@ -1,14 +0,0 @@
-package com.izouma.jmrh.service;
-
-import com.izouma.jmrh.repo.NotificationMessageRepo;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-@Service
-@AllArgsConstructor
-public class NotificationMessageService {
-
-    private NotificationMessageRepo notificationMessageRepo;
-
-
-}

+ 3 - 12
src/main/java/com/izouma/jmrh/service/OrgInfoService.java

@@ -1,10 +1,8 @@
 package com.izouma.jmrh.service;
 
 import com.izouma.jmrh.domain.OrgInfo;
-import com.izouma.jmrh.enums.ResSnDType;
 import com.izouma.jmrh.exception.BusinessException;
-import com.izouma.jmrh.repo.OrgInfoRepo;
-import com.izouma.jmrh.repo.ResourceSupplyAndDemandRepo;
+import com.izouma.jmrh.repo.*;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -16,18 +14,11 @@ import java.util.Map;
 public class OrgInfoService {
 
     private OrgInfoRepo orgInfoRepo;
-    private ResourceSupplyAndDemandRepo resourceSupplyAndDemandRepo;
 
-    public Map<String, Object> getAllCount(Long id) {
+    public Map<String, Object> getAllCount(Long id){
         HashMap<String, Object> map = new HashMap<>();
         OrgInfo orgInfo = orgInfoRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-        map.put("orgInfo", orgInfo);
-        map.put("productCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.PRODUCT_SUPPLY));
-        map.put("artProductCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.TECH_SUPPLY));
-        map.put("financingNeedsCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.FINANCING_DEMAND));
-        map.put("productNeedCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.PRODUCT_DEMAND));
-        map.put("artNeedCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.TECH_DEMAND));
-        map.put("tResourceCount", resourceSupplyAndDemandRepo.countByAndOrgIdAndType(orgInfo.getId(), ResSnDType.RES_SUPPLY));
+        map.put("orgInfo",orgInfo);
         return map;
     }
 

+ 3 - 0
src/main/java/com/izouma/jmrh/service/PostService.java

@@ -35,6 +35,7 @@ public class PostService {
     private LikeRecordRepo likeRecordRepo;
     private UserRepo       userRepo;
     private CommentRepo    commentRepo;
+    private MessageService messageService;
 
     public Post save(Post record) {
         if (record.getId() == null) {
@@ -94,6 +95,8 @@ public class PostService {
                 post.setDislikeNum(post.getDislikeNum() + 1);
             } else {
                 post.setLikeNum(post.getLikeNum() + 1);
+                messageService.sendLikeMsg(SecurityUtils.getAuthenticatedUser().getId(), post.getUserId(),
+                        "post", post, null);
             }
         } else {
             if (dislike == likeRecord.isDislike()) {

+ 136 - 34
src/main/java/com/izouma/jmrh/service/ResourceSupplyAndDemandService.java

@@ -1,54 +1,117 @@
 package com.izouma.jmrh.service;
 
+import com.izouma.jmrh.domain.DockingRecord;
+import com.izouma.jmrh.domain.OrgInfo;
 import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
+import com.izouma.jmrh.dto.PageQuery;
+import com.izouma.jmrh.dto.ResSnDAndPropertyDTO;
 import com.izouma.jmrh.dto.SndDTO;
+import com.izouma.jmrh.enums.AuditStatus;
+import com.izouma.jmrh.enums.DockingRole;
+import com.izouma.jmrh.enums.DockingStatus;
 import com.izouma.jmrh.enums.ResSnDType;
+import com.izouma.jmrh.exception.BusinessException;
+import com.izouma.jmrh.repo.DockingRecordRepo;
+import com.izouma.jmrh.repo.OrgInfoRepo;
+import com.izouma.jmrh.repo.ResSnDPropertyRepo;
 import com.izouma.jmrh.repo.ResourceSupplyAndDemandRepo;
+import com.izouma.jmrh.utils.ObjUtils;
+import com.izouma.jmrh.utils.SecurityUtils;
+import com.izouma.jmrh.web.BaseController;
 import lombok.AllArgsConstructor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.*;
+import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
 
 @Service
 @AllArgsConstructor
 public class ResourceSupplyAndDemandService {
 
     private ResourceSupplyAndDemandRepo resourceSupplyAndDemandRepo;
+    private DockingRecordRepo           dockingRecordRepo;
+    private OrgInfoRepo                 orgInfoRepo;
+    private ResSnDPropertyRepo          resSnDPropertyRepo;
 
-    public List<Map<String, Object>> getDataCountList(String productType, String techType) {
-        List<Map<String, Object>> productCountList = resourceSupplyAndDemandRepo.getProductCountList(productType);
-        List<Map<String, Object>> techCountList = resourceSupplyAndDemandRepo.getTechCountList(techType);
-        List<Map<String, Object>> voList = new ArrayList<>();
-        for (Map<String, Object> product : productCountList
-        ) {
-            Map<String, Object> map = new HashMap<>();
-            map.putAll(product);
-            if (techCountList != null && techCountList.size() > 0) {
-                for (Map<String, Object> tech : techCountList
-                ) {
-                    if (product.get("createdAt").equals(tech.get("createdAt"))) {
-                        map.put("techCount", tech.get("techCount"));
-                        techCountList.remove(tech);
-                        break;
-                    }
-                }
-            }
-            voList.add(map);
+    public ResSnDAndPropertyDTO save(ResSnDAndPropertyDTO record) {
+        if (record.getResSnD() == null || record.getPropertyList() == null) {
+            throw new BusinessException("信息不完善");
+        }
+        if (record.getResSnD().getId() != null) {
+            ResourceSupplyAndDemand orig = resourceSupplyAndDemandRepo.findById(record.getResSnD().getId())
+                    .orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            record.setResSnD(resourceSupplyAndDemandRepo.save(orig));
+        } else {
+            record.getResSnD().setStatus(AuditStatus.PENDING);
+            record.getResSnD().setPublishersId(SecurityUtils.getAuthenticatedUser().getId());
+            record.getResSnD().setOrgId(SecurityUtils.getAuthenticatedUser().getOrgInfo().getId());
+            record.setResSnD(resourceSupplyAndDemandRepo.save(record.getResSnD()));
         }
-        if (techCountList != null && techCountList.size() > 0) {
-            techCountList.forEach(tech -> {
-                tech.put("productCount", 0);
-                productCountList.add(tech);
-            });
+        resSnDPropertyRepo.deleteByResSnDId(record.getResSnD().getId());
+        record.getPropertyList().forEach(item -> {
+            item.setId(null);
+            item.setResSnDId(record.getResSnD().getId());
+            resSnDPropertyRepo.save(item);
+        });
+        return record;
+    }
+
+    public SndDTO get(Long id, Long userId) {
+        ResourceSupplyAndDemand snd = resourceSupplyAndDemandRepo.findById(id)
+                .orElseThrow(new BusinessException("无记录"));
+        OrgInfo orgInfo = orgInfoRepo.findById(snd.getOrgId())
+                .orElseThrow(new BusinessException("无记录"));
+        SndDTO dto = toDTO(snd, userId);
+        dto.setOrgInfo(orgInfo);
+        return dto;
+    }
+
+    public Page<SndDTO> allDTO(Long userId, PageQuery pageQuery) {
+        Map<String, String> property = (Map<String, String>) pageQuery.getQuery().get("property");
+        Specification<ResourceSupplyAndDemand> specification =
+                BaseController.toSpecification(pageQuery, ResourceSupplyAndDemand.class);
+        if (property != null && !property.isEmpty()) {
+            specification = specification
+                    .and((Specification<ResourceSupplyAndDemand>) (root, criteriaQuery, criteriaBuilder) -> {
+                        List<Predicate> or = new ArrayList<>();
+                        property.forEach((name, value) -> {
+                            or.add(criteriaBuilder.and(
+                                    criteriaBuilder.equal(root.join("resSnDPropertyList").get("name"), name),
+                                    criteriaBuilder.equal(root.join("resSnDPropertyList").get("value"), value)
+                            ));
+                        });
+                        return criteriaBuilder.or(or.toArray(new Predicate[0]));
+                    });
         }
+        Page<ResourceSupplyAndDemand> page = resourceSupplyAndDemandRepo
+                .findAll(specification, BaseController.toPageRequest(pageQuery));
+        return toDTOPage(page, userId);
+    }
 
-        return voList;
+    public Page<SndDTO> my(Long userId, List<ResSnDType> types, Pageable pageable) {
+        Page<ResourceSupplyAndDemand> page = resourceSupplyAndDemandRepo
+                .findAll((Specification<ResourceSupplyAndDemand>) (root, criteriaQuery, criteriaBuilder) -> {
+                    List<Predicate> predicates = new ArrayList<>();
+                    predicates.add(criteriaBuilder.equal(root.get("publishersId"), userId));
+                    if (types != null && !types.isEmpty()) {
+                        predicates.add(root.get("type").in(types));
+                    }
+                    return criteriaQuery.where(predicates.toArray(new Predicate[0]))
+                            .orderBy(criteriaBuilder.desc(root.get("createdAt")))
+                            .getRestriction();
+                }, pageable);
+        return toDTOPage(page, userId);
     }
 
     public Page<SndDTO> myCollect(Long userId, List<ResSnDType> types, Pageable pageable) {
@@ -58,10 +121,49 @@ public class ResourceSupplyAndDemandService {
         } else {
             page = resourceSupplyAndDemandRepo.myCollect(userId, types, pageable);
         }
-        return page.map(snd -> {
-            SndDTO dto = new SndDTO();
-            BeanUtils.copyProperties(snd, dto);
-            return dto;
-        });
+        return toDTOPage(page, userId);
+    }
+
+    public Page<SndDTO> myDocking(Long userId, DockingRole role, List<ResSnDType> types, Pageable pageable) {
+        Page<SndDTO> page;
+        if (types != null && !types.isEmpty()) {
+            page = resourceSupplyAndDemandRepo.myDockingSnd(userId, role, types, pageable);
+        } else {
+            page = resourceSupplyAndDemandRepo.myDockingSnd(userId, role, pageable);
+        }
+        addOrgInfo(page);
+        return page;
+    }
+
+    private Page<SndDTO> toDTOPage(Page<ResourceSupplyAndDemand> page, Long userId) {
+        Page<SndDTO> dtoPage = page.map(snd -> toDTO(snd, userId));
+        addOrgInfo(dtoPage);
+        return dtoPage;
+    }
+
+    private SndDTO toDTO(ResourceSupplyAndDemand snd, Long userId) {
+        SndDTO dto = new SndDTO();
+        BeanUtils.copyProperties(snd, dto);
+        if (userId != null && !snd.getPublishersId().equals(userId)) {
+            dto.setDockingStatus(Optional.ofNullable(dockingRecordRepo
+                    .findFirstByUserIdAndSndIdAndRoleOrderByIdDesc(userId, snd.getId(), DockingRole.DOCKING))
+                    .map(DockingRecord::getStatus).orElse(null));
+        }
+        return dto;
+    }
+
+    private void addOrgInfo(Page<SndDTO> page) {
+        Set<Long> orgIds = page.stream().map(SndDTO::getOrgId).filter(Objects::nonNull).collect(Collectors.toSet());
+        List<OrgInfo> orgInfos = new ArrayList<>();
+        if (!orgIds.isEmpty()) {
+            orgInfos = orgInfoRepo.findAllById(orgIds);
+        }
+        for (SndDTO dto : page) {
+            dto.setOrgInfo(orgInfos
+                    .stream()
+                    .filter(orgInfo -> orgInfo.getId().equals(dto.getOrgId()))
+                    .findFirst()
+                    .orElse(null));
+        }
     }
 }

+ 1 - 1
src/main/java/com/izouma/jmrh/web/ArticleController.java

@@ -19,7 +19,7 @@ import java.util.List;
 @RestController
 @RequestMapping("/article")
 @AllArgsConstructor
-public class ArticleController extends UtilBaseController {
+public class ArticleController extends BaseController {
     private ArticleService articleService;
     private ArticleRepo articleRepo;
 

+ 4 - 6
src/main/java/com/izouma/jmrh/web/AuditHistoryController.java

@@ -1,10 +1,9 @@
 package com.izouma.jmrh.web;
-
 import com.izouma.jmrh.domain.AuditHistory;
+import com.izouma.jmrh.service.AuditHistoryService;
 import com.izouma.jmrh.dto.PageQuery;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.AuditHistoryRepo;
-import com.izouma.jmrh.service.AuditHistoryService;
 import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.SecurityUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
@@ -33,7 +32,6 @@ public class AuditHistoryController extends BaseController {
         }
         record.setUser(SecurityUtils.getAuthenticatedUser());
         AuditHistory auditHistory = auditHistoryService.updateState(record);
-        auditHistory.setUser(SecurityUtils.getAuthenticatedUser());
         return auditHistoryRepo.save(auditHistory);
     }
 
@@ -41,13 +39,13 @@ public class AuditHistoryController extends BaseController {
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     public Page<AuditHistory> all(PageQuery pageQuery) {
-        return auditHistoryRepo.findAll(toSpecification(pageQuery, AuditHistory.class), toPageRequest(pageQuery));
+        return auditHistoryRepo.findAll(toSpecification(pageQuery,AuditHistory.class), toPageRequest(pageQuery));
     }
 
     @GetMapping("/myAll")
     public Page<AuditHistory> myAll(PageQuery pageQuery) {
-        pageQuery.getQuery().put("myUser", SecurityUtils.getAuthenticatedUser());
-        return auditHistoryRepo.findAll(toSpecification(pageQuery, AuditHistory.class), toPageRequest(pageQuery));
+        pageQuery.getQuery().put("myUser",SecurityUtils.getAuthenticatedUser());
+        return auditHistoryRepo.findAll(toSpecification(pageQuery,AuditHistory.class), toPageRequest(pageQuery));
     }
 
     @GetMapping("/get/{id}")

+ 25 - 272
src/main/java/com/izouma/jmrh/web/BaseController.java

@@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.izouma.jmrh.annotations.Searchable;
 import com.izouma.jmrh.domain.*;
 import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.enums.ResSnDType;
 import com.izouma.jmrh.utils.DateTimeUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -46,6 +45,31 @@ public class BaseController {
         return pageRequest;
     }
 
+    public <T> Specification<T> getResAll(PageQuery pageQuery, Class<?> queryClass) {
+        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
+            List<Predicate> or = new ArrayList<>();
+            List<Predicate> and = new ArrayList<>();
+            or.add(root.get("tresource").isNotNull());
+            or.add(root.get("product").isNotNull());
+            or.add(root.get("artProduct").isNotNull());
+            if (pageQuery.getQuery().get("user") != null) {
+                User user = (User) pageQuery.getQuery().get("user");
+                Join<User, Collect> join = root.join("user", JoinType.LEFT);
+                ObjectMapper objectMapper = new ObjectMapper();
+                if (user.getId() != null && user.getId() > 0) {
+                    and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
+                }
+            }
+            Predicate[] array_and = new Predicate[and.size()];
+            Predicate Pre_And = criteriaBuilder.and(and.toArray(array_and));
+
+            Predicate[] arrayOr = new Predicate[or.size()];
+            Predicate Pre_Or = criteriaBuilder.or(or.toArray(arrayOr));
+
+            /*criteriaBuilder.or(or.toArray(new Predicate[0]));*/
+            return criteriaQuery.where(Pre_And, Pre_Or).getRestriction();
+        };
+    }
 
     public static <T> Specification<T> toSpecification(PageQuery pageQuery, Class<?> queryClass) {
         return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
@@ -205,148 +229,6 @@ public class BaseController {
                 Field field = getDeclaredField(queryClass, property);
                 if (field == null) return;
                 Class fieldType = field.getType();
-                if (Enum.class.isAssignableFrom(fieldType)) {
-                    if (value instanceof Collection) {
-                        if (!((Collection) value).isEmpty()) {
-                            List list = new ArrayList();
-                            for (Object o : ((Collection) value)) {
-                                list.add(Enum.valueOf(fieldType, String.valueOf(o)));
-                            }
-                            and.add(root.get(property).in(list));
-                        }
-                    } else if (value instanceof String && StringUtils.isNotEmpty((String) value)) {
-                        if (((String) value).contains(",")) {
-                            String[] arr = ((String) value).split(",");
-                            List list = new ArrayList();
-                            for (String s : arr) {
-                                list.add(Enum.valueOf(fieldType, s));
-                            }
-                            and.add(root.get(property).in(list));
-                        } else {
-                            and.add(criteriaBuilder.and(criteriaBuilder
-                                    .equal(root.get(property), Enum.valueOf(fieldType, String.valueOf(value)))));
-                        }
-                    }
-                } else if (LocalDateTime.class == fieldType) {
-                    if (value instanceof List) {
-                        List list = (List) value;
-                        if (list.size() == 1) {
-                            LocalDateTime start = DateTimeUtils
-                                    .toLocalDateTime((String) list.get(0), "yyyy-MM-dd HH:mm:ss");
-                            and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        } else if (list.size() == 2) {
-                            LocalDateTime end = DateTimeUtils
-                                    .toLocalDateTime((String) list.get(1), "yyyy-MM-dd HH:mm:ss");
-                            and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                        }
-                    } else if (value instanceof String && Pattern
-                            .matches("^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$", (String) value)) {
-                        String[] arr = ((String) value).split(",");
-                        LocalDateTime start = DateTimeUtils.toLocalDateTime(arr[0], "yyyy-MM-dd HH:mm:ss");
-                        and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        LocalDateTime end = DateTimeUtils.toLocalDateTime(arr[1], "yyyy-MM-dd HH:mm:ss");
-                        and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), DateTimeUtils
-                                .toLocalDateTime((String) value, "yyyy-MM-dd HH:mm:ss"))));
-                    }
-                } else if (LocalDate.class == fieldType) {
-                    if (value instanceof List) {
-                        List list = (List) value;
-                        if (list.size() == 1) {
-                            LocalDate start = DateTimeUtils
-                                    .toLocalDate((String) list.get(0), "yyyy-MM-dd");
-                            and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        } else if (list.size() == 2) {
-                            LocalDate end = DateTimeUtils
-                                    .toLocalDate((String) list.get(1), "yyyy-MM-dd");
-                            and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                        }
-                    } else if (value instanceof String && Pattern
-                            .matches("^\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}$", (String) value)) {
-                        String[] arr = ((String) value).split(",");
-                        LocalDate start = DateTimeUtils.toLocalDate(arr[0], "yyyy-MM-dd");
-                        and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        LocalDate end = DateTimeUtils.toLocalDate(arr[1], "yyyy-MM-dd");
-                        and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), DateTimeUtils
-                                .toLocalDateTime((String) value, "yyyy-MM-dd"))));
-                    }
-                } else if (property.equals("resSnDPropertyList")) {
-                    String str = String.valueOf(value);
-                    if (StringUtils.isNotEmpty(str)) {
-                        Join<ResSnDProperty, Class> join = root.join(property, JoinType.LEFT);
-                        String[] split = str.split(";");
-                        for (String item : split) {
-                            String strItem = item.trim();
-                            String name = strItem.substring(strItem.indexOf(":") + 1, strItem.indexOf(","));
-                            String strValue = strItem.substring(strItem.indexOf("value:") + 6);
-                            if (StringUtils.isNotEmpty(strValue) && !strValue.equals('0')) {
-                                and.add(criteriaBuilder.equal(join.get("name"), name));
-                                and.add(criteriaBuilder.equal(join.get("value"), strValue));
-                            }
-                        }
-                    }
-                } else {
-                    and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), value)));
-                }
-            });
-
-            if (StringUtils.isNotEmpty(pageQuery.getSearch())) {
-                Field[] fields = queryClass.getDeclaredFields();
-                List<Predicate> or = new ArrayList<>();
-                try {
-                    if (StringUtils.isNumeric(pageQuery.getSearch())) {
-                        or.add(criteriaBuilder.equal(root.get("id"), Long.parseLong(pageQuery.getSearch())));
-                    }
-                } catch (Exception ignored) {
-                }
-                for (Field field : fields) {
-                    Searchable annotation = field.getAnnotation(Searchable.class);
-                    if (annotation == null) {
-                        continue;
-                    }
-                    if (!annotation.value()) {
-                        continue;
-                    }
-                    or.add(criteriaBuilder.like(root.get(field.getName()), "%" + pageQuery.getSearch() + "%"));
-                }
-                and.add(criteriaBuilder.or(or.toArray(new Predicate[0])));
-            }
-            criteriaQuery.distinct(true);
-            return criteriaBuilder.and(and.toArray(new Predicate[0]));
-        };
-    }
-
-    public <T> Specification<T> getConversation(PageQuery pageQuery, Class<?> queryClass) {
-        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
-            List<Predicate> and = new ArrayList<>();
-            pageQuery.getQuery().forEach((property, value) -> {
-                if (value == null) {
-                    return;
-                }
-                if (String.class.equals(value.getClass())) {
-                    if (StringUtils.isEmpty((String) value)) {
-                        return;
-                    }
-                }
-                if (property.equals("typeStr")) {
-                    String str = String.valueOf(value);
-                    if (StringUtils.isNotEmpty(str)) {
-                        Join<ResourceSupplyAndDemand, Conversation> join = root.join("resourceSupplyDemand", JoinType.LEFT);
-                        String[] split = str.split(",");
-                        List list = new ArrayList();
-                        for (String item : split
-                        ) {
-                            list.add(Enum.valueOf(ResSnDType.class, String.valueOf(item)));
-                        }
-                        and.add(criteriaBuilder.and(join.get("type").in(list)));
-                    }
-                }
-                Field field = getDeclaredField(queryClass, property);
-                if (field == null) return;
-                Class fieldType = field.getType();
                 if (Enum.class.isAssignableFrom(fieldType)) {
                     if (value instanceof Collection) {
                         if (!((Collection) value).isEmpty()) {
@@ -446,7 +328,6 @@ public class BaseController {
         };
     }
 
-
     private static Field getDeclaredField(Class<?> clazz, String property) {
         String className = clazz.getName();
         while (clazz != null && clazz != Object.class) {
@@ -459,132 +340,4 @@ public class BaseController {
         log.error("no such field [{}] in class [{}]", property, className);
         return null;
     }
-
-
-    public <T> Specification<T> getNeedMessage(PageQuery pageQuery, Class<?> queryClass) {
-        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
-            List<Predicate> and = new ArrayList<>();
-            List<Predicate> or = new ArrayList<>();
-            or.add(root.get("artNeed").isNotNull());
-            or.add(root.get("productNeed").isNotNull());
-            or.add(root.get("financingNeeds").isNotNull());
-            pageQuery.getQuery().forEach((property, value) -> {
-                Field field = getDeclaredField(queryClass, property);
-                if (field == null) return;
-                Class fieldType = field.getType();
-                if (fieldType == User.class) {
-                    if (property == "user") {
-                        Join<User, Message> join = root.join("user", JoinType.LEFT);
-                        ObjectMapper objectMapper = new ObjectMapper();
-                        User user = objectMapper.convertValue(value, User.class);
-                        if (user.getId() != null && user.getId() > 0) {
-                            and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                        }
-                    } else {
-                        Join<User, Message> join = root.join("myUser", JoinType.LEFT);
-                        ObjectMapper objectMapper = new ObjectMapper();
-                        User user = objectMapper.convertValue(value, User.class);
-                        if (user.getId() != null && user.getId() > 0) {
-                            and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                        }
-
-                    }
-                } else if (property == "onExist") {
-                    String[] split = String.valueOf(value).split(",");
-                    if (split.length > 1) {
-                        List<Predicate> or2 = new ArrayList<>();
-                        or2.add(criteriaBuilder.equal(root.get("onExist"), Long.parseLong(split[0])));
-                        or2.add(criteriaBuilder.equal(root.get("onExist"), Long.parseLong(split[1])));
-                        //and.add(criteriaBuilder.or(or.toArray(new Predicate[0])));
-                        Predicate[] array_or2 = new Predicate[or2.size()];
-                        Predicate Pre_Or2 = criteriaBuilder.or(or2.toArray(array_or2));
-                        and.add(criteriaBuilder.and(Pre_Or2));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), value)));
-                    }
-                }
-            });
-            Predicate[] array_and = new Predicate[and.size()];
-            Predicate Pre_And = criteriaBuilder.and(and.toArray(array_and));
-            Predicate[] arrayOr = new Predicate[or.size()];
-            Predicate Pre_Or = criteriaBuilder.or(or.toArray(arrayOr));
-            return criteriaQuery.where(Pre_And, Pre_Or).getRestriction();
-        };
-    }
-
-    public <T> Specification<T> getResMessage(PageQuery pageQuery, Class<?> queryClass) {
-        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
-            List<Predicate> and = new ArrayList<>();
-            List<Predicate> or = new ArrayList<>();
-            or.add(root.get("product").isNotNull());
-            or.add(root.get("artProduct").isNotNull());
-            or.add(root.get("tresource").isNotNull());
-            pageQuery.getQuery().forEach((property, value) -> {
-                Field field = getDeclaredField(queryClass, property);
-                if (field == null) return;
-                Class fieldType = field.getType();
-                if (fieldType == User.class) {
-                    if (property == "user") {
-                        Join<User, Message> join = root.join("user", JoinType.LEFT);
-                        ObjectMapper objectMapper = new ObjectMapper();
-                        User user = objectMapper.convertValue(value, User.class);
-                        if (user.getId() != null && user.getId() > 0) {
-                            and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                        }
-                    } else {
-                        Join<User, Message> join = root.join("myUser", JoinType.LEFT);
-                        ObjectMapper objectMapper = new ObjectMapper();
-                        User user = objectMapper.convertValue(value, User.class);
-                        if (user.getId() != null && user.getId() > 0) {
-                            and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                        }
-
-                    }
-                } else if (property == "onExist") {
-                    String[] split = String.valueOf(value).split(",");
-                    if (split.length > 1) {
-                        List<Predicate> or2 = new ArrayList<>();
-                        or2.add(criteriaBuilder.equal(root.get("onExist"), Long.parseLong(split[0])));
-                        or2.add(criteriaBuilder.equal(root.get("onExist"), Long.parseLong(split[1])));
-                        //and.add(criteriaBuilder.or(or.toArray(new Predicate[0])));
-                        Predicate[] array_or2 = new Predicate[or2.size()];
-                        Predicate Pre_Or2 = criteriaBuilder.or(or2.toArray(array_or2));
-                        and.add(criteriaBuilder.and(Pre_Or2));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), value)));
-                    }
-                }
-            });
-            Predicate[] array_and = new Predicate[and.size()];
-            Predicate Pre_And = criteriaBuilder.and(and.toArray(array_and));
-            Predicate[] arrayOr = new Predicate[or.size()];
-            Predicate Pre_Or = criteriaBuilder.or(or.toArray(arrayOr));
-
-            return criteriaQuery.where(Pre_And, Pre_Or).getRestriction();
-        };
-    }
-
-    public <T> Specification<T> getMessage(Message message) {
-        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
-            List<Predicate> and = new ArrayList<>();
-            if (message.getUser() != null) {
-                Join<User, Message> join = root.join("user", JoinType.LEFT);
-                ObjectMapper objectMapper = new ObjectMapper();
-                User user = objectMapper.convertValue(message.getUser(), User.class);
-                if (user.getId() != null && user.getId() > 0) {
-                    and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                }
-            }
-            if (message.getMyUser() != null) {
-                Join<User, Message> join = root.join("myUser", JoinType.LEFT);
-                ObjectMapper objectMapper = new ObjectMapper();
-                User user = objectMapper.convertValue(message.getMyUser(), User.class);
-                if (user.getId() != null && user.getId() > 0) {
-                    and.add(criteriaBuilder.equal(join.get("id"), user.getId()));
-                }
-
-            }
-            return criteriaBuilder.and(and.toArray(new Predicate[0]));
-        };
-    }
 }

+ 3 - 3
src/main/java/com/izouma/jmrh/web/CollectController.java

@@ -33,9 +33,9 @@ public class CollectController extends BaseController {
     }
 
     @PostMapping("/remove")
-    public void remove(@RequestBody List<Long> ids) {
-        if (!ids.isEmpty()) {
-            collectRepo.deleteAllByUserIdAndSndId(SecurityUtils.getAuthenticatedUser().getId(), ids);
+    public void remove(@RequestParam List<Long> sndIds) {
+        if (!sndIds.isEmpty()) {
+            collectRepo.deleteAllByUserIdAndSndIdIn(SecurityUtils.getAuthenticatedUser().getId(), sndIds);
         }
     }
 }

+ 0 - 84
src/main/java/com/izouma/jmrh/web/CommunicationRecordController.java

@@ -1,84 +0,0 @@
-package com.izouma.jmrh.web;
-
-import com.izouma.jmrh.domain.CommunicationRecord;
-import com.izouma.jmrh.domain.Conversation;
-import com.izouma.jmrh.domain.User;
-import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.enums.ConversationStatus;
-import com.izouma.jmrh.exception.BusinessException;
-import com.izouma.jmrh.repo.CommunicationRecordRepo;
-import com.izouma.jmrh.repo.ConversationRepo;
-import com.izouma.jmrh.service.CommunicationRecordService;
-import com.izouma.jmrh.utils.ObjUtils;
-import com.izouma.jmrh.utils.SecurityUtils;
-import com.izouma.jmrh.utils.excel.ExcelUtils;
-import lombok.AllArgsConstructor;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-
-@RestController
-@RequestMapping("/communicationRecord")
-@AllArgsConstructor
-public class CommunicationRecordController extends BaseController {
-    private CommunicationRecordService communicationRecordService;
-    private CommunicationRecordRepo communicationRecordRepo;
-    private ConversationRepo conversationRepo;
-
-    //@PreAuthorize("hasRole('ADMIN')")
-    @PostMapping("/save")
-    public CommunicationRecord save(@RequestBody CommunicationRecord record) {
-        if (record.getId() != null) {
-            CommunicationRecord orig = communicationRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            return communicationRecordRepo.save(orig);
-        }
-        User user = SecurityUtils.getAuthenticatedUser();
-        record.setUserId(user.getId());
-        record.setNickname(user.getNickname());
-        record.setAvatar(user.getAvatar());
-        Conversation conversation = conversationRepo.findById(record.getConversationId()).orElseThrow(new BusinessException("无记录"));
-        Long publishersId = conversation.getResourceSupplyDemand().getPublishersId();
-        //当前登录用户为发布者并且回复了对接用户修改状态为正在对接
-        if (publishersId == SecurityUtils.getAuthenticatedUser().getId()) {
-            List<CommunicationRecord> communicationRecordList = communicationRecordRepo.findByConversationIdAndUserId(record.getConversationId(), SecurityUtils.getAuthenticatedUser().getId());
-            if (communicationRecordList.size() < 1) {
-                conversationRepo.updateStatus(ConversationStatus.CONDUCTED, record.getConversationId());
-            }
-        }
-        return communicationRecordRepo.save(record);
-    }
-
-    //@PreAuthorize("hasRole('ADMIN')")
-    @GetMapping("/all")
-    public Page<CommunicationRecord> all(PageQuery pageQuery) {
-        Page<CommunicationRecord> all = communicationRecordRepo.findAll(toSpecification(pageQuery, CommunicationRecord.class), toPageRequest(pageQuery));
-        return all;
-    }
-
-    @GetMapping("/get/{id}")
-    public CommunicationRecord get(@PathVariable Long id) {
-        return communicationRecordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-    }
-
-    @GetMapping("/getList/{id}")
-    public List<CommunicationRecord> getList(@PathVariable Long id) {
-        return communicationRecordRepo.findByConversationId(id);
-    }
-
-    @PostMapping("/del/{id}")
-    public void del(@PathVariable Long id) {
-        communicationRecordRepo.deleteById(id);
-    }
-
-    @GetMapping("/excel")
-    @ResponseBody
-    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
-        List<CommunicationRecord> data = all(pageQuery).getContent();
-        ExcelUtils.export(response, data);
-    }
-}
-

+ 29 - 22
src/main/java/com/izouma/jmrh/web/ConversationController.java

@@ -2,18 +2,23 @@ package com.izouma.jmrh.web;
 
 import com.izouma.jmrh.domain.Conversation;
 import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
+import com.izouma.jmrh.dto.ConversationDTO;
 import com.izouma.jmrh.dto.PageQuery;
+import com.izouma.jmrh.enums.Exist;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.ConversationRepo;
 import com.izouma.jmrh.service.ConversationService;
 import com.izouma.jmrh.utils.ObjUtils;
+import com.izouma.jmrh.utils.SecurityUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 @RestController
@@ -21,43 +26,39 @@ import java.util.List;
 @AllArgsConstructor
 public class ConversationController extends BaseController {
     private ConversationService conversationService;
-    private ConversationRepo conversationRepo;
+    private ConversationRepo    conversationRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public Conversation save(@RequestBody Conversation record) {
-        if (record.getId() != null) {
-            Conversation orig = conversationRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            return conversationRepo.save(orig);
-        }
-        return conversationRepo.save(record);
+        if (record.getId() == null) throw new BusinessException("id不能为空");
+        Conversation orig = conversationRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+        ObjUtils.merge(orig, record);
+        return conversationRepo.save(orig);
     }
 
     @PostMapping("/create")
-    public Conversation create(@RequestBody Conversation record) {
-        return conversationService.create(record);
+    public void create(@RequestParam Long sndId, @RequestParam String orgName,
+                       @RequestParam String contactName, @RequestParam String contactPhone,
+                       @RequestParam(required = false) String email, @RequestParam String content) {
+        conversationService.create(SecurityUtils.getAuthenticatedUser().getId(),
+                sndId, orgName, contactName, contactPhone, email, content);
     }
 
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     public Page<Conversation> all(PageQuery pageQuery) {
-        pageQuery.getQuery().put("publisherVisible", true);
-        return conversationRepo.findAll(getConversation(pageQuery, Conversation.class), toPageRequest(pageQuery));
+        //过滤已经终止并删除的对接
+        ArrayList<Exist> exists = new ArrayList<>();
+        exists.add(Exist.PUBLISHERS_DELETED);
+        exists.add(Exist.ON_DELETED);
+        pageQuery.getQuery().put("exist", exists);
+        return conversationRepo.findAll(toSpecification(pageQuery, Conversation.class), toPageRequest(pageQuery));
     }
 
     @GetMapping("/get/{id}")
-    public Conversation get(@PathVariable Long id) {
-        return conversationRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-    }
-
-    //个人中心-我发布的-对接详情
-    @GetMapping("/getList/{id}")
-    public List<Conversation> getList(@PathVariable Long id) {
-        ResourceSupplyAndDemand resourceSupplyAndDemand = new ResourceSupplyAndDemand();
-        resourceSupplyAndDemand.setId(id);
-        List<Conversation> byResourceSupplyDemand = conversationRepo.findByResourceSupplyDemandAndUserVisible(resourceSupplyAndDemand, true);
-        return byResourceSupplyDemand;
+    public ConversationDTO get(@PathVariable Long id) {
+        return conversationService.get(id);
     }
 
     @PostMapping("/del/{id}")
@@ -71,5 +72,11 @@ public class ConversationController extends BaseController {
         List<Conversation> data = all(pageQuery).getContent();
         ExcelUtils.export(response, data);
     }
+
+    @GetMapping("/my")
+    @ApiOperation("我的对话")
+    public List<ConversationDTO> my() {
+        return conversationService.my(SecurityUtils.getAuthenticatedUser().getId());
+    }
 }
 

+ 3 - 2
src/main/java/com/izouma/jmrh/web/DataTypeController.java

@@ -1,4 +1,5 @@
 package com.izouma.jmrh.web;
+
 import com.izouma.jmrh.domain.DataType;
 import com.izouma.jmrh.service.DataTypeService;
 import com.izouma.jmrh.dto.PageQuery;
@@ -17,9 +18,9 @@ import java.util.List;
 @RestController
 @RequestMapping("/dataType")
 @AllArgsConstructor
-public class DataTypeController extends UtilBaseController {
+public class DataTypeController extends BaseController {
     private DataTypeService dataTypeService;
-    private DataTypeRepo dataTypeRepo;
+    private DataTypeRepo    dataTypeRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")

+ 13 - 25
src/main/java/com/izouma/jmrh/web/DockingRecordController.java

@@ -1,6 +1,8 @@
 package com.izouma.jmrh.web;
+
 import com.izouma.jmrh.domain.DockingRecord;
 import com.izouma.jmrh.domain.Message;
+import com.izouma.jmrh.enums.DockingStatus;
 import com.izouma.jmrh.repo.MessageRepo;
 import com.izouma.jmrh.service.DockingRecordService;
 import com.izouma.jmrh.dto.PageQuery;
@@ -17,47 +19,33 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
+import java.util.Objects;
 
 @RestController
 @RequestMapping("/dockingRecord")
 @AllArgsConstructor
 public class DockingRecordController extends BaseController {
     private DockingRecordService dockingRecordService;
-    private DockingRecordRepo dockingRecordRepo;
-    private MessageRepo messageRepo;
+    private DockingRecordRepo    dockingRecordRepo;
+    private MessageRepo          messageRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public DockingRecord save(@RequestBody DockingRecord record) {
-        if (record.getId() != null) {
-            DockingRecord orig = dockingRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            return dockingRecordRepo.save(orig);
-        }
-        record.setUser(SecurityUtils.getAuthenticatedUser());
-        return dockingRecordRepo.save(record);
+        Objects.requireNonNull(record.getId(), "无记录");
+        DockingRecord orig = dockingRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+        ObjUtils.merge(orig, record);
+        return dockingRecordRepo.save(orig);
     }
 
-/**/
-//@PreAuthorize("hasRole('ADMIN')")
-@PostMapping("/updateMessageSave")
-public DockingRecord updateMessageSave(@RequestBody DockingRecord record) {
-
-    record.setUser(SecurityUtils.getAuthenticatedUser());
-    List<DockingRecord> dockingRecord = dockingRecordRepo.findDockingRecordByUserAndDockingRecordId(SecurityUtils.getAuthenticatedUser(), record.getDockingRecordId());
-   if (dockingRecord.size()<=0){
-       Message message = new Message();
-       message.setId(record.getDockingRecordId());
-       message.setState(1L);
-       messageRepo.updateStatus(message);
-   }
-    return dockingRecordRepo.save(record);
-}
+    public DockingRecord updateStatus(@RequestParam Long id, @RequestParam DockingStatus status) {
+        return dockingRecordService.updateStatue(id, status);
+    }
 
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     public Page<DockingRecord> all(PageQuery pageQuery) {
-        return dockingRecordRepo.findAll(toSpecification(pageQuery,DockingRecord.class), toPageRequest(pageQuery));
+        return dockingRecordRepo.findAll(toSpecification(pageQuery, DockingRecord.class), toPageRequest(pageQuery));
     }
 
     @GetMapping("/get/{id}")

+ 44 - 56
src/main/java/com/izouma/jmrh/web/MessageController.java

@@ -1,93 +1,81 @@
 package com.izouma.jmrh.web;
 
 import com.izouma.jmrh.domain.Message;
-import com.izouma.jmrh.domain.User;
+import com.izouma.jmrh.dto.MessageDTO;
 import com.izouma.jmrh.dto.PageQuery;
+import com.izouma.jmrh.enums.MessageType;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.MessageRepo;
 import com.izouma.jmrh.service.MessageService;
+import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.SecurityUtils;
+import com.izouma.jmrh.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.web.bind.annotation.*;
 
-@RequestMapping("message")
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RequestMapping("/message")
 @RestController
 @AllArgsConstructor
 @ApiOperation("联系对接")
 public class MessageController extends BaseController {
-    private MessageRepo messageRepo;
+    private MessageRepo    messageRepo;
     private MessageService messageService;
 
-/*
-    @ApiOperation("添加修改对接")
+    //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public Message save(@RequestBody Message record) {
-        record.setUser(SecurityUtils.getAuthenticatedUser());
-        List<Message> all = messageRepo.findAll(getMessage(record));
-        if (all.size() > 0) {
-            return null;
+        if (record.getId() != null) {
+            Message orig = messageRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return messageRepo.save(orig);
         }
-        Message message = messageService.getMessage(record);
-        return messageRepo.save(message);
+        return messageRepo.save(record);
     }
-*/
 
-    @ApiOperation("修改对接状态")
-    @PostMapping("/updateStatus")
-    public Integer updateStatus(@RequestBody Message record) {
-        Message message = messageRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-        User user = SecurityUtils.getAuthenticatedUser();
-        message.setState(record.getState());
-        message.setOnExist(record.getOnExist());
-        //终止并删除
-        if (record.getState() == 4L) {
-            if (user.getId() == message.getMyUser().getId()) {
-                message.setOnExist(1L);
-            } else if (user.getId() == message.getUser().getId()) {
-                message.setOnExist(2L);
-            }
-        }
-        return messageRepo.save(message) != null ? 1 : 0;
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<MessageDTO> all(@RequestParam String sessionId, @RequestParam(required = false) MessageType type,
+                                Pageable pageable) {
+        return messageService.all(sessionId, type, pageable);
     }
 
-    @ApiOperation("对接列表")
-    @GetMapping("/all")
-    public Page<Message> all(PageQuery pageQuery) {
-        Page<Message> all = messageRepo.findAll(toSpecification(pageQuery, Message.class), toPageRequest(pageQuery));
-        return all;
+    @GetMapping("/get/{id}")
+    public Message get(@PathVariable Long id) {
+        return messageRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
 
-    @ApiOperation("对接列表条件查询")
-    @GetMapping("/getMessage")
-    public Page<Message> getMessage(PageQuery pageQuery) {
-        //Page<Message> all = messageRepo.findAll(getMessage(pageQuery, Message.class), toPageRequest(pageQuery));
-        return null;
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        messageRepo.deleteById(id);
     }
 
-    @ApiOperation("我对接别人的对接列表(需求)")
-    @GetMapping("/getMyMessageNeed")
-    public Page<Message> getMyMessageNeed(PageQuery pageQuery) {
-        pageQuery.getQuery().put("user", SecurityUtils.getAuthenticatedUser());
-        Page<Message> all = messageRepo.findAll(getNeedMessage(pageQuery, Message.class), toPageRequest(pageQuery));
-        return all;
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, @RequestParam String sessionId, @RequestParam(required = false) MessageType type,
+                      Pageable pageable) throws IOException {
+        List<MessageDTO> data = all(sessionId, type, pageable).getContent();
+        ExcelUtils.export(response, data);
     }
 
-    @ApiOperation("我对接别人的对接列表(产品)")
-    @GetMapping("/getMyMessageRes")
-    public Page<Message> getMyMessageRes(PageQuery pageQuery) {
-        pageQuery.getQuery().put("user", SecurityUtils.getAuthenticatedUser());
-        Page<Message> all = messageRepo.findAll(getResMessage(pageQuery, Message.class), toPageRequest(pageQuery));
-        return all;
+    @GetMapping("/unreadNum")
+    public long unreadNum() {
+        return messageRepo.countByToUserIdAndReadFalse(SecurityUtils.getAuthenticatedUser().getId());
     }
 
+    @GetMapping("/readAll")
+    public void realAll(@RequestParam(required = false) String sessionId) {
+        messageService.readAll(SecurityUtils.getAuthenticatedUser().getId(), sessionId);
+    }
 
-    @ApiOperation("别人对接我的对接列表(需求)")
-    @GetMapping("/getMySupply")
-    public Page<Message> getMySupply(PageQuery pageQuery) {
-        pageQuery.getQuery().put("myUser", SecurityUtils.getAuthenticatedUser());
-        Page<Message> all = messageRepo.findAll(getNeedMessage(pageQuery, Message.class), toPageRequest(pageQuery));
-        return all;
+    @PostMapping("/send")
+    public void send(@RequestParam String sessionId, @RequestParam Long toUserId, @RequestParam MessageType type, @RequestParam String content) {
+        messageService.send(SecurityUtils.getAuthenticatedUser().getId(), toUserId, sessionId, type, content);
     }
 }

+ 0 - 60
src/main/java/com/izouma/jmrh/web/NotificationMessageController.java

@@ -1,60 +0,0 @@
-package com.izouma.jmrh.web;
-
-import com.izouma.jmrh.domain.NotificationMessage;
-import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.exception.BusinessException;
-import com.izouma.jmrh.repo.NotificationMessageRepo;
-import com.izouma.jmrh.service.NotificationMessageService;
-import com.izouma.jmrh.utils.ObjUtils;
-import com.izouma.jmrh.utils.excel.ExcelUtils;
-import lombok.AllArgsConstructor;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-
-@RestController
-@RequestMapping("/notificationMessage")
-@AllArgsConstructor
-public class NotificationMessageController extends BaseController {
-    private NotificationMessageService notificationMessageService;
-    private NotificationMessageRepo notificationMessageRepo;
-
-    //@PreAuthorize("hasRole('ADMIN')")
-    @PostMapping("/save")
-    public NotificationMessage save(@RequestBody NotificationMessage record) {
-        if (record.getId() != null) {
-            NotificationMessage orig = notificationMessageRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            return notificationMessageRepo.save(orig);
-        }
-        return notificationMessageRepo.save(record);
-    }
-
-
-    //@PreAuthorize("hasRole('ADMIN')")
-    @GetMapping("/all")
-    public Page<NotificationMessage> all(PageQuery pageQuery) {
-        return notificationMessageRepo.findAll(toSpecification(pageQuery, NotificationMessage.class), toPageRequest(pageQuery));
-    }
-
-    @GetMapping("/get/{id}")
-    public NotificationMessage get(@PathVariable Long id) {
-        return notificationMessageRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-    }
-
-    @PostMapping("/del/{id}")
-    public void del(@PathVariable Long id) {
-        notificationMessageRepo.deleteById(id);
-    }
-
-    @GetMapping("/excel")
-    @ResponseBody
-    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
-        List<NotificationMessage> data = all(pageQuery).getContent();
-        ExcelUtils.export(response, data);
-    }
-}
-

+ 7 - 13
src/main/java/com/izouma/jmrh/web/OrgInfoController.java

@@ -2,12 +2,11 @@ package com.izouma.jmrh.web;
 
 import com.izouma.jmrh.domain.OrgInfo;
 import com.izouma.jmrh.domain.User;
+import com.izouma.jmrh.repo.UserRepo;
+import com.izouma.jmrh.service.OrgInfoService;
 import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.enums.AuditStatus;
 import com.izouma.jmrh.exception.BusinessException;
 import com.izouma.jmrh.repo.OrgInfoRepo;
-import com.izouma.jmrh.repo.UserRepo;
-import com.izouma.jmrh.service.OrgInfoService;
 import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.SecurityUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
@@ -29,8 +28,8 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class OrgInfoController extends BaseController {
     private OrgInfoService orgInfoService;
-    private OrgInfoRepo orgInfoRepo;
-    private UserRepo userRepo;
+    private OrgInfoRepo    orgInfoRepo;
+    private UserRepo       userRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
@@ -40,7 +39,7 @@ public class OrgInfoController extends BaseController {
             ObjUtils.merge(orig, record);
             return orgInfoRepo.save(orig);
         }
-        record.setStatus(AuditStatus.PENDING);
+        record.setState(0L);
         OrgInfo save = orgInfoRepo.save(record);
         User user = new User();
         user.setId(record.getUserId());
@@ -66,12 +65,6 @@ public class OrgInfoController extends BaseController {
                 .collect(Collectors.toList()), page.getPageable(), page.getTotalElements());
     }
 
-    @GetMapping("/count")
-    public long count(PageQuery pageQuery) {
-        pageQuery.getQuery().put("status", AuditStatus.PASS);
-        return orgInfoRepo.count(toSpecification(pageQuery, OrgInfo.class));
-    }
-
     @GetMapping("/get/{id}")
     public OrgInfo get(@PathVariable Long id) {
         return orgInfoRepo.findById(id).orElseThrow(new BusinessException("无记录"));
@@ -82,7 +75,8 @@ public class OrgInfoController extends BaseController {
         long id = Long.parseLong(String.valueOf(pageQuery.getQuery().get("id")));
         String[] split = pageQuery.getSort().split(",");
         Sort sort = new Sort(split[1].equals("desc") ? Sort.Direction.DESC : Sort.Direction.ASC, split[0]);
-        Page<Map<String, Object>> created_at = orgInfoRepo.listSupplyDemand(id, PageRequest.of(pageQuery.getPage(), pageQuery.getSize(), sort));
+        Page<Map<String, Object>> created_at = orgInfoRepo
+                .listSupplyDemand(id, PageRequest.of(pageQuery.getPage(), pageQuery.getSize(), sort));
         return created_at;
     }
 

+ 34 - 115
src/main/java/com/izouma/jmrh/web/ResourceSupplyAndDemandController.java

@@ -1,13 +1,11 @@
 package com.izouma.jmrh.web;
 
-import com.izouma.jmrh.domain.Conversation;
-import com.izouma.jmrh.domain.OrgInfo;
-import com.izouma.jmrh.domain.ResourceSupplyAndDemand;
-import com.izouma.jmrh.domain.User;
+import com.izouma.jmrh.domain.*;
 import com.izouma.jmrh.dto.PageQuery;
 import com.izouma.jmrh.dto.ResSnDAndPropertyDTO;
 import com.izouma.jmrh.dto.SndDTO;
 import com.izouma.jmrh.enums.AuditStatus;
+import com.izouma.jmrh.enums.DockingRole;
 import com.izouma.jmrh.enums.Exist;
 import com.izouma.jmrh.enums.ResSnDType;
 import com.izouma.jmrh.exception.BusinessException;
@@ -16,6 +14,7 @@ import com.izouma.jmrh.service.ResourceSupplyAndDemandService;
 import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.SecurityUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
@@ -23,124 +22,41 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 @RequestMapping("/resourceSupplyAndDemand")
 @AllArgsConstructor
 public class ResourceSupplyAndDemandController extends BaseController {
     private ResourceSupplyAndDemandService resourceSupplyAndDemandService;
-    private ResourceSupplyAndDemandRepo resourceSupplyAndDemandRepo;
-    private ResSnDPropertyRepo resSnDPropertyRepo;
-    private OrgInfoRepo orgInfoRepo;
-    private DataTypeRepo dataTypeRepo;
-    private ConversationRepo conversationRepo;
+    private ResourceSupplyAndDemandRepo    resourceSupplyAndDemandRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public ResSnDAndPropertyDTO save(@RequestBody ResSnDAndPropertyDTO record) {
-        if (SecurityUtils.getAuthenticatedUser() == null) {
-            throw new BusinessException("用户未登录");
-        }
-        if (record.getResSnD() == null || record.getPropertyList() == null) {
-            throw new BusinessException("信息不完善");
-        }
-        if (record.getResSnD().getId() != null) {
-            ResourceSupplyAndDemand orig = resourceSupplyAndDemandRepo.findById(record.getResSnD().getId())
-                    .orElseThrow(new BusinessException("无记录"));
-            ObjUtils.merge(orig, record);
-            record.setResSnD(resourceSupplyAndDemandRepo.save(orig));
-        } else {
-            record.getResSnD().setStatus(AuditStatus.PENDING);
-            record.getResSnD().setPublishersId(SecurityUtils.getAuthenticatedUser().getId());
-            record.getResSnD().setOrgId(SecurityUtils.getAuthenticatedUser().getOrgInfo().getId());
-            record.setResSnD(resourceSupplyAndDemandRepo.save(record.getResSnD()));
-        }
-        resSnDPropertyRepo.deleteByResSnDId(record.getResSnD().getId());
-        record.getPropertyList().forEach(item -> {
-            item.setId(null);
-            item.setResSnDId(record.getResSnD().getId());
-            resSnDPropertyRepo.save(item);
-        });
-        return record;
+        return resourceSupplyAndDemandService.save(record);
     }
 
-
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
-    /*
-     * 查询添加对接状态
-     * */
     public Page<ResourceSupplyAndDemand> all(PageQuery pageQuery) {
-        Page<ResourceSupplyAndDemand> all = resourceSupplyAndDemandRepo
+        return resourceSupplyAndDemandRepo
                 .findAll(getResourceSupplyAndDemand(pageQuery, ResourceSupplyAndDemand.class), toPageRequest(pageQuery));
-        User user = SecurityUtils.getAuthenticatedUser();
-        if (user != null) {
-            ArrayList<Exist> exists = new ArrayList<>();
-            exists.add(Exist.ON_DELETED);
-            all.getContent().forEach(item -> {
-                Conversation conversation = null;
-                if (item.getPublishersId().equals(user.getId())) {
-                    conversation = conversationRepo
-                            .findByResourceSupplyDemandAndPublisherVisibleAndConversationUserId(item, true, user.getId());
-
-                } else {
-                    conversation = conversationRepo
-                            .findByResourceSupplyDemandAndUserVisibleAndConversationUserId(item, true, user.getId());
-
-                }
-                if (conversation != null) {
-                    item.setConversationStatus(conversation.getStatus());
-                }
-            });
-        }
-        return all;
     }
 
-    //我发布的
-    @GetMapping("/getMyAll")
-    public Page<ResourceSupplyAndDemand> getMyAll(PageQuery pageQuery) {
-        pageQuery.getQuery().put("publishersId", SecurityUtils.getAuthenticatedUser().getId());
-        Page<ResourceSupplyAndDemand> all = resourceSupplyAndDemandRepo
-                .findAll(getResourceSupplyAndDemand(pageQuery, ResourceSupplyAndDemand.class), toPageRequest(pageQuery));
-        all.getContent().forEach(item -> {
-            List<Conversation> demand = conversationRepo.findByResourceSupplyDemandAndUserVisible(item, true);
-            item.setCount(demand.size());
-        });
-        return all;
+    @PostMapping("/allDTO")
+    @ApiOperation("前端列表查询")
+    public Page<SndDTO> allDTO(@RequestBody PageQuery pageQuery) {
+        return resourceSupplyAndDemandService
+                .allDTO(Optional.ofNullable(SecurityUtils.getAuthenticatedUser()).map(BaseEntity::getId)
+                        .orElse(null), pageQuery);
     }
 
     @GetMapping("/get/{id}")
-    public Map<String, Object> get(@PathVariable Long id) {
-        HashMap<String, Object> map = new HashMap<>();
-        User user = SecurityUtils.getAuthenticatedUser();
-        ResourceSupplyAndDemand resourceSupplyAndDemand = resourceSupplyAndDemandRepo.findById(id)
-                .orElseThrow(new BusinessException("无记录"));
-        OrgInfo orgInfo = orgInfoRepo.findById(resourceSupplyAndDemand.getOrgId())
-                .orElseThrow(new BusinessException("无记录"));
-        map.put("resourceSupplyAndDemand", resourceSupplyAndDemand);
-        map.put("orgInfo", orgInfo);
-        if (user != null) {
-            ArrayList<Exist> exists = new ArrayList<>();
-            exists.add(Exist.ON_DELETED);
-            Conversation conversation = null;
-            if (resourceSupplyAndDemand.getPublishersId().equals(user.getId())) {
-                conversation = conversationRepo
-                        .findByResourceSupplyDemandAndPublisherVisibleAndConversationUserId(resourceSupplyAndDemand, true, user.getId());
-
-            } else {
-                conversation = conversationRepo
-                        .findByResourceSupplyDemandAndUserVisibleAndConversationUserId(resourceSupplyAndDemand, true, user.getId());
-
-            }
-            if (conversation != null) {
-                resourceSupplyAndDemand.setConversationStatus(conversation.getStatus());
-            }
-        }
-        return map;
+    public SndDTO get(@PathVariable Long id) {
+        return resourceSupplyAndDemandService
+                .get(id, Optional.ofNullable(SecurityUtils.getAuthenticatedUser()).map(BaseEntity::getId)
+                        .orElse(null));
     }
 
     @PostMapping("/del/{id}")
@@ -155,26 +71,29 @@ public class ResourceSupplyAndDemandController extends BaseController {
         ExcelUtils.export(response, data);
     }
 
-    /*
-    首页
-    * */
-    @GetMapping("/getDataCount")
-    public List<Map<String, Object>> getDataCount(@RequestParam String productType, @RequestParam String techType) {
-        return resourceSupplyAndDemandService.getDataCountList(productType, techType);
-    }
-
-    @GetMapping("/count")
-    public long count(PageQuery pageQuery) {
-        pageQuery.getQuery().put("status", AuditStatus.PENDING);
-        return resourceSupplyAndDemandRepo.count(toSpecification(pageQuery, ResourceSupplyAndDemandRepo.class));
-    }
-
     @GetMapping("/myCollect")
+    @ApiOperation("我收藏的")
     public Page<SndDTO> myCollect(@RequestParam(required = false) List<ResSnDType> types, Pageable pageable) {
         if (types == null) {
             types = new ArrayList<>();
         }
         return resourceSupplyAndDemandService.myCollect(SecurityUtils.getAuthenticatedUser().getId(), types, pageable);
     }
+
+    @GetMapping("/my")
+    @ApiOperation("我发布的")
+    public Page<SndDTO> my(@RequestParam(required = false) List<ResSnDType> types, Pageable pageable) {
+        return resourceSupplyAndDemandService.my(SecurityUtils.getAuthenticatedUser().getId(), types, pageable);
+    }
+
+    @GetMapping("/myDocking")
+    @ApiOperation("我对接的")
+    public Page<SndDTO> myDocking(@RequestParam(required = false) DockingRole role, List<ResSnDType> types, Pageable pageable) {
+        if (role == null) {
+            role = DockingRole.DOCKING;
+        }
+        return resourceSupplyAndDemandService
+                .myDocking(SecurityUtils.getAuthenticatedUser().getId(), role, types, pageable);
+    }
 }
 

+ 0 - 185
src/main/java/com/izouma/jmrh/web/UtilBaseController.java

@@ -1,185 +0,0 @@
-package com.izouma.jmrh.web;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.izouma.jmrh.annotations.Searchable;
-import com.izouma.jmrh.domain.*;
-import com.izouma.jmrh.dto.PageQuery;
-import com.izouma.jmrh.utils.DateTimeUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.jpa.domain.Specification;
-
-import javax.persistence.criteria.Join;
-import javax.persistence.criteria.JoinType;
-import javax.persistence.criteria.Predicate;
-import java.lang.reflect.Field;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.regex.Pattern;
-
-@SuppressWarnings("ALL")
-@Slf4j
-public class UtilBaseController {
-    public PageRequest toPageRequest(PageQuery pageQuery) {
-        PageRequest pageRequest;
-        if (StringUtils.isNotEmpty(pageQuery.getSort())) {
-            List<Sort.Order> orders = new ArrayList<>();
-            for (String sortStr : pageQuery.getSort().split(";")) {
-                String direction = "asc";
-                String prop = sortStr;
-                if (sortStr.contains(",asc") || sortStr.contains(",desc")) {
-                    prop = sortStr.split(",")[0];
-                    direction = sortStr.split(",")[1];
-                }
-                orders.add("asc".equals(direction) ? Sort.Order.asc(prop) : Sort.Order.desc(prop));
-            }
-            pageRequest = PageRequest.of(pageQuery.getPage(), pageQuery.getSize(), Sort.by(orders));
-        } else {
-            pageRequest = PageRequest.of(pageQuery.getPage(), pageQuery.getSize());
-        }
-        return pageRequest;
-    }
-
-
-    public <T> Specification<T> toSpecification(PageQuery pageQuery, Class<?> queryClass) {
-        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> {
-            List<Predicate> and = new ArrayList<>();
-            pageQuery.getQuery().forEach((property, value) -> {
-                if (value == null) {
-                    return;
-                }
-                if (String.class.equals(value.getClass())) {
-                    if (StringUtils.isEmpty((String) value)) {
-                        return;
-                    }
-                }
-                Field field = getDeclaredField(queryClass, property);
-                if (field == null) return;
-                Class fieldType = field.getType();
-                if (Enum.class.isAssignableFrom(fieldType)) {
-                    if (value instanceof Collection) {
-                        if (!((Collection) value).isEmpty()) {
-                            List list = new ArrayList();
-                            for (Object o : ((Collection) value)) {
-                                list.add(Enum.valueOf(fieldType, String.valueOf(o)));
-                            }
-                            and.add(root.get(property).in(list));
-                        }
-                    } else if (value instanceof String && StringUtils.isNotEmpty((String) value)) {
-                        if (((String) value).contains(",")) {
-                            String[] arr = ((String) value).split(",");
-                            List list = new ArrayList();
-                            for (String s : arr) {
-                                list.add(Enum.valueOf(fieldType, s));
-                            }
-                            and.add(root.get(property).in(list));
-                        } else {
-                            and.add(criteriaBuilder.and(criteriaBuilder
-                                    .equal(root.get(property), Enum.valueOf(fieldType, String.valueOf(value)))));
-                        }
-                    }
-                } else if (LocalDateTime.class == fieldType) {
-                    if (value instanceof List) {
-                        List list = (List) value;
-                        if (list.size() == 1) {
-                            LocalDateTime start = DateTimeUtils
-                                    .toLocalDateTime((String) list.get(0), "yyyy-MM-dd HH:mm:ss");
-                            and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        } else if (list.size() == 2) {
-                            LocalDateTime end = DateTimeUtils
-                                    .toLocalDateTime((String) list.get(1), "yyyy-MM-dd HH:mm:ss");
-                            and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                        }
-                    } else if (value instanceof String && Pattern
-                            .matches("^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$", (String) value)) {
-                        String[] arr = ((String) value).split(",");
-                        LocalDateTime start = DateTimeUtils.toLocalDateTime(arr[0], "yyyy-MM-dd HH:mm:ss");
-                        and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        LocalDateTime end = DateTimeUtils.toLocalDateTime(arr[1], "yyyy-MM-dd HH:mm:ss");
-                        and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), DateTimeUtils
-                                .toLocalDateTime((String) value, "yyyy-MM-dd HH:mm:ss"))));
-                    }
-                } else if (LocalDate.class == fieldType) {
-                    if (value instanceof List) {
-                        List list = (List) value;
-                        if (list.size() == 1) {
-                            LocalDate start = DateTimeUtils
-                                    .toLocalDate((String) list.get(0), "yyyy-MM-dd");
-                            and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        } else if (list.size() == 2) {
-                            LocalDate end = DateTimeUtils
-                                    .toLocalDate((String) list.get(1), "yyyy-MM-dd");
-                            and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                        }
-                    } else if (value instanceof String && Pattern
-                            .matches("^\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}$", (String) value)) {
-                        String[] arr = ((String) value).split(",");
-                        LocalDate start = DateTimeUtils.toLocalDate(arr[0], "yyyy-MM-dd");
-                        and.add(criteriaBuilder.greaterThanOrEqualTo(root.get(property), start));
-                        LocalDate end = DateTimeUtils.toLocalDate(arr[1], "yyyy-MM-dd");
-                        and.add(criteriaBuilder.lessThanOrEqualTo(root.get(property), end));
-                    } else {
-                        and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), DateTimeUtils
-                                .toLocalDateTime((String) value, "yyyy-MM-dd"))));
-                    }
-                } else if (fieldType == DataType.class) {
-                    Class cla = queryClass;
-                    Join<DataType, Class> join = root.join(property, JoinType.LEFT);
-                    ObjectMapper objectMapper = new ObjectMapper();
-                    DataType articleType = objectMapper.convertValue(value, DataType.class);
-                    if (StringUtils.isNotEmpty(articleType.getKeyType())) {
-                        and.add(criteriaBuilder.equal(join.get("keyType"), articleType.getKeyType()));
-                    }
-                    if (articleType.getId() != null && articleType.getId() > 0) {
-                        and.add(criteriaBuilder.equal(join.get("id"), articleType.getId()));
-                    }
-
-                } else {
-                    and.add(criteriaBuilder.and(criteriaBuilder.equal(root.get(property), value)));
-                }
-            });
-            if (StringUtils.isNotEmpty(pageQuery.getSearch())) {
-                Field[] fields = queryClass.getDeclaredFields();
-                List<Predicate> or = new ArrayList<>();
-                try {
-                    if (StringUtils.isNumeric(pageQuery.getSearch())) {
-                        or.add(criteriaBuilder.equal(root.get("id"), Long.parseLong(pageQuery.getSearch())));
-                    }
-                } catch (Exception ignored) {
-                }
-                for (Field field : fields) {
-                    Searchable annotation = field.getAnnotation(Searchable.class);
-                    if (annotation == null) {
-                        continue;
-                    }
-                    if (!annotation.value()) {
-                        continue;
-                    }
-                    or.add(criteriaBuilder.like(root.get(field.getName()), "%" + pageQuery.getSearch() + "%"));
-                }
-                and.add(criteriaBuilder.or(or.toArray(new Predicate[0])));
-            }
-            return criteriaBuilder.and(and.toArray(new Predicate[0]));
-        };
-    }
-
-    private Field getDeclaredField(Class<?> clazz, String property) {
-        String className = clazz.getName();
-        while (clazz != null && clazz != Object.class) {
-            try {
-                return clazz.getDeclaredField(property);
-            } catch (NoSuchFieldException ignored) {
-            }
-            clazz = clazz.getSuperclass();
-        }
-        log.error("no such field [{}] in class [{}]", property, className);
-        return null;
-    }
-}

BIN
src/main/jmrh/src/assets/top_nav.png


BIN
src/main/jmrh/src/assets/xiaoxi_icon_xitong.png


+ 1 - 1
src/main/jmrh/src/components/announcement.vue

@@ -22,7 +22,7 @@
                         <li
                             v-for="n in inform"
                             :key="n.id"
-                            @click="$router.push({ name: 'article', query: { id: n.id } })"
+                            @click="$router.push({ name: 'article', query: { id: n.id, typeId: 1108 } })"
                         >
                             {{ n.title }}
                         </li>

+ 4 - 4
src/main/jmrh/src/components/enterprise/financingRelease.vue

@@ -16,9 +16,9 @@
                     class="con_card"
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 3 } })"
+                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'RES_SUPPLY' } })"
                 >
-                    <img :src="item.picList[0].url" />
+                    <img :src="item.images[0]" />
                     <h5>{{ item.name }}</h5>
                     <p>{{ item.description }}</p>
                 </li>
@@ -49,7 +49,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/tresource/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc'
         };
     },
@@ -69,7 +69,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'RES_SUPPLY' } };
         }
     }
 };

+ 12 - 8
src/main/jmrh/src/components/enterprise/financingRequire.vue

@@ -15,22 +15,26 @@
                 <li
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 3 } })"
+                    @click="
+                        $router.push({ name: 'resourceFanceDetail', query: { id: item.id, type: 'FINANCING_DEMAND' } })
+                    "
                 >
-                    <img :src="item.pic" />
+                    <img :src="item.images" />
                     <div class="con_main_right">
                         <div class="con_main_tit">
-                            <i>正在对接</i><span>{{ item.name }}</span>
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
                         </div>
                         <div class="con_info">
                             <div class="con_info_item">
-                                <i>计划融资</i><span>{{ item.planMoney }}</span>
+                                <i>计划融资</i><span>{{ item.resSnDPropertyList[0].value }}</span>
                             </div>
                             <div class="con_info_item">
-                                <i>融资阶段</i><span>{{ item.stageType.name }}</span>
+                                <i>融资阶段</i><span>{{ item.resSnDPropertyList[1].value }}</span>
                             </div>
                             <div class="con_info_item">
-                                <i>行业类型</i><span>{{ item.dataType.name }}</span>
+                                <i>行业类型</i><span>{{ item.resSnDPropertyList[2].value }}</span>
                             </div>
                         </div>
                         <span class="con_time">{{ item.createdAt }}</span>
@@ -62,7 +66,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/financingNeeds/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc'
         };
     },
@@ -82,7 +86,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'FINANCING_DEMAND' } };
         }
     }
 };

+ 1 - 1
src/main/jmrh/src/components/enterprise/listSupplyDemand.vue

@@ -54,7 +54,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/orgInfo/urlListSupplyDemand',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'tep.createdAt,desc'
         };
     },

+ 4 - 4
src/main/jmrh/src/components/enterprise/productRelease.vue

@@ -16,9 +16,9 @@
                     class="con_card"
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 1 } })"
+                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'PRODUCT_SUPPLY' } })"
                 >
-                    <img :src="item.picList[0].url" />
+                    <img :src="item.images[0]" />
                     <h5>{{ item.name }}</h5>
                     <p>{{ item.description }}</p>
                 </li>
@@ -48,7 +48,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: 'product/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc'
         };
     },
@@ -68,7 +68,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'PRODUCT_SUPPLY' } };
         }
     }
 };

+ 12 - 6
src/main/jmrh/src/components/enterprise/productRequire.vue

@@ -15,15 +15,17 @@
                 <li
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 1 } })"
+                    @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 'PRODUCT_DEMAND' } })"
                 >
-                    <img :src="item.pic" />
+                    <img :src="item.images" />
                     <div class="con_main_right">
                         <div class="con_main_tit">
-                            <i>正在对接</i><span>{{ item.name }}</span>
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
                         </div>
                         <p>
-                            {{ item.needInfo }}
+                            {{ item.description }}
                         </p>
                         <span class="con_time">{{ item.createdAt }}</span>
                     </div>
@@ -54,7 +56,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/productNeed/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc'
         };
     },
@@ -74,7 +76,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'PRODUCT_DEMAND' } };
         }
     }
 };
@@ -154,6 +156,10 @@ export default {
                 padding: 5px 3px;
                 margin-right: 6px;
             }
+            .wait {
+                background-color: #ffebe8;
+                color: #ff4a33;
+            }
             span {
                 font-size: 14px;
                 color: #000;

+ 11 - 5
src/main/jmrh/src/components/enterprise/techRelease.vue

@@ -15,12 +15,14 @@
                 <li
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 2 } })"
+                    @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'TECH_SUPPLY' } })"
                 >
-                    <img :src="item.picList[0].url" />
+                    <img :src="item.images[0]" />
                     <div class="con_main_right">
                         <div class="con_main_tit">
-                            <i>正在对接</i><span>{{ item.name }}</span>
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
                         </div>
                         <p>
                             {{ item.description }}
@@ -54,7 +56,7 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/artProduct/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc'
         };
     },
@@ -74,7 +76,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'TECH_SUPPLY' } };
         }
     }
 };
@@ -154,6 +156,10 @@ export default {
                 padding: 5px 3px;
                 margin-right: 6px;
             }
+            .wait {
+                background-color: #ffebe8;
+                color: #ff4a33;
+            }
             span {
                 font-size: 14px;
                 color: #000;

+ 16 - 7
src/main/jmrh/src/components/enterprise/techRequier.vue

@@ -15,15 +15,18 @@
                 <li
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 1 } })"
+                    @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 'TECH_DEMAND' } })"
                 >
-                    <img :src="item.pic" />
+                    <img :src="item.images" />
                     <div class="con_main_right">
                         <div class="con_main_tit">
-                            <i>正在对接</i><span>{{ item.name }}</span>
+                            <!-- <i>正在对接</i><span>{{ item.name }}</span> -->
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
                         </div>
                         <p>
-                            {{ item.needInfo }}
+                            {{ item.description }}
                         </p>
                         <span class="con_time">{{ item.createdAt }}</span>
                     </div>
@@ -54,9 +57,11 @@ export default {
         return {
             active: true,
             isSort: 2, //1为升序,2为降序
-            url: '/artNeed/all',
+            // url: '/artNeed/all',
+            url: '/resourceSupplyAndDemand/all',
             sortStr: 'createdAt,desc',
-            totalElements: 0
+            totalElements: 0,
+            tableData: {}
         };
     },
     methods: {
@@ -75,7 +80,7 @@ export default {
             this.getData();
         },
         beforeGetData() {
-            return { query: { orgInfo: { id: this.$route.query.id } } };
+            return { query: { orgInfo: { id: this.$route.query.id }, type: 'TECH_DEMAND' } };
         }
     }
 };
@@ -155,6 +160,10 @@ export default {
                 padding: 5px 3px;
                 margin-right: 6px;
             }
+            .wait {
+                background-color: #ffebe8;
+                color: #ff4a33;
+            }
             span {
                 font-size: 14px;
                 color: #000;

+ 38 - 29
src/main/jmrh/src/components/interact/insert.vue

@@ -17,12 +17,12 @@
             <el-dialog width="760px" :title="title" :visible.sync="innerVisible" append-to-body center>
                 <el-form :model="form" ref="dataForm" :rules="rules" :label-width="formLabelWidth" key="0">
                     <el-form-item label="姓名" prop="name">
-                        <el-input v-model="form.name" placeholder="请输入姓名"></el-input>
+                        <el-input v-model="form.name" placeholder="请输入单位名称"></el-input>
                     </el-form-item>
-                    <el-form-item label="职业" prop="profession">
+                    <el-form-item label="职业" prop="occupation">
                         <el-input v-model="form.profession" placeholder="请输入您的职业"></el-input>
                     </el-form-item>
-                    <el-form-item label="电话" prop="tel">
+                    <el-form-item label="电话" prop="phone">
                         <el-input v-model="form.phone" placeholder="请输入您的联系方式"></el-input>
                     </el-form-item>
                     <el-form-item label="邮箱" prop="email">
@@ -30,7 +30,7 @@
                     </el-form-item>
                     <el-form-item label="证件类型" prop="papersType">
                         <el-select v-model="form.papersType" placeholder="请选择">
-                            <el-option label="身份证" value="IDENTITY_CARDS"></el-option>
+                            <el-option label="身份证" :value="'IDENTITY_CARDS'"></el-option>
                         </el-select>
                     </el-form-item>
                     <el-form-item label="证件编号" prop="num">
@@ -45,23 +45,23 @@
                             style="width:526px"
                         ></el-input>
                     </el-form-item>
-                    <el-form-item label="正文详情" prop="details">
+                    <el-form-item label="正文详情" prop="content">
                         <el-input
-                            v-model="form.details"
+                            v-model="form.content"
                             placeholder="请写明问题有关时间/地点/事实等相关信息,不超过1000字"
                             maxlength="1000"
                             show-word-limit
                             type="textarea"
                             style="width:526px;"
-                            :row="10"
+                            :rows="5"
                         ></el-input>
                     </el-form-item>
-                    <el-form-item label="图片附件" prop="images">
-                        <multi-upload v-model="form.images"> </multi-upload>
+                    <el-form-item label="图片附件" prop="pic">
+                        <multi-upload v-model="form.pics"> </multi-upload>
                     </el-form-item>
-                    <el-form-item label="是否公开" prop="publicity" style="width:400px">
-                        <el-radio v-model="form.publicity" :label="true">是</el-radio>
-                        <el-radio v-model="form.publicity" :label="false">否</el-radio>
+                    <el-form-item label="是否公开" prop="publicity" style="width:400px" v-if="dataType == 1">
+                        <el-radio v-model="form.publicPost" :label="true">是</el-radio>
+                        <el-radio v-model="form.publicPost" :label="false">否</el-radio>
                     </el-form-item>
                 </el-form>
 
@@ -92,7 +92,7 @@ export default {
                 name: [{ required: true, message: '请输入单位名称', trigger: 'blur' }],
                 phone: [{ required: true, message: '请输入您的联系方式', trigger: 'blur' }],
                 title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
-                detail: [{ required: true, message: '请输入正文详情', trigger: 'blur' }]
+                content: [{ required: true, message: '请输入正文详情', trigger: 'blur' }]
             }
         };
     },
@@ -102,27 +102,36 @@ export default {
             this.innerVisible = false;
             this.$emit('toColse', false);
         },
-        save(url) {
-            this.$http.post(url, this.form, { body: 'json' }).then(res => {
-                this.$refs.dataForm.resetFields();
-                this.toShow();
-            });
+        save(url, data) {
+            // this.$http.post(url, this.form, { body: 'json' }).then(res => {
+            //     this.toShow();
+            // });
+            this.$http
+                .post(url, data, { body: 'json' })
+                .then(res => {
+                    if (res) {
+                        this.$message.success('成功');
+                        this.$refs['form'].resetFields();
+                        this.toShow();
+                    }
+                })
+                .catch(e => {
+                    this.$message.error(e.error);
+                });
         },
         add() {
-            this.$refs.dataForm.validate(valid => {
+            this.$refs.form.validate(valid => {
                 if (valid) {
-                    /*                if (this.dataType === 1) {
-                        this.save('/civilAffairsInteraction/save');
-                        this.form.type = dataType;
+                    if (this.dataType === 1) {
+                        this.form.type = 'OFFICIAL';
+                        this.save('/post/create', this.form);
                     } else if (this.dataType === 2) {
-                        this.form.type = 'HOT';
-                        this.save('/civilAffairsInteraction/save');
+                        this.form.type = 'TOPIC';
+                        this.save('/post/create', this.form);
                     } else if (this.dataType === 3) {
-                        this.form.type = 'FORUM';
-                        this.save('/civilAffairsInteraction/save');
-                    } */
-                    this.form.type = this.dataType;
-                    this.save('/civilAffairsInteraction/save');
+                        this.form.type = 'QA';
+                        this.save('/post/create', this.form);
+                    }
                 } else {
                     return false;
                 }

+ 8 - 6
src/main/jmrh/src/components/interact/official.vue

@@ -17,7 +17,7 @@
                         <li
                             v-for="(item, index) in tableData"
                             :key="item.id"
-                            @click="$router.push({ name: 'interactDetail', query: { id: item.id } })"
+                            @click="$router.push({ name: 'interactDetail', query: { id: item.id, type: 'OFFICIAL' } })"
                         >
                             <div>
                                 <i :class="index >= 0 ? 'show' : ''">问</i>
@@ -59,11 +59,13 @@ export default {
     name: '',
     data() {
         return {
-            url: '/civilAffairsInteraction/all',
+            // url: '/question/getAll',
+            url: '/post/allDTO',
+            query: { type: 'OFFICIAL' },
             outerVisible: false,
             title: '',
-            dataType: 'OFFICIAL',
-            query: { type: 'OFFICIAL' }
+            dataType: 'OFFICIAL'
+            // query: { type: 'OFFICIAL' }
         };
     },
     computed: {
@@ -79,8 +81,8 @@ export default {
         },
         open() {
             if (this.$store.state.userInfo) {
-                this.title = '发布问题';
-                this.dataType = 'OFFICIAL';
+                this.title = '发布咨询';
+                this.dataType = 1;
                 this.outerVisible = true;
             } else {
                 this.$alert('用户未登录,请先进行登录?', '提示', {

+ 11 - 6
src/main/jmrh/src/components/interact/problem.vue

@@ -23,8 +23,8 @@
                                     {{ item.title }}
                                 </span>
                             </div>
-                            <span class="author">{{ item.name }}</span>
-                            <span class="num">回复&nbsp;{{ item.count }}</span>
+                            <span class="author">{{ item.nickname }}</span>
+                            <span class="num">回复&nbsp;{{ item.commentNum }}</span>
                             <span class="time">{{ item.createdAt }}</span>
                         </li>
                     </ul>
@@ -59,10 +59,10 @@ export default {
     },
     data() {
         return {
-            url: '/civilAffairsInteraction/getList',
+            // url: '/topic/all',
+            url: '/post/allDTO',
             outerVisible: false,
-
-            query: { type: 'FORUM' },
+            query: { type: 'QA' },
             title: '',
             dataType: 'FORUM'
         };
@@ -73,10 +73,15 @@ export default {
         }
     },
     methods: {
+        // beforeGetData() {
+        //     if (this.search || this.query) {
+        //         return { search: this.search, query: this.query };
+        //     }
+        // },
         open() {
             if (this.$store.state.userInfo) {
                 this.title = '发布问题';
-                this.dataType = 'FORUM';
+                this.dataType = 3;
                 this.outerVisible = true;
             } else {
                 this.$alert('用户未登录,请先进行登录?', '提示', {

+ 14 - 13
src/main/jmrh/src/components/interact/topic.vue

@@ -6,7 +6,7 @@
                     <span>热议话题</span>
                     <button @click="open()">
                         <img src="../../assets/icon_edit.png" alt="" />
-                        <span>发布题</span>
+                        <span>发布题</span>
                     </button>
                 </div>
             </el-row>
@@ -16,7 +16,7 @@
                         <li
                             v-for="(item, index) in tableData"
                             :key="item.id"
-                            @click="$router.push({ name: 'interactDetail2', query: { id: item.id } })"
+                            @click="$router.push({ name: 'interactDetail2', query: { id: item.id, type: 'TOPIC' } })"
                         >
                             <div style="width:500px">
                                 <i :class="index < 3 ? 'show' : ''">热</i>
@@ -24,8 +24,8 @@
                                     {{ item.title }}
                                 </span>
                             </div>
-                            <span class="author">{{ item.name }}</span>
-                            <span class="num">回复&nbsp;{{ item.count }}</span>
+                            <span class="author">{{ item.nickname }}</span>
+                            <span class="num">回复&nbsp;{{ item.commentNum }}</span>
                             <span class="time">{{ item.createdAt }}</span>
                         </li>
                     </ul>
@@ -60,9 +60,10 @@ export default {
     },
     data() {
         return {
-            url: '/civilAffairsInteraction/getList',
+            // url: '/topic/all',
+            url: '/post/allDTO',
             outerVisible: false,
-            query: { type: 'HOT' },
+            query: { type: 'TOPIC' },
             title: '',
             dataType: 'HOT'
         };
@@ -73,15 +74,15 @@ export default {
         }
     },
     methods: {
-        beforeGetData() {
-            if (this.search || this.query) {
-                return { search: this.search, query: this.query };
-            }
-        },
+        // beforeGetData() {
+        //     if (this.search || this.query) {
+        //         return { search: this.search, query: this.query };
+        //     }
+        // },
         open() {
             if (this.$store.state.userInfo) {
-                this.title = '发布题';
-                this.dataType = 'HOT';
+                this.title = '发布题';
+                this.dataType = 2;
                 this.outerVisible = true;
             } else {
                 this.$alert('用户未登录,请先进行登录?', '提示', {

+ 137 - 0
src/main/jmrh/src/components/message/chatInfo.vue

@@ -0,0 +1,137 @@
+<template>
+    <div>
+        <div class="chatInfo ">
+            <el-avatar :size="48" name="chat" src="../../assets/top_user.png"></el-avatar>
+            <div class="main">
+                <div class="userInfo">
+                    <span class="name">张三</span>
+                    <span class="time">2021.01.06</span>
+                </div>
+                <div class="title">
+                    你好,我对贵方的
+                    <span>新能源汽车一体化集成动力系统相关配套</span>
+                    很感兴趣
+                </div>
+                <div class="card">
+                    <div class="card_item">
+                        <div class="text1">单位名称</div>
+                        <div class="text2">阿里巴巴股份有限公司</div>
+                    </div>
+                    <div class="card_item">
+                        <div class="text1">职位</div>
+                        <div class="text2">运营总监</div>
+                    </div>
+                    <div class="card_item">
+                        <div class="text1">联系人</div>
+                        <div class="text2">张三</div>
+                    </div>
+                    <div class="card_item">
+                        <div class="text1">联系方式</div>
+                        <div class="text2">15686868686</div>
+                    </div>
+                    <div class="card_item">
+                        <div class="text1">对接描述</div>
+                        <div class="text2">
+                            负载采用AC-DC、DC-AC两级变换架构,动态响应速度快、输入电压适应范围宽,可将输入的交流能量全功率段回馈至电网压适应范围宽,可将输入的交流能压适应范围宽
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- <div class="chatInfo">
+            <el-avatar :size="48" name="chat" src="../../assets/top_user.png"></el-avatar>
+            <div class="main">
+                <div class="userInfo">
+                    <span class="name">张三</span>
+                    <span class="time">2021.01.06</span>
+                </div>
+                <div class="content">
+                    嗯嗯,我对贵公司的产品简直不要太喜欢,就算我穷尽我的词汇也无法真实表达我的感受
+                </div>
+            </div>
+        </div> -->
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'chatInfo',
+    data() {
+        return {};
+    }
+};
+</script>
+<style lang="less" scoped>
+.chatInfo {
+    & + .chatInfo {
+        margin-top: 12px;
+    }
+    display: flex;
+    // el-avatar {
+    //     width: 100%;
+    // }
+
+    .main {
+        // flex-grow: 1;
+        margin-left: 10px;
+
+        font-family: PingFangSC-Regular, PingFang SC;
+        .userInfo {
+            .name {
+                font-size: 14px;
+                font-weight: 500;
+                color: #000000;
+                margin-right: 20px;
+            }
+            .time {
+                font-size: 14px;
+                font-weight: 400;
+                color: #c8c9cc;
+            }
+        }
+        .title {
+            // width: 80%;
+            margin: 10px 0px 12px;
+            padding: 12px;
+            background: #f5f7fa;
+            border-radius: 0px 8px 8px 8px;
+            font-size: 14px;
+            font-weight: 400;
+            color: #000000;
+            span {
+                color: #bf1616;
+            }
+        }
+        .card {
+            width: 489px;
+            padding: 12px;
+            background: #f5f7fa;
+            border-radius: 0px 8px 8px 8px;
+            font-size: 14px;
+            font-weight: 400;
+            box-sizing: border-box;
+            .card_item {
+                display: flex;
+                min-height: 30px;
+                .text1 {
+                    color: #939599;
+                    min-width: 60px;
+                    margin-right: 16px;
+                }
+                .text2 {
+                    color: #000000;
+                }
+            }
+        }
+        .content {
+            margin: 10px 0px 12px;
+            padding: 12px;
+            background: #f5f7fa;
+            border-radius: 0px 8px 8px 8px;
+            font-size: 14px;
+            font-weight: 400;
+            color: #000000;
+        }
+    }
+}
+</style>

+ 110 - 0
src/main/jmrh/src/components/message/msgPopups.vue

@@ -0,0 +1,110 @@
+<template>
+    <div>
+        <div class="box" @click="$router.push({ name: 'messageDetails' })">
+            <img src="../../assets/xiaoxi_icon_xitong.png" />
+            <div class="info">
+                <div class="name">系统消息</div>
+                <p>{{ sysList.content }}</p>
+            </div>
+            <div class="time">{{ sysList.createdAt }}</div>
+        </div>
+        <!-- <div class="box" v-for="n in tableData" :key="n.id" >
+                <img :src="n.user.avatar" />
+                <div class="info">
+                    <div class="name">姓名</div>
+                    <p>你好,我对贵方的一体化集成动力设备很感兴趣,有很多细节希望可以进一步沟通一下</p>
+                </div>
+                <div class="time">{{ n.createdAt }}</div>
+            </div> -->
+        <div class="box" v-for="n in conversationList" :key="n.id" @click="$router.push({ name: 'chat' })">
+            <img :src="n.senderAvatar" />
+            <div class="info">
+                <div class="name">{{ n.senderName }}</div>
+                <p>{{ n.content }}</p>
+            </div>
+            <div class="time">{{ n.createdAt }}</div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'msgPopups',
+    data() {
+        return {
+            current: 0,
+            sysList: {},
+            conversationList: {}
+        };
+    },
+    created() {
+        this.$http.get('notificationMessage/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.sysList = res.content;
+        });
+        this.$http.get('notificationMessage/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.conversationList = res.content;
+        });
+    },
+    methods: {
+        getIndex(index) {
+            this.current = index;
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.box {
+    // overflow: hidden;
+    display: flex;
+    padding: 20px 0 20px;
+    height: auto;
+    // box-sizing: content-box;
+    cursor: pointer;
+    img {
+        width: 46px;
+        height: 46px;
+        border-radius: 50%;
+        // background: cadetblue;
+    }
+    .info {
+        // width: 780px;
+        width: 90%;
+        margin-left: 8px;
+        height: auto;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-around;
+        .name {
+            font-size: 14px;
+            font-weight: 500;
+            color: #000000;
+        }
+        p {
+            margin: 0px;
+            // width: 600px;
+            // height: 22px;
+            width: 100%;
+            font-size: 14px;
+
+            color: #c8c9cc;
+            line-height: 22px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+    }
+    .time {
+        width: 20%;
+        height: 22px;
+        font-size: 13px;
+        color: #c8c9cc;
+        line-height: 22px;
+    }
+    + .box {
+        // margin-top: 20px;
+        border-top: 1px solid #f2f3f5;
+    }
+}
+</style>

+ 1 - 1
src/main/jmrh/src/components/news/hot.vue

@@ -11,7 +11,7 @@
                     class="notice"
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'article', query: { id: item.id } })"
+                    @click="$router.push({ name: 'article', query: { id: item.id, typeId: 1002 } })"
                 >
                     <div class="notice_con">
                         <i></i>

+ 2 - 2
src/main/jmrh/src/components/news/qusetion.vue

@@ -2,7 +2,7 @@
     <div>
         <el-row>
             <div class="content_title">
-                <span>通知告</span>
+                <span>通知告</span>
             </div>
         </el-row>
         <el-row>
@@ -11,7 +11,7 @@
                     class="notice"
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'article', query: { id: item.id } })"
+                    @click="$router.push({ name: 'article', query: { id: item.id, typeId: 1108 } })"
                 >
                     <div class="notice_con">
                         <i></i>

+ 1 - 1
src/main/jmrh/src/components/news/topic.vue

@@ -11,7 +11,7 @@
                     class="notice"
                     v-for="item in tableData"
                     :key="item.id"
-                    @click="$router.push({ name: 'article', query: { id: item.id } })"
+                    @click="$router.push({ name: 'article', query: { id: item.id, typeId: 1004 } })"
                 >
                     <div class="notice_con">
                         <i></i>

+ 91 - 23
src/main/jmrh/src/components/resource/financingRelease.vue

@@ -3,27 +3,25 @@
         <div class="filter">
             <div class="first">
                 <div class="name">应用领域</div>
-                <span
-                    :class="query.applicationField.id === 0 ? 'active' : false"
-                    @click="getType('applicationField', 0)"
+                <span :class="show.applicationField.id === '' ? 'active' : false" @click="getTab('应用领域', '')"
                     >全部</span
                 >
                 <span
                     v-for="n in yylyList"
                     :key="n.value"
-                    :class="query.applicationField.id === n.value ? 'active' : false"
-                    @click="getType('applicationField', n.value)"
+                    :class="show.applicationField.id === n.label ? 'active' : false"
+                    @click="getTab('应用领域', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
             <div class="second">
                 <div class="name">设备类型</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <span :class="show.dataType.id === '' ? 'active' : false" @click="getTab('设备类型', '')">全部</span>
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.dataType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('设备类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -43,10 +41,16 @@
                         class="con_card"
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 3 } })"
+                        @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'RES_SUPPLY' } })"
                     >
-                        <img :src="item.picList[0].url" />
-                        <h5>{{ item.name }}</h5>
+                        <img :src="item.images[0]" />
+                        <!-- <h5>{{ item.name }}</h5> -->
+                        <div class="con_title">
+                            <!-- <i>等待对接</i> -->
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
+                        </div>
                         <p>{{ item.description }}</p>
                     </li>
                 </ul>
@@ -75,8 +79,11 @@ export default {
     data() {
         return {
             search: '',
-            url: '/tresource/all',
-            query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/tresource/all',
+            // query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/resourceSupplyAndDemand/all',
+            // query: { type: 'RES_SUPPLY', resSnDPropertyList: '' },
+            show: { applicationField: { id: '' }, dataType: { id: '' } },
             active: true
         };
     },
@@ -86,15 +93,15 @@ export default {
         }
     },
     methods: {
-        getType(type, id) {
-            if ('dataType' === type) {
-                this.query.dataType.id = id;
-            }
-            if ('applicationField' === type) {
-                this.query.applicationField.id = id;
-            }
-            this.getData();
-        },
+        // getType(type, id) {
+        //     if ('dataType' === type) {
+        //         this.query.dataType.id = id;
+        //     }
+        //     if ('applicationField' === type) {
+        //         this.query.applicationField.id = id;
+        //     }
+        //     this.getData();
+        // },
         beforeGetData() {
             if (this.search || this.query) {
                 return { search: this.search, query: this.query };
@@ -119,6 +126,47 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'RES_SUPPLY', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '应用领域') {
+                if (id !== '') {
+                    this.property = { 应用领域: id };
+
+                    this.show.applicationField.id = id;
+                } else {
+                    this.property = {};
+                    this.show.applicationField.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '设备类型') {
+                if (id !== '') {
+                    this.property = { 设备类型: id };
+                    this.show.dataType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.dataType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {
@@ -129,7 +177,7 @@ export default {
     mounted() {
         if (this.$route.query.tabId) {
             let tabId = this.$route.query.tabId;
-            this.query.dataType.id = tabId;
+            this.show.dataType.id = tabId;
         }
     }
 };
@@ -279,6 +327,26 @@ export default {
                 color: #000;
                 margin: 10px 0;
             }
+            .con_title {
+                margin: 10px 0;
+                i {
+                    font-style: normal;
+                    font-size: 12px;
+                    color: #22b197;
+                    background: #ebf9f7;
+                    padding: 5px 3px;
+                    margin-right: 6px;
+                }
+                .wait {
+                    background-color: #ffebe8;
+                    color: #ff4a33;
+                }
+                span {
+                    font-size: 14px;
+                    color: #000;
+                    font-weight: 700;
+                }
+            }
             p {
                 font-size: 12px;
                 color: #939599;

+ 75 - 17
src/main/jmrh/src/components/resource/financingRequire.vue

@@ -3,23 +3,25 @@
         <div class="filter">
             <div class="first">
                 <div class="name">融资阶段</div>
-                <span :class="query.stageType.id === 0 ? 'active' : false" @click="getType('stageType', 0)">全部</span>
+                <span :class="show.stageType.id === '' ? 'active' : false" @click="getTab('融资阶段', '')">全部</span>
                 <span
                     v-for="n in rzjdList"
                     :key="n.value"
-                    :class="query.stageType.id === n.value ? 'active' : false"
-                    @click="getType('stageType', n.value)"
+                    :class="show.stageType.id === n.label ? 'active' : false"
+                    @click="getTab('融资阶段', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
             <div class="second">
-                <div class="name">融资行业</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <div class="name">融资类型</div>
+                <span :class="show.industryType.id === '' ? 'active' : false" @click="getTab('融资类型', '')"
+                    >全部</span
+                >
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.industryType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('融资类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -36,25 +38,33 @@
                     <li
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceFanceDetail', query: { id: item.id, type: 3 } })"
+                        @click="
+                            $router.push({
+                                name: 'resourceFanceDetail',
+                                query: { id: item.id, type: 'FINANCING_DEMAND' }
+                            })
+                        "
                     >
-                        <img :src="item.pic" />
+                        <img :src="item.images" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
-                                <i :class="item.state === 1 ? 'wait' : ''">{{
+                                <!-- <i :class="item.state === 1 ? 'wait' : ''">{{
                                     item.state === 1 ? '等待对接' : '正在对接'
-                                }}</i>
+                                }}</i> -->
+                                <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
                                 <span>{{ item.name }}</span>
                             </div>
                             <div class="con_info">
                                 <div class="con_info_item">
-                                    <i>计划融资</i><span>{{ item.planMoney }}</span>
+                                    <i>计划融资</i><span>{{ item.resSnDPropertyList[0].value }}</span>
                                 </div>
                                 <div class="con_info_item">
-                                    <i>融资阶段</i><span>{{ item.stageType.name }}</span>
+                                    <i>融资阶段</i><span>{{ item.resSnDPropertyList[1].value }}</span>
                                 </div>
                                 <div class="con_info_item">
-                                    <i>行业类型</i><span>{{ item.dataType.name }}</span>
+                                    <i>融资类型:</i>
+                                    <span>{{ item.resSnDPropertyList[2].value }}</span>
                                 </div>
                             </div>
                             <span class="con_time">{{ item.createdAt }}</span>
@@ -86,10 +96,16 @@ export default {
     data() {
         return {
             search: '',
-            url: '/financingNeeds/all',
-            query: { stageType: { id: 0 }, dataType: { id: 0 }, state: '1,3' },
+            // url: '/financingNeeds/all',
+            // query: { stageType: { id: 0 }, dataType: { id: 0 }, state: '1,3' },
+            // url: '/resourceSupplyAndDemand/all',
+            // query: { type: 'FINANCING_DEMAND', resSnDPropertyList: '' },
+            show: { stageType: { id: '' }, industryType: { id: '' } },
             pageSize: 5,
             active: true
+            // planMoney: '',
+            // resSnDPropertyList: {},
+            // list: {}
         };
     },
     computed: {
@@ -122,16 +138,58 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'FINANCING_DEMAND', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '融资阶段') {
+                if (id !== '') {
+                    this.property = { 融资阶段: id };
+
+                    this.show.stageType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.stageType.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '融资类型') {
+                if (id !== '') {
+                    this.property = { 融资类型: id };
+                    this.show.industryType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.industryType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {
         this.getDataType({ query: { keyType: 'rzjd' } }, this.rzjdList);
         this.getDataType({ query: { keyType: 'rzhy' } }, this.sblxList);
+        this.getData();
     },
     mounted() {
         if (this.$route.query.tabId) {
             let tabId = this.$route.query.tabId;
-            this.query.dataType.id = tabId;
+            this.show.industryType.id = tabId;
         }
     }
 };

+ 83 - 13
src/main/jmrh/src/components/resource/productRelease.vue

@@ -3,27 +3,25 @@
         <div class="filter">
             <div class="first">
                 <div class="name">应用领域</div>
-                <span
-                    :class="query.applicationField.id === 0 ? 'active' : false"
-                    @click="getType('applicationField', 0)"
+                <span :class="show.applicationField.id === '' ? 'active' : false" @click="getTab('应用领域', '')"
                     >全部</span
                 >
                 <span
                     v-for="n in yylyList"
                     :key="n.value"
-                    :class="query.applicationField.id === n.value ? 'active' : false"
-                    @click="getType('applicationField', n.value)"
+                    :class="show.applicationField.id === n.label ? 'active' : false"
+                    @click="getTab('应用领域', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
             <div class="second">
                 <div class="name">设备类型</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <span :class="show.dataType.id === '' ? 'active' : false" @click="getTab('设备类型', '')">全部</span>
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.dataType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('设备类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -41,10 +39,18 @@
                         class="con_card"
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 1 } })"
+                        @click="
+                            $router.push({ name: 'resourceRelease', query: { id: item.id, type: 'PRODUCT_SUPPLY' } })
+                        "
                     >
-                        <img :src="item.picList[0].url" />
-                        <h5>{{ item.name }}</h5>
+                        <img :src="item.images[0]" />
+                        <!-- <h5>{{ item.name }}</h5> -->
+                        <div class="con_title">
+                            <!-- <i>等待对接</i> -->
+                            <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                            <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                            <span>{{ item.name }}</span>
+                        </div>
                         <p>{{ item.description }}</p>
                     </li>
                 </ul>
@@ -73,8 +79,11 @@ export default {
     data() {
         return {
             search: '',
-            url: '/product/all',
-            query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/product/all',
+            // query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/resourceSupplyAndDemand/all',
+            // query: { type: 'PRODUCT_SUPPLY', resSnDPropertyList: '' },
+            show: { applicationField: { id: '' }, dataType: { id: '' } },
             active: true
         };
     },
@@ -108,6 +117,47 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'PRODUCT_SUPPLY', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '应用领域') {
+                if (id !== '') {
+                    this.property = { 应用领域: id };
+
+                    this.show.applicationField.id = id;
+                } else {
+                    this.property = {};
+                    this.show.applicationField.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '设备类型') {
+                if (id !== '') {
+                    this.property = { 设备类型: id };
+                    this.show.dataType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.dataType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {
@@ -258,6 +308,26 @@ export default {
                 color: #000;
                 margin: 10px 0;
             }
+            .con_title {
+                margin: 10px 0;
+                i {
+                    font-style: normal;
+                    font-size: 12px;
+                    color: #22b197;
+                    background: #ebf9f7;
+                    padding: 5px 3px;
+                    margin-right: 6px;
+                }
+                .wait {
+                    background-color: #ffebe8;
+                    color: #ff4a33;
+                }
+                span {
+                    font-size: 14px;
+                    color: #000;
+                    font-weight: 700;
+                }
+            }
             p {
                 font-size: 12px;
                 color: #939599;

+ 63 - 17
src/main/jmrh/src/components/resource/productRequire.vue

@@ -3,27 +3,25 @@
         <div class="filter">
             <div class="first">
                 <div class="name">应用领域</div>
-                <span
-                    :class="query.applicationField.id === 0 ? 'active' : false"
-                    @click="getType('applicationField', 0)"
+                <span :class="show.applicationField.id === '' ? 'active' : false" @click="getTab('应用领域', '')"
                     >全部</span
                 >
                 <span
                     v-for="n in yylyList"
                     :key="n.value"
-                    :class="query.applicationField.id === n.value ? 'active' : false"
-                    @click="getType('applicationField', n.value)"
+                    :class="show.applicationField.id === n.label ? 'active' : false"
+                    @click="getTab('应用领域', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
             <div class="second">
                 <div class="name">设备类型</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <span :class="show.dataType.id === '' ? 'active' : false" @click="getTab('设备类型', '')">全部</span>
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.dataType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('设备类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -40,18 +38,22 @@
                     <li
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 2 } })"
+                        @click="
+                            $router.push({ name: 'resourceDetail', query: { id: item.id, type: 'PRODUCT_DEMAND' } })
+                        "
                     >
-                        <img :src="item.pic" />
+                        <img :src="item.images" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
-                                <i :class="item.state === 1 ? 'wait' : ''">{{
-                                    item.state === 1 ? '等待对接' : '正在对接'
-                                }}</i>
+                                <!-- <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
+                                    item.status === 'PENDING' ? '等待对接' : '正在对接'
+                                }}</i> -->
+                                <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
                                 <span>{{ item.name }}</span>
                             </div>
                             <p>
-                                {{ item.needInfo }}
+                                {{ item.description }}
                             </p>
                             <span class="con_time">{{ item.createdAt }}</span>
                         </div>
@@ -82,9 +84,12 @@ export default {
     data() {
         return {
             search: '',
-            url: '/productNeed/all',
-            query: { applicationField: { id: 0 }, dataType: { id: 0 } },
-            active: true
+            // url: '/resourceSupplyAndDemand/all',
+            // query: { type: 'PRODUCT_DEMAND', resSnDPropertyList: '' },
+            // applicationField: { id: 0 }, dataType: { id: 0 }
+            active: true,
+            show: { applicationField: { id: '' }, dataType: { id: '' } },
+            property: {}
         };
     },
     computed: {
@@ -117,6 +122,47 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'PRODUCT_DEMAND', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '应用领域') {
+                if (id !== '') {
+                    this.property = { 应用领域: id };
+
+                    this.show.applicationField.id = id;
+                } else {
+                    this.property = {};
+                    this.show.applicationField.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '设备类型') {
+                if (id !== '') {
+                    this.property = { 设备类型: id };
+                    this.show.dataType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.dataType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {

+ 16 - 11
src/main/jmrh/src/components/resource/recommendToU.vue

@@ -3,7 +3,9 @@
         <div class="rec_card_title">为你推荐</div>
         <div class="rec_card_line"></div>
         <div class="rec_card" @click="Go">
-            <img :src="list[0] ? list[0].pic : null" />
+            <!-- <img :src="list[this.index] ? list[this.index].images : null" />
+            <div class="rec_card_name">{{ list[this.index] ? list[this.index].name : null }}</div> -->
+            <img :src="list[0] ? list[0].images : null" />
             <div class="rec_card_name">{{ list[0] ? list[0].name : null }}</div>
         </div>
     </div>
@@ -19,12 +21,13 @@ export default {
             url: '',
 
             list: []
+            // index: 0
         };
     },
 
     methods: {
         Go() {
-            if (this.type === 3) {
+            if (this.type === 'FINANCING_DEMAND') {
                 this.$router.push({
                     name: 'resourceFanceDetail',
                     query: { id: this.list[0].id, type: this.type }
@@ -35,19 +38,21 @@ export default {
         },
         getData() {
             this.type;
+            console.log(this.type);
             this.dataType;
-            if (this.type == 1) {
-                this.url = '/artNeed/all';
-            } else if (this.type == 2) {
-                this.url = '/productNeed/all';
-            } else if (this.type == 3) {
-                this.url = '/financingNeeds/all';
-            }
-            this.query.dataType.id = this.dataType;
+            // if (this.type == 'TECH_DEMAND') {
+            //     // this.url = '/artNeed/all';
+            // } else if (this.type == 'PRODUCT_DEMAND') {
+            //     // this.url = '/productNeed/all';
+            // } else if (this.type == 'FINANCING_DEMAND') {
+            //     // this.url = '/financingNeeds/all';
+            // }
+            // this.query.dataType.id = this.dataType;
             this.$http
-                .get(this.url, this.query)
+                .get('/resourceSupplyAndDemand/all', { query: { type: this.type } })
                 .then(res => {
                     this.list = res.content;
+                    // this.index = Math.floor(Math.random() * (this.list.length - 0) + 0);
                 })
                 .catch(e => {
                     console.log(e);

+ 56 - 14
src/main/jmrh/src/components/resource/techRelease.vue

@@ -3,27 +3,25 @@
         <div class="filter">
             <div class="first">
                 <div class="name">应用领域</div>
-                <span
-                    :class="query.applicationField.id === 0 ? 'active' : false"
-                    @click="getType('applicationField', 0)"
+                <span :class="show.applicationField.id === '' ? 'active' : false" @click="getTab('应用领域', '')"
                     >全部</span
                 >
                 <span
                     v-for="n in yylyList"
                     :key="n.value"
-                    :class="query.applicationField.id === n.value ? 'active' : false"
-                    @click="getType('applicationField', n.value)"
+                    :class="show.applicationField.id === n.label ? 'active' : false"
+                    @click="getTab('应用领域', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
             <div class="second">
                 <div class="name">技术类型</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <span :class="show.techType.id === '' ? 'active' : false" @click="getTab('技术类型', '')">全部</span>
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.techType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('技术类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -39,13 +37,13 @@
                     <li
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 2 } })"
+                        @click="$router.push({ name: 'resourceRelease', query: { id: item.id, type: 'TECH_SUPPLY' } })"
                     >
-                        <img :src="item.picList[0].url" />
+                        <img :src="item.images[0]" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
-                                <i :class="item.state === 1 ? 'wait' : ''">{{
-                                    item.state === 1 ? '等待对接' : '正在对接'
+                                <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
+                                    item.status === 'PENDING' ? '等待对接' : '正在对接'
                                 }}</i>
                                 <span>{{ item.name }}</span>
                             </div>
@@ -81,8 +79,11 @@ export default {
     data() {
         return {
             search: '',
-            url: '/artProduct/all',
-            query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/artProduct/all',
+            // query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/resourceSupplyAndDemand/all',
+            // query: { type: 'TECH_SUPPLY', resSnDPropertyList: '' },
+            show: { applicationField: { id: '' }, techType: { id: '' } },
             active: true
         };
     },
@@ -116,6 +117,47 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'TECH_SUPPLY', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '应用领域') {
+                if (id !== '') {
+                    this.property = { 应用领域: id };
+
+                    this.show.applicationField.id = id;
+                } else {
+                    this.property = {};
+                    this.show.applicationField.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '技术类型') {
+                if (id !== '') {
+                    this.property = { 技术类型: id };
+                    this.show.techType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.techType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {

+ 63 - 18
src/main/jmrh/src/components/resource/techRequire.vue

@@ -3,27 +3,26 @@
         <div class="filter">
             <div class="first">
                 <div class="name">应用领域</div>
-                <span
-                    :class="query.applicationField.id === 0 ? 'active' : false"
-                    @click="getType('applicationField', 0)"
+                <span :class="show.applicationField.id === '' ? 'active' : false" @click="getTab('应用领域', '')"
                     >全部</span
                 >
                 <span
                     v-for="n in yylyList"
                     :key="n.value"
-                    :class="query.applicationField.id === n.value ? 'active' : false"
-                    @click="getType('applicationField', n.value)"
-                    >{{ n.label }}</span
+                    :class="show.applicationField.id === n.label ? 'active' : false"
+                    @click="getTab('应用领域', n.label)"
                 >
+                    {{ n.label }}
+                </span>
             </div>
             <div class="second">
                 <div class="name">技术类型</div>
-                <span :class="query.dataType.id === 0 ? 'active' : false" @click="getType('dataType', 0)">全部</span>
+                <span :class="show.techType.id === '' ? 'active' : false" @click="getTab('技术类型', '')">全部</span>
                 <span
-                    :class="query.dataType.id === n.value ? 'active' : false"
+                    :class="show.techType.id === n.label ? 'active' : false"
                     v-for="n in sblxList"
                     :key="n.value"
-                    @click="getType('dataType', n.value)"
+                    @click="getTab('技术类型', n.label)"
                     >{{ n.label }}</span
                 >
             </div>
@@ -40,18 +39,20 @@
                     <li
                         v-for="item in tableData"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 1 } })"
+                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 'TECH_DEMAND' } })"
                     >
-                        <img :src="item.pic" />
+                        <img :src="item.images" />
                         <div class="con_main_right">
                             <div class="con_main_tit">
-                                <i :class="item.state === 1 ? 'wait' : ''">{{
-                                    item.state === 1 ? '等待对接' : '正在对接'
-                                }}</i>
+                                <!-- <i :class="item.status === 'PENDING' ? 'wait' : ''">{{
+                                    item.status === 'PENDING' ? '等待对接' : '正在对接'
+                                }}</i> -->
+                                <i class="wait" v-if="item.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                <i v-if="item.conversationStatus === 'CONDUCTED'"> 正在对接</i>
                                 <span>{{ item.name }}</span>
                             </div>
                             <p>
-                                {{ item.needInfo }}
+                                {{ item.description }}
                             </p>
                             <span class="con_time">{{ item.createdAt }}</span>
                         </div>
@@ -82,10 +83,13 @@ export default {
     data() {
         return {
             search: '',
-            url: '/artNeed/all',
-            query: { applicationField: { id: 0 }, dataType: { id: 0 } },
+            // url: '/resourceSupplyAndDemand/all',
+            // url: '/resourceSupplyAndDemand/allDTO',
+            // query: { type: 'TECH_DEMAND', resSnDPropertyList: '' },
             pageSize: 5,
-            active: true
+            active: true,
+            show: { applicationField: { id: '' }, techType: { id: '' } },
+            property: {}
         };
     },
     computed: {
@@ -118,6 +122,47 @@ export default {
                     type: 'warning'
                 });
             }
+        },
+        getData() {
+            this.$http
+                .post(
+                    '/resourceSupplyAndDemand/allDTO',
+                    {
+                        query: { type: 'TECH_DEMAND', property: this.property }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                    this.totalElements = res.totalElements;
+                    if (this.afterGetData) {
+                        this.afterGetData(res);
+                    }
+                });
+        },
+        getTab(strType, id) {
+            if (strType == '应用领域') {
+                if (id !== '') {
+                    this.property = { 应用领域: id };
+
+                    this.show.applicationField.id = id;
+                } else {
+                    this.property = {};
+                    this.show.applicationField.id = '';
+                    console.log(this.property);
+                }
+            } else if (strType == '技术类型') {
+                if (id !== '') {
+                    this.property = { 技术类型: id };
+                    this.show.techType.id = id;
+                } else {
+                    this.property = {};
+                    this.show.techType.id = '';
+                }
+            }
+
+            this.getData();
         }
     },
     created() {

+ 38 - 7
src/main/jmrh/src/mixins/pageableTable.js

@@ -6,6 +6,7 @@ export default {
             totalPages: 0,
             totalElements: 0,
             tableData: [],
+            typeStr: [],
             sort: {},
             sortStr: '',
             tableHeight: 200,
@@ -32,14 +33,44 @@ export default {
         //this.tableHeight = document.querySelector('.el-table').getBoundingClientRect().height;
     },
     methods: {
-        getType(type, id) {
-            if ('dataType' === type) {
-                this.query.dataType.id = id;
-            } else if ('applicationField' === type) {
-                this.query.applicationField.id = id;
-            } else if ('stageType' === type) {
-                this.query.stageType.id = id;
+        getType(strType, id) {
+            // debugger;
+            if ('融资类型' === strType) {
+                //this.query.resSnDPropertyList.push({ name: type, value: id });
+                this.show.industryType.id = id;
+            } else if ('应用领域' === strType) {
+                //this.query.resSnDPropertyList.push({ name: type, value: id });
+                this.show.applicationField.id = id;
+            } else if ('融资阶段' === strType) {
+                //this.query.resSnDPropertyList.push({ name: type, value: id });
+                this.show.stageType.id = id;
+            } else if ('技术类型' === strType) {
+                this.show.techType.id = id;
+            } else if ('设备类型' === strType) {
+                this.show.dataType.id = id;
             }
+
+            let strTypeIndex = this.query.resSnDPropertyList.indexOf(strType);
+            let valueIndex = this.query.resSnDPropertyList.indexOf(id);
+            if (strTypeIndex == -1 && valueIndex == -1) {
+                this.typeStr.push('name:' + strType + ',value:' + id);
+            } else {
+                // debugger;
+                this.typeStr.forEach((item, index) => {
+                    let strIndex = item.indexOf(strType);
+                    if (strIndex != -1) {
+                        this.typeStr.splice(index, 1);
+
+                        console.log(this.typeStr);
+                    }
+                });
+                this.typeStr.push('name:' + strType + ',value:' + id);
+            }
+            // debugger;
+            // this.typeStr = [];
+            // this.typeStr.push(id);
+            // this.query.contact = this.typeStr.join(';');
+            this.query.resSnDPropertyList = this.typeStr.join(';');
             this.getData();
         },
         getDataType(data, list) {

+ 2 - 2
src/main/jmrh/src/plugins/http.js

@@ -5,8 +5,8 @@ import qs from 'qs';
 let baseUrl = 'http://127.0.0.1:8080';
 switch (process.env.NODE_ENV) {
     case 'development':
-        // baseUrl = 'http://localhost:8081';
-        baseUrl = 'http://127.0.0.1:8080/';
+        baseUrl = 'http://localhost:8080';
+        // baseUrl = 'http://127.0.0.1:8080/';
         break;
     case 'test':
         // baseUrl = 'http://localhost:8081';

+ 57 - 6
src/main/jmrh/src/router/index.js

@@ -52,6 +52,15 @@ const routes = [
                     menu: 'policy'
                 }
             },
+            {
+                path: '/policyArticle',
+                name: 'policyArticle',
+                component: () => import(/* webpackChunkName: "policy" */ '@/views/policyArticle.vue'),
+                meta: {
+                    menu: 'policy'
+                }
+            },
+
             {
                 path: '/article',
                 name: 'article',
@@ -144,12 +153,12 @@ const routes = [
                 path: '/',
                 component: () => import('@/views/mine/base.vue'),
                 children: [
-                    {
-                        path: '/message',
-                        name: 'message',
-                        component: () => import('@/views/mine/message.vue'),
-                        meta: {}
-                    },
+                    // {
+                    //     path: '/message',
+                    //     name: 'message',
+                    //     component: () => import('@/views/mine/message.vue'),
+                    //     meta: {}
+                    // },
                     {
                         path: '/interactive',
                         name: 'interactive',
@@ -210,6 +219,12 @@ const routes = [
                         component: () => import('@/views/mine/releaseRequirement.vue'),
                         meta: {}
                     },
+                    // {
+                    //     path: '/releaseInfo',
+                    //     name: 'releaseInfo',
+                    //     component: () => import('@/views/mine/releaseInfo.vue'),
+                    //     meta: {}
+                    // },
                     {
                         path: '/editPhoneStep1',
                         name: 'editPhoneStep1',
@@ -229,6 +244,42 @@ const routes = [
                         meta: {}
                     }
                 ]
+            },
+            {
+                path: '/',
+                component: () => import('@/views/messageCenter/messageCenter.vue'),
+                children: [
+                    {
+                        path: '/message',
+                        name: 'message',
+                        component: () => import('@/views/messageCenter/message.vue'),
+                        meta: {}
+                    },
+                    {
+                        path: '/reply',
+                        name: 'reply',
+                        component: () => import('@/views/messageCenter/reply.vue'),
+                        meta: {}
+                    },
+                    {
+                        path: '/giveLike',
+                        name: 'giveLike',
+                        component: () => import('@/views/messageCenter/giveLike.vue'),
+                        meta: {}
+                    },
+                    {
+                        path: '/messageDetails',
+                        name: 'messageDetails',
+                        component: () => import('@/views/messageCenter/messageDetails.vue'),
+                        meta: {}
+                    },
+                    {
+                        path: '/chat',
+                        name: 'chat',
+                        component: () => import('@/views/messageCenter/chat.vue'),
+                        meta: {}
+                    }
+                ]
             }
         ]
     },

+ 126 - 6
src/main/jmrh/src/views/Index.vue

@@ -38,6 +38,52 @@
                                 <el-menu-item index="resource" :route="{ name: 'resource' }">资源供需</el-menu-item>
                                 <el-menu-item index="interact" :route="{ name: 'interact' }">政民互动</el-menu-item>
                             </el-menu>
+
+                            <el-popover
+                                class="user-info-dropdown-msg"
+                                placement="bottom-end"
+                                trigger="hover"
+                                v-if="userInfo"
+                                width="500"
+                            >
+                                <div class="user-info" slot="reference">
+                                    <img src="../assets/top_nav.png" class="msg" />
+                                    <!-- <img src="../assets/top_user.png" class="userImg" /> -->
+                                </div>
+                                <div class="user-info-drop-down-menu-msg">
+                                    <div class="msgTop">
+                                        <div class="msgtab">
+                                            <div class="title" :class="{ active: tab === 1001 }" @click="tab = 1001">
+                                                消息
+                                            </div>
+                                            <div class="title" :class="{ active: tab === 1002 }" @click="tab = 1002">
+                                                回复
+                                            </div>
+                                            <div class="title" :class="{ active: tab === 1003 }" @click="tab = 1003">
+                                                点赞
+                                            </div>
+                                        </div>
+
+                                        <router-link to="/message">
+                                            <el-link type="info" :underline="false">查看全部</el-link></router-link
+                                        >
+                                    </div>
+                                    <div class="msgCon" v-if="tab === 1001">
+                                        <msg-popups></msg-popups>
+                                    </div>
+                                    <div class="msgCon" v-if="tab === 1002"></div>
+                                    <div class="msgCon" v-if="tab === 1003"></div>
+                                    <!-- <div class="btn" @click="$router.push({ name: 'message' })">
+                                            消息
+                                        </div>
+                                        <div class="btn" @click="$router.push({ name: 'reply' })">
+                                            回复
+                                        </div>
+                                        <div class="btn" @click="$router.push({ name: 'giveLike' })">
+                                            点赞
+                                        </div> -->
+                                </div>
+                            </el-popover>
                             <el-popover
                                 class="user-info-dropdown"
                                 placement="bottom-start"
@@ -47,12 +93,13 @@
                                 <div class="user-info" slot="reference">
                                     <!-- <div class="avatar" :style="{ backgroundImage: `url(${userInfo.avatar})` }"></div> -->
                                     <!-- <div class="name">{{ userInfo.nickname }}</div> -->
-                                    <img
+                                    <!-- <img src="../assets/top_user.png" class="userImg" /> -->
+
+                                    <!-- <img
                                         src="../assets/top_nav.png"
                                         class="msg"
                                         @click="$router.push({ name: 'message' })"
-                                    />
-                                    <!-- <img src="../assets/top_user.png" class="userImg" /> -->
+                                    /> -->
 
                                     <img :src="userInfo.avatar" class="userImg" />
                                     <img src="../assets/icon_down_a.png" class="icon-tri" />
@@ -121,8 +168,9 @@
 
 <script>
 import Footer from '../components/footer';
+import msgPopups from '../components/message/msgPopups';
 export default {
-    components: { Footer },
+    components: { Footer, msgPopups },
     name: 'index',
     data() {
         return {
@@ -138,7 +186,8 @@ export default {
             // ],
             options: [],
             value: '',
-            search: ''
+            search: '',
+            tab: 1001
         };
     },
     mounted() {
@@ -353,7 +402,47 @@ export default {
                 .msg {
                     width: 32px;
                     height: 32px;
-                    margin-right: 20px;
+                    margin-right: 70px;
+                }
+            }
+        }
+        .user-info-dropdown-msg {
+            position: absolute;
+            right: 40px;
+            top: 0;
+            height: 50px;
+            .user-info {
+                widows: 100px;
+                height: 50px;
+                .flex();
+                cursor: pointer;
+                // .avatar {
+                //     width: 22px;
+                //     height: 22px;
+                //     border-radius: 11px;
+                //     background-position: center;
+                //     background-size: cover;
+                //     background-repeat: no-repeat;
+                // }
+                // .name {
+                //     color: white;
+                //     margin-left: 8px;
+                //     font-size: 13px;
+                // }
+                .icon-tri {
+                    width: 16px;
+                    height: 16px;
+                }
+                .userImg {
+                    width: 34px;
+                    height: 34px;
+                    margin-right: 4px;
+                    border-radius: 50%;
+                }
+                .msg {
+                    width: 32px;
+                    height: 32px;
+                    margin-right: 70px;
                 }
             }
         }
@@ -435,4 +524,35 @@ export default {
         }
     }
 }
+.user-info-drop-down-menu-msg {
+    // margin: 8px auto -12px auto;
+    .msgTop {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 16px;
+        .msgtab {
+            display: flex;
+        }
+        .title {
+            font-size: 14px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 20px;
+            cursor: pointer;
+            margin-right: 24px;
+            &.active {
+                color: #bf1616;
+                border-bottom: #bf1616 2px solid;
+            }
+        }
+
+        .el-link {
+            font-size: 12px;
+        }
+    }
+    .msgCon {
+        padding: 0px 16px;
+    }
+}
 </style>

+ 34 - 1
src/main/jmrh/src/views/article.vue

@@ -1,6 +1,16 @@
 <template>
     <div class="article">
         <div class="container">
+            <!-- 面包屑 -->
+            <el-row>
+                <el-col :span="24">
+                    <el-breadcrumb separator="/">
+                        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
+                        <el-breadcrumb-item :to="{ path: '/newsList' }">通知公告</el-breadcrumb-item>
+                        <el-breadcrumb-item>{{ breadcrumb }}</el-breadcrumb-item>
+                    </el-breadcrumb>
+                </el-col>
+            </el-row>
             <div class="title">
                 {{ article.title }}
             </div>
@@ -15,7 +25,8 @@ export default {
     name: 'article',
     data() {
         return {
-            article: {}
+            article: {},
+            breadcrumb: ''
         };
     },
     created() {
@@ -24,14 +35,36 @@ export default {
                 this.article = res;
             });
         }
+        if (this.$route.query.typeId) {
+            if (this.$route.query.typeId == 1002) {
+                this.breadcrumb = '热点推荐';
+            } else if (this.$route.query.typeId == 1004) {
+                this.breadcrumb = '新闻动态';
+            } else if (this.$route.query.typeId == 1108) {
+                this.breadcrumb = '通知通告';
+            } else if (this.$route.query.typeId == 1076) {
+                this.breadcrumb = '国家政策法规';
+            } else {
+                this.breadcrumb = '新闻咨询';
+            }
+        }
     }
 };
 </script>
 <style lang="less" scoped>
+.el-breadcrumb {
+    height: 60px;
+    line-height: 60px;
+    /deep/.el-breadcrumb__inner {
+        font-size: 12px;
+        color: #000 !important;
+    }
+}
 .container {
     width: 1200px;
     margin: auto;
     padding: 30px 100px;
+    padding-top: 0px;
     box-sizing: border-box;
 }
 .article {

+ 56 - 21
src/main/jmrh/src/views/enterprise.vue

@@ -8,42 +8,42 @@
                         <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                         <el-breadcrumb-item :to="{ path: '/resource' }">资源供需</el-breadcrumb-item>
                         <el-breadcrumb-item>产品详情</el-breadcrumb-item>
-                        <el-breadcrumb-item><span style="color:#C8C9CC">看企业</span></el-breadcrumb-item>
+                        <el-breadcrumb-item><span style="color:#C8C9CC">看企业</span></el-breadcrumb-item>
                     </el-breadcrumb>
                 </el-col>
             </el-row>
             <el-row>
                 <div class="top">
                     <div class="name">
-                        <img :src="data.orgInfo ? data.orgInfo.loge : null" alt="" />
-                        <span>{{ data.orgInfo ? data.orgInfo.orgName : null }}</span>
+                        <!-- <img :src="data.orgInfo ? data.orgInfo.loge : null" alt="" /> -->
+                        <!-- <span>{{ data.orgInfo ? data.orgInfo.orgName : null }}</span> -->
+                        <img :src="logo" />
+                        <span>{{ orgName }}</span>
                     </div>
                     <div class="tab">
-                        <span :class="{ active: index === 0 }" @click="index = 0">全部供需</span>
-                        <span :class="{ active: index === 1 }" @click="index = 1"
-                            >技术需求({{ data.requirementCount }})</span
-                        >
+                        <!-- <span :class="{ active: index === 0 }" @click="index = 0">全部供需</span> -->
+                        <span :class="{ active: index === 1 }" @click="index = 1">技术需求({{ list.length }})</span>
                         <span :class="{ active: index === 2 }" @click="index = 2"
-                            >产品需求({{ data.productNeedCount }})</span
+                            >产品需求({{ productNeedList.length }})</span
                         >
                         <span :class="{ active: index === 3 }" @click="index = 3"
-                            >融资需求({{ data.financingNeedsCount }})</span
+                            >融资需求({{ financingRequireList.length }})</span
                         >
                         <span :class="{ active: index === 4 }" @click="index = 4"
-                            >产品发布({{ data.productCount }})</span
+                            >产品发布({{ productList.length }})</span
                         >
                         <span :class="{ active: index === 5 }" @click="index = 5"
-                            >技术发布({{ data.artProductCount }})</span
+                            >技术发布({{ artProductList.length }})</span
                         >
                         <span :class="{ active: index === 6 }" @click="index = 6"
-                            >资源共享({{ data.tResourceCount }})</span
+                            >资源共享({{ financineReleaseList.length }})</span
                         >
                     </div>
                 </div>
                 <div class="content">
-                    <div v-if="index === 0">
+                    <!-- <div v-if="index === 0">
                         <listSupplyDemand></listSupplyDemand>
-                    </div>
+                    </div> -->
                     <div v-if="index === 1">
                         <techRequier></techRequier>
                     </div>
@@ -75,7 +75,7 @@ import financingRequire from '../components/enterprise/financingRequire';
 import productRelease from '../components/enterprise/productRelease';
 import techRelease from '../components/enterprise/techRelease';
 import financingRelease from '../components/enterprise/financingRelease';
-import listSupplyDemand from '../components/enterprise/listSupplyDemand';
+// import listSupplyDemand from '../components/enterprise/listSupplyDemand';
 
 export default {
     components: {
@@ -84,22 +84,57 @@ export default {
         financingRequire,
         productRelease,
         techRelease,
-        financingRelease,
-        listSupplyDemand
+        financingRelease
+        // listSupplyDemand
     },
     name: 'enterprise',
     data() {
         return {
             index: 1,
-            data: {}
+            data: {},
+            list: {},
+            productNeedList: {},
+            financingRequireList: {},
+            productList: {},
+            artProductList: {},
+            financineReleaseList: {},
+            orgName: '',
+            logo: ''
         };
     },
     created() {
+        // if (this.$route.query) {
+        //     this.$http.get(`orgInfo/getAllCount/${this.$route.query.id}`).then(res => {
+        //         this.data = res;
+        //     });
+        // }
+        // if (this.$route.query) {
+        //     this.orgName = this.$route.query.name;
+        //     this.logo = this.$route.query.logo;
+        //     console.log(this.$route.query.logo);
+        // }
         if (this.$route.query) {
-            this.$http.get(`orgInfo/getAllCount/${this.$route.query.id}`).then(res => {
-                this.data = res;
-            });
+            this.orgName = this.$route.query.name;
+            this.logo = this.$route.query.logo;
         }
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'TECH_DEMAND' } }).then(res => {
+            this.list = res.content;
+        });
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'PRODUCT_DEMAND' } }).then(res => {
+            this.productNeedList = res.content;
+        });
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'FINANCING_DEMAND' } }).then(res => {
+            this.financingRequireList = res.content;
+        });
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'PRODUCT_SUPPLY' } }).then(res => {
+            this.productList = res.content;
+        });
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'TECH_SUPPLY' } }).then(res => {
+            this.artProductList = res.content;
+        });
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'RES_SUPPLY' } }).then(res => {
+            this.financineReleaseList = res.content;
+        });
     }
 };
 </script>

+ 72 - 30
src/main/jmrh/src/views/home.vue

@@ -33,7 +33,7 @@
                                 class="row"
                                 v-for="item in news"
                                 :key="item.id"
-                                @click="$router.push({ name: 'article', query: { id: item.id } })"
+                                @click="$router.push({ name: 'article', query: { id: item.id, typeId: typeId } })"
                             >
                                 <div class="name">
                                     {{ item.title }}
@@ -143,9 +143,14 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                                 <div
                                     class="li_active "
                                     v-show="index == num"
-                                    @click="$router.push({ name: 'resourceRelease', query: { id: n.id, type: 1 } })"
+                                    @click="
+                                        $router.push({
+                                            name: 'resourceRelease',
+                                            query: { id: n.id, type: 'PRODUCT_SUPPLY' }
+                                        })
+                                    "
                                 >
-                                    <img src="../assets/publish_img_active.png" />
+                                    <img :src="n.images[0]" />
                                     <div style="width:500px;float:left">
                                         <h5>
                                             {{ n.name }}
@@ -158,7 +163,7 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                                 </div>
                                 <div class="li_show " v-show="index != num">
                                     <div>
-                                        <img src="../assets/publish_img.png" />
+                                        <img :src="n.images[0]" />
                                         <span class="pub_span">
                                             {{ n.name }}
                                         </span>
@@ -173,9 +178,14 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                                 <div
                                     class="li_active "
                                     v-show="index == num"
-                                    @click="$router.push({ name: 'resourceRelease', query: { id: n.id, type: 2 } })"
+                                    @click="
+                                        $router.push({
+                                            name: 'resourceRelease',
+                                            query: { id: n.id, type: 'TECH_SUPPLY' }
+                                        })
+                                    "
                                 >
-                                    <img src="../assets/publish_img_active.png" />
+                                    <img :src="n.images[0]" />
                                     <div style="width:500px;float:left">
                                         <h5>
                                             {{ n.name }}
@@ -188,7 +198,7 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                                 </div>
                                 <div class="li_show " v-show="index != num">
                                     <div>
-                                        <img src="../assets/publish_img.png" />
+                                        <img :src="n.images[0]" />
                                         <span class="pub_span">
                                             {{ n.name }}
                                         </span>
@@ -213,7 +223,7 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                     <div class="pub_r_row" v-for="n in productCountList" :key="n.id">
                         <span>{{ n.createdAt }}</span>
                         <span>新发布产品{{ n.productCount ? n.productCount : 0 }}条 </span>
-                        <span>技术{{ n.artCount ? n.artCount : 0 }}条</span>
+                        <span>技术{{ n.techCount ? n.techCount : 0 }}条</span>
                     </div>
                 </div>
             </div>
@@ -248,7 +258,9 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                         class="pub_left_content needs_con"
                         v-for="item in productNeedList"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 2 } })"
+                        @click="
+                            $router.push({ name: 'resourceDetail', query: { id: item.id, type: 'PRODUCT_DEMAND' } })
+                        "
                     >
                         <div class="pub_tit ">
                             <span>{{ item.name }} </span>
@@ -261,7 +273,7 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                         class="pub_left_content needs_con"
                         v-for="item in list"
                         :key="item.id"
-                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 1 } })"
+                        @click="$router.push({ name: 'resourceDetail', query: { id: item.id, type: 'TECH_DEMAND' } })"
                     >
                         <div class="pub_tit ">
                             <span>{{ item.name }} </span>
@@ -283,7 +295,7 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                     <div class="pub_r_row" v-for="n in NeedCountList" :key="n.id">
                         <span>{{ n.createdAt }}</span>
                         <span>新增产品需求{{ n.productCount ? n.productCount : 0 }}条 </span>
-                        <span>技术需求{{ n.artCount ? n.artCount : 0 }}条</span>
+                        <span>技术需求{{ n.techCount ? n.techCount : 0 }}条</span>
                     </div>
                 </div>
             </div>
@@ -299,18 +311,24 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                     </div>
                 </div>
                 <div class="res_bottom">
-                    <div class="res_img" @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: 11419 } })">
+                    <div
+                        class="res_img"
+                        @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: '实验设备' } })"
+                    >
                         <img src="../assets/home_img_ziyuan_shiyanshebei.png" />
                         <p>实验设备</p>
                     </div>
                     <div
                         class="res_img"
-                        @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: 1142319 } })"
+                        @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: '计量器具' } })"
                     >
                         <img src="../assets/home_img_ziyuan_jiliang.png" />
                         <p>计量器具</p>
                     </div>
-                    <div class="res_img" @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: 12319 } })">
+                    <div
+                        class="res_img"
+                        @click="$router.push({ name: 'resource', query: { myTab: 5, tabId: '科研仪器' } })"
+                    >
                         <img src="../assets/home_img_ziyuan_keyan.png" />
                         <p>科研仪器</p>
                     </div>
@@ -330,13 +348,16 @@ background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);padding:50px 0 20p
                     </div>
                 </div>
                 <div class="res_bottom">
-                    <div class="res_img" @click="$router.push({ name: 'resource', query: { myTab: 2, tabId: 11411 } })">
+                    <div
+                        class="res_img"
+                        @click="$router.push({ name: 'resource', query: { myTab: 2, tabId: '债务融资' } })"
+                    >
                         <img src="../assets/home_img_rongzi_zhaiwu.png" />
                         <p>债务融资</p>
                     </div>
                     <div
                         class="res_img"
-                        @click="$router.push({ name: 'resource', query: { myTab: 2, tabId: 114101 } })"
+                        @click="$router.push({ name: 'resource', query: { myTab: 2, tabId: '权益融资' } })"
                     >
                         <img src="../assets/home_img_rongzi_quanyi.png" />
                         <p>权益融资</p>
@@ -400,7 +421,8 @@ export default {
                 }
             ],
             value: '',
-            num: 0
+            num: 0,
+            typeId: 0
         };
     },
     computed: {
@@ -420,26 +442,45 @@ export default {
         this.$http.get('/article/all', { query: { typeId: 1005 } }).then(res => {
             this.banners = res.content;
         });
-        this.$http.post('/product/count').then(res => {
-            this.productCountList = res;
-        });
+
         this.$http.post('/artNeed/count').then(res => {
             this.NeedCountList = res;
         });
         this.getNews();
-        this.$http.get('/artNeed/all', { size: 8 }).then(res => {
-            this.list = res.content;
-        });
-        this.$http.get('/productNeed/all', { size: 8 }).then(res => {
-            this.productNeedList = res.content;
-        });
-        this.$http.get('/product/all', { size: 5 }).then(res => {
+        // 产品发布
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'PRODUCT_SUPPLY' } }).then(res => {
             this.productList = res.content;
-            console.log(this.productList);
         });
-        this.$http.get('/artProduct/all', { size: 5 }).then(res => {
+        // 技术发布
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 5, query: { type: 'TECH_SUPPLY' } }).then(res => {
             this.artProductList = res.content;
         });
+        // 产品需求
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'PRODUCT_DEMAND' } }).then(res => {
+            this.productNeedList = res.content;
+        });
+        // 技术需求
+        this.$http.get('/resourceSupplyAndDemand/all', { size: 8, query: { type: 'TECH_DEMAND' } }).then(res => {
+            this.list = res.content;
+        });
+        // 产品发布条数
+        this.$http
+            .get('/resourceSupplyAndDemand/getDataCount', {
+                productType: 'PRODUCT_SUPPLY',
+                techType: 'TECH_SUPPLY'
+            })
+            .then(res => {
+                this.productCountList = res;
+            });
+        // 产品需求条数
+        this.$http
+            .get('/resourceSupplyAndDemand/getDataCount', {
+                productType: 'PRODUCT_DEMAND',
+                techType: 'TECH_DEMAND'
+            })
+            .then(res => {
+                this.NeedCountList = res;
+            });
     },
     methods: {
         // policyAll() {
@@ -449,8 +490,9 @@ export default {
             this.bannerIndex = e;
         },
         getNews() {
-            this.$http.get('/article/all', { query: { typeId: this.tab }, size: 4 }).then(res => {
+            this.$http.get('/article/all', { query: { typeId: this.tab }, size: 7 }).then(res => {
                 this.news = res.content;
+                this.typeId = this.tab;
             });
         },
         goTab1() {

+ 21 - 13
src/main/jmrh/src/views/interactDetail.vue

@@ -9,10 +9,10 @@
             <div class="zixun">
                 <advisory-detail
                     :title="title"
-                    :caption="civilAffairsInteraction.title"
-                    :content="civilAffairsInteraction.details"
-                    :name="civilAffairsInteraction.name"
-                    :time="civilAffairsInteraction.createdAt"
+                    :caption="list.title"
+                    :content="list.content"
+                    :name="list.nickname"
+                    :time="list.createdAt"
                 >
                 </advisory-detail>
             </div>
@@ -22,10 +22,10 @@
                     <span>官方答复</span>
                 </div>
                 <div class="official_line"></div>
-                <div class="official_main">
+                <div class="official_main" v-for="n in commentList" :key="n.id">
                     <img src="../assets/icon_hui.png" />
-                    <div class="official_content" v-html="comment.length > 0 ? comment[0].description : '未回复'">
-                        {{ comment.length > 0 ? comment[0].description : '未回复' }}
+                    <div class="official_content" v-html="n.content">
+                        {{ n.content }}
                     </div>
                 </div>
             </div>
@@ -40,16 +40,24 @@ export default {
     data() {
         return {
             name01: '标题',
-            civilAffairsInteraction: {},
-            comment: [],
-            title: '咨询详情'
+            list: [],
+            title: '咨询详情',
+            commentList: {}
         };
     },
     created() {
         if (this.$route.query.id) {
-            this.$http.get(`/civilAffairsInteraction/getDetails/${this.$route.query.id}`).then(res => {
-                this.civilAffairsInteraction = res.civilAffairsInteraction;
-                this.comment = res.comment;
+            this.$http.get(`/post/getDTO/${this.$route.query.id}`).then(res => {
+                this.list = res;
+            });
+            // this.$http.get(`/comment/allDTO`).then(res => {
+            //     this.commentList = res.content;
+            //     let a = [...this.commentList].find(item => item.postId == this.$route.query.id);
+            //     this.commentContent = a.content;
+            // });
+            this.$http.get('/comment/allDTO', { query: { postId: this.$route.query.id } }).then(res => {
+                this.commentList = res.content;
+                console.log(this.commentList);
             });
         }
     },

+ 65 - 25
src/main/jmrh/src/views/interactDetail2.vue

@@ -18,8 +18,8 @@
                     </el-col>
                     <el-col>
                         <div class="name">正文</div>
-                        <div class="content" v-html="list.details">
-                            {{ list.details }}
+                        <div class="content" v-html="list.content">
+                            {{ list.content }}
                         </div>
                     </el-col>
                 </el-row>
@@ -29,7 +29,7 @@
                     <div class="title">
                         <img src="../assets/icon_reyi2.png" />
                         <span>热议回复 </span>
-                        <span style="margin-left:6px">({{ commentList.length > 0 ? commentList.length : 0 }})</span>
+                        <span style="margin-left:6px">({{ list.commentNum }})</span>
                     </div>
                     <button @click="releaseGo">
                         <img src="../assets/icon_edit.png" alt="" />
@@ -37,26 +37,55 @@
                     </button>
                 </div>
                 <div class="main">
-                    <div class="card" v-for="item in commentList" :key="item.id">
+                    <div class="card" v-for="item in replyList" :key="item.id">
                         <div class="card_left">
-                            <img :src="item.user.avatar" />
+                            <img :src="item.avatar" />
                         </div>
                         <div class="card_right">
                             <div class="card_info">
-                                <span class="name">{{ item.user.nickname }}</span>
+                                <span class="name">{{ item.nickname }}</span>
                                 <span class="time">{{ item.createdAt }}</span>
                             </div>
                             <div class="card_content">
-                                {{ item.description }}
+                                <div>{{ item.content }}</div>
+                                <div v-for="n in item.pics" :key="n.index">
+                                    <img :src="n" />
+                                </div>
                             </div>
                             <div class="card_icon">
+                                <!-- <div class="up">
+                                    <img :ref="item.id" :src="item.likeNum | to(userInfo)" @click="onUp(item.id)" />
+                                    <span>{{ item.likeNum }}</span>
+                                </div>
+                                <div class="low">
+                                    <img :ref="item.id" :src="item.dislikeNum | bu(userInfo)" @click="onLow(item.id)" />
+                                    <span>{{ item.dislikeNum }}</span>
+                                </div> -->
                                 <div class="up">
-                                    <img :ref="item.id" :src="item.praiseList | to(userInfo)" @click="onUp(item.id)" />
-                                    <span>{{ item.praiseList.length }}</span>
+                                    <img
+                                        src="../assets/icon_dian_active.png"
+                                        @click="onUp(item.id)"
+                                        v-if="item.liked == true"
+                                    />
+                                    <img
+                                        src="../assets/icon_dian.png"
+                                        @click="onUp(item.id)"
+                                        v-if="item.liked == false"
+                                    />
+                                    <span>{{ item.likeNum }}</span>
                                 </div>
                                 <div class="low">
-                                    <img :ref="item.id" :src="item.differList | bu(userInfo)" @click="onLow(item.id)" />
-                                    <span>{{ item.differList.length }}</span>
+                                    <img
+                                        src="../assets/icon_bu_active.png"
+                                        @click="onLow(item.id)"
+                                        v-if="item.disliked == true"
+                                    />
+                                    <img
+                                        src="../assets/icon_bu.png"
+                                        @click="onLow(item.id)"
+                                        v-if="item.disliked == false"
+                                    />
+                                    <span>{{ item.dislikeNum }}</span>
                                 </div>
                             </div>
                         </div>
@@ -72,7 +101,7 @@
                     </el-form-item> -->
                     <el-form-item prop="cont" label="回复内容">
                         <el-input
-                            v-model="formData.description"
+                            v-model="formData.content"
                             placeholder="请输入您要回复的内容,1000字以内"
                             type="textarea"
                             :rows="10"
@@ -81,7 +110,7 @@
                         ></el-input>
                     </el-form-item>
                     <el-form-item prop="pic" label="图片附件">
-                        <single-upload v-model="formData.pic"></single-upload>
+                        <multi-upload v-model="formData.pics"></multi-upload>
                     </el-form-item>
                 </el-form>
             </div>
@@ -164,8 +193,9 @@ export default {
             dianImg: require('@/assets/icon_dian.png'),
             buImg: require('@/assets/icon_bu.png'),
             rules: {
-                description: [{ required: true, message: '请输入内容', trigger: 'blur' }]
-            }
+                content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
+            },
+            replyList: {}
         };
     },
     created() {
@@ -175,7 +205,7 @@ export default {
         add() {
             this.$refs['formData'].resetFields();
             this.$http
-                .post('/comment/save', this.formData, { body: 'json' })
+                .post('/comment/create', this.formData, { body: 'json' })
                 .then(res => {
                     this.$message.success('成功');
                     this.getData();
@@ -189,25 +219,30 @@ export default {
         },
         getData() {
             if (this.$route.query.id) {
-                this.$http.get(`/civilAffairsInteraction/getDetails/${this.$route.query.id}`).then(res => {
-                    this.list = res.civilAffairsInteraction;
-                    this.commentList = res.comment;
-                    //this.formData.topicId = res.civilAffairsInteraction.id;
-                    //console.log(this.commentList);
+                this.$http.get(`/post/getDTO/${this.$route.query.id}`).then(res => {
+                    this.list = res;
+                    // this.commentList = this.list.commentList;
+                    this.formData.postId = res.id;
+                    // console.log(this.commentList);
+                });
+                this.$http.get('/comment/allDTO', { query: { postId: this.$route.query.id } }).then(res => {
+                    this.replyList = res.content;
+                    console.log(this.replyList);
                 });
             }
         },
         onUp(id) {
             this.$http
-                .post('/praise/add', { commentId: id }, { body: 'json' })
+                .get('/comment/like', { commentId: id, dislike: false }, { body: 'json' })
                 .then(res => {
-                    /* this.getData(); */
+                    console.log(res);
                 })
                 .catch(e => {
                     console.log(e);
 
                     this.$message.error(e.error);
                 });
+            window.location.reload();
             /* 添加赞样式 */
             if (this.$store.state.userInfo) {
                 if (this.$refs[id][0].src === require('@/assets/icon_dian_active.png')) {
@@ -253,7 +288,7 @@ export default {
         },
         onLow(id) {
             this.$http
-                .post('/differ/add', { commentId: id }, { body: 'json' })
+                .get('/comment/like', { commentId: id, dislike: true }, { body: 'json' })
                 .then(res => {
                     /*  this.getData(); */
                 })
@@ -261,7 +296,7 @@ export default {
                     console.log(e);
                     this.$message.error(e.error);
                 });
-
+            window.location.reload();
             if (this.$store.state.userInfo) {
                 if (this.$refs[id][1].src === require('@/assets/icon_bu_active.png')) {
                     this.$refs[id][1].src === require('@/assets/icon_bu.png');
@@ -453,6 +488,11 @@ export default {
                 font-size: 14px;
                 color: #000000;
                 line-height: 24px;
+
+                img {
+                    width: 90px;
+                    height: 90px;
+                }
             }
             .card_icon {
                 display: flex;

+ 2 - 2
src/main/jmrh/src/views/login/attest.vue

@@ -65,8 +65,8 @@
                         style="width:300px"
                     ></el-input>
                 </el-form-item>
-                <el-form-item prop="loge" label="企业loge">
-                    <single-upload v-model="formData.loge"></single-upload>
+                <el-form-item prop="logo" label="企业logo">
+                    <single-upload v-model="formData.logo"></single-upload>
                     <span class="remind">请上传企业logo图片,格式JPG或PNG,尺寸500x500px,大小不超过1M</span>
                 </el-form-item>
                 <el-form-item label="营业执照" prop="license">

+ 93 - 0
src/main/jmrh/src/views/messageCenter/chat.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <el-row>
+            <div class="content_title">
+                <span>和&nbsp;某某某&nbsp;的沟通</span>
+            </div>
+        </el-row>
+        <el-row>
+            <div class="chat_card">
+                <chat-info></chat-info>
+            </div>
+        </el-row>
+        <el-row>
+            <div class="chatMine">
+                <div class="chat-input">
+                    <!-- v-model="message" -->
+                    <el-input
+                        placeholder="请输入内容…"
+                        size="mini"
+                        clearable
+                        type="textarea"
+                        resize="none"
+                        limit="300"
+                        autosize
+                    ></el-input>
+                    <div class="btn">
+                        <!-- @click="sendMessage" -->
+                        <button>发送</button>
+                    </div>
+                </div>
+            </div>
+        </el-row>
+    </div>
+</template>
+
+<script>
+import chatInfo from '../../components/message/chatInfo';
+export default {
+    name: 'chat',
+    components: {
+        chatInfo
+    },
+    data() {
+        return {};
+    }
+};
+</script>
+<style lang="less" scoped>
+.content_title {
+    height: 60px;
+    line-height: 60px;
+    box-sizing: border-box;
+    padding-bottom: 20px;
+    border-bottom: #f2f3f5 1px solid;
+    > span {
+        font-size: 16px;
+        color: #000000;
+        line-height: 30px;
+        font-weight: 700;
+    }
+}
+.chat_card {
+    padding: 10px 0;
+}
+.chat-input {
+    display: flex;
+    position: relative;
+    .el-textarea {
+        flex-grow: 1;
+        margin-right: 10px;
+    }
+}
+
+.btn {
+    position: absolute;
+    top: 0;
+    right: 0;
+    button {
+        width: 86px;
+        height: 44px;
+        background: #bf1616;
+        color: #fff;
+        font-size: 14px;
+    }
+}
+</style>
+<style lang="less">
+.el-textarea {
+    textarea {
+        padding: 10px 15px;
+    }
+}
+</style>

+ 117 - 0
src/main/jmrh/src/views/messageCenter/giveLike.vue

@@ -0,0 +1,117 @@
+<template>
+    <div>
+        <el-row>
+            <div class="content_title">
+                <span>点赞消息</span>
+            </div>
+        </el-row>
+        <el-row>
+            <div class="box" v-for="item in list" :key="item.id">
+                <img :src="item.senderAvatar" />
+                <div class="info">
+                    <div class="name">{{ item.senderName }}</div>
+                    <p>赞了我的回复</p>
+                    <div class="topic">
+                        <span>“{{ item.content }}”</span>
+                    </div>
+                </div>
+                <div class="time">{{ item.createdAt }}</div>
+            </div>
+            <!-- <div class="box">
+                <img src="../../assets/attest_img.png" />
+                <div class="info">
+                    <div class="name">姓名</div>
+                    <p>赞了我的回复</p>
+                    <div class="topic">
+                        <span>“1996年12月,我国正式接受《国际货币基金组织协定》第八条款,实现经常项目可兑换”</span>
+                    </div>
+                </div>
+                <div class="time">2021.01.06</div>
+            </div> -->
+        </el-row>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'giveLike',
+    data() {
+        return {
+            list: {}
+        };
+    },
+    created() {
+        this.$http.get('notificationMessage/all', { query: { messageType: 'LIKE_RECORD_MESSAGE' } }).then(res => {
+            console.log(res);
+            this.list = res.content;
+        });
+    }
+};
+</script>
+<style lang="less" scoped>
+.content_title {
+    height: 60px;
+    line-height: 60px;
+    box-sizing: border-box;
+    padding-bottom: 20px;
+    border-bottom: #f2f3f5 1px solid;
+    > span {
+        font-size: 16px;
+        color: #000000;
+        line-height: 30px;
+        font-weight: 700;
+    }
+}
+.box {
+    // overflow: hidden;
+    display: flex;
+    padding: 20px 0 20px;
+    height: auto;
+    // box-sizing: content-box;
+    img {
+        width: 46px;
+        height: 46px;
+        border-radius: 50%;
+        // background: cadetblue;
+    }
+    .info {
+        width: 780px;
+        margin-left: 8px;
+        height: auto;
+        .name {
+            height: 24px;
+            font-size: 14px;
+            font-weight: 600;
+            color: #000000;
+        }
+        p {
+            margin: 0px;
+            width: 600px;
+            // height: 22px;
+            font-size: 13px;
+            color: #494a4d;
+            line-height: 22px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+        .topic {
+            margin-top: 12px;
+            span {
+                background: #f5f7fa;
+                border-radius: 2px;
+                padding: 12px;
+                font-size: 13px;
+                color: #494a4d;
+            }
+        }
+    }
+    .time {
+        width: 20%;
+        height: 22px;
+        font-size: 13px;
+        color: #c8c9cc;
+        line-height: 22px;
+    }
+}
+</style>

+ 170 - 0
src/main/jmrh/src/views/messageCenter/message.vue

@@ -0,0 +1,170 @@
+<template>
+    <div class="message">
+        <el-row>
+            <div class="content_title">
+                <span>通知消息</span>
+            </div>
+        </el-row>
+
+        <el-row>
+            <div class="box" @click="$router.push({ name: 'messageDetails' })">
+                <img src="../../assets/xiaoxi_icon_xitong.png" />
+                <div class="info">
+                    <div class="name">系统消息</div>
+                    <p>{{ sysList.content }}</p>
+                </div>
+                <div class="time">{{ sysList.createdAt }}</div>
+            </div>
+            <!-- <div class="box" v-for="n in tableData" :key="n.id" >
+                <img :src="n.user.avatar" />
+                <div class="info">
+                    <div class="name">姓名</div>
+                    <p>你好,我对贵方的一体化集成动力设备很感兴趣,有很多细节希望可以进一步沟通一下</p>
+                </div>
+                <div class="time">{{ n.createdAt }}</div>
+            </div> -->
+            <div class="box" v-for="n in conversationList" :key="n.id" @click="$router.push({ name: 'chat' })">
+                <img :src="n.senderAvatar" />
+                <div class="info">
+                    <div class="name">{{ n.senderName }}</div>
+                    <p>{{ n.content }}</p>
+                </div>
+                <div class="time">{{ n.createdAt }}</div>
+            </div>
+        </el-row>
+    </div>
+</template>
+
+<script>
+// import pageableTable from '@/mixins/pageableTable';
+export default {
+    // mixins: [pageableTable],
+    name: 'message',
+    data() {
+        return {
+            // url: '/notificationMessage/all',
+            current: 0,
+            sysList: {},
+            conversationList: {}
+        };
+    },
+    created() {
+        this.$http.get('notificationMessage/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.sysList = res.content;
+        });
+        this.$http.get('notificationMessage/all', { query: { messageType: 'CONVERSATION_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.conversationList = res.content;
+        });
+    },
+    methods: {
+        getIndex(index) {
+            this.current = index;
+            /*            if (index === 0) {
+                this.url = '/auditHistory/myAll';
+                this.getData();
+                this.url = '/message/all';
+                const arr = this.tableData;
+                this.getData();
+                arr.push.apply(arr, this.tableData);
+                this.url = '/topic/all';
+                this.getData();
+                arr.push.apply(arr, this.tableData);
+                this.tableData = arr;
+                return;
+            } */
+            // if (index === 0) {
+            //     this.url = '/auditHistory/myAll';
+            // }
+            // if (index === 1) {
+            //     this.url = '/message/getMySupply';
+            // }
+            // if (index === 2) {
+            //     this.url = '/topic/myAll';
+            // }
+            // this.getData();
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.content_title {
+    height: 60px;
+    line-height: 60px;
+    box-sizing: border-box;
+    padding-bottom: 20px;
+    border-bottom: #f2f3f5 1px solid;
+    > span {
+        font-size: 16px;
+        color: #000000;
+        line-height: 30px;
+        font-weight: 700;
+    }
+}
+.classify {
+    height: 60px;
+    line-height: 60px;
+    span {
+        cursor: pointer;
+        font-size: 13px;
+        color: #818999;
+        + span {
+            margin-left: 30px;
+        }
+        &.active {
+            color: #bf1616;
+        }
+    }
+}
+.box {
+    // overflow: hidden;
+    display: flex;
+    padding: 20px 0 20px;
+    height: auto;
+    // box-sizing: content-box;
+    cursor: pointer;
+    img {
+        width: 46px;
+        height: 46px;
+        border-radius: 50%;
+        // background: cadetblue;
+    }
+    .info {
+        width: 780px;
+        margin-left: 8px;
+        height: auto;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-around;
+        .name {
+            font-size: 14px;
+            font-weight: 500;
+            color: #000000;
+        }
+        p {
+            margin: 0px;
+            width: 600px;
+            // height: 22px;
+            font-size: 14px;
+
+            color: #c8c9cc;
+            line-height: 22px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+    }
+    .time {
+        width: 20%;
+        height: 22px;
+        font-size: 13px;
+        color: #c8c9cc;
+        line-height: 22px;
+    }
+    + .box {
+        // margin-top: 20px;
+        border-top: 1px solid #f2f3f5;
+    }
+}
+</style>

+ 138 - 0
src/main/jmrh/src/views/messageCenter/messageCenter.vue

@@ -0,0 +1,138 @@
+<template>
+    <div class="manage">
+        <div class="container">
+            <el-row>
+                <el-col :span="24">
+                    <el-breadcrumb separator="/">
+                        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
+                        <el-breadcrumb-item>消息中心</el-breadcrumb-item>
+                    </el-breadcrumb>
+                </el-col>
+            </el-row>
+            <el-row class="content">
+                <el-col :span="4">
+                    <!-- <side-bar :current="current" @change="changeTab" :tabList="tabList" :title="barTitle"></side-bar> -->
+                    <div class="needs_menu">
+                        <div class="needs_title"><img src="../../assets/needs_icon.png" />消息中心</div>
+                        <div
+                            class="menu_tab"
+                            v-for="(item, index) in tabList"
+                            :key="index"
+                            :class="{ active: routerPath === item.path }"
+                            @click="$router.push(item.path)"
+                        >
+                            {{ item.name }}
+                        </div>
+                    </div>
+                </el-col>
+                <el-col :span="20">
+                    <div class="content_r">
+                        <router-view />
+                    </div>
+                </el-col>
+            </el-row>
+        </div>
+    </div>
+</template>
+<script>
+// import SideBar from '../../components/SideBar';
+export default {
+    // components: { SideBar },
+    name: 'messageCenter',
+    data() {
+        return {
+            // barTitle: '消息中心',
+            current: 0,
+            tabList: [
+                { id: 0, name: '消息', path: '/message' },
+                { id: 0, name: '回复', path: '/reply' },
+                { id: 0, name: '点赞', path: '/giveLike' }
+            ]
+        };
+    },
+    // created() {
+    //     // if (this.$route.params.selectTab) {
+    //     //     this.current = this.$route.params.selectTab;
+    //     //     console.log(this.$route.params.selectTab);
+    //     // }
+    // },
+    // methods: {
+    //     // changeTab(index, e) {
+    //     //     this.current = index;
+    //     //     this.$router.push(this.tabList[this.current].path);
+    //     // }
+    // },
+    computed: {
+        routerPath() {
+            return this.$route.path;
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.container {
+    width: 1200px;
+    margin: 0 auto;
+}
+.el-breadcrumb {
+    height: 60px;
+    line-height: 60px;
+    /deep/.el-breadcrumb__inner {
+        font-size: 12px;
+        color: #000 !important;
+    }
+}
+.content_r {
+    margin-left: 20px;
+    padding: 0 20px 40px;
+    background-color: #fff;
+    box-sizing: border-box;
+}
+.needs_menu {
+    background-color: #fff;
+    height: auto;
+    padding-bottom: 10px;
+    box-sizing: border-box;
+    .needs_title {
+        color: #fff;
+        width: 200px;
+        height: 60px;
+        line-height: 60px;
+        text-align: center;
+        background: url('../../assets/needs_bg.png') no-repeat center;
+        background-size: 100%;
+        position: relative;
+        margin-bottom: 10px;
+        img {
+            width: 24px;
+            height: 24px;
+            position: absolute;
+            top: 0;
+            bottom: 0;
+            left: 34px;
+            margin: auto;
+        }
+    }
+    .menu_tab {
+        width: 200px;
+        height: 60px;
+        line-height: 60px;
+        text-align: center;
+        cursor: pointer;
+        &.active {
+            color: #bf1616;
+            // background: linear-gradient(90deg, #bf1616 0%, #ffffff 100%);
+            // box-shadow: 2px 0px 0px 0px #bf1616;
+            border-left: 2px solid #bf1616;
+            background: linear-gradient(90deg, #fbeeee 0%, #fff 100%);
+        }
+        + .menu_tab {
+            margin-top: 10px;
+        }
+    }
+    .supply_title {
+        background: url('../../assets/supply_bg.png') no-repeat center;
+        background-size: 100%;
+    }
+}
+</style>

+ 120 - 0
src/main/jmrh/src/views/messageCenter/messageDetails.vue

@@ -0,0 +1,120 @@
+<template>
+    <div>
+        <el-row>
+            <div class="content_title">
+                <span>系统消息</span>
+            </div>
+        </el-row>
+        <el-row>
+            <div class="box" v-for="item in list" :key="item.id">
+                <img src="../../assets/xiaoxi_icon_xitong.png" />
+                <div class="info">
+                    <div class="first">
+                        <div class="name">姓名</div>
+                        <div class="time">2021.01.06</div>
+                    </div>
+                    <div class="topic">
+                        <p>
+                            这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字
+                        </p>
+                    </div>
+                </div>
+            </div>
+            <div class="box">
+                <img src="../../assets/xiaoxi_icon_xitong.png" />
+                <div class="info">
+                    <div class="first">
+                        <div class="name">姓名</div>
+                        <div class="time">2021.01.06</div>
+                    </div>
+                    <div class="topic">
+                        <p>
+                            这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字这是消息内容文字
+                        </p>
+                    </div>
+                </div>
+            </div>
+        </el-row>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'messageDetails',
+    data() {
+        return {
+            // url: '/notificationMessage/all'
+            // // query: { messageType: 'SYSTEM_MESSAGE' }
+            list: {}
+        };
+    },
+    created() {
+        this.$http.get('/notificationMessage/all', { query: { messageType: 'SYSTEM_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.list = res.content;
+        });
+    }
+};
+</script>
+<style lang="less" scoped>
+.content_title {
+    height: 60px;
+    line-height: 60px;
+    box-sizing: border-box;
+    padding-bottom: 20px;
+    border-bottom: #f2f3f5 1px solid;
+    > span {
+        font-size: 16px;
+        color: #000000;
+        line-height: 30px;
+        font-weight: 700;
+    }
+}
+.box {
+    // overflow: hidden;
+    display: flex;
+    padding: 20px 0 20px;
+    height: auto;
+    // box-sizing: content-box;
+    img {
+        width: 46px;
+        height: 46px;
+        border-radius: 50%;
+        background: cadetblue;
+    }
+    .info {
+        width: 780px;
+        margin-left: 8px;
+        height: auto;
+        .first {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .name {
+                font-size: 14px;
+                font-weight: 600;
+                color: #000000;
+            }
+            .time {
+                height: 22px;
+                font-size: 13px;
+                color: #c8c9cc;
+                line-height: 22px;
+            }
+        }
+    }
+    .topic {
+        margin-top: 12px;
+        p {
+            background: #f5f7fa;
+            box-shadow: 0px -1px 0px 0px #f2f3f5;
+            border-radius: 0px 8px 8px 8px;
+            border-radius: 2px;
+            padding: 12px;
+
+            color: #000000;
+            font-size: 14px;
+        }
+    }
+}
+</style>

+ 117 - 0
src/main/jmrh/src/views/messageCenter/reply.vue

@@ -0,0 +1,117 @@
+<template>
+    <div>
+        <el-row>
+            <div class="content_title">
+                <span>回复消息</span>
+            </div>
+        </el-row>
+        <el-row>
+            <!-- <div class="box">
+                <img src="../../assets/attest_img.png" />
+                <div class="info">
+                    <div class="name">姓名</div>
+                    <p>回复:有些急症只有几分钟的黄金抢救时间,若等120专业急救人员来到现场处置,就可能错过生机。</p>
+                    <div class="topic">
+                        <span> #普及急救知识,避免错过黄金抢救时间#</span>
+                    </div>
+                </div>
+                <div class="time">2021.01.06</div>
+            </div> -->
+            <div class="box" v-for="item in list" :key="item.id">
+                <img :src="item.senderAvatar" />
+                <div class="info">
+                    <div class="name">{{ item.senderName }}</div>
+                    <p>回复:{{ item.content }}</p>
+                    <div class="topic">
+                        <span> {{ item.name }}</span>
+                    </div>
+                </div>
+                <div class="time">{{ item.createdAt }}</div>
+            </div>
+        </el-row>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'reply',
+    data() {
+        return {
+            list: {}
+        };
+    },
+    created() {
+        this.$http.get('/notificationMessage/all', { query: { messageType: 'COMMENT_MESSAGE' } }).then(res => {
+            // console.log(res);
+            this.list = res.content;
+        });
+    }
+};
+</script>
+<style lang="less" scoped>
+.content_title {
+    height: 60px;
+    line-height: 60px;
+    box-sizing: border-box;
+    padding-bottom: 20px;
+    border-bottom: #f2f3f5 1px solid;
+    > span {
+        font-size: 16px;
+        color: #000000;
+        line-height: 30px;
+        font-weight: 700;
+    }
+}
+.box {
+    // overflow: hidden;
+    display: flex;
+    padding: 20px 0 20px;
+    height: auto;
+    // box-sizing: content-box;
+    img {
+        width: 46px;
+        height: 46px;
+        border-radius: 50%;
+        // background: cadetblue;
+    }
+    .info {
+        width: 780px;
+        margin-left: 8px;
+        height: auto;
+        .name {
+            height: 24px;
+            font-size: 14px;
+            font-weight: 600;
+            color: #000000;
+        }
+        p {
+            margin: 0px;
+            width: 600px;
+            // height: 22px;
+            font-size: 13px;
+            color: #494a4d;
+            line-height: 22px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+        .topic {
+            margin-top: 12px;
+            span {
+                background: #f5f7fa;
+                border-radius: 2px;
+                padding: 12px;
+                font-size: 13px;
+                color: #494a4d;
+            }
+        }
+    }
+    .time {
+        width: 20%;
+        height: 22px;
+        font-size: 13px;
+        color: #c8c9cc;
+        line-height: 22px;
+    }
+}
+</style>

+ 1 - 1
src/main/jmrh/src/views/mine/base.vue

@@ -44,7 +44,7 @@ export default {
             barTitle: '个人中心',
             current: 0,
             tabList: [
-                { id: 0, name: '通知消息', path: '/message' },
+                // { id: 0, name: '通知消息', path: '/message' },
                 { id: 1, name: '我发布的', path: '/release' },
                 { id: 2, name: '我对接的', path: '/docking' },
                 { id: 3, name: '我的收藏', path: '/myCollection' },

+ 90 - 175
src/main/jmrh/src/views/mine/docking.vue

@@ -6,6 +6,7 @@
                 <span class="tab" :class="{ active: tab === 0 }" @click="tabTo(0)">需求信息</span>
             </div>
         </el-row>
+        <!-- 需求信息 -->
         <el-row v-if="tab === 0">
             <el-row>
                 <ul class="title">
@@ -17,94 +18,33 @@
                 </ul>
             </el-row>
             <el-row v-for="item in tableData" :key="item.id">
-                <!-- 产品需求对接 -->
-                <ul class="row" v-if="item.productNeed">
+                <ul class="row">
                     <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
+                        <span
+                            class="wait"
+                            v-if="item.status === 'AWAIT' || item.status === null || item.status === undefined"
                             >等待对接</span
                         >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
+                        <span class="now" v-if="item.status === 'CONDUCTED'">正在对接</span>
+                        <span class="success" v-if="item.status === 'SUCCEED'">对接成功</span>
+                        <span class="fail" v-if="item.status === 'DEFEAT'">对接失败</span>
                     </li>
                     <li class="con">
-                        <img :src="item.productNeed ? item.productNeed.pic : null" />
-                        <span>{{ item.productNeed.name }}</span>
+                        <img :src="item.resourceSupplyDemand.images[0]" />
+                        <span>{{ item.resourceSupplyDemand.name }}</span>
                     </li>
                     <li class="company">{{ item.orgName }}</li>
                     <li class="mes">
                         <p>
                             {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
                         </p>
+                        <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
                     </li>
                     <li class="operat">
-                        <div v-if="state === 3">
+                        <div v-if="item.status === 'TERMINATION '">
                             <span class="fail" @click="replyId(item.id)">回复</span>
                             <span class="fail" @click="edit(item.id)">编辑</span>
                         </div>
-                    </li>
-                </ul>
-
-                <!-- 技术需求对接 -->
-                <ul class="row" v-else-if="item.artNeed != undefined">
-                    <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
-                            >等待对接</span
-                        >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
-                    </li>
-                    <li class="con">
-                        <img :src="item.artNeed ? item.artNeed.pic : null" />
-                        <span>{{ item.artNeed.name }}</span>
-                    </li>
-                    <li class="company">{{ item.orgName }}</li>
-                    <li class="mes">
-                        <p>
-                            {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
-                        </p>
-                    </li>
-                    <li class="operat">
-                        <div v-if="state === 3">
-                            <span class="fail" @click="dialogReplyVisible = true">回复</span>
-                            <span class="fail" @click="dialogVisible = true">编辑</span>
-                        </div>
-                        <div v-else>
-                            <span @click="replyId(item.id)">回复</span>
-                            <span @click="edit(item.id)">编辑</span>
-                        </div>
-                    </li>
-                </ul>
-
-                <!-- 融资需求对接 -->
-                <ul class="row" v-else-if="item.financingNeeds">
-                    <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
-                            >等待对接</span
-                        >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
-                    </li>
-                    <li class="con">
-                        <img :src="item.financingNeeds ? item.financingNeeds.pic : null" />
-                        <span>{{ item.financingNeeds.name }}</span>
-                    </li>
-                    <li class="company">{{ item.orgName }}</li>
-                    <li class="mes">
-                        <p>
-                            {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
-                        </p>
-                    </li>
-                    <li class="operat">
-                        <div v-if="state === 3">
-                            <span class="fail" @click="dialogReplyVisible = true">回复</span>
-                            <span class="fail" @click="edit(item.id)">编辑</span>
-                        </div>
                         <div v-else>
                             <span @click="replyId(item.id)">回复</span>
                             <span @click="edit(item.id)">编辑</span>
@@ -114,12 +54,12 @@
 
                 <div class="detail" v-if="item.id === appear">
                     <div class="detail_tit">沟通记录</div>
-                    <div class="detail_item" v-for="record in item.recordList" :key="record.id">
-                        <div class="detail_name">{{ record.user.nickname }}</div>
-                        <div class="detail_con">
+                    <div class="detail_item" v-for="record in recordList" :key="record.id">
+                        <div class="detail_name" v-if="record.conversationId === item.id">{{ record.nickname }}</div>
+                        <div class="detail_con" v-if="record.conversationId === item.id">
                             {{ record.content }}
                         </div>
-                        <div class="detail_time">{{ record.createdAt }}</div>
+                        <div class="detail_time" v-if="record.conversationId === item.id">{{ record.createdAt }}</div>
                     </div>
                 </div>
                 <!-- 回复 -->
@@ -137,7 +77,11 @@
                 <el-dialog title="更改对接状态" :visible.sync="dialogVisible" width="660px" center>
                     <div class="edit">
                         <div class="edit_info">
-                            <div class="edit_item" :class="{ active: editTab === 4 }" @click="editTab = 4">
+                            <div
+                                class="edit_item"
+                                :class="{ active: editTab === 'TERMINATION ' }"
+                                @click="editTab = 'TERMINATION '"
+                            >
                                 终止并删除
                             </div>
                             <button class="sumbit" @click="saveMessage(item.id)">提交</button>
@@ -157,6 +101,7 @@
             >
             </el-pagination>
         </el-row>
+        <!-- 供应信息 -->
         <el-row v-if="tab === 1">
             <el-row>
                 <ul class="title">
@@ -168,29 +113,30 @@
                 </ul>
             </el-row>
             <el-row v-for="item in tableData" :key="item.id">
-                <!-- 技术产品 -->
-                <ul class="row" v-if="item.artProduct != undefined">
+                <ul class="row">
                     <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
+                        <span
+                            class="wait"
+                            v-if="item.status === 'AWAIT' || item.status === null || item.status === undefined"
                             >等待对接</span
                         >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
+                        <span class="now" v-if="item.status === 'CONDUCTED'">正在对接</span>
+                        <span class="success" v-if="item.status === 'SUCCEED'">对接成功</span>
+                        <span class="fail" v-if="item.status === 'DEFEAT'">对接失败</span>
                     </li>
                     <li class="con">
-                        <img :src="item.artProduct.picList ? item.artProduct.picList[0].url : null" />
-                        <span>{{ item.artProduct.name }}</span>
+                        <img :src="item.resourceSupplyDemand.images[0]" />
+                        <span>{{ item.resourceSupplyDemand.name }}</span>
                     </li>
                     <li class="company">{{ item.orgName }}</li>
                     <li class="mes">
                         <p>
                             {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
                         </p>
+                        <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
                     </li>
                     <li class="operat">
-                        <div v-if="state === 3">
+                        <div v-if="item.status === 'TERMINATION '">
                             <span class="fail" @click="replyId(item.id)">回复</span>
                             <span class="fail" @click="edit(item.id)">编辑</span>
                         </div>
@@ -201,76 +147,14 @@
                     </li>
                 </ul>
 
-                <!-- 产品 -->
-
-                <ul class="row" v-if="item.product != undefined">
-                    <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
-                            >等待对接</span
-                        >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
-                    </li>
-                    <li class="con">
-                        <img :src="item.product.picList ? item.product.picList[0].url : null" />
-                        <span>{{ item.product.name }}</span>
-                    </li>
-                    <li class="company">{{ item.orgName }}</li>
-                    <li class="mes">
-                        <p>
-                            {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
-                        </p>
-                    </li>
-                    <li class="operat">
-                        <div v-if="state === 3">
-                            <span class="fail" @click="replyId(item.id)">回复</span>
-                            <span class="fail" @click="edit(item.id)">编辑</span>
-                        </div>
-                        <div v-else>
-                            <span @click="replyId(item.id)">回复</span>
-                            <span @click="edit(item.id)">编辑</span>
-                        </div>
-                    </li>
-                </ul>
-                <!-- 共享资源 -->
-                <ul class="row" v-if="item.tresource">
-                    <li class="status">
-                        <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
-                            >等待对接</span
-                        >
-                        <span class="now" v-if="item.state === 1">正在对接</span>
-                        <span class="success" v-if="item.state === 2">对接成功</span>
-                        <span class="fail" v-if="item.state === 3">对接失败</span>
-                    </li>
-                    <li class="con">
-                        <img :src="item.tresource.picList ? item.tresource.picList[0].url : null" />
-                        <span>{{ item.tresource.name }}</span>
-                    </li>
-                    <li class="company">{{ item.orgName }}</li>
-                    <li class="mes">
-                        <p>
-                            {{ item.description }}
-                            <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
-                        </p>
-                    </li>
-                    <li class="operat">
-                        <div>
-                            <span class="fail" @click="replyId(item.id)">回复</span>
-                            <span class="fail" @click="edit(item.id)">编辑</span>
-                        </div>
-                    </li>
-                </ul>
-
                 <div class="detail" v-if="item.id === appear">
                     <div class="detail_tit">沟通记录</div>
-                    <div class="detail_item" v-for="record in item.recordList" :key="record.id">
-                        <div class="detail_name">{{ record.user.nickname }}</div>
-                        <div class="detail_con">
+                    <div class="detail_item" v-for="record in recordList" :key="record.id">
+                        <div class="detail_name" v-if="record.conversationId === item.id">{{ record.nickname }}</div>
+                        <div class="detail_con" v-if="record.conversationId === item.id">
                             {{ record.content }}
                         </div>
-                        <div class="detail_time">{{ record.createdAt }}</div>
+                        <div class="detail_time" v-if="record.conversationId === item.id">{{ record.createdAt }}</div>
                     </div>
                 </div>
 
@@ -289,7 +173,11 @@
                 <el-dialog title="更改对接状态" :visible.sync="dialogVisible" width="660px" center>
                     <div class="edit">
                         <div class="edit_info">
-                            <div class="edit_item" :class="{ active: editTab === 4 }" @click="editTab = 4">
+                            <div
+                                class="edit_item"
+                                :class="{ active: editTab === 'TERMINATION ' }"
+                                @click="editTab = 'TERMINATION '"
+                            >
                                 终止并删除
                             </div>
                             <button class="sumbit" @click="saveMessage()">提交</button>
@@ -322,26 +210,52 @@ export default {
         return {
             tab: 1,
             state: 0, //对接状态
-            query: { onExist: '0,1' },
+            // query: { onExist: '0,1' },
             appear: 0, //detail 默认隐藏
             currentPage: 5,
             dialogReplyVisible: false, // 回复
             dialogVisible: false, // 编辑
-            url: '/message/getMyMessageRes',
+            // url: '/message/getMyMessageRes',
+            url: '/conversation/all',
             model: {},
-            editTab: 0,
-            clickCount: 0
+            editTab: '',
+            clickCount: 0,
+            list: {},
+            resSnDPropertyList: {},
+            // types: [
+            //     ['TECH_DEMAND', 'PRODUCT_DEMAND', 'FINANCING_DEMAND'],
+            //     ['TECH_SUPPLY', 'PRODUCT_SUPPLY', 'RES_SUPPLY']
+            // ]
+            type: 'PRODUCT_SUPPLY' + ',' + 'TECH_SUPPLY' + ',' + 'RES_SUPPLY',
+            recordList: {}
         };
     },
+    created() {
+        this.$http.get('/communicationRecord/all').then(res => {
+            this.recordList = res.content;
+        });
+    },
+    computed: {
+        userInfo() {
+            return this.$store.state.userInfo;
+        }
+    },
     methods: {
         beforeGetData() {
-            if (this.query) {
-                return { query: this.query };
-            }
+            return {
+                query: {
+                    typeStr: this.type,
+                    publisherVisible: true,
+                    conversationUserId: this.$store.state.userInfo.id
+                }
+            };
+            // if (this.query) {
+            //     return { query: this.query };
+            // }
         },
         replyId(id) {
             this.dialogReplyVisible = true;
-            this.model.dockingRecordId = id;
+            this.model.conversationId = id;
         },
         edit(id) {
             this.model.messageId = id;
@@ -350,24 +264,25 @@ export default {
 
         tabTo(show) {
             this.tab = show;
-            if (this.tab === 0) {
-                this.url = '/message/getMyMessageNeed';
+            if (this.tab === 1) {
+                // this.url = '/conversation/all';
+                this.type = 'PRODUCT_SUPPLY' + ',' + 'TECH_SUPPLY' + ',' + 'RES_SUPPLY';
                 this.getData();
-            } else {
-                this.url = '/message/getMyMessageRes';
+            } else if (this.tab === 0) {
+                // this.url = '/conversation/all';
+                this.type = 'TECH_DEMAND' + ',' + 'PRODUCT_DEMAND' + ',' + 'FINANCING_DEMAND';
                 this.getData();
             }
         },
         saveMessage(id) {
             this.$http
-                .post(
-                    '/message/updateStatus',
-                    { id: this.model.messageId, state: this.editTab, onExist: '2' },
-                    { body: 'json' }
-                )
+                .post('/conversation/create', { id: id, state: this.editTab, onExist: '2' }, { body: 'json' })
                 .then(res => {
-                    this.getData();
-                    this.$message.success('修改成功');
+                    if (res) {
+                        this.getData();
+                        this.$message.success('修改成功');
+                        this.dialogVisible = false;
+                    }
                 })
                 .catch(e => {
                     console.log(e);
@@ -376,12 +291,12 @@ export default {
         },
         save() {
             this.$http
-                .post('/dockingRecord/save', this.model, { body: 'json' })
+                .post('/communicationRecord/save', this.model, { body: 'json' })
                 .then(res => {
                     this.getData();
                     this.dialogReplyVisible = false;
                     this.$message.success('回复成功');
-                    this.dialogVisible = false;
+                    // this.dialogVisible = false;
                     //this.$router.go(-1);
                 })
                 .catch(e => {

+ 3 - 3
src/main/jmrh/src/views/mine/editInfo.vue

@@ -17,7 +17,7 @@
                 <img v-if="avatar" :src="avatar" />
                 <i v-else class="avatar"></i>
             </el-upload>
-            <div class="edit_avatar">修改头像</div>
+            <div class="edit_avatar">点击头像修改</div>
         </div>
         <el-form ref="form" :model="form" label-width="150px" :rules="rules" style="max-width: 450px;" size="small">
             <el-form-item label="id" v-show="false">
@@ -60,8 +60,8 @@
             <el-form-item prop="description" label="企业简介">
                 <el-input type="textarea" v-model="form.intro" placeholder="请填写企业简介,不超过200字"></el-input>
             </el-form-item>
-            <el-form-item prop="loge" label="企业loge">
-                <single-upload v-model="form.loge"></single-upload>
+            <el-form-item prop="logo" label="企业logo">
+                <single-upload v-model="form.logo"></single-upload>
                 <span class="remind">请上传企业logo图片,格式JPG或PNG,尺寸500x500px,大小不超过1M</span>
             </el-form-item>
             <el-form-item prop="license" label="营业执照">

+ 2 - 2
src/main/jmrh/src/views/mine/editPassword.vue

@@ -14,7 +14,7 @@
                 label-width="100px"
                 class="demo-ruleForm"
             >
-                <el-form-item label="原密码" prop="age">
+                <el-form-item label="原密码" prop="password">
                     <el-input v-model.number="formData.password" placeholder="请输入原始密码"></el-input>
                 </el-form-item>
                 <el-form-item label="新密码" prop="passWordTo">
@@ -27,7 +27,7 @@
                 </el-form-item>
                 <el-form-item label="确认密码" prop="passWordTo2">
                     <el-input
-                        type="password"
+                        type="passWordTo2"
                         v-model="formData.passWordTo2"
                         autocomplete="off"
                         placeholder="请再次输出新密码"

+ 66 - 42
src/main/jmrh/src/views/mine/interactive.vue

@@ -18,41 +18,54 @@
             </div>
         </el-row>
         <el-row v-if="this.current === 0">
-            <div
-                class="box"
-                v-for="n in tableData"
-                :key="n.id"
-                @click="$router.push({ name: 'interactDetail', query: { id: n.id } })"
-            >
-                <div class="info">
-                    <i></i><span>{{ n.title }}</span>
+            <div v-for="n in tableData" :key="n.id">
+                <div
+                    class="box"
+                    @click="$router.push({ name: 'interactDetail', query: { id: n.id, type: 'OFFICIAL' } })"
+                >
+                    <div class="info">
+                        <i></i><span>{{ n.title }}</span>
+                    </div>
+                    <div class="num">{{ (n.commentNum = 0 ? '未回复' : '已回复') }}</div>
+                    <div class="time">{{ n.createdAt }}</div>
                 </div>
-                <div class="num">{{ n.count == 0 ? '未回复' : '已回复' }}</div>
-                <div class="time">{{ n.createdAt }}</div>
             </div>
         </el-row>
-
-        <el-row v-if="this.current === 1 || this.current === 2">
-            <div
-                class="box"
-                v-for="n in tableData"
-                :key="n.id"
-                @click="$router.push({ name: 'interactDetail2', query: { id: n.id } })"
-            >
-                <div class="info">
-                    <i></i><span>{{ n.title }}</span>
+        <el-row v-if="this.current === 1">
+            <div v-for="n in tableData" :key="n.id">
+                <div class="box" @click="$router.push({ name: 'interactDetail2', query: { id: n.id, type: 'TOPIC' } })">
+                    <div class="info">
+                        <i></i><span>{{ n.title }}</span>
+                    </div>
+                    <div class="num">
+                        回复 <span>{{ n.commentNum }}</span>
+                    </div>
+                    <div class="time">{{ n.createdAt }}</div>
                 </div>
-                <div class="num">
-                    回复 <span>{{ n.commentList ? n.commentList.length : 0 }}</span>
+            </div>
+        </el-row>
+        <el-row v-if="this.current === 2">
+            <div v-for="n in tableData" :key="n.id">
+                <div
+                    class="box"
+                    v-if="n.type === 'QA'"
+                    @click="$router.push({ name: 'interactDetail2', query: { id: n.id, type: 'QA' } })"
+                >
+                    <div class="info">
+                        <i></i><span>{{ n.title }}</span>
+                    </div>
+                    <div class="num">
+                        回复 <span>{{ n.commentNum }}</span>
+                    </div>
+                    <div class="time">{{ n.createdAt }}</div>
                 </div>
-                <div class="time">{{ n.createdAt }}</div>
             </div>
         </el-row>
 
-        <el-row v-if="this.current === 3">
+        <!-- <el-row v-if="this.current === 3">
             <div
                 class="box"
-                v-for="n in tableData"
+                v-for="n in replylist"
                 :key="n.id"
                 @click="$router.push({ name: 'interactDetail2', query: { id: n.id } })"
             >
@@ -64,7 +77,7 @@
                 </div>
                 <div class="time">{{ n.createdAt }}</div>
             </div>
-        </el-row>
+        </el-row> -->
     </div>
 </template>
 
@@ -75,37 +88,48 @@ export default {
     name: 'interactive',
     data() {
         return {
-            url: 'question/myAll',
-            List: ['我的咨询', '我的话题', '我的问题', '我的回复'],
+            url: '/post/allDTO',
+            // List: ['我的咨询', '我的话题', '我的问题', '我的回复'],
+            List: ['我的咨询', '我的话题', '我的问题'],
             current: 0,
-            search: '',
-            query: {}
+            // search: '',
+            query: { type: 'OFFICIAL' }
         };
     },
+    created() {
+        this.$http.get('/post/pcPostDTO').then(res => {
+            this.replylist = res.content;
+            console.log(res);
+        });
+    },
     methods: {
         beforeGetData() {
-            if (this.search || this.query) {
-                return { search: this.search, query: this.query };
+            if (this.query) {
+                // if (this.current === 1) {
+                //     // this.query = 'TOPIC';
+                //     this.query = {
+                //         type: 'TOPIC'
+                //     };
+                // }
+                return { query: this.query };
             }
         },
         getIndex(index) {
             this.current = index;
             if (this.current === 0) {
-                this.url = 'civilAffairsInteraction/getList';
-                this.query = { type: 'OFFICIAL', publishersId: this.$store.state.userInfo.id };
+                this.query = { type: 'OFFICIAL' };
                 this.getData();
             } else if (this.current === 1) {
-                this.query = { type: 'HOT', publishersId: this.$store.state.userInfo.id };
-                this.url = 'civilAffairsInteraction/getList';
+                this.query = { type: 'TOPIC' };
                 this.getData();
             } else if (this.current === 2) {
-                this.query = { type: 'FORUM', publishersId: this.$store.state.userInfo.id };
-                this.url = 'civilAffairsInteraction/getList';
-                this.getData();
-            } else if (this.current === 3) {
-                this.url = 'topic/myAll';
+                this.query = { type: 'QA' };
                 this.getData();
             }
+            //else if (this.current === 3) {
+            //     this.url = 'topic/myAll';
+            //     this.getData();
+            // }
         }
     }
 };
@@ -170,7 +194,7 @@ export default {
     .num {
         font-size: 14px;
         color: #c8c9cc;
-        margin: 0 88px 0 177px;
+        // margin: 0 88px 0 177px;
     }
     .time {
         font-size: 14px;

+ 73 - 54
src/main/jmrh/src/views/mine/myCollection.vue

@@ -8,102 +8,98 @@
             </div>
         </el-row>
         <el-row>
-            <span
-                class="tab"
-                :class="{ active: tab === 0 }"
-                @click="(tab = 0), (url = '/collect/getNeedAll'), getData()"
-                >需求信息</span
-            >
-            <span class="tab" :class="{ active: tab === 1 }" @click="(tab = 1), (url = '/collect/getResAll'), getData()"
-                >供应信息</span
-            >
+            <span class="tab" :class="{ active: tab === 0 }" @click="(tab = 0), getData()">需求信息</span>
+            <span class="tab" :class="{ active: tab === 1 }" @click="(tab = 1), getData()">供应信息</span>
         </el-row>
         <el-row v-if="tab === 0">
             <div class="con_main" v-for="item in tableData" :key="item.id">
                 <ul>
                     <!-- 技术需求 -->
                     <div>
-                        <li :class="{ active: checked === true }" v-if="item.artNeed">
+                        <li :class="{ active: checked === true }" v-if="item.type == 'TECH_DEMAND'">
                             <el-checkbox v-if="isEdit === true" @change="addId(item.id)" :key="item.id"></el-checkbox>
-                            <img :src="item.artNeed.pic" />
+                            <img :src="item.images" />
                             <div
                                 class="con_main_right"
                                 @click="
                                     $router.push({
                                         name: 'resourceDetail',
-                                        query: { id: item.artNeed.id, type: 1 }
+                                        query: { id: item.id, type: 'TECH_DEMAND' }
                                     })
                                 "
                             >
                                 <div class="con_main_tit">
-                                    <i :class="item.artNeed.state === 1 ? 'wait' : ''">{{
+                                    <!-- <i :class="item.artNeed.state === 1 ? 'wait' : ''">{{
                                         item.artNeed.state === 1 ? '等待对接' : '正在对接'
-                                    }}</i>
-                                    <span>{{ item.artNeed.name }}</span>
+                                    }}</i> -->
+                                    <i class="wait" v-if="list.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                    <i v-if="list.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                                    <span>{{ item.name }}</span>
                                 </div>
                                 <p>
-                                    {{ item.artNeed.needInfo }}
+                                    {{ item.description }}
                                 </p>
-                                <span class="con_time">{{ item.artNeed.createdAt }}</span>
+                                <span class="con_time">{{ item.resSnDPropertyList[0].createdAt }}</span>
                             </div>
                         </li>
                         <!-- 产品需求 -->
-                        <li :class="{ active: checked === true }" v-else-if="item.productNeed">
+                        <li :class="{ active: checked === true }" v-else-if="item.type == 'PRODUCT_DEMAND'">
                             <el-checkbox v-if="isEdit === true" @change="addId(item.id)"></el-checkbox>
-                            <img :src="item.productNeed.pic" />
+                            <img :src="item.images" />
 
                             <div
                                 class="con_main_right"
                                 @click="
                                     $router.push({
                                         name: 'resourceDetail',
-                                        query: { id: item.productNeed.id, type: 2 }
+                                        query: { id: item.id, type: 'PRODUCT_DEMAND' }
                                     })
                                 "
                             >
                                 <div class="con_main_tit">
                                     <!-- <i>{{ item.productNeed.state }}</i
                                     ><span>{{ item.productNeed.name }}</span> -->
-                                    <i :class="item.productNeed.state === 1 ? 'wait' : ''">{{
+                                    <!-- <i :class="item.productNeed.state === 1 ? 'wait' : ''">{{
                                         item.productNeed.state === 1 ? '等待对接' : '正在对接'
-                                    }}</i>
-                                    <span>{{ item.productNeed.name }}</span>
+                                    }}</i> -->
+                                    <i class="wait" v-if="list.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                    <i v-if="list.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                                    <span>{{ item.name }}</span>
                                 </div>
-                                <p>{{ item.productNeed.needInfo }}</p>
-                                <span class="con_time">{{ item.productNeed.createdAt }}</span>
+                                <p>{{ item.description }}</p>
+                                <span class="con_time">{{ item.resSnDPropertyList[0].createdAt }}</span>
                             </div>
                         </li>
                         <!-- 融资需求 -->
-                        <li :class="{ active: checked === true }" v-else-if="item.financingNeeds">
+                        <li :class="{ active: checked === true }" v-else-if="item.type == 'FINANCING_DEMAND'">
                             <el-checkbox v-if="isEdit === true" @change="addId(item.id)"></el-checkbox>
-                            <img :src="item.financingNeeds.pic" />
+                            <img :src="item.images" />
                             <div
                                 class="con_main_right"
                                 @click="
                                     $router.push({
                                         name: 'resourceFanceDetail',
-                                        query: { id: item.financingNeeds.id, type: 3 }
+                                        query: { id: item.id, type: 'FINANCING_DEMAND' }
                                     })
                                 "
                             >
                                 <div class="con_main_tit">
-                                    <i :class="item.financingNeeds.state === 1 ? 'wait' : ''">{{
-                                        item.financingNeeds.state === 1 ? '等待对接' : '正在对接'
-                                    }}</i>
-                                    <span>{{ item.financingNeeds.name }}</span>
+                                    <i class="wait" v-if="list.conversationStatus === 'AWAIT'"> 等待对接 </i>
+                                    <i v-if="list.conversationStatus === 'CONDUCTED'"> 正在对接</i>
+                                    <span>{{ item.name }}</span>
                                 </div>
                                 <div class="con_info">
                                     <div class="con_info_item">
-                                        <i>计划融资</i><span>{{ item.financingNeeds.planMoney }}</span>
+                                        <i>计划融资</i><span>{{ item.resSnDPropertyList[0].value }}</span>
                                     </div>
                                     <div class="con_info_item">
-                                        <i>融资阶段</i><span>{{ item.financingNeeds.stageType.name }}</span>
+                                        <i>融资阶段</i><span>{{ item.resSnDPropertyList[1].value }}</span>
                                     </div>
                                     <div class="con_info_item">
-                                        <i>行业类型</i><span>{{ item.financingNeeds.dataType.name }}</span>
+                                        <i>行业类型</i><span>{{ item.resSnDPropertyList[2].value }}</span>
                                     </div>
                                 </div>
-                                <span class="con_time">{{ item.financingNeeds.createdAt }}</span>
+                                <span class="con_time">{{ item.resSnDPropertyList[0].createdAt }}</span>
                             </div>
                         </li>
                     </div>
@@ -113,40 +109,55 @@
         <el-row v-else>
             <div class="con_main ">
                 <ul class="con_card_ul" v-for="item in tableData" :key="item.id">
-                    <li class="con_card " :class="{ active: checked === true }" v-if="item.tresource">
+                    <li class="con_card " :class="{ active: checked === true }" v-if="item.type == 'RES_SUPPLY'">
                         <div
                             @click="
-                                $router.push({ name: 'resourceRelease', query: { id: item.tresource.id, type: 3 } })
+                                $router.push({
+                                    name: 'resourceRelease',
+                                    query: { id: item.id, type: 'RES_SUPPLY' }
+                                })
                             "
                         >
-                            <img :src="item.tresource.picList ? item.tresource.picList[0].url : null" />
-                            <h5>{{ item.tresource.name }}</h5>
-                            <p>{{ item.tresource.description }}</p>
+                            <img :src="item.images[0]" />
+                            <h5>{{ item.name }}</h5>
+                            <p>{{ item.description }}</p>
                         </div>
                         <el-checkbox v-if="isEdit === true" @change="addId(item.id)"></el-checkbox>
                     </li>
 
-                    <li class="con_card " :class="{ active: checked === true }" v-else-if="item.product">
+                    <li
+                        class="con_card "
+                        :class="{ active: checked === true }"
+                        v-else-if="item.type == 'PRODUCT_SUPPLY'"
+                    >
                         <div
-                            @click="$router.push({ name: 'resourceRelease', query: { id: item.product.id, type: 1 } })"
+                            @click="
+                                $router.push({
+                                    name: 'resourceRelease',
+                                    query: { id: item.id, type: 'PRODUCT_SUPPLY' }
+                                })
+                            "
                         >
-                            <img :src="item.product.picList ? item.product.picList[0].url : null" />
-                            <h5>{{ item.product.name }}</h5>
-                            <p>{{ item.product.description }}</p>
+                            <img :src="item.images[0]" />
+                            <h5>{{ item.name }}</h5>
+                            <p>{{ item.description }}</p>
                         </div>
 
                         <el-checkbox v-if="isEdit === true" @change="addId(item.id)"></el-checkbox>
                     </li>
 
-                    <li class="con_card " :class="{ active: checked === true }" v-else-if="item.artProduct">
+                    <li class="con_card " :class="{ active: checked === true }" v-else-if="item.type == 'TECH_SUPPLY'">
                         <div
                             @click="
-                                $router.push({ name: 'resourceRelease', query: { id: item.artProduct.id, type: 2 } })
+                                $router.push({
+                                    name: 'resourceRelease',
+                                    query: { id: item.id, type: 'TECH_SUPPLY' }
+                                })
                             "
                         >
-                            <img :src="item.artProduct.picList ? item.artProduct.picList[0].url : null" />
-                            <h5>{{ item.artProduct.name }}</h5>
-                            <p>{{ item.artProduct.description }}</p>
+                            <img :src="item.images[0]" />
+                            <h5>{{ item.name }}</h5>
+                            <p>{{ item.description }}</p>
                         </div>
                         <el-checkbox v-if="isEdit === true" @change="addId(item.id)"></el-checkbox>
                     </li>
@@ -175,13 +186,21 @@ export default {
     name: 'myCollection',
     data() {
         return {
-            url: '/collect/getNeedAll',
+            // url: '/collect/getNeedAll',
+            url: '/resourceSupplyAndDemand/myCollect',
             isEdit: false,
             tab: 0,
             currentPage: 1,
-            checked: []
+            checked: [],
+            list: {},
+            techList: {}
         };
     },
+    created() {
+        // this.$http.get('/resourceSupplyAndDemand/myCollect').then(res => {
+        //     console.log(res);
+        // });
+    },
     methods: {
         addId(value) {
             if (this.checked.indexOf(value) === -1) {
@@ -195,7 +214,7 @@ export default {
             let ids = this.checked;
             this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
                 .then(() => {
-                    return this.$axios.post('/collect/delIds', JSON.stringify(ids), {
+                    return this.$axios.post('/collect/remove', JSON.stringify(ids), {
                         headers: {
                             'Content-Type': 'application/json;charset=UTF-8'
                         }

+ 114 - 54
src/main/jmrh/src/views/mine/release.vue

@@ -27,26 +27,43 @@
             </el-row>
             <!-- 产品 -->
             <el-row>
-                <div class="card_list" v-if="current != 2">
+                <div class="card_list" v-if="current == 0">
                     <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.url" />
+                        <img :src="n.images[0]" />
                         <h5>{{ n.name }}</h5>
                         <p>{{ n.description }}</p>
                         <div class="btn">
                             <div class="edit" @click="toShow(n)">
                                 编辑
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count }}</div>
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                     </div>
                 </div>
-                <!-- 共享资源 -->
-                <div class="card_list" v-else>
+                <div class="card_list" v-if="current == 1">
                     <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.picList ? n.picList[0].url : null" />
+                        <img :src="n.images[0]" />
                         <h5>{{ n.name }}</h5>
                         <p>{{ n.description }}</p>
-                        <div class="btn"></div>
+                        <div class="btn">
+                            <div class="edit" @click="toShow(n)">
+                                编辑
+                            </div>
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                        </div>
+                    </div>
+                </div>
+                <div class="card_list" v-if="current == 2">
+                    <div class="card" v-for="n in tableData" :key="n.id">
+                        <img :src="n.images[0]" />
+                        <h5>{{ n.name }}</h5>
+                        <p>{{ n.description }}</p>
+                        <div class="btn">
+                            <div class="edit" @click="toShow(n)">
+                                编辑
+                            </div>
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                        </div>
                     </div>
                 </div>
             </el-row>
@@ -79,41 +96,59 @@
             </el-row>
             <!-- 产品需求,技术需求 -->
             <el-row>
+                <!-- <div v-for="n in tableData" :key="n.id" class="neens_div"> -->
                 <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current != 2">
-                        <img :src="n.pic" />
+                    <div class="needs_card" v-if="current == 0">
+                        <img :src="n.images[0]" />
                         <div class="info">
                             <div class="title">{{ n.name }}</div>
                             <p>
-                                {{ n.need_info }}
+                                {{ n.description }}
                             </p>
-                            <div class="time">{{ n.created_at }}</div>
+                            <div class="time">{{ n.createdAt }}</div>
                         </div>
                         <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count }}</div>
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             <div class="edit" @click="toNeedShow(n)">编辑</div>
                         </div>
                     </div>
-                    <!-- 融资需求 -->
-                    <div class="needs_card" v-else>
-                        <img :src="n.pic" />
+                </div>
+                <div v-for="n in tableData" :key="n.id" class="neens_div">
+                    <div class="needs_card" v-if="current == 1">
+                        <img :src="n.images[0]" />
+                        <div class="info">
+                            <div class="title">{{ n.name }}</div>
+                            <p>
+                                {{ n.description }}
+                            </p>
+                            <div class="time">{{ n.createdAt }}</div>
+                        </div>
+                        <div class="btn">
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                            <div class="edit" @click="toNeedShow(n)">编辑</div>
+                        </div>
+                    </div>
+                </div>
+                <div v-for="n in tableData" :key="n.id" class="neens_div">
+                    <div class="needs_card" v-if="current == 2">
+                        <img :src="n.images[0]" />
                         <div class="info">
                             <div class="title">{{ n.name }}</div>
                             <div class="con_info">
                                 <div class="con_info_item">
-                                    <i>计划融资</i><span>{{ n.planMoney }}</span>
+                                    <i>计划融资</i><span>{{ n.resSnDPropertyList[0].value }}</span>
                                 </div>
                                 <div class="con_info_item">
-                                    <i>融资阶段</i><span>{{ n.stageName }}</span>
+                                    <i>融资阶段</i><span>{{ n.resSnDPropertyList[1].value }}</span>
                                 </div>
                                 <div class="con_info_item">
-                                    <i>行业类型</i><span>{{ n.typeName }}</span>
+                                    <i>行业类型</i><span>{{ n.resSnDPropertyList[2].value }}</span>
                                 </div>
                             </div>
-                            <div class="time">{{ n.created_at }}</div>
+                            <div class="time">{{ n.createdAt }}</div>
                         </div>
                         <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count }}</div>
+                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             <div class="edit" @click="toNeedShow(n)">编辑</div>
                         </div>
                     </div>
@@ -147,8 +182,17 @@ export default {
             needsList: [/* '全部需求', */ '技术需求', '产品需求', '融资需求'],
             current: 0,
             currentPage: 1,
-            url: 'product/reqAllCount',
-            pageSize: 5
+            url: '/resourceSupplyAndDemand/my',
+            pageSize: 10,
+            // infoList: {}
+            productList: {},
+            techList: {},
+            resList: {},
+            techDemandtList: {},
+            proDemandtList: {},
+            resDemandtList: {},
+            // query: {}
+            types: ''
         };
     },
     methods: {
@@ -160,63 +204,64 @@ export default {
                 this.getIndex(this.current);
             }
         },
+        // 供应信息
         getIndex(index) {
             this.current = index;
             if (this.current === 0) {
-                this.url = 'product/reqAllCount';
-                this.getData();
-            } else if (this.current === 0) {
-                this.url = 'product/reqAllCount';
+                // this.query = { types:PRODUCT_SUPPLY' };
+                this.types = 'PRODUCT_SUPPLY';
                 this.getData();
             } else if (this.current === 1) {
-                this.url = 'artProduct/reqAllCount';
+                // this.query = { types: 'TECH_SUPPLY' };
+                this.types = 'TECH_SUPPLY';
                 this.getData();
             } else if (this.current === 2) {
-                this.url = 'tresource/myAll';
+                this.types = 'RES_SUPPLY';
                 this.getData();
             }
         },
+        // 需求信息
         getIndexNeed(index) {
             this.current = index;
             if (this.current === 0) {
-                this.url = 'artNeed/reqAllCount';
+                this.types = 'TECH_DEMAND';
                 this.getData();
             } else if (this.current === 0) {
-                this.url = 'artNeed/reqAllCount';
+                this.types = 'TECH_DEMAND';
                 this.getData();
             } else if (this.current === 1) {
-                this.url = 'productNeed/reqAllCount';
+                this.types = 'PRODUCT_DEMAND';
                 this.getData();
             } else if (this.current === 2) {
-                this.url = 'financingNeeds/reqAllCount';
+                this.types = 'FINANCING_DEMAND';
                 this.getData();
             }
         },
         toShow(n) {
-            if (this.current === 0) {
-                this.query = { product: { id: n.id }, name: n.name };
-            } else if (this.current === 1) {
-                this.query = { product: { id: n.id }, name: n.name };
-            } else if (this.current === 2) {
-                this.query = { artProduct: { id: n.id }, name: n.name };
-            } /* else if (this.current === 3) {
-
-            } */
-            localStorage.setItem('releaseParams', JSON.stringify(this.query));
-            this.$router.push({ name: 'releaseDetails' });
+            // if (this.current === 0) {
+            //     this.query = { product: { id: n.id }, name: n.name };
+            // } else if (this.current === 1) {
+            //     this.query = { product: { id: n.id }, name: n.name };
+            // } else if (this.current === 2) {
+            //     this.query = { artProduct: { id: n.id }, name: n.name };
+            // }
+            // localStorage.setItem('releaseParams', JSON.stringify(this.query));
+            // this.$router.push({ name: 'releaseDetails' });
+            this.$router.push({ name: 'releaseDetails', query: { id: n.id } });
         },
         toNeedShow(n) {
-            if (this.current === 0) {
-                this.query = { artNeed: { id: n.id }, name: n.name };
-            } else if (this.current === 0) {
-                this.query = { artNeed: { id: n.id }, name: n.name };
-            } else if (this.current === 1) {
-                this.query = { productNeed: { id: n.id }, name: n.name };
-            } else if (this.current === 2) {
-                this.query = { financingNeeds: { id: n.id }, name: n.name };
-            }
-            localStorage.setItem('releaseParams', JSON.stringify(this.query));
-            this.$router.push({ name: 'releaseDetails' });
+            // if (this.current === 0) {
+            //     this.query = { artNeed: { id: n.id }, name: n.name };
+            // } else if (this.current === 0) {
+            //     this.query = { artNeed: { id: n.id }, name: n.name };
+            // } else if (this.current === 1) {
+            //     this.query = { productNeed: { id: n.id }, name: n.name };
+            // } else if (this.current === 2) {
+            //     this.query = { financingNeeds: { id: n.id }, name: n.name };
+            // }
+            // localStorage.setItem('releaseParams', JSON.stringify(this.query));
+            // this.$router.push({ name: 'releaseDetails' });
+            this.$router.push({ name: 'releaseDetails', query: { id: n.id } });
         },
         changeTab() {
             if (this.tab == 0) {
@@ -224,6 +269,21 @@ export default {
             } else {
                 this.$router.push({ name: 'releaseRequirement' });
             }
+        },
+        beforeGetData() {
+            if (this.tab == 0) {
+                if (this.current === 0) {
+                    return { types: 'PRODUCT_SUPPLY' };
+                } else {
+                    return { types: this.types };
+                }
+            } else {
+                if (this.current === 0) {
+                    return { types: 'TECH_DEMAND' };
+                } else {
+                    return { types: this.types };
+                }
+            }
         }
     }
 };

+ 43 - 22
src/main/jmrh/src/views/mine/releaseDetails.vue

@@ -2,7 +2,7 @@
     <div class="releaseDetails">
         <el-row>
             <div class="content_title">
-                <span>对接详情-{{ info.name }}</span>
+                <span>对接详情-{{ resourceSupplyDemand.name }}</span>
             </div>
         </el-row>
         <el-row>
@@ -15,22 +15,24 @@
                 <li style="width:110px;text-align: center;">操作</li>
             </ul>
         </el-row>
-        <el-row v-for="item in tableData" :key="item.id">
+        <el-row v-for="item in list" :key="item.id">
             <ul class="row">
                 <li class="status">
-                    <span class="wait" v-if="item.state === 0 || item.state === null || item.state === undefined"
+                    <span
+                        class="wait"
+                        v-if="item.status === 'AWAIT' || item.status === null || item.status === undefined"
                         >等待对接</span
                     >
-                    <span class="now" v-if="item.state === 1">正在对接</span>
-                    <span class="success" v-if="item.state === 2">对接成功</span>
-                    <span class="fail" v-if="item.state === 3">对接失败</span>
-                    <span class="fail" v-if="item.state === 4">终止并删除</span>
+                    <span class="now" v-if="item.status === 'CONDUCTED'">正在对接</span>
+                    <span class="success" v-if="item.status === 'SUCCEED'">对接成功</span>
+                    <span class="fail" v-if="item.status === 'DEFEAT'">对接失败</span>
+                    <span class="fail" v-if="item.status === 'TERMINATION '">终止并删除</span>
                 </li>
                 <li class="company">{{ item.orgName }}</li>
-                <li class="name">{{ item.userName }}</li>
-                <li class="tel">{{ item.userPhone }}</li>
+                <li class="name">{{ resourceSupplyDemand.contact }}</li>
+                <li class="tel">{{ resourceSupplyDemand.phone }}</li>
                 <li class="mes">
-                    <p>{{ item.description }}</p>
+                    <!-- <p>{{ item.description }}</p> -->
                     <span @click="unfold(item.id, 1)">{{ appear === item.id ? '收起详情' : '展开详情' }}</span>
                 </li>
                 <li class="operat">
@@ -46,12 +48,12 @@
             </ul>
             <div class="detail" v-if="item.id === appear">
                 <div class="detail_tit">沟通记录</div>
-                <div class="detail_item" v-for="record in item.recordList" :key="record.id">
-                    <div class="detail_name">{{ record.user.nickname }}</div>
-                    <div class="detail_con">
+                <div class="detail_item" v-for="record in recordList" :key="record.id">
+                    <div class="detail_name" v-if="record.conversationId === item.id">{{ record.nickname }}</div>
+                    <div class="detail_con" v-if="record.conversationId === item.id">
                         {{ record.content }}
                     </div>
-                    <div class="detail_time">{{ record.createdAt }}</div>
+                    <div class="detail_time" v-if="record.conversationId === item.id">{{ record.createdAt }}</div>
                 </div>
             </div>
             <!-- 回复 -->
@@ -69,13 +71,17 @@
             <el-dialog title="更改对接状态" :visible.sync="dialogVisible" width="660px" center>
                 <div class="edit">
                     <div class="edit_info">
-                        <div class="edit_item" :class="{ active: editTab === 2 }" @click="editTab = 2">
+                        <div class="edit_item" :class="{ active: editTab === 'SUCCEED' }" @click="editTab = 'SUCCEED'">
                             对接成功
                         </div>
-                        <div class="edit_item" :class="{ active: editTab === 3 }" @click="editTab = 3">
+                        <div class="edit_item" :class="{ active: editTab === 'DEFEAT' }" @click="editTab = 'DEFEAT'">
                             对接失败
                         </div>
-                        <div class="edit_item" :class="{ active: editTab === 4 }" @click="editTab = 4">
+                        <div
+                            class="edit_item"
+                            :class="{ active: editTab === 'TERMINATION' }"
+                            @click="editTab = 'TERMINATION'"
+                        >
                             终止并删除
                         </div>
                     </div>
@@ -100,17 +106,31 @@ export default {
             dialogReplyVisible: false, // 回复
             dialogVisible: false, // 编辑
             editTab: 0,
-            url: '/message/getMessage',
+            // url: '/message/getMessage',
             query: { onExist: '0,2' },
             info: {},
-            clickCount: 0
+            clickCount: 0,
+            list: {},
+            resourceSupplyDemand: {},
+            recordList: {},
+            orgName: ''
         };
     },
+    created() {
+        this.$http.get(`/conversation/getList/${this.$route.query.id}`).then(res => {
+            this.list = res;
+            this.resourceSupplyDemand = res[0].resourceSupplyDemand;
+            this.orgName = res[0].orgName;
+        });
+        this.$http.get('/communicationRecord/all').then(res => {
+            this.recordList = res.content;
+        });
+    },
     methods: {
         save(id) {
-            this.model.dockingRecordId = id;
+            this.model.conversationId = id;
             this.$http
-                .post('/dockingRecord/updateMessageSave', this.model, { body: 'json' })
+                .post('/communicationRecord/save', this.model, { body: 'json' })
                 .then(res => {
                     this.getData();
                     this.dialogReplyVisible = false;
@@ -126,7 +146,7 @@ export default {
         },
         saveMessage(id) {
             this.$http
-                .post('/message/updateStatus', { id: id, state: this.editTab }, { body: 'json' })
+                .post('/conversation/create', { id: id, status: this.editTab }, { body: 'json' })
                 .then(res => {
                     this.getData();
                     this.$message.success('成功');
@@ -139,6 +159,7 @@ export default {
         beforeGetData() {
             var query = JSON.parse(localStorage.getItem('releaseParams'));
             this.info = query;
+            console.log(this.info);
             if (query) {
                 return { query: query };
             }

Some files were not shown because too many files changed in this diff