Browse Source

Merge remote-tracking branch 'origin/hxw' into lzy

# Conflicts:
#	Marketplace/src/main/java/com/dt/common/domain/User.java
#	Marketplace/src/main/java/com/dt/common/service/UserService.java
#	Marketplace/src/main/java/com/dt/common/service/impl/FoodRecordServiceImpl.java
#	Marketplace/src/main/java/com/dt/common/service/impl/UserServiceImpl.java
#	Marketplace/src/main/java/com/dt/user/mapper/UserMapper.java
#	Marketplace/src/main/resources/com/dt/common/mapper/UserMapper.xml
lzy 2 months ago
parent
commit
f3e4c08bd7

+ 1 - 6
Marketplace/src/main/java/com/dt/care/controller/AgesNameController.java

@@ -79,10 +79,5 @@ public class AgesNameController {
     }
     }
 
 
 
 
-    @RequestMapping("findByVaccines")//疫苗查询详情
-    @NonLoginRequired
-    public ResultVo findByVaccines(@RequestBody AgesNameDto dto){
-        HxwVaccines hxwVaccines=hxwVaccinesService.findByVaccinesDetails(dto);
-        return ResultVo.OK(hxwVaccines);
-    }
+
 }
 }

+ 13 - 0
Marketplace/src/main/java/com/dt/care/controller/ExcelFileLeadInController.java

@@ -1,8 +1,11 @@
 package com.dt.care.controller;
 package com.dt.care.controller;
 
 
+import com.dt.care.dto.AgesNameDto;
 import com.dt.care.vo.ResultVo;
 import com.dt.care.vo.ResultVo;
+import com.dt.common.domain.HxwVaccines;
 import com.dt.common.service.*;
 import com.dt.common.service.*;
 import com.dt.config.NonLoginRequired;
 import com.dt.config.NonLoginRequired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -32,6 +35,8 @@ public class ExcelFileLeadInController {
 
 
 
 
 
 
+
+
     @RequestMapping("leadIn")
     @RequestMapping("leadIn")
     @NonLoginRequired
     @NonLoginRequired
     public ResultVo leadIn(@RequestParam("file")MultipartFile file){
     public ResultVo leadIn(@RequestParam("file")MultipartFile file){
@@ -47,4 +52,12 @@ public class ExcelFileLeadInController {
         }
         }
         return ResultVo.OK("导入成功");
         return ResultVo.OK("导入成功");
     }
     }
+
+    @RequestMapping("findByVaccines")//疫苗查询详
+    @NonLoginRequired
+    public ResultVo findByVaccines(@RequestBody AgesNameDto dto){
+        HxwVaccines hxwVaccines=foodRecordService.findByVaccinesDetails(dto);
+        return ResultVo.OK(hxwVaccines);
+    }
+
 }
 }

+ 1 - 0
Marketplace/src/main/java/com/dt/common/domain/HxwKnowledgeArticles.java

@@ -86,6 +86,7 @@ public class HxwKnowledgeArticles {
      * 更新时间
      * 更新时间
      */
      */
     private Date updatedAt;
     private Date updatedAt;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private HxwVaccines vaccines;
     private HxwVaccines vaccines;
 
 

+ 70 - 22
Marketplace/src/main/java/com/dt/common/domain/HxwVaccineDiscussions.java

@@ -10,7 +10,7 @@ import com.dt.user.pojo.User;
 import lombok.Data;
 import lombok.Data;
 
 
 /**
 /**
- * hxw_疫苗讨论表:存储用户对疫苗的讨论内容
+ * hxw_疫苗讨论表:存储用户发起的疫苗相关讨论
  * @TableName hxw_vaccine_discussions
  * @TableName hxw_vaccine_discussions
  */
  */
 @TableName(value ="hxw_vaccine_discussions")
 @TableName(value ="hxw_vaccine_discussions")
@@ -23,30 +23,59 @@ public class HxwVaccineDiscussions {
     private Integer id;
     private Integer id;
 
 
     /**
     /**
-     * 关联的疫苗ID
+     * 讨论标题
      */
      */
-    private Integer vaccineId;
+    private String title;
+
+    /**
+     * 讨论内容
+     */
+    private String content;
 
 
     /**
     /**
-     * 用户ID
+     * 封面图片URL
+     */
+    private String coverImageUrl;
+
+    /**
+     * 发起用户ID
      */
      */
     private Integer userId;
     private Integer userId;
 
 
     /**
     /**
-     * 讨论内容
+     * 相关疫苗ID
      */
      */
-    private String content;
+    private Integer vaccineId;
+
+    /**
+     * 浏览量
+     */
+    private Integer viewCount;
+
+    /**
+     * 评论数
+     */
+    private Integer commentCount;
 
 
     /**
     /**
      * 点赞数
      * 点赞数
      */
      */
-    @TableField(exist = false)
-    private Integer likesCount;
+    private Integer likeCount;
 
 
     /**
     /**
-     * 是否精选
+     * 是否热门
      */
      */
-    private Integer isHighlighted;
+    private Integer isHot;
+
+    /**
+     * 是否推荐
+     */
+    private Integer isRecommended;
+
+    /**
+     * 讨论状态
+     */
+    private Object status;
 
 
     /**
     /**
      * 创建时间
      * 创建时间
@@ -57,6 +86,7 @@ public class HxwVaccineDiscussions {
      * 更新时间
      * 更新时间
      */
      */
     private Date updatedAt;
     private Date updatedAt;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private User user;
     private User user;
 
 
@@ -73,11 +103,17 @@ public class HxwVaccineDiscussions {
         }
         }
         HxwVaccineDiscussions other = (HxwVaccineDiscussions) that;
         HxwVaccineDiscussions other = (HxwVaccineDiscussions) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getVaccineId() == null ? other.getVaccineId() == null : this.getVaccineId().equals(other.getVaccineId()))
