Browse Source

达人需求开发

ldz 2 months ago
parent
commit
bfe00ce717
23 changed files with 480 additions and 40 deletions
  1. 92 0
      alien-entity/src/main/java/shop/alien/entity/store/ExpertImg.java
  2. 8 0
      alien-entity/src/main/java/shop/alien/entity/store/LifeUserExpert.java
  3. 16 0
      alien-entity/src/main/java/shop/alien/entity/store/LifeUserExpertOrder.java
  4. 16 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserExpertOrderVo.java
  5. 5 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserExpertVo.java
  6. 20 0
      alien-entity/src/main/java/shop/alien/mapper/ExpertImgMapper.java
  7. 12 3
      alien-entity/src/main/java/shop/alien/mapper/LifeUserExpertMapper.java
  8. 20 2
      alien-entity/src/main/java/shop/alien/mapper/LifeUserExpertOrderMapper.java
  9. 28 0
      alien-entity/src/main/resources/mapper/ExpertImgMapper.xml
  10. 3 1
      alien-entity/src/main/resources/mapper/LifeUserExpertMapper.xml
  11. 6 3
      alien-entity/src/main/resources/mapper/LifeUserExpertOrderMapper.xml
  12. 8 4
      alien-store/src/main/java/shop/alien/store/controller/LifePromotionPackageController.java
  13. 23 6
      alien-store/src/main/java/shop/alien/store/controller/LifeUserExpertController.java
  14. 15 3
      alien-store/src/main/java/shop/alien/store/controller/LifeUserExpertOrderController.java
  15. 15 0
      alien-store/src/main/java/shop/alien/store/controller/StoreUserExpertController.java
  16. 3 1
      alien-store/src/main/java/shop/alien/store/service/LifeUserExpertOrderService.java
  17. 3 1
      alien-store/src/main/java/shop/alien/store/service/LifeUserExpertService.java
  18. 2 1
      alien-store/src/main/java/shop/alien/store/service/PromotionPackageService.java
  19. 5 0
      alien-store/src/main/java/shop/alien/store/service/StoreUserExpertService.java
  20. 48 2
      alien-store/src/main/java/shop/alien/store/service/impl/LifeUserExpertOrderServiceImpl.java
  21. 61 11
      alien-store/src/main/java/shop/alien/store/service/impl/LifeUserExpertServiceImpl.java
  22. 6 2
      alien-store/src/main/java/shop/alien/store/service/impl/PromotionPackageServiceImpl.java
  23. 65 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreUserExpertServiceImpl.java

+ 92 - 0
alien-entity/src/main/java/shop/alien/entity/store/ExpertImg.java

@@ -0,0 +1,92 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 达人图片表
+ * </p>
+ *
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ExpertImg对象", description="达人图片表")
+public class ExpertImg extends Model<ExpertImg> {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键id")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "达人id")
+    @TableField(value = "expert_id")
+    private Integer expertId;
+
+    @ApiModelProperty(value = "达人码")
+    @TableField("expert_code")
+    private Integer expertCode;
+
+    @ApiModelProperty(value = "用户id(life_user表id)")
+    @TableField("user_id")
+    private Integer userId;
+
+
+    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
+    @TableField("delete_flag")
+    @TableLogic
+    private Integer deleteFlag;
+
+
+    @ApiModelProperty(value = "图片类型 0 申请成为达人上传的图片")
+    @TableField("img_type")
+    private Integer imgType;
+
+    @ApiModelProperty(value = "图片描述")
+    @TableField("img_description")
+    private String imgDescription;
+
+    @ApiModelProperty(value = "图片排序")
+    @TableField("img_sort")
+    private Integer imgSort;
+
+    @ApiModelProperty(value = "图片路径")
+    @TableField("img_url")
+    private String imgUrl;
+
+    @ApiModelProperty(value = "补充说明")
+    @TableField(value = "add_explanation")
+    private String addExplanation;
+
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(value = "created_time", fill = FieldFill.INSERT)
+    private Date createdTime;
+
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
+    private Date updatedTime;
+
+
+    @ApiModelProperty(value = "推广类型")
+    @TableField(value = "promote_type")
+    private String promoteType;
+
+
+
+
+
+
+
+
+}

+ 8 - 0
alien-entity/src/main/java/shop/alien/entity/store/LifeUserExpert.java

@@ -66,4 +66,12 @@ public class LifeUserExpert extends Model<LifeUserExpert> {
     @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
     private Integer updatedUserId;
 
+    @ApiModelProperty(value = "审核状态  0审核通过 1审核中 2审核未通过")
+    @TableField(value = "expert_status")
+    private Integer expertStatus;
+
+    @ApiModelProperty(value = "补充说明 ")
+    @TableField(value = "add_explanation")
+    private String addExplanation;
+
 }

+ 16 - 0
alien-entity/src/main/java/shop/alien/entity/store/LifeUserExpertOrder.java