-            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
+            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
             && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
             && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
-            && (this.getLikesCount() == null ? other.getLikesCount() == null : this.getLikesCount().equals(other.getLikesCount()))
-            && (this.getIsHighlighted() == null ? other.getIsHighlighted() == null : this.getIsHighlighted().equals(other.getIsHighlighted()))
+            && (this.getCoverImageUrl() == null ? other.getCoverImageUrl() == null : this.getCoverImageUrl().equals(other.getCoverImageUrl()))
+            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
+            && (this.getVaccineId() == null ? other.getVaccineId() == null : this.getVaccineId().equals(other.getVaccineId()))
+            && (this.getViewCount() == null ? other.getViewCount() == null : this.getViewCount().equals(other.getViewCount()))
+            && (this.getCommentCount() == null ? other.getCommentCount() == null : this.getCommentCount().equals(other.getCommentCount()))
+            && (this.getLikeCount() == null ? other.getLikeCount() == null : this.getLikeCount().equals(other.getLikeCount()))
+            && (this.getIsHot() == null ? other.getIsHot() == null : this.getIsHot().equals(other.getIsHot()))
+            && (this.getIsRecommended() == null ? other.getIsRecommended() == null : this.getIsRecommended().equals(other.getIsRecommended()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
             && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
             && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
             && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
             && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
     }
     }
@@ -87,11 +123,17 @@ public class HxwVaccineDiscussions {
         final int prime = 31;
         final int prime = 31;
         int result = 1;
         int result = 1;
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
-        result = prime * result + ((getVaccineId() == null) ? 0 : getVaccineId().hashCode());
-        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
+        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
         result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
         result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
-        result = prime * result + ((getLikesCount() == null) ? 0 : getLikesCount().hashCode());
-        result = prime * result + ((getIsHighlighted() == null) ? 0 : getIsHighlighted().hashCode());
+        result = prime * result + ((getCoverImageUrl() == null) ? 0 : getCoverImageUrl().hashCode());
+        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
+        result = prime * result + ((getVaccineId() == null) ? 0 : getVaccineId().hashCode());
+        result = prime * result + ((getViewCount() == null) ? 0 : getViewCount().hashCode());
+        result = prime * result + ((getCommentCount() == null) ? 0 : getCommentCount().hashCode());
+        result = prime * result + ((getLikeCount() == null) ? 0 : getLikeCount().hashCode());
+        result = prime * result + ((getIsHot() == null) ? 0 : getIsHot().hashCode());
+        result = prime * result + ((getIsRecommended() == null) ? 0 : getIsRecommended().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
         result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
         result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
         result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
         result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
         return result;
         return result;
@@ -104,11 +146,17 @@ public class HxwVaccineDiscussions {
         sb.append(" [");
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", id=").append(id);
-        sb.append(", vaccineId=").append(vaccineId);
-        sb.append(", userId=").append(userId);
+        sb.append(", title=").append(title);
         sb.append(", content=").append(content);
         sb.append(", content=").append(content);
-        sb.append(", likesCount=").append(likesCount);
-        sb.append(", isHighlighted=").append(isHighlighted);
+        sb.append(", coverImageUrl=").append(coverImageUrl);
+        sb.append(", userId=").append(userId);
+        sb.append(", vaccineId=").append(vaccineId);
+        sb.append(", viewCount=").append(viewCount);
+        sb.append(", commentCount=").append(commentCount);
+        sb.append(", likeCount=").append(likeCount);
+        sb.append(", isHot=").append(isHot);
+        sb.append(", isRecommended=").append(isRecommended);
+        sb.append(", status=").append(status);
         sb.append(", createdAt=").append(createdAt);
         sb.append(", createdAt=").append(createdAt);
         sb.append(", updatedAt=").append(updatedAt);
         sb.append(", updatedAt=").append(updatedAt);
         sb.append("]");
         sb.append("]");

+ 224 - 0
Marketplace/src/main/java/com/dt/common/domain/User.java

@@ -0,0 +1,224 @@
+package com.dt.common.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 用户表
+ * @TableName user
+ */
+@TableName(value ="user")
+@Data
+public class User {
+    /**
+     * 用户ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户名
+     */
+    private String username;
+
+    /**
+     * 密码(BCrypt加密)
+     */
+    private String password;
+
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 头像URL
+     */
+    private String avatar;
+
+    /**
+     * 性别(0-未知,1-男,2-女)
+     */
+    private Integer gender;
+
+    /**
+     * 出生日期
+     */
+    private Date birthDate;
+
+    /**
+     * 状态(0-禁用,1-正常)
+     */
+    private Integer status;
+
+    /**
+     * 最后登录时间
+     */
+    private Date lastLoginTime;
+
+    /**
+     * 最后登录IP
+     */
+    private String lastLoginIp;
+
+    /**
+     * 最后登录设备
+     */
+    private String lastLoginDevice;
+
+    /**
+     * 人脸图片URL
+     */
+    private String faceImageUrl;
+
+    /**
+     * 是否启用人脸登录(0-禁用,1-启用)
+     */
+    private Integer faceLoginEnabled;
+
+    /**
+     * 创建时间
+     */
+    private Date createdAt;
+
+    /**
+     * 更新时间
+     */
+    private Date updatedAt;
+
+    /**
+     * 是否删除(0-未删除,1-已删除)
+     */
+    private Integer deleted;
+
+    /**
+     * 上次签到时间
+     */
+    private Date lastSignInTime;
+
+    /**
+     * 连续签到天数
+     */
+    private Integer continuousSignInDays;
+
+    /**
+     * 累计签到天数
+     */
+    private Integer totalSignInDays;
+
+    /**
+     * 豆豆数量
+     */
+    private Integer beans;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        User other = (User) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
+            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
+            && (this.getRealName() == null ? other.getRealName() == null : this.getRealName().equals(other.getRealName()))
+            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
+            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
+            && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
+            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
+            && (this.getBirthDate() == null ? other.getBirthDate() == null : this.getBirthDate().equals(other.getBirthDate()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getLastLoginTime() == null ? other.getLastLoginTime() == null : this.getLastLoginTime().equals(other.getLastLoginTime()))
+            && (this.getLastLoginIp() == null ? other.getLastLoginIp() == null : this.getLastLoginIp().equals(other.getLastLoginIp()))
+            && (this.getLastLoginDevice() == null ? other.getLastLoginDevice() == null : this.getLastLoginDevice().equals(other.getLastLoginDevice()))
+            && (this.getFaceImageUrl() == null ? other.getFaceImageUrl() == null : this.getFaceImageUrl().equals(other.getFaceImageUrl()))
+            && (this.getFaceLoginEnabled() == null ? other.getFaceLoginEnabled() == null : this.getFaceLoginEnabled().equals(other.getFaceLoginEnabled()))
+            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
+            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
+            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
+            && (this.getLastSignInTime() == null ? other.getLastSignInTime() == null : this.getLastSignInTime().equals(other.getLastSignInTime()))
+            && (this.getContinuousSignInDays() == null ? other.getContinuousSignInDays() == null : this.getContinuousSignInDays().equals(other.getContinuousSignInDays()))
+            && (this.getTotalSignInDays() == null ? other.getTotalSignInDays() == null : this.getTotalSignInDays().equals(other.getTotalSignInDays()))
+            && (this.getBeans() == null ? other.getBeans() == null : this.getBeans().equals(other.getBeans()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
+        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
+        result = prime * result + ((getRealName() == null) ? 0 : getRealName().hashCode());
+        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
+        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
+        result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
+        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
+        result = prime * result + ((getBirthDate() == null) ? 0 : getBirthDate().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getLastLoginTime() == null) ? 0 : getLastLoginTime().hashCode());
+        result = prime * result + ((getLastLoginIp() == null) ? 0 : getLastLoginIp().hashCode());
+        result = prime * result + ((getLastLoginDevice() == null) ? 0 : getLastLoginDevice().hashCode());
+        result = prime * result + ((getFaceImageUrl() == null) ? 0 : getFaceImageUrl().hashCode());
+        result = prime * result + ((getFaceLoginEnabled() == null) ? 0 : getFaceLoginEnabled().hashCode());
+        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
+        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
+        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
+        result = prime * result + ((getLastSignInTime() == null) ? 0 : getLastSignInTime().hashCode());
+        result = prime * result + ((getContinuousSignInDays() == null) ? 0 : getContinuousSignInDays().hashCode());
+        result = prime * result + ((getTotalSignInDays() == null) ? 0 : getTotalSignInDays().hashCode());
+        result = prime * result + ((getBeans() == null) ? 0 : getBeans().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", username=").append(username);
+        sb.append(", password=").append(password);
+        sb.append(", realName=").append(realName);
+        sb.append(", phone=").append(phone);
+        sb.append(", email=").append(email);
+        sb.append(", avatar=").append(avatar);
+        sb.append(", gender=").append(gender);
+        sb.append(", birthDate=").append(birthDate);
+        sb.append(", status=").append(status);
+        sb.append(", lastLoginTime=").append(lastLoginTime);
+        sb.append(", lastLoginIp=").append(lastLoginIp);
+        sb.append(", lastLoginDevice=").append(lastLoginDevice);
+        sb.append(", faceImageUrl=").append(faceImageUrl);
+        sb.append(", faceLoginEnabled=").append(faceLoginEnabled);
+        sb.append(", createdAt=").append(createdAt);
+        sb.append(", updatedAt=").append(updatedAt);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", lastSignInTime=").append(lastSignInTime);
+        sb.append(", continuousSignInDays=").append(continuousSignInDays);
+        sb.append(", totalSignInDays=").append(totalSignInDays);
+        sb.append(", beans=").append(beans);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 2 - 2
Marketplace/src/main/java/com/dt/common/mapper/HxwVaccineDiscussionsMapper.java

@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 
 /**
 /**
 * @author sunday
 * @author sunday
-* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户对疫苗的讨论内容)】的数据库操作Mapper
-* @createDate 2025-07-03 09:45:44
+* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户发起的疫苗相关讨论)】的数据库操作Mapper
+* @createDate 2025-07-11 14:41:37
 * @Entity com.dt.common.domain.HxwVaccineDiscussions
 * @Entity com.dt.common.domain.HxwVaccineDiscussions
 */
 */
 public interface HxwVaccineDiscussionsMapper extends BaseMapper<HxwVaccineDiscussions> {
 public interface HxwVaccineDiscussionsMapper extends BaseMapper<HxwVaccineDiscussions> {

+ 3 - 1
Marketplace/src/main/java/com/dt/common/service/FoodRecordService.java

@@ -1,7 +1,9 @@
 package com.dt.common.service;
 package com.dt.common.service;
 
 
+import com.dt.care.dto.AgesNameDto;
 import com.dt.common.domain.FoodRecord;
 import com.dt.common.domain.FoodRecord;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.dt.common.domain.HxwVaccines;
 
 
 import java.io.InputStream;
 import java.io.InputStream;
 
 
@@ -13,5 +15,5 @@ import java.io.InputStream;
 public interface FoodRecordService extends IService<FoodRecord> {
 public interface FoodRecordService extends IService<FoodRecord> {
 
 
     void leadIn(InputStream inputStream);
     void leadIn(InputStream inputStream);
-
+    HxwVaccines findByVaccinesDetails(AgesNameDto dto);
 }
 }

+ 2 - 2
Marketplace/src/main/java/com/dt/common/service/HxwVaccineDiscussionsService.java

@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 
 /**
 /**
 * @author sunday
 * @author sunday
-* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户对疫苗的讨论内容)】的数据库操作Service
-* @createDate 2025-07-03 09:45:44
+* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户发起的疫苗相关讨论)】的数据库操作Service
+* @createDate 2025-07-11 14:41:37
 */
 */
 public interface HxwVaccineDiscussionsService extends IService<HxwVaccineDiscussions> {
 public interface HxwVaccineDiscussionsService extends IService<HxwVaccineDiscussions> {
 
 

+ 1 - 1
Marketplace/src/main/java/com/dt/common/service/HxwVaccinesService.java

@@ -16,7 +16,7 @@ public interface HxwVaccinesService extends IService<HxwVaccines> {
 
 
     List<HxwVaccines> findByVaccinesByCategory(VaccinesDto dto);
     List<HxwVaccines> findByVaccinesByCategory(VaccinesDto dto);
 
 
-    HxwVaccines findByVaccinesDetails(AgesNameDto dto);
+
 
 
     List<HxwVaccines> findByAdultAll(AgesNameDto dto);
     List<HxwVaccines> findByAdultAll(AgesNameDto dto);
 
 

+ 13 - 0
Marketplace/src/main/java/com/dt/common/service/UserService.java

@@ -0,0 +1,13 @@
+package com.dt.common.service;
+
+import com.dt.common.domain.User;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author sunday
+* @description 针对表【user(用户表)】的数据库操作Service
+* @createDate 2025-07-11 14:41:37
+*/
+public interface UserService extends IService<User> {
+
+}

+ 160 - 80
Marketplace/src/main/java/com/dt/common/service/impl/FoodRecordServiceImpl.java

@@ -1,20 +1,18 @@
 package com.dt.common.service.impl;
 package com.dt.common.service.impl;
 
 
+
 import cn.hutool.poi.excel.ExcelUtil;
 import cn.hutool.poi.excel.ExcelUtil;
 import cn.hutool.poi.excel.sax.handler.RowHandler;
 import cn.hutool.poi.excel.sax.handler.RowHandler;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.dt.common.domain.Child;
-import com.dt.common.domain.FoodRecord;
-import com.dt.common.mapper.ChildMapper;
+import com.dt.care.dto.AgesNameDto;
+import com.dt.common.domain.*;
+import com.dt.common.mapper.*;
 import com.dt.common.service.FoodRecordService;
 import com.dt.common.service.FoodRecordService;
-import com.dt.common.mapper.FoodRecordMapper;
-import com.dt.user.mapper.UserMapper;
-import com.dt.user.pojo.User;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.io.InputStream;
 import java.io.InputStream;
@@ -29,104 +27,186 @@ import java.util.concurrent.atomic.AtomicInteger;
 @Service
 @Service
 @Slf4j
 @Slf4j
 public class FoodRecordServiceImpl extends ServiceImpl<FoodRecordMapper, FoodRecord>
 public class FoodRecordServiceImpl extends ServiceImpl<FoodRecordMapper, FoodRecord>
-    implements FoodRecordService {
+    implements FoodRecordService{
 
 
 
 
-        @Resource
-        private ChildMapper childMapper;
-        @Resource
-        private UserMapper userMapper;
 
 
-        static AtomicInteger num = new AtomicInteger(0);
+    @Resource
+    private HxwVaccineCategoriesMapper hxwVaccineCategoriesMapper;
+    @Resource
+    private HxwVaccinesMapper hxwVaccinesMapper;
+    @Resource
+    private HxwVaccineExpertRelationsMapper hxwVaccineExpertRelationsMapper;
+    @Resource
+    private HxwVaccineExpertsMapper hxwVaccineExpertsMapper;
+    @Resource
+    private HxwVaccineDetailsMapper hxwVaccineDetailsMapper;
+    @Resource
+    private HxwVaccineDiscussionsMapper hxwVaccineDiscussionsMapper;
+    @Resource
+    private HxwVaccineContentModulesMapper hxwVaccineContentModulesMapper;
+//    @Resource
+//    private UserMapper userMapper;
 
 
-        @Override
-        public void leadIn(InputStream inputStream) {
-            List<FoodRecord> list = new ArrayList<>();
-            ExcelUtil.readBySax(inputStream, -1, createRowHandler(list));
-            if (!CollectionUtils.isEmpty(list)) {
-                batchAddFoodRecord(list);
-            }
+    @Resource
+    private HxwKnowledgeArticlesMapper hxwKnowledgeArticlesMapper;
+
+
+
+
+
+
+
+
+
+
+
+
+
+    @Resource
+    private ChildMapper childMapper;
+    @Resource
+    private UserMapper userMapper;
+
+    static AtomicInteger num=new AtomicInteger(0);
+
+    @Override
+    public void leadIn(InputStream inputStream) {
+        List<FoodRecord> list=new ArrayList<>();
+        ExcelUtil.readBySax(inputStream, -1, createRowHandler(list));
+        if(!CollectionUtils.isEmpty(list)){
+            batchAddFoodRecord(list);
         }
         }
+    }
 
 
 
 
-        public void batchAddFoodRecord(List<FoodRecord> list) {
+    public void batchAddFoodRecord(List<FoodRecord> list){
 
 
-            for (FoodRecord foodRecord : list) {
-                num.getAndIncrement();
+        for (FoodRecord foodRecord : list){
+            num.getAndIncrement();
                 try {
                 try {
                     addFoodRecord(foodRecord);
                     addFoodRecord(foodRecord);
                 } catch (Exception e) {
                 } catch (Exception e) {
-                    log.info("第" + num.get() + "行数据插入失败");
+                    log.info("第"+num.get()+"行数据插入失败");
                 }
                 }
             }
             }
         }
         }
 
 
 
 
-        @Transactional(rollbackFor = {Exception.class, RuntimeException.class})
-        public void addFoodRecord(FoodRecord foodRecord) {
-            if (foodRecord != null) {
-                this.baseMapper.insert(foodRecord);
-            }
+    @Transactional(rollbackFor = {Exception.class, RuntimeException.class})
+    public void addFoodRecord(FoodRecord foodRecord){
+        if (foodRecord!=null){
+            this.baseMapper.insert(foodRecord);
         }
         }
+    }
 
 
 
 
-        private RowHandler createRowHandler(List<FoodRecord> foodRecordList) {
-            return new RowHandler() {
-                @Override
-                public void handle(int i, long l, List<Object> list) {
-                    if (l > 0) {
-                        String childName = list.get(0).toString();
-                        QueryWrapper<Child> wrapper = new QueryWrapper<>();
-                        wrapper.eq("name", childName);
-                        Child child = childMapper.selectOne(wrapper);
-                        if (child == null) {
-                            log.warn("第{}行数据被跳过:未找到姓名为【{}】的幼儿", l, childName);
-                            return;
-                        }
-                        Long id = child.getId();
-                        Date recordTime = (Date) list.get(1);
-
-                        Map<String, Integer> map = new HashMap<>();//将食谱名称映射成数字
-                        map.put("早餐", 0);
-                        map.put("上午加餐", 1);
-                        map.put("午餐", 2);
-                        map.put("下午加餐", 3);
-                        map.put("晚餐", 4);
-
-                        String goodName = list.get(2).toString();//食谱名称
-                        Integer mealType = map.get(goodName);//食谱名称对应的数字
-                        if (mealType == null) {
-                            mealType = 5;
-                        }
-                        String foodContent = list.get(3).toString();
-                        String amount = list.get(4).toString();
-                        String remark = list.get(5).toString();
-                        String username = list.get(6).toString();
-                        QueryWrapper<User> userWrapper = new QueryWrapper<>();
-                        userWrapper.eq("username", username);
-                        User user = userMapper.selectOne(userWrapper);
-                        if (user == null) {
-                            log.warn("第{}行数据被跳过:未找到名称为【{}】的记录人", l, username);
-                            return;
-                        }
-                        Long recorderId = user.getId();
-                        FoodRecord foodRecord = new FoodRecord();
-                        foodRecord.setChildId(id);
-                        foodRecord.setRecordTime(recordTime);
-                        foodRecord.setMealType(mealType);
-                        foodRecord.setFoodContent(foodContent);
-                        foodRecord.setAmount(amount);
-                        foodRecord.setRemark(remark);
-                        foodRecord.setRecorderId(recorderId);
-                        foodRecordList.add(foodRecord);
+
+    private RowHandler createRowHandler(List<FoodRecord> foodRecordList){
+        return new RowHandler() {
+            @Override
+            public void handle(int i, long l, List<Object> list) {
+                if(l>0){
+                    String childName = list.get(0).toString();
+                    QueryWrapper<Child> wrapper=new QueryWrapper<>();
+                    wrapper.eq("name",childName);
+                    Child child = childMapper.selectOne(wrapper);
+                    if(child==null){
+                        log.warn("第{}行数据被跳过:未找到姓名为【{}】的幼儿", l, childName);
+                        return;
+                    }
+                    Long id = child.getId();
+                    Date recordTime = (Date) list.get(1);
+
+                    Map<String,Integer> map=new HashMap<>();//将食谱名称映射成数字
+                    map.put("早餐",0);
+                    map.put("上午加餐",1);
+                    map.put("午餐",2);
+                    map.put("下午加餐",3);
+                    map.put("晚餐",4);
+
+                    String goodName =  list.get(2).toString();//食谱名称
+                    Integer mealType = map.get(goodName);//食谱名称对应的数字
+                    if(mealType==null){
+                        mealType=5;
                     }
                     }
+                    String foodContent =list.get(3).toString();
+                    String amount = list.get(4).toString();
+                    String remark=list.get(5).toString();
+                    String username =  list.get(6).toString();
+                    QueryWrapper<User> userWrapper=new QueryWrapper<>();
+                    userWrapper.eq("username",username);
+                    User user = userMapper.selectOne(userWrapper);
+                    if (user==null){
+                        log.warn("第{}行数据被跳过:未找到名称为【{}】的记录人", l, username);
+                        return;
+                    }
+                    Long recorderId = user.getId();
+                    FoodRecord foodRecord=new FoodRecord();
+                    foodRecord.setChildId(id);
+                    foodRecord.setRecordTime(recordTime);
+                    foodRecord.setMealType(mealType);
+                    foodRecord.setFoodContent(foodContent);
+                    foodRecord.setAmount(amount);
+                    foodRecord.setRemark(remark);
+                    foodRecord.setRecorderId(recorderId);
+                    foodRecordList.add(foodRecord);
                 }
                 }
-            };
-        }
+            }
+        };
+    }
+
+
 
 
+    @Override
+    public HxwVaccines findByVaccinesDetails(AgesNameDto dto) {
+        QueryWrapper<HxwVaccines> wrapper=new QueryWrapper<>();
+        wrapper.eq("name",dto.getVaccinesName());
+        HxwVaccines hxwVaccines = hxwVaccinesMapper.selectOne(wrapper);//疫苗基本信息
+        Integer id = hxwVaccines.getId();//疫苗id
+        if (id!=null){
+            QueryWrapper<HxwVaccineExpertRelations> wrapper1=new QueryWrapper<>();
+            wrapper1.eq("vaccine_id",id);
+            HxwVaccineExpertRelations hxwVaccineExpertRelations = hxwVaccineExpertRelationsMapper.selectOne(wrapper1);
+            Integer expertId = hxwVaccineExpertRelations.getExpertId();//医生 id
+            QueryWrapper<HxwVaccineExperts> wrapper2=new QueryWrapper<>();
+            wrapper2.eq("id",expertId);
+            HxwVaccineExperts hxwVaccineExperts = hxwVaccineExpertsMapper.selectOne(wrapper2);
+            hxwVaccines.setExperts(hxwVaccineExperts);//设置医生信息
+            QueryWrapper<HxwVaccineDetails> wrapper3=new QueryWrapper<>();
+            wrapper3.eq("vaccine_id",id);
+            HxwVaccineDetails hxwVaccineDetails = hxwVaccineDetailsMapper.selectOne(wrapper3);
+            hxwVaccines.setDetails(hxwVaccineDetails);//设置疫苗详情信息
+            QueryWrapper<HxwVaccineDiscussions> wrapper4=new QueryWrapper<>();
+            wrapper4.eq("vaccine_id",id);
+            List<HxwVaccineDiscussions> hxwVaccineDiscussions = hxwVaccineDiscussionsMapper.selectList(wrapper4);
+            for (HxwVaccineDiscussions discussion : hxwVaccineDiscussions){
+                Integer userId = discussion.getUserId();
+                QueryWrapper<User> wrapper5=new QueryWrapper<>();
+                wrapper5.eq("id",userId);
+                User user = userMapper.selectOne(wrapper5);
+                discussion.setUser(user);
+            }
+            System.err.println("_-----------------"+hxwVaccineDiscussions);
+            hxwVaccines.setDiscussions(hxwVaccineDiscussions);//设置讨论信息
+            QueryWrapper<HxwVaccineContentModules> wrapper8=new QueryWrapper<>();
+            wrapper8.eq("vaccine_id",id);
+            List<HxwVaccineContentModules> hxwVaccineContentModules = hxwVaccineContentModulesMapper.selectList(wrapper8);
+            hxwVaccines.setContentModules(hxwVaccineContentModules);//设置内容模块信息
+            QueryWrapper<HxwKnowledgeArticles> wrapper6=new QueryWrapper<>();
+            wrapper6.eq("related_vaccine_id",id);
+            List<HxwKnowledgeArticles> hxwKnowledgeArticles = hxwKnowledgeArticlesMapper.selectList(wrapper6);
+            hxwVaccines.setArticles(hxwKnowledgeArticles);
+            return hxwVaccines;
+        }else {
+            return null;
+        }
 
 
     }
     }
 
 
 
 
+}
+
+
 
 
 
 

+ 2 - 2
Marketplace/src/main/java/com/dt/common/service/impl/HxwVaccineDiscussionsServiceImpl.java

@@ -8,8 +8,8 @@ import org.springframework.stereotype.Service;
 
 
 /**
 /**
 * @author sunday
 * @author sunday
-* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户对疫苗的讨论内容)】的数据库操作Service实现
-* @createDate 2025-07-03 09:45:44
+* @description 针对表【hxw_vaccine_discussions(hxw_疫苗讨论表:存储用户发起的疫苗相关讨论)】的数据库操作Service实现
+* @createDate 2025-07-11 14:41:37
 */
 */
 @Service
 @Service
 public class HxwVaccineDiscussionsServiceImpl extends ServiceImpl<HxwVaccineDiscussionsMapper, HxwVaccineDiscussions>
 public class HxwVaccineDiscussionsServiceImpl extends ServiceImpl<HxwVaccineDiscussionsMapper, HxwVaccineDiscussions>

+ 0 - 43
Marketplace/src/main/java/com/dt/common/service/impl/HxwVaccinesServiceImpl.java

@@ -53,50 +53,7 @@ public class HxwVaccinesServiceImpl extends ServiceImpl<HxwVaccinesMapper, HxwVa
         return vaccinesList;
         return vaccinesList;
     }
     }
 
 
-    @Override
-    public HxwVaccines findByVaccinesDetails(AgesNameDto dto) {
-        QueryWrapper<HxwVaccines> wrapper=new QueryWrapper<>();
-        wrapper.eq("name",dto.getVaccinesName());
-        HxwVaccines hxwVaccines = this.baseMapper.selectOne(wrapper);//疫苗基本信息
-        Integer id = hxwVaccines.getId();//疫苗id
-        if (id!=null){
-            QueryWrapper<HxwVaccineExpertRelations> wrapper1=new QueryWrapper<>();
-            wrapper1.eq("vaccine_id",id);
-            HxwVaccineExpertRelations hxwVaccineExpertRelations = hxwVaccineExpertRelationsMapper.selectOne(wrapper1);
-            Integer expertId = hxwVaccineExpertRelations.getExpertId();//医生 id
-            QueryWrapper<HxwVaccineExperts> wrapper2=new QueryWrapper<>();
-            wrapper2.eq("id",expertId);
-            HxwVaccineExperts hxwVaccineExperts = hxwVaccineExpertsMapper.selectOne(wrapper2);
-            hxwVaccines.setExperts(hxwVaccineExperts);//设置医生信息
-            QueryWrapper<HxwVaccineDetails> wrapper3=new QueryWrapper<>();
-            wrapper3.eq("vaccine_id",id);
-            HxwVaccineDetails hxwVaccineDetails = hxwVaccineDetailsMapper.selectOne(wrapper3);
-            hxwVaccines.setDetails(hxwVaccineDetails);//设置疫苗详情信息
-            QueryWrapper<HxwVaccineDiscussions> wrapper4=new QueryWrapper<>();
-            wrapper4.eq("related_vaccine_id",id);
-            List<HxwVaccineDiscussions> hxwVaccineDiscussions = hxwVaccineDiscussionsMapper.selectList(wrapper4);
-            for (HxwVaccineDiscussions discussion : hxwVaccineDiscussions){
-                Integer userId = discussion.getUserId();
-                QueryWrapper<User> wrapper5=new QueryWrapper<>();
-                wrapper5.eq("id",userId);
-                User user = userMapper.selectOne(wrapper5);
-                discussion.setUser(user);
-            }
-            hxwVaccines.setDiscussions(hxwVaccineDiscussions);//设置讨论信息
-            QueryWrapper<HxwVaccineContentModules> wrapper5=new QueryWrapper<>();
-            wrapper5.eq("vaccine_id",id);
-            List<HxwVaccineContentModules> hxwVaccineContentModules = hxwVaccineContentModulesMapper.selectList(wrapper5);
-            hxwVaccines.setContentModules(hxwVaccineContentModules);//设置内容模块信息
-            QueryWrapper<HxwKnowledgeArticles> wrapper6=new QueryWrapper<>();
-            wrapper6.eq("related_vaccine_id",id);
-            List<HxwKnowledgeArticles> hxwKnowledgeArticles = hxwKnowledgeArticlesMapper.selectList(wrapper6);
-            hxwVaccines.setArticles(hxwKnowledgeArticles);
-            return hxwVaccines;
-        }else {
-            return null;
-        }
 
 
-    }
 
 
     @Override
     @Override
     public List<HxwVaccines> findByAdultAll(AgesNameDto dto) {
     public List<HxwVaccines> findByAdultAll(AgesNameDto dto) {

+ 22 - 0
Marketplace/src/main/java/com/dt/common/service/impl/UserServiceImpl.java

@@ -0,0 +1,22 @@
+package com.dt.common.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dt.common.domain.User;
+import com.dt.common.service.UserService;
+import com.dt.common.mapper.UserMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author sunday
+* @description 针对表【user(用户表)】的数据库操作Service实现
+* @createDate 2025-07-11 14:41:37
+*/
+@Service
+public class UserServiceImpl extends ServiceImpl<UserMapper, User>
+    implements UserService{
+
+}
+
+
+
+

+ 5 - 7
Marketplace/src/main/java/com/dt/user/mapper/UserMapper.java

@@ -1,16 +1,14 @@
-package com.dt.user.mapper;
+package com.dt.common.mapper;
 
 
-import com.dt.user.pojo.User;
+import com.dt.common.domain.User;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
 
 
 /**
 /**
-* @author 张大宇
+* @author sunday
 * @description 针对表【user(用户表)】的数据库操作Mapper
 * @description 针对表【user(用户表)】的数据库操作Mapper
-* @createDate 2025-07-01 15:03:44
-* @Entity com.dt.user.pojo.User
+* @createDate 2025-07-01 16:33:35
+* @Entity com.dt.common.domain.User
 */
 */
-@Mapper
 public interface UserMapper extends BaseMapper<User> {
 public interface UserMapper extends BaseMapper<User> {
 
 
 }
 }

+ 13 - 6
Marketplace/src/main/resources/com/dt/common/mapper/HxwVaccineDiscussionsMapper.xml

@@ -6,17 +6,24 @@
 
 
     <resultMap id="BaseResultMap" type="com.dt.common.domain.HxwVaccineDiscussions">
     <resultMap id="BaseResultMap" type="com.dt.common.domain.HxwVaccineDiscussions">
             <id property="id" column="id" />
             <id property="id" column="id" />
-            <result property="vaccineId" column="vaccine_id" />
-            <result property="userId" column="user_id" />
+            <result property="title" column="title" />
             <result property="content" column="content" />
             <result property="content" column="content" />
-            <result property="likesCount" column="likes_count" />
-            <result property="isHighlighted" column="is_highlighted" />
+            <result property="coverImageUrl" column="cover_image_url" />
+            <result property="userId" column="user_id" />
+            <result property="vaccineId" column="vaccine_id" />
+            <result property="viewCount" column="view_count" />
+            <result property="commentCount" column="comment_count" />
+            <result property="likeCount" column="like_count" />
+            <result property="isHot" column="is_hot" />
+            <result property="isRecommended" column="is_recommended" />
+            <result property="status" column="status" />
             <result property="createdAt" column="created_at" />
             <result property="createdAt" column="created_at" />
             <result property="updatedAt" column="updated_at" />
             <result property="updatedAt" column="updated_at" />
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id,vaccine_id,user_id,content,likes_count,is_highlighted,
-        created_at,updated_at
+        id,title,content,cover_image_url,user_id,vaccine_id,
+        view_count,comment_count,like_count,is_hot,is_recommended,
+        status,created_at,updated_at
     </sql>
     </sql>
 </mapper>
 </mapper>

+ 39 - 0
Marketplace/src/main/resources/com/dt/common/mapper/UserMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dt.common.mapper.UserMapper">
+
+    <resultMap id="BaseResultMap" type="com.dt.common.domain.User">
+            <id property="id" column="id" />
+            <result property="username" column="username" />
+            <result property="password" column="password" />
+            <result property="realName" column="real_name" />
+            <result property="phone" column="phone" />
+            <result property="email" column="email" />
+            <result property="avatar" column="avatar" />
+            <result property="gender" column="gender" />
+            <result property="birthDate" column="birth_date" />
+            <result property="status" column="status" />
+            <result property="lastLoginTime" column="last_login_time" />
+            <result property="lastLoginIp" column="last_login_ip" />
+            <result property="lastLoginDevice" column="last_login_device" />
+            <result property="faceImageUrl" column="face_image_url" />
+            <result property="faceLoginEnabled" column="face_login_enabled" />
+            <result property="createdAt" column="created_at" />
+            <result property="updatedAt" column="updated_at" />
+            <result property="deleted" column="deleted" />
+            <result property="lastSignInTime" column="last_sign_in_time" />
+            <result property="continuousSignInDays" column="continuous_sign_in_days" />
+            <result property="totalSignInDays" column="total_sign_in_days" />
+            <result property="beans" column="beans" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,username,password,real_name,phone,email,
+        avatar,gender,birth_date,status,last_login_time,
+        last_login_ip,last_login_device,face_image_url,face_login_enabled,created_at,
+        updated_at,deleted,last_sign_in_time,continuous_sign_in_days,total_sign_in_days,
+        beans
+    </sql>
+</mapper>