@@ -46,6 +46,10 @@ public class LifeUserExpertOrder extends Model<LifeUserExpertOrder> {
     @TableField("store_id")
     private Integer storeId;
 
+    @ApiModelProperty(value = "推广套餐id")
+    @TableField("package_id")
+    private Integer packageId;
+
     @ApiModelProperty(value = "订单金额")
     @TableField("order_money")
     private BigDecimal orderMoney;
@@ -78,6 +82,10 @@ public class LifeUserExpertOrder extends Model<LifeUserExpertOrder> {
     @TableField("order_gmv")
     private BigDecimal orderGmv;
 
+    @ApiModelProperty(value = "临时测试")
+    @TableField("actual_gmv")
+    private BigDecimal actualGmv;
+
     @ApiModelProperty(value = "状态(1-待完成  2-已完成)")
     @TableField("status")
     private Integer status;
@@ -103,4 +111,12 @@ public class LifeUserExpertOrder extends Model<LifeUserExpertOrder> {
     @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
     private Integer updatedUserId;
 
+    @ApiModelProperty(value = "申请首款按钮")
+    @TableField(value = "first_funds_button")
+    private String firstFundsButton;
+
+    @ApiModelProperty(value = "申请尾款按钮")
+    @TableField(value = "end_funds_button")
+    private String endFundsButton;
+
 }

+ 16 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserExpertOrderVo.java

@@ -59,5 +59,21 @@ public class LifeUserExpertOrderVo extends LifeUserExpertOrder {
     @ApiModelProperty(value = "进店浏览数")
     private Integer storeVisitViewCount;
 
+    @ApiModelProperty(value = "套餐名称")
+    private String name;
+
+//    @ApiModelProperty(value = "申请首款按钮状态")
+//    private String firstFundsButton;
+//
+//    @ApiModelProperty(value = "申请尾款按钮状态")
+//    private String endFundsButton;
+
+    @ApiModelProperty(value = "申请首款按钮")
+    @TableField(value = "first_funds_button")
+    private String firstFundsButton;
+
+    @ApiModelProperty(value = "申请尾款按钮")
+    @TableField(value = "end_funds_button")
+    private String endFundsButton;
 
 }

+ 5 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserExpertVo.java

@@ -1,5 +1,6 @@
 package shop.alien.entity.store.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -97,4 +98,8 @@ public class LifeUserExpertVo extends LifeUserExpert {
 
     @ApiModelProperty(value = "性别占比")
     private List<Map<String, String>> sexPercentageList;
+
+    @ApiModelProperty(value = "审核状态  0审核通过 1审核中 2审核未通过")
+    private Integer expertStuats;
+
 }

+ 20 - 0
alien-entity/src/main/java/shop/alien/mapper/ExpertImgMapper.java

@@ -0,0 +1,20 @@
+package shop.alien.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import shop.alien.entity.store.ExpertImg;
+
+
+
+/**
+ * <p>
+ * 用户达人表 Mapper 接口
+ * </p>
+ *
+ * @author ssk
+ * @since 2025-02-19
+ */
+public interface ExpertImgMapper extends BaseMapper<ExpertImg> {
+
+
+}

+ 12 - 3
alien-entity/src/main/java/shop/alien/mapper/LifeUserExpertMapper.java

@@ -42,7 +42,7 @@ public interface LifeUserExpertMapper extends BaseMapper<LifeUserExpert> {
             "    where delete_flag = 0 " +
             "    group by expert_id " +
             ") " +
-            "select expert.id, expert.expert_code, user.user_name, ifnull(fans.num, 0) fansNum, ifnull(works.worksNum, 0) worksNum, ifnull(works.likeNum, 0) likeNum, ifnull(works.playNum, 0) playNum, " +
+            "select expert.id, expert.expert_code,expert.expert_status, user.user_phone,user.user_name, ifnull(fans.num, 0) fansNum, ifnull(works.worksNum, 0) worksNum, ifnull(works.likeNum, 0) likeNum, ifnull(works.playNum, 0) playNum, " +
             "       ifnull(orders.orderMoney, 0) orderMoney, ifnull(orders.accountMoney, 0) accountMoney, (ifnull(orders.orderMoney, 0) - ifnull(orders.accountMoney, 0)) pendMoney " +
             "from life_user_expert expert " +
             "join life_user user on user.id = expert.user_id " +
@@ -155,7 +155,7 @@ public interface LifeUserExpertMapper extends BaseMapper<LifeUserExpert> {
     List<LifeUserExpertVo> getFanPortrait(Integer expertId);
 
     @Select("select expert.id, expert.expert_code, " +
-            "expert.delete_flag, expert.created_time, expert.created_user_id, expert.updated_time, expert.updated_user_id," +
+            "expert.delete_flag, expert.created_time, expert.expert_status,expert.created_user_id, expert.updated_time, expert.updated_user_id," +
             "user.user_name, user.province, user.city, user.district, user.user_brithday, user.user_sex " +
             " from life_user_expert expert " +
             " left join life_user user on user.id = expert.user_id " +
@@ -190,7 +190,16 @@ public interface LifeUserExpertMapper extends BaseMapper<LifeUserExpert> {
     @Select("select * from life_user_expert where user_id = #{userId} and delete_flag = 1")
     LifeUserExpert selectIsExpert(Integer userId);
 
-    @Update("update life_user_expert set expert_type = #{expertType},delete_flag = '0'" +
+    @Update("update life_user_expert set expert_code = #{expertCode},expert_status = #{expertStatus},delete_flag = '0'" +
             "where id = #{id}")
     Boolean updateExpert(LifeUserExpert lifeUserExpert);
+
+    @Select(
+            "select expert.* ,user.*" +
+                    "from life_user_expert expert " +
+                    "join life_user user on user.id = expert.user_id " +
+                    "where expert.expert_status = 1 and orders.expert_id = #{expertId} ")
+
+    IPage<LifeUserExpertVo> getApplicationExpertList(IPage<LifeUserExpertVo> iPage, @Param(Constants.WRAPPER) QueryWrapper<LifeUserExpertVo> wrapper);
+
 }

+ 20 - 2
alien-entity/src/main/java/shop/alien/mapper/LifeUserExpertOrderMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 import shop.alien.entity.store.LifeUserExpertOrder;
 import shop.alien.entity.store.vo.LifeUserExpertOrderVo;
 
@@ -45,10 +46,11 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
     List<LifeUserExpertOrderVo> getExpertOrderDetails(@Param("expertId") Long expertId);
 
 
-    @Select("select orders.id, orders.order_no, store.store_name, orders.order_money, orders.account_money, if (orders.status = '1', '待完成', '已完成') statusName, " +
+    @Select("select orders.id, orders.order_no, store.store_name, orders.order_money, package.name,orders.account_money,orders.first_funds_button,orders.end_funds_button, if (orders.status = '1', '待完成', '已完成') statusName, " +
             "       orders.order_time, orders.complete_time  " +
             "from life_user_expert_order orders " +
             "left join store_info store on store.id = orders.store_id " +
+            "left join life_promotion_package package on package.id = orders.package_id " +
             "WHERE orders.expert_id = #{expertId}")
     List<LifeUserExpertOrderVo> getPromotionOrderInfoList(@Param("expertId") Long expertId);
 
@@ -57,11 +59,12 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
             "earliest_works AS (SELECT order_id, MIN(created_time) AS earliest_created_time FROM life_user_expert_works GROUP BY order_id), " +
             "purchase AS (SELECT order_id, SUM(CASE WHEN STATUS = 1 THEN 1 ELSE 0 END) completedOrdersNumber, SUM(purchase_amount) amount FROM life_user_expert_purchase WHERE delete_flag = 0 GROUP BY order_id), " +
             "record AS (SELECT order_id, COUNT(order_id) storeVisitViewCount FROM life_browse_record WHERE delete_flag = 0 GROUP BY order_id) " +
-            "SELECT orders.id, orders.order_no, store.store_name, orders.order_money, ew.earliest_created_time, orders.account_money, IF(orders.STATUS = '1', '待完成', '已完成') AS statusName, " +
+            "SELECT orders.id, orders.order_no, store.store_name, orders.order_money, orders.first_funds_button,orders.end_funds_button,package.name,ew.earliest_created_time, orders.account_money, IF(orders.STATUS = '1', '待完成', '已完成') AS statusName, " +
             "orders.order_time, orders.first_payment_time, orders.final_payment_time, orders.complete_time, orders.order_play_count, orders.order_gmv, " +
             "IFNULL(works.playCount, 0) AS actualPlayCount, IFNULL(purchase.amount, 0) AS actualGmv, IFNULL(purchase.completedOrdersNumber, 0) AS completedOrdersNumber, " +
             "IFNULL(purchase.amount, 0) AS transactionAmount, IFNULL(record.storeVisitViewCount, 0) AS storeVisitViewCount, ew.earliest_created_time AS firstWorkTime " +
             "FROM life_user_expert_order orders " +
+            "left join life_promotion_package package on package.id = orders.package_id " +
             "LEFT JOIN store_info store ON store.id = orders.store_id " +
             "LEFT JOIN works ON works.order_id = orders.id " +
             "LEFT JOIN purchase ON purchase.order_id = orders.id " +
@@ -82,4 +85,19 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
             "FROM life_user_expert_order " +
             "WHERE order_id = #{orderId}")
     LifeUserExpertOrderVo selectByOrderId(Integer orderId);
+
+    //增加一个updateButton的方法,通过订单id来更新按钮状态
+//    @Update("UPDATE " +
+//            "life_user_expert_order " +
+//            "SET update_button = #{updateButton} " +
+//            "WHERE order_id = #{orderId}")
+//    Integer updateButton(@Param("orderId") String orderId, @Param("updateButton") String updateButton);
+
+
+    @Update("UPDATE " +
+            "life_user_expert_order " +
+            "SET first_funds_button = #{firstButton}, " +
+            "end_funds_button = #{endButton} " +
+            "WHERE order_no = #{orderNo}")
+    void updateButton(@Param("firstButton") String firstButton,@Param("endButton") String endButton,@Param("orderNo") String orderNo);
 }

+ 28 - 0
alien-entity/src/main/resources/mapper/ExpertImgMapper.xml

@@ -0,0 +1,28 @@
+<?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="shop.alien.mapper.ExpertImgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="shop.alien.entity.store.ExpertImg">
+        <id column="id" property="id" />
+        <result column="expert_id" property="expertId" />
+        <result column="expert_code" property="expertCode" />
+        <result column="user_id" property="userId" />
+        <result column="delete_flag" property="deleteFlag" />
+        <result column="img_type" property="imgType" />
+        <result column="img_description" property="imgDescription" />
+        <result column="img_sort" property="imgSort" />
+        <result column="img_url" property="imgUrl" />
+        <result column="add_explanation" property="addExplanation" />
+        <result column="created_time" property="createdTime" />
+        <result column="updated_time" property="updatedTime" />
+        <result column="promote_type" property="promoteType" />
+
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, expert_id ,expert_code,user_id, delete_flag,img_type, img_description, img_sort, img_url,add_explanation,created_time, updated_time,promote_type
+    </sql>
+
+</mapper>

+ 3 - 1
alien-entity/src/main/resources/mapper/LifeUserExpertMapper.xml

@@ -12,11 +12,13 @@
         <result column="created_user_id" property="createdUserId" />
         <result column="updated_time" property="updatedTime" />
         <result column="updated_user_id" property="updatedUserId" />
+        <result column="expert_status" property="expertStatus" />
+        <result column="add_explanation" property="addExplanation" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, user_id, expert_code, delete_flag, created_time, created_user_id, updated_time, updated_user_id
+        id, user_id, expert_code, delete_flag, created_time, created_user_id, updated_time, updated_user_id,expert_status, add_explanation
     </sql>
 
 </mapper>

+ 6 - 3
alien-entity/src/main/resources/mapper/LifeUserExpertOrderMapper.xml

@@ -5,9 +5,10 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="shop.alien.entity.store.LifeUserExpertOrder">
         <id column="id" property="id" />
-        <result column="order_id" property="orderId" />
+        <result column="order_no" property="orderNo" />
         <result column="expert_id" property="expertId" />
         <result column="store_id" property="storeId" />
+        <result column="package_id" property="packageId" />
         <result column="order_money" property="orderMoney" />
         <result column="account_money" property="accountMoney" />
         <result column="order_time" property="orderTime" />
@@ -15,7 +16,7 @@
         <result column="first_payment_time" property="firstPaymentTime" />
         <result column="final_payment_time" property="finalPaymentTime" />
         <result column="order_play_count" property="orderPlayCount" />
-        <result column="actual_play_count" property="actualPlayCount" />
+<!--        <result column="actual_play_count" property="actualPlayCount" />-->
         <result column="order_gmv" property="orderGmv" />
         <result column="actual_gmv" property="actualGmv" />
         <result column="status" property="status" />
@@ -24,11 +25,13 @@
         <result column="created_user_id" property="createdUserId" />
         <result column="updated_time" property="updatedTime" />
         <result column="updated_user_id" property="updatedUserId" />
+        <result column="first_funds_button" property="firstFundsButton" />
+        <result column="end_funds_button" property="endFundsButton" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, order_id, expert_id, store_id, order_money, account_money, order_time, complete_time, first_payment_time, final_payment_time, order_play_count, actual_play_count, order_gmv, actual_gmv, status, delete_flag, created_time, created_user_id, updated_time, updated_user_id
+        id, order_id, expert_id, package_id , store_id, order_money, account_money, order_time, complete_time, first_payment_time, final_payment_time, order_play_count, order_gmv, actual_gmv, status, delete_flag, created_time, created_user_id, updated_time, updated_user_id, first_funds_button, end_funds_button
     </sql>
 
 </mapper>

+ 8 - 4
alien-store/src/main/java/shop/alien/store/controller/LifePromotionPackageController.java

@@ -1,5 +1,6 @@
 package shop.alien.store.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -29,11 +30,14 @@ public class LifePromotionPackageController {
 
     @ApiOperation("获取推广套餐")
     @ApiOperationSupport(order = 1)
-    @ApiImplicitParams({@ApiImplicitParam(name = "expert_id", value = "达人id", dataType = "Long", paramType = "query", required = true)})
+    @ApiImplicitParams({@ApiImplicitParam(name = "expert_id", value = "达人id", dataType = "Long", paramType = "query", required = true),
+            @ApiImplicitParam(name = "page", value = "页数", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "size", value = "大小", dataType = "Integer", paramType = "query", required = true)}
+    )
     @GetMapping("/getByExpertId")
-    public R<List<LifePromotionPackageVo>> getByExpertId(Long expertId) {
-        log.info("LifePromotionPackageController.getByExpertId?id={}", expertId);
-        return R.data(promotionPackageService.getByExpertId(expertId));
+    public R<IPage<LifePromotionPackageVo>> getByExpertId(@RequestParam("expertId") Long expertId,@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size) {
+        log.info("LifePromotionPackageController.getByExpertId?id={},page={},size={}", expertId,page,size);
+        return R.data(promotionPackageService.getByExpertId(expertId, page, size));
     }
 
     @ApiOperation("新增或修改推广套餐")

+ 23 - 6
alien-store/src/main/java/shop/alien/store/controller/LifeUserExpertController.java

@@ -53,14 +53,17 @@ public class LifeUserExpertController {
         return R.data(lifeUserExpertService.getExpertOrderList(page, size, expertId, orderNo, storeName, storeId));
     }
 
-    @ApiOperation("成为达人")
+    @ApiOperation("成为达人,以及状态审核或驳回")
     @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", paramType = "query", required = true),
-            @ApiImplicitParam(name = "expertType", value = "达人类型", dataType = "String", paramType = "query", required = true)})
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "用户id", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "userPhone", value = "用户电话", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "comment", value = "拒绝原因", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "expertStatus", value = "审核状态 通过0 审核中1 拒绝2", dataType = "Integer", paramType = "query", required = true)})
+//    @ApiImplicitParam(name = "expertType", value = "达人类型", dataType = "String", paramType = "query", required = true)})
     @GetMapping("/becomeExpert")
-    public R<Boolean> becomeExpert(Integer userId, String expertType) {
-        log.info("LifeUserExpertController.becomeExpert?id={},expertType={}", userId, expertType);
-        return R.data(lifeUserExpertService.becomeExpert(userId, expertType));
+    public R<Boolean> becomeExpert(Integer id,  String userPhone, String comment, Integer expertStatus) {
+        log.info("LifeUserExpertController.becomeExpert?id={},expertType={}", id, expertStatus);
+        return R.data(lifeUserExpertService.becomeExpert(id, userPhone,comment,expertStatus));
     }
 
     @ApiOperation("取消达人")
@@ -103,4 +106,18 @@ public class LifeUserExpertController {
         log.info("LifeUserExpertController.greatGoodsType?expertId={}", expertId);
         return R.data(lifeUserExpertService.greatGoodsType(expertId));
     }
+
+    @ApiOperation("申请中达人列表")
+    @ApiOperationSupport(order = 9)
+    @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "分页页数", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "size", value = "分页条数", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "userName", value = "姓名", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
+    @GetMapping("/getApplicationExpertList")
+    public R<IPage<LifeUserExpertVo>> getApplicationExpertList(Integer page, Integer size, String userName, String expertCode, Integer userId) {
+        log.info("LifeUserExpertController.getUserExpertList?page={},size={},userName={},phone={},userId={}", page, size, userName, expertCode, userId);
+        return R.data(lifeUserExpertService.getApplicationExpertList(page, size, userName, expertCode, userId));
+    }
+
+
 }

+ 15 - 3
alien-store/src/main/java/shop/alien/store/controller/LifeUserExpertOrderController.java

@@ -1,5 +1,6 @@
 package shop.alien.store.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperationSupport;
@@ -42,9 +43,9 @@ public class LifeUserExpertOrderController {
     @ApiOperation("推广订单信息列表")
     @ApiOperationSupport(order = 2)
     @GetMapping("/getPromotionOrderInfoList")
-    public R<List<LifeUserExpertOrderVo>> getPromotionOrderInfoList(@RequestParam("expertId") Long expertId) {
-        log.info("StoreUserExpertOrderController.getPromotionOrderInfoList?id={}", expertId);
-        return R.data(lifeUserExpertOrderService.getPromotionOrderInfoList(expertId));
+    public R<IPage<LifeUserExpertOrderVo>> getPromotionOrderInfoList(@RequestParam("expertId") Long expertId,@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size){
+        log.info("StoreUserExpertOrderController.getPromotionOrderInfoList?id={},page={},size={}", expertId, page, size);
+        return R.data(lifeUserExpertOrderService.getPromotionOrderInfoList(expertId,page, size));
     }
 
     @ApiOperation("达人订单详情")
@@ -54,4 +55,15 @@ public class LifeUserExpertOrderController {
         log.info("LifeUserExpertController.fetchExpertOrderInfo?expertId={},orderId={}", expertId, orderId);
         return R.data(lifeUserExpertOrderService.fetchExpertOrderInfo(expertId, orderId));
     }
+
+    @ApiOperation("申请款项按钮")
+    @ApiOperationSupport(order = 4)
+    @GetMapping("/getApplicationFunds")
+    public R<Map<String, Object>> getApplicationFunds( @RequestParam("buttonType") String buttonType,@RequestParam("buttonStatus") String buttonStatus,@RequestParam("orderNo") String orderNo,@RequestParam("userPhone") String userPhone) {
+        log.info("LifeUserExpertController.getApplicationFunds?buttonType={},buttonStatus={},orderNo={},userPhone={}", buttonType, buttonStatus,orderNo, userPhone);
+        return R.data(lifeUserExpertOrderService.getApplicationFunds(buttonType, buttonStatus, orderNo,userPhone));
+    }
+
+
+
 }

+ 15 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreUserExpertController.java

@@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.ExpertImg;
 import shop.alien.entity.store.vo.LifeUserExpertVo;
 import shop.alien.store.service.StoreUserExpertService;
 
@@ -50,4 +51,18 @@ public class StoreUserExpertController {
         log.info("StoreUserExpertController.getExpertDetails?expertId={}", expertId);
         return R.data(storeUserExpertService.getExpertDetails(expertId));
     }
+
+@ApiOperation("申请达人,上传图片以及补充说明")
+@ApiOperationSupport(order = 4)
+@PostMapping("/applyExpert")
+public R<Map<String, String>> applyExpert(@RequestBody ExpertImg expertImgs) {
+    log.info("StoreUserExpertController.applyExpert?expertImgs={}", expertImgs);
+    if (null == expertImgs) {
+        return R.fail("参数错误");
+    }
+    return R.data(storeUserExpertService.getapplyExpert(expertImgs));
+}
+
+
+
 }

+ 3 - 1
alien-store/src/main/java/shop/alien/store/service/LifeUserExpertOrderService.java

@@ -22,9 +22,11 @@ public interface LifeUserExpertOrderService extends IService<LifeUserExpertOrder
 
     List<LifeUserExpertOrderVo> getExpertOrderDetails(Long expertId);
 
-    List<LifeUserExpertOrderVo> getPromotionOrderInfoList(Long expertId);
+    IPage<LifeUserExpertOrderVo> getPromotionOrderInfoList(Long expertId, int page, int size);
 
     List<Map<String, Object>> fetchExpertOrderInfo(Long expertId, String orderId);
 
     List<LifeUserExpertOrderVo> getTalentPromotionOrder(String orderId, String expertId);
+
+    Map<String, Object> getApplicationFunds(String buttonType, String buttonStatus ,String orderNo,String userPhone);
 }

+ 3 - 1
alien-store/src/main/java/shop/alien/store/service/LifeUserExpertService.java

@@ -23,7 +23,7 @@ public interface LifeUserExpertService extends IService<LifeUserExpert> {
 
     IPage<LifeUserExpertOrderVo> getExpertOrderList(int page, int size, Integer expertId, String orderNo, String storeName, Integer storeId);
 
-    boolean becomeExpert(Integer userId, String expertType);
+    boolean becomeExpert(Integer id, String userPhone,String comment,Integer expertStatus);
 
     boolean cancelExpert(Integer id);
 
@@ -40,4 +40,6 @@ public interface LifeUserExpertService extends IService<LifeUserExpert> {
      * @return List<Map < String, Object>>
      */
     List<ExpertGoodsTypeVo> greatGoodsType(Integer expertId);
+
+    IPage<LifeUserExpertVo> getApplicationExpertList(int page, int size, String userName, String expertCode, Integer userId);
 }

+ 2 - 1
alien-store/src/main/java/shop/alien/store/service/PromotionPackageService.java

@@ -1,5 +1,6 @@
 package shop.alien.store.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import shop.alien.entity.store.LifePromotionPackage;
 import shop.alien.entity.store.vo.LifePromotionPackageVo;
@@ -9,7 +10,7 @@ import java.util.Map;
 
 public interface PromotionPackageService extends IService<LifePromotionPackage> {
 
-    List<LifePromotionPackageVo> getByExpertId(Long expertId);
+    IPage<LifePromotionPackageVo> getByExpertId(Long expertId, Integer page, Integer size);
 
     Map<String, Object> buyPromotion(LifePromotionPackageVo lifePromotionPackageVo);
 }

+ 5 - 0
alien-store/src/main/java/shop/alien/store/service/StoreUserExpertService.java

@@ -1,6 +1,8 @@
 package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.result.R;
+import shop.alien.entity.store.ExpertImg;
 import shop.alien.entity.store.LifeUserExpert;
 import shop.alien.entity.store.vo.LifeUserExpertVo;
 
@@ -14,4 +16,7 @@ public interface StoreUserExpertService extends IService<LifeUserExpert> {
     List<Map<String, LifeUserExpertVo>> getExpertDetails(Integer expertId);
 
     List<LifeUserExpertVo> ifExpert(String id);
+
+
+    Map<String, String> getapplyExpert(ExpertImg expertImgs);
 }

+ 48 - 2
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserExpertOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package shop.alien.store.service.impl;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -7,11 +8,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
+import shop.alien.entity.store.LifeNotice;
 import shop.alien.entity.store.LifeUserExpertOrder;
 import shop.alien.entity.store.vo.LifeUserExpertOrderVo;
+import shop.alien.mapper.LifeNoticeMapper;
 import shop.alien.mapper.LifeUserExpertOrderMapper;
 import shop.alien.store.service.LifeUserExpertOrderService;
+import shop.alien.util.common.ListToPage;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -30,6 +36,7 @@ import java.util.Map;
 public class LifeUserExpertOrderServiceImpl extends ServiceImpl<LifeUserExpertOrderMapper, LifeUserExpertOrder> implements LifeUserExpertOrderService {
 
     private final LifeUserExpertOrderMapper lifeUserExpertOrderMapper;
+    private final LifeNoticeMapper lifeNoticeMapper;
 
     @Override
     public IPage<LifeUserExpertOrderVo> getExpertOrderList(int page, int size, String orderNo, String storeName) {
@@ -48,8 +55,10 @@ public class LifeUserExpertOrderServiceImpl extends ServiceImpl<LifeUserExpertOr
     }
 
     @Override
-    public List<LifeUserExpertOrderVo> getPromotionOrderInfoList(Long expertId) {
-        return lifeUserExpertOrderMapper.getPromotionOrderInfoList(expertId);
+    public IPage<LifeUserExpertOrderVo> getPromotionOrderInfoList(Long expertId, int page, int size) {
+        List<LifeUserExpertOrderVo> data=lifeUserExpertOrderMapper.getPromotionOrderInfoList(expertId);
+            return ListToPage.setPage(data, page, size);
+//        return lifeUserExpertOrderMapper.getPromotionOrderInfoList(expertId);
     }
 
     @Override
@@ -78,6 +87,9 @@ public class LifeUserExpertOrderServiceImpl extends ServiceImpl<LifeUserExpertOr
         resultMap.put("actualGmv", lifeUserExpertOrderVos.getActualGmv());
         resultMap.put("completedOrdersNumber", lifeUserExpertOrderVos.getCompletedOrdersNumber());
         resultMap.put("storeVisitViewCount", lifeUserExpertOrderVos.getStoreVisitViewCount());
+        resultMap.put("firstFundsButton", lifeUserExpertOrderVos.getFirstFundsButton());
+        resultMap.put("endFundsButton", lifeUserExpertOrderVos.getEndFundsButton());
+        resultMap.put("name", lifeUserExpertOrderVos.getName());
 
         // 处理购买套餐状态
         Map<String, Object> buyMap = new HashMap<>();
@@ -155,4 +167,38 @@ public class LifeUserExpertOrderServiceImpl extends ServiceImpl<LifeUserExpertOr
     public List<LifeUserExpertOrderVo> getTalentPromotionOrder(String orderId, String expertId) {
         return lifeUserExpertOrderMapper.getTalentPromotionOrder(expertId, orderId);
     }
+
+    @Override
+    public Map<String, Object> getApplicationFunds(String buttonType, String buttonStatus ,String orderNo,String userPhone ) {
+        Map<String, Object> resultMap = new HashMap<>();
+        //buttonType 0: 首次打款 1: 尾次打款  buttonStatus  0未点击  1已点击审核中  2已点击审核通过
+        if ("0".equals(buttonType)){
+            String firstButton = "1";
+            String endButton = "";
+            lifeUserExpertOrderMapper.updateButton(firstButton,endButton,orderNo);
+            resultMap.put("firstButton", buttonStatus);
+            return resultMap;
+        } else if ("1".equals(buttonType)) {
+            String endButton = "1";
+            String firstButton = "";
+            lifeUserExpertOrderMapper.updateButton(firstButton,endButton,orderNo);
+            resultMap.put("endButton", buttonStatus);
+            LifeNotice lifeMessage = new LifeNotice();
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String formattedDate = LocalDateTime.now().format(formatter);
+            String text = "您在" + formattedDate + "提交的申请尾款信息,已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("message", text);
+            lifeMessage.setReceiverId("user_" + userPhone);
+            lifeMessage.setTitle("申请尾款通知");
+            lifeMessage.setContext(jsonObject.toJSONString());
+            lifeMessage.setNoticeType(1);
+            lifeMessage.setIsRead(0);
+            lifeMessage.setDeleteFlag(0);
+            lifeMessage.setSenderId("system");
+            lifeNoticeMapper.insert(lifeMessage);
+            return resultMap;
+        }
+        return resultMap;
+    }
 }

+ 61 - 11
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserExpertServiceImpl.java

@@ -1,5 +1,6 @@
 package shop.alien.store.service.impl;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -9,12 +10,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.stereotype.Service;
-import shop.alien.entity.store.LifeUserExpert;
-import shop.alien.entity.store.LifeUserExpertOrder;
-import shop.alien.entity.store.LifeUserExpertWorks;
+import shop.alien.entity.store.*;
 import shop.alien.entity.store.vo.ExpertGoodsTypeVo;
 import shop.alien.entity.store.vo.LifeUserExpertOrderVo;
 import shop.alien.entity.store.vo.LifeUserExpertVo;
+import shop.alien.mapper.LifeNoticeMapper;
 import shop.alien.mapper.LifeUserExpertMapper;
 import shop.alien.mapper.LifeUserExpertOrderMapper;
 import shop.alien.mapper.LifeUserExpertWorksMapper;
@@ -24,8 +24,10 @@ import shop.alien.store.service.LifeUserExpertService;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.Period;
 import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -46,6 +48,7 @@ public class LifeUserExpertServiceImpl extends ServiceImpl<LifeUserExpertMapper,
     private final LifeUserExpertWorksMapper lifeUserExpertWorksMapper;
     private final LifeUserExpertOrderService lifeUserExpertOrderService;
     private final LifeUserExpertOrderMapper lifeUserExpertOrderMapper;
+    private final LifeNoticeMapper lifeNoticeMapper;
 
     @Override
     public IPage<LifeUserExpertVo> getUserExpertList(int page, int size, String userName, String expertCode, Integer userId) {
@@ -73,21 +76,54 @@ public class LifeUserExpertServiceImpl extends ServiceImpl<LifeUserExpertMapper,
     }
 
     @Override
-    public boolean becomeExpert(Integer userId, String expertType) {
+    public boolean becomeExpert(Integer id, String userPhone ,String comment ,Integer expertStatus) {
         LambdaQueryWrapper<LifeUserExpert> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(LifeUserExpert::getUserId, userId);
+        wrapper.eq(LifeUserExpert::getId, id);
         wrapper.eq(LifeUserExpert::getDeleteFlag, 1);
-        LifeUserExpert lifeUserExpert = lifeUserExpertMapper.selectIsExpert(userId);
+        LifeUserExpert lifeUserExpert = lifeUserExpertMapper.selectIsExpert(id);
         if (lifeUserExpert != null) {
             lifeUserExpert.setDeleteFlag(0);
-            lifeUserExpert.setExpertType(expertType);
+            lifeUserExpert.setExpertStatus(expertStatus);
             return lifeUserExpertMapper.updateExpert(lifeUserExpert);
         }
         LifeUserExpert expert = new LifeUserExpert();
-        expert.setUserId(userId);
-        expert.setExpertType(expertType);
-        expert.setExpertCode(setExpertCode());
-        return this.save(expert);
+        expert.setId(id);
+        expert.setExpertStatus(expertStatus);
+        if (expertStatus == 0){
+            expert.setExpertCode(setExpertCode());
+        } else if(expertStatus == 2){
+            expert.setExpertCode(null);
+            expert.setDeleteFlag(1);
+        }
+        LifeNotice lifeMessage = new LifeNotice();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDate = LocalDateTime.now().format(formatter);
+        if (expertStatus == 0){
+            String text = "您在"+formattedDate+"提交的信息已经通过审核。恭喜您成为达人。";
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("message", text);
+            lifeMessage.setReceiverId("user_"+userPhone);
+            lifeMessage.setTitle("审核通过通知");
+            lifeMessage.setContext(jsonObject.toJSONString());
+            lifeMessage.setNoticeType(1);
+            lifeMessage.setIsRead(0);
+            lifeMessage.setDeleteFlag(0);
+            lifeMessage.setSenderId("system");
+            lifeNoticeMapper.insert(lifeMessage);
+        } else if (expertStatus == 2) {
+            String text = "您在"+formattedDate+"提交的信息未通过审核,拒绝原因:"+comment+"。请您重新填写信息后再次提交至平台审核。";
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("message", text);
+            lifeMessage.setReceiverId("user_"+userPhone);
+            lifeMessage.setTitle("审核失败通知");
+            lifeMessage.setContext(jsonObject.toJSONString());
+            lifeMessage.setNoticeType(1);
+            lifeMessage.setIsRead(0);
+            lifeMessage.setDeleteFlag(0);
+            lifeMessage.setSenderId("system");
+            lifeNoticeMapper.insert(lifeMessage);
+        }
+        return lifeUserExpertMapper.updateExpert(expert);
     }
 
     public Integer setExpertCode() {
@@ -308,4 +344,18 @@ public class LifeUserExpertServiceImpl extends ServiceImpl<LifeUserExpertMapper,
                 .sorted(Comparator.comparing(ExpertGoodsTypeVo::getTypeCount).reversed())
                 .collect(Collectors.toList());
     }
+
+    @Override
+    public IPage<LifeUserExpertVo> getApplicationExpertList(int page, int size, String userName, String expertCode, Integer userId) {
+        QueryWrapper<LifeUserExpertVo> wrapper = new QueryWrapper<>();
+        wrapper.eq("expert.delete_flag", 0);
+        wrapper.eq("user.delete_flag", 0);
+        wrapper.eq(userId != null, "user.id", userId);
+        wrapper.eq( "expert.expert_status", 1);
+        wrapper.like(StringUtils.isNotEmpty(userName), "user.user_name", userName);
+        wrapper.like(StringUtils.isNotEmpty(expertCode), "expert.expert_code", expertCode);
+        wrapper.orderByDesc("accountMoney");
+        return lifeUserExpertMapper.getApplicationExpertList(new Page<>(page, size), wrapper);
+    }
+
 }

+ 6 - 2
alien-store/src/main/java/shop/alien/store/service/impl/PromotionPackageServiceImpl.java

@@ -1,9 +1,11 @@
 package shop.alien.store.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.netease.yidun.sdk.core.utils.StringUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
+import shop.alien.entity.result.R;
 import shop.alien.entity.store.LifePromotionPackage;
 import shop.alien.entity.store.StoreAliPayLog;
 import shop.alien.entity.store.vo.LifePromotionPackageVo;
@@ -14,6 +16,7 @@ import shop.alien.mapper.LifeUserExpertOrderMapper;
 import shop.alien.mapper.PromotionPackageMapper;
 import shop.alien.store.service.PromotionPackageService;
 import shop.alien.store.util.ali.AliApi;
+import shop.alien.util.common.ListToPage;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -48,8 +51,9 @@ public class PromotionPackageServiceImpl extends ServiceImpl<PromotionPackageMap
      * @return list
      */
     @Override
-    public List<LifePromotionPackageVo> getByExpertId(Long expertId) {
-        return promotionPackageMapper.getByExpertId(expertId);
+    public IPage<LifePromotionPackageVo> getByExpertId(Long expertId, Integer page, Integer size) {
+        List<LifePromotionPackageVo> promotionPackageVos=promotionPackageMapper.getByExpertId(expertId);
+        return ListToPage.setPage(promotionPackageVos,page, size);
     }
 
     @Override

+ 65 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreUserExpertServiceImpl.java

@@ -1,18 +1,28 @@
 package shop.alien.store.service.impl;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.stereotype.Service;
+import shop.alien.entity.store.ExpertImg;
+import shop.alien.entity.store.LifeNotice;
+import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.LifeUserExpert;
 import shop.alien.entity.store.vo.LifeUserExpertVo;
+import shop.alien.mapper.ExpertImgMapper;
+import shop.alien.mapper.LifeNoticeMapper;
 import shop.alien.mapper.LifeUserExpertMapper;
+import shop.alien.mapper.LifeUserMapper;
 import shop.alien.store.service.StoreUserExpertService;
 
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.Period;
 import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -30,6 +40,12 @@ public class StoreUserExpertServiceImpl extends ServiceImpl<LifeUserExpertMapper
 
     private final LifeUserExpertMapper lifeUserExpertMapper;
 
+    private final ExpertImgMapper expertImgMapper;
+
+    private final LifeNoticeMapper lifeNoticeMapper;
+
+    private final LifeUserMapper lifeUserMapper;
+
     @Override
     public List<LifeUserExpertVo> getRankList() {
         return lifeUserExpertMapper.getRankList();
@@ -186,4 +202,53 @@ public class StoreUserExpertServiceImpl extends ServiceImpl<LifeUserExpertMapper
         return expertVo;
     }
 
+    @Override
+    public Map<String, String> getapplyExpert(ExpertImg expertImgs) {
+        Map<String, String> result = new HashMap<>();
+        //先对expertImgs进行判断若为空直接返回若不为空则进行保存操作
+        if (expertImgs == null) {
+            result.put("参数异常", "false");
+            return result;
+        }
+        LifeUserExpert expert = new LifeUserExpert();
+        expert.setUserId(expertImgs.getUserId());
+        expert.setDeleteFlag(0);
+        expert.setCreatedTime(new Date());
+        expert.setUpdatedTime(new Date());
+        expert.setExpertStatus(1);
+        expert.setAddExplanation(expertImgs.getAddExplanation());
+        lifeUserExpertMapper.insert(expert);
+        Integer insertedId = expert.getId();
+        for (String imgUrl : expertImgs.getImgUrl().split(",")) {
+            ExpertImg expertImg = new ExpertImg();
+            expertImg.setImgUrl(imgUrl);
+            expertImg.setDeleteFlag(0);
+            expertImg.setCreatedTime(new Date());
+            expertImg.setUpdatedTime(new Date());
+            expertImg.setExpertId(insertedId);
+            expertImg.setImgType(0);
+            expertImg.setUserId(expertImgs.getUserId());
+            expertImg.setPromoteType(expertImgs.getPromoteType());
+            expertImgMapper.insert(expertImg);
+        }
+        //发送消息
+        LifeUser lifeUser = lifeUserMapper.selectById(expertImgs.getUserId());
+        LifeNotice lifeMessage = new LifeNotice();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDate = LocalDateTime.now().format(formatter);
+        String text = "您在"+formattedDate+"申请成为达人,信息已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收";
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("message", text);
+        lifeMessage.setReceiverId("user_"+lifeUser.getUserPhone());
+        lifeMessage.setTitle("申请达人通知");
+        lifeMessage.setContext(jsonObject.toJSONString());
+        lifeMessage.setNoticeType(1);
+        lifeMessage.setIsRead(0);
+        lifeMessage.setDeleteFlag(0);
+        lifeMessage.setSenderId("system");
+        lifeNoticeMapper.insert(lifeMessage);
+        return result;
+    }
+
+
 }