Aslee 3 年之前
父节点
当前提交
fe32dec8d8

+ 1 - 7
src/main/java/com/caimei/controller/HeHeApi.java

@@ -44,13 +44,7 @@ public class HeHeApi {
     public ResponseJson<String> mobileLogin(@RequestBody Map<String, Object> param) throws Exception {
         String url = userUrl + "/user/he/mobile/login";
         String parameters = HttpRequest.sendPost(url, param);
-        ResponseJson<String> responseJson = getResponseJson(parameters);
-        Integer shareUserId = (Integer) param.get("shareUserId");
-        if (responseJson.getCode() == 0 && null != shareUserId) {
-            JSONObject data = JSONObject.parseObject(responseJson.getData());
-            couponService.saveCouponShareRecord(data,shareUserId);
-        }
-        return responseJson;
+        return getResponseJson(parameters);
     }
 
     @ApiOperation("发送手机号验证码")

+ 0 - 6
src/main/java/com/caimei/mapper/CouponMapper.java

@@ -126,12 +126,6 @@ public interface CouponMapper {
      */
     void insertReceiveCoupon(ReceiveCouponPo receiveCoupon);
 
-    /**
-     * 插入优惠券分享记录
-     * @param couponSharePo
-     */
-    void insertCouponShare(CouponSharePo couponSharePo);
-
     /**
      * 根据被分享者用户id查询优惠券分享记录Id
      * @param receiveUserId

+ 0 - 4
src/main/java/com/caimei/model/po/CmCartPo.java

@@ -22,10 +22,6 @@ public class CmCartPo implements Serializable {
 
     private Date addTime;
 
-    private String isOutOfTime;
-
-    private String skuID;
-
     private String reBuyFlag;
 
     /**

+ 0 - 25
src/main/java/com/caimei/model/po/CmOrderPo.java

@@ -64,11 +64,6 @@ public class CmOrderPo implements Serializable {
      */
     private String hasActProduct;
 
-    /**
-     * 订单自动关闭时间点单位毫秒(v5.0版本已废弃)
-     */
-    private BigDecimal autoCloseTimeMills;
-
     /**
      * 0待确认,11待收待发,12待收部发,13待收全发,21部收待发,22部收部发,23部收全发,31已收待发,32已收部发,33已收全发,4交易完成,5订单完成,6已关闭,7交易全退
      */
@@ -168,11 +163,6 @@ public class CmOrderPo implements Serializable {
      */
     private String clubScanTime;
 
-    /**
-     * 支付方式,(协销订单可能会存在多种进账方式用,隔开)(v5.0版本已废弃)
-     */
-    private String payWay;
-
     /**
      * 订单来源:1WWW、2CRM、3APP[历史数据]、4客服、5外单、6小程序[采美,星范等]
      */
@@ -213,21 +203,6 @@ public class CmOrderPo implements Serializable {
      */
     private Integer promotionalGiftsCount;
 
-    /**
-     * 库分期免息状态 0、免息 1、不免息[V5.0.0版本已废弃]
-     */
-    private String cooFreeFlag;
-
-    /**
-     * 库分期分期费率[V5.0.0版本已废弃]
-     */
-    private Integer cooFreeRate;
-
-    /**
-     * 库分期免息金额[V5.0.0版本已废弃]
-     */
-    private BigDecimal cooFreeAmount;
-
     /**
      * 是否开发票 没开发票 0 开个人发票 1 开企业发票2
      */

+ 0 - 30
src/main/java/com/caimei/model/po/CmOrderProductPo.java

@@ -69,21 +69,6 @@ public class CmOrderProductPo implements Serializable {
      */
     private String outStoreType;
 
-    /**
-     * skuId
-     */
-    private Integer skuID;
-
-    /**
-     * sku属性
-     */
-    private String props;
-
-    /**
-     * 属性名
-     */
-    private String propName;
-
     /**
      * 商品编号
      */
@@ -104,16 +89,6 @@ public class CmOrderProductPo implements Serializable {
      */
     private BigDecimal costPrice;
 
-    /**
-     * 记录普通用户购买时价格  活动价优先
-     */
-    private BigDecimal price0;
-
-    /**
-     * 记录会员用户购买时价格  活动价优先
-     */
-    private BigDecimal price1;
-
     /**
      * 总价  = price X num
      */
@@ -224,11 +199,6 @@ public class CmOrderProductPo implements Serializable {
      */
     private String status;
 
-    /**
-     * 是否已评论:1是,空或0未评论(V5.0.0版本后已废弃--)
-     */
-    private String commentFlag;
-
     /**
      * 获取到的总采美豆值
      */

+ 0 - 16
src/main/java/com/caimei/model/po/CmShopOrderPo.java

@@ -93,11 +93,6 @@ public class CmShopOrderPo implements Serializable {
      */
     private String note;
 
-    /**
-     * 运费:-1到付,0包邮,其他为具体运费(v5.0版本已废弃,运费已使用商品形式存储)
-     */
-    private Double fee;
-
     /**
      * 余额支付时使用的金额
      */
@@ -119,12 +114,6 @@ public class CmShopOrderPo implements Serializable {
     private BigDecimal needPayAmount;
 
     private BigDecimal discountAmount;
-
-    /**
-     * 经理折扣(v5.0版本已废弃,经理折扣只和主订单有关)
-     */
-    private BigDecimal discountFee;
-
     /**
      * 订单总优惠
      */
@@ -160,11 +149,6 @@ public class CmShopOrderPo implements Serializable {
      */
     private Long autoOverTimeMills;
 
-    /**
-     * 订单状态:见表c_orderstatus或枚举OrderStatus(v5.0版本已废弃只有主订单状态)
-     */
-    private Integer status;
-
     /**
      * (付款供应商)付款状态:1待付款、2部分付款、3已付款
      */

+ 0 - 5
src/main/java/com/caimei/model/vo/OrderProductVo.java

@@ -70,11 +70,6 @@ public class OrderProductVo implements Serializable {
      */
     private BigDecimal costPrice;
 
-    /**
-     * 记录会员用户购买时价格  活动价优先
-     */
-    private BigDecimal price1;
-
     /**
      * 总价  = price X num
      */

+ 0 - 7
src/main/java/com/caimei/service/CouponService.java

@@ -80,11 +80,4 @@ public interface CouponService {
      * @return
      */
     ResponseJson<Map<String, Object>> couponsByProductIds(Integer userId, String productIds);
-
-    /**
-     * 保存优惠券分享记录
-     * @param data
-     * @param shareUserId
-     */
-    void saveCouponShareRecord(JSONObject data, Integer shareUserId);
 }

+ 19 - 11
src/main/java/com/caimei/service/impl/CouponServiceImpl.java

@@ -2,16 +2,19 @@ package com.caimei.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.mapper.CouponMapper;
+import com.caimei.mapper.ProductMapper;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.CouponsDto;
 import com.caimei.model.po.CouponPo;
 import com.caimei.model.po.CouponSharePo;
 import com.caimei.model.po.ReceiveCouponPo;
+import com.caimei.model.po.UserSearchHistoryPo;
 import com.caimei.model.vo.*;
 import com.caimei.service.CouponService;
 import com.caimei.service.ProductService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,6 +34,8 @@ public class CouponServiceImpl implements CouponService {
     private CouponMapper couponMapper;
     @Autowired
     private ProductService productService;
+    @Resource
+    private ProductMapper productMapper;
 
 
     @Override
@@ -117,6 +122,20 @@ public class CouponServiceImpl implements CouponService {
     public ResponseJson<PageInfo<ProductVo>> productPage(Integer couponId, Integer userId, String productName, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         List<ProductVo> productList = couponMapper.getCouponProduct(couponId, productName);
+        //搜索关键字
+        if (StringUtils.isNotBlank(productName) && userId != null && userId > 0) {
+            Integer recordId = productMapper.findSearchHistory(userId, productName);
+            if (recordId != null && recordId > 0) {
+                productMapper.updateHistoryByDate(recordId);
+            } else {
+                UserSearchHistoryPo history = new UserSearchHistoryPo();
+                history.setUserId(Long.valueOf(userId));
+                history.setDelFlag("0");
+                history.setSearchWord(productName);
+                history.setSearchDate(new Date());
+                productMapper.insertSearchHistory(history);
+            }
+        }
         productList.forEach(product -> productService.setProductDetails(product,userId));
         PageInfo<ProductVo> pageInfo = new PageInfo<>(productList);
         return ResponseJson.success(pageInfo);
@@ -177,15 +196,4 @@ public class CouponServiceImpl implements CouponService {
         couponsMap.put("receiveCouponList", receiveCouponList);
         return ResponseJson.success(couponsMap);
     }
-
-    @Override
-    public void saveCouponShareRecord(JSONObject data, Integer shareUserId) {
-        Integer receiveUserId = (Integer) data.get("userId");
-        CouponSharePo couponSharePo = new CouponSharePo();
-        couponSharePo.setShareUserId(shareUserId);
-        couponSharePo.setReceiveUserId(receiveUserId);
-        String shareCouponIds = couponMapper.getCurrentCouponIds(4);
-        couponSharePo.setShareCouponIds(shareCouponIds);
-        couponMapper.insertCouponShare(couponSharePo);
-    }
 }

+ 1 - 1
src/main/java/com/caimei/service/impl/OrderServiceImpl.java

@@ -115,7 +115,7 @@ public class OrderServiceImpl implements OrderService {
             for (OrderProductVo orderProduct : orderProductList) {
                 //运费
                 if (shopOrder.getShopId() == 998) {
-                    order.setFreight(orderProduct.getPrice1());
+                    order.setFreight(orderProduct.getPrice());
                 }
                 //总税费
                 expensesOfTaxation = expensesOfTaxation.add(orderProduct.getTotalAddedValueTax());

+ 12 - 17
src/main/java/com/caimei/service/impl/OrderSubmitServiceImpl.java

@@ -171,9 +171,6 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         order.setOrganizeID(0);
         order.setUpdateDate(curDateStr);
         order.setPayFlag("0");
-        order.setCooFreeFlag("0");
-        order.setCooFreeAmount(BigDecimal.ZERO);
-        order.setCooFreeRate(0);
         order.setOnlinePayFlag("0");
         order.setPreferential(BigDecimal.ZERO);
         order.setDiscountFee(BigDecimal.ZERO);
@@ -250,6 +247,10 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                             }
                         }
                     }
+                    Integer discount = productMapper.findProductDiscount(product.getProductId(), userId);
+                    if (null != discount && discount > 0) {
+                        productPrice = MathUtil.div(MathUtil.mul(productPrice, discount), 100);
+                    }
                     //税费
                     boolean addTaxFlag = (0 == product.getIncludedTax()) && (1 == product.getInvoiceType() || 2 == product.getInvoiceType());
                     if (addTaxFlag) {
@@ -330,10 +331,16 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         orderTotalFee = productTotalFee;
         order.setOrderTotalFee(orderTotalFee);
         payTotalFee = MathUtil.sub(payTotalFee, couponAmount);
-        order.setPayTotalFee(payTotalFee);
-        payableAmount = payTotalFee;
         // 订单状态
         order.setStatus("11");
+        if (MathUtil.compare(payTotalFee, 0) < 0 && MathUtil.compare(productTotalFee, 0) >= 0 && MathUtil.compare(couponAmount, 0) > 0) {
+            // 订单金额因为使用优惠券而小于0,将金额置为0
+            payTotalFee = BigDecimal.ZERO;
+            order.setCouponAmount(productTotalFee);
+            order.setStatus("31");
+        }
+        order.setPayTotalFee(payTotalFee);
+        payableAmount = payTotalFee;
         order.setConfirmTime(curDateStr);
 
         // 余额支付金额
@@ -523,8 +530,6 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
             orderProduct.setNormalPrice(BigDecimal.ZERO);
         }
         orderProduct.setCostPrice(product.getCostPrice());
-        orderProduct.setPrice0(product.getPrice());
-        orderProduct.setPrice1(product.getPrice());
         orderProduct.setTotalAmount(MathUtil.mul(product.getPrice(), productNum));
 
         orderProduct.setDiscount(new BigDecimal(100));
@@ -611,8 +616,6 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         orderProduct.setBuyAgainFlag("0");
         // 未出库数量
         orderProduct.setNotOutStore(productNum);
-        // 是否已评论 1 是 0 未评论
-        orderProduct.setCommentFlag("0");
         orderProduct.setActPreferential(new BigDecimal(0));
         orderProduct.setActType(null);
         if (priceType == 1) {
@@ -703,15 +706,8 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         }
 
         // freePostFlag: 0包邮 -1到付 1 有运费
-        // fee: 运费:-1到付,0包邮,其他为具体运费(v5.0版本已废弃,运费已使用商品形式存储)
-        if ("1".equals(order.getFreePostFlag())) {
-            shopOrder.setFee(0d);
-        } else {
-            shopOrder.setFee(Double.parseDouble(order.getFreePostFlag()));
-        }
         shopOrder.setNote(shopNote);
         shopOrder.setOrderTime(order.getOrderTime());
-        shopOrder.setDiscountFee(BigDecimal.ZERO);
         shopOrder.setCanRefundFlag(1);
         shopOrder.setCanRefundAmount(needPayAmount.doubleValue());
         shopOrder.setAccountAmount(BigDecimal.ZERO);
@@ -736,7 +732,6 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         shopOrder.setItemCount(buyNum);
         // 普通订单 1 协销订单0 与cm_order一样
         shopOrder.setOrderType(order.getOrderType());
-        shopOrder.setStatus(1);
         shopOrder.setOrderSubmitType(order.getOrderSubmitType());
         shopOrder.setTotalAmount(totalAmount);
         shopOrder.setProductAmount(productAmount);

+ 1 - 5
src/main/resources/mapper/CouponMapper.xml

@@ -11,10 +11,6 @@
         insert into cm_hehe_receive_coupon (userId, couponId, source, status, receiveTime, delFlag)
         values (#{userId}, #{couponId}, #{source}, #{status}, #{receiveTime}, #{delFlag})
     </insert>
-    <insert id="insertCouponShare">
-        insert into cm_hehe_coupon_share (shareUserId, receiveUserId, shareCouponIds,createTime)
-        values (#{shareUserId}, #{receiveUserId}, #{shareCouponIds},NOW())
-    </insert>
     <update id="updateCouponShareRecord">
         update cm_hehe_coupon_share set consumeFlag = 1 and consumeCouponIds = #{consumeCouponIds}
     </update>
@@ -196,7 +192,7 @@
         select group_concat(id)
         from cm_hehe_coupon
         where couponType = #{couponType} and if(startNowFlag = 1,true, NOW() <![CDATA[  >=  ]]> startTime )
-          and if(permanentFlag = 1,true,NOW() <![CDATA[  <=  ]]> endTime)
+          and if(permanentFlag = 1,true,NOW() <![CDATA[  <=  ]]> endTime) and delFlag = 0
         group by couponType
     </select>
     <select id="getCouponShareId" resultType="java.lang.Integer">

+ 0 - 1
src/main/resources/mapper/OrderMapper.xml

@@ -115,7 +115,6 @@
           cop.price,
           cop.normalPrice,
           cop.costPrice,
-          cop.price1,
           cop.totalAmount,
           cop.totalFee,
           cop.shouldPayFee,

+ 0 - 99
src/main/resources/mapper/OrderSubmitMapper.xml

@@ -123,9 +123,6 @@
             <if test="hasActProduct != null">
                 hasActProduct,
             </if>
-            <if test="autoCloseTimeMills != null">
-                autoCloseTimeMills,
-            </if>
             <if test="status != null">
                 `status`,
             </if>
@@ -186,9 +183,6 @@
             <if test="clubScanTime != null">
                 clubScanTime,
             </if>
-            <if test="payWay != null">
-                payWay,
-            </if>
             <if test="orderSource != null">
                 orderSource,
             </if>
@@ -213,15 +207,6 @@
             <if test="promotionalGiftsCount != null">
                 promotionalGiftsCount,
             </if>
-            <if test="cooFreeFlag != null">
-                cooFreeFlag,
-            </if>
-            <if test="cooFreeRate != null">
-                cooFreeRate,
-            </if>
-            <if test="cooFreeAmount != null">
-                cooFreeAmount,
-            </if>
             <if test="invoiceFlag != null">
                 invoiceFlag,
             </if>
@@ -305,9 +290,6 @@
             <if test="hasActProduct != null">
                 #{hasActProduct,jdbcType=CHAR},
             </if>
-            <if test="autoCloseTimeMills != null">
-                #{autoCloseTimeMills,jdbcType=DECIMAL},
-            </if>
             <if test="status != null">
                 #{status,jdbcType=CHAR},
             </if>
@@ -368,9 +350,6 @@
             <if test="clubScanTime != null">
                 #{clubScanTime,jdbcType=VARCHAR},
             </if>
-            <if test="payWay != null">
-                #{payWay,jdbcType=VARCHAR},
-            </if>
             <if test="orderSource != null">
                 #{orderSource,jdbcType=CHAR},
             </if>
@@ -395,15 +374,6 @@
             <if test="promotionalGiftsCount != null">
                 #{promotionalGiftsCount,jdbcType=INTEGER},
             </if>
-            <if test="cooFreeFlag != null">
-                #{cooFreeFlag,jdbcType=CHAR},
-            </if>
-            <if test="cooFreeRate != null">
-                #{cooFreeRate,jdbcType=INTEGER},
-            </if>
-            <if test="cooFreeAmount != null">
-                #{cooFreeAmount,jdbcType=DECIMAL},
-            </if>
             <if test="invoiceFlag != null">
                 #{invoiceFlag,jdbcType=CHAR},
             </if>
@@ -522,9 +492,6 @@
             <if test="note != null">
                 note,
             </if>
-            <if test="fee != null">
-                fee,
-            </if>
             <if test="accountAmount != null">
                 accountAmount,
             </if>
@@ -540,9 +507,6 @@
             <if test="discountAmount != null">
                 discountAmount,
             </if>
-            <if test="discountFee != null">
-                discountFee,
-            </if>
             <if test="preferential != null">
                 preferential,
             </if>
@@ -564,9 +528,6 @@
             <if test="autoOverTimeMills != null">
                 autoOverTimeMills,
             </if>
-            <if test="status != null">
-                `status`,
-            </if>
             <if test="payStatus != null">
                 payStatus,
             </if>
@@ -743,9 +704,6 @@
             <if test="note != null">
                 #{note,jdbcType=VARCHAR},
             </if>
-            <if test="fee != null">
-                #{fee,jdbcType=FLOAT},
-            </if>
             <if test="accountAmount != null">
                 #{accountAmount,jdbcType=DECIMAL},
             </if>
@@ -761,9 +719,6 @@
             <if test="discountAmount != null">
                 #{discountAmount,jdbcType=DECIMAL},
             </if>
-            <if test="discountFee != null">
-                #{discountFee,jdbcType=DECIMAL},
-            </if>
             <if test="preferential != null">
                 #{preferential,jdbcType=DECIMAL},
             </if>
@@ -785,9 +740,6 @@
             <if test="autoOverTimeMills != null">
                 #{autoOverTimeMills,jdbcType=BIGINT},
             </if>
-            <if test="status != null">
-                #{status,jdbcType=INTEGER},
-            </if>
             <if test="payStatus != null">
                 #{payStatus,jdbcType=CHAR},
             </if>
@@ -956,15 +908,6 @@
             <if test="outStoreType != null">
                 outStoreType,
             </if>
-            <if test="skuID != null">
-                skuID,
-            </if>
-            <if test="props != null">
-                props,
-            </if>
-            <if test="propName != null">
-                propName,
-            </if>
             <if test="productNo != null">
                 productNo,
             </if>
@@ -977,12 +920,6 @@
             <if test="costPrice != null">
                 costPrice,
             </if>
-            <if test="price0 != null">
-                price0,
-            </if>
-            <if test="price1 != null">
-                price1,
-            </if>
             <if test="totalAmount != null">
                 totalAmount,
             </if>
@@ -1037,9 +974,6 @@
             <if test="status != null">
                 `status`,
             </if>
-            <if test="commentFlag != null">
-                commentFlag,
-            </if>
             <if test="totalBeans != null">
                 totalBeans,
             </if>
@@ -1156,15 +1090,6 @@
             <if test="outStoreType != null">
                 #{outStoreType,jdbcType=CHAR},
             </if>
-            <if test="skuID != null">
-                #{skuID,jdbcType=INTEGER},
-            </if>
-            <if test="props != null">
-                #{props,jdbcType=VARCHAR},
-            </if>
-            <if test="propName != null">
-                #{propName,jdbcType=VARCHAR},
-            </if>
             <if test="productNo != null">
                 #{productNo,jdbcType=VARCHAR},
             </if>
@@ -1177,12 +1102,6 @@
             <if test="costPrice != null">
                 #{costPrice,jdbcType=DECIMAL},
             </if>
-            <if test="price0 != null">
-                #{price0,jdbcType=DECIMAL},
-            </if>
-            <if test="price1 != null">
-                #{price1,jdbcType=DECIMAL},
-            </if>
             <if test="totalAmount != null">
                 #{totalAmount,jdbcType=DECIMAL},
             </if>
@@ -1237,9 +1156,6 @@
             <if test="status != null">
                 #{status,jdbcType=CHAR},
             </if>
-            <if test="commentFlag != null">
-                #{commentFlag,jdbcType=CHAR},
-            </if>
             <if test="totalBeans != null">
                 #{totalBeans,jdbcType=DECIMAL},
             </if>
@@ -1357,9 +1273,6 @@
             <if test="hasActProduct != null">
                 hasActProduct = #{hasActProduct,jdbcType=CHAR},
             </if>
-            <if test="autoCloseTimeMills != null">
-                autoCloseTimeMills = #{autoCloseTimeMills,jdbcType=DECIMAL},
-            </if>
             <if test="status != null">
                 `status` = #{status,jdbcType=CHAR},
             </if>
@@ -1417,9 +1330,6 @@
             <if test="clubScanTime != null">
                 clubScanTime = #{clubScanTime,jdbcType=VARCHAR},
             </if>
-            <if test="payWay != null">
-                payWay = #{payWay,jdbcType=VARCHAR},
-            </if>
             <if test="orderSource != null">
                 orderSource = #{orderSource,jdbcType=CHAR},
             </if>
@@ -1441,15 +1351,6 @@
             <if test="presentCount != null">
                 presentCount = #{presentCount,jdbcType=INTEGER},
             </if>
-            <if test="cooFreeFlag != null">
-                cooFreeFlag = #{cooFreeFlag,jdbcType=CHAR},
-            </if>
-            <if test="cooFreeRate != null">
-                cooFreeRate = #{cooFreeRate,jdbcType=INTEGER},
-            </if>
-            <if test="cooFreeAmount != null">
-                cooFreeAmount = #{cooFreeAmount,jdbcType=DECIMAL},
-            </if>
             <if test="invoiceFlag != null">
                 invoiceFlag = #{invoiceFlag,jdbcType=CHAR},
             </if>

+ 0 - 1
src/main/resources/mapper/PayOrderMapper.xml

@@ -123,7 +123,6 @@
           price,
           normalPrice,
           costPrice,
-          price1,
           totalAmount,
           totalFee,
           shouldPayFee,

+ 3 - 1
src/main/resources/mapper/ProductMapper.xml

@@ -306,8 +306,10 @@
         from cm_hehe_discount chd
                  left join cm_hehe_discount_product chdp on chd.id = chdp.discountId
                  left join cm_hehe_discount_user chdu on chd.id = chdu.discountId
-        where chdp.productId = #{productId}
+        where (chd.productType = 1 or chdp.productId = #{productId})
           and chdu.userId = #{userId}
+        order by chd.discount desc
+        limit 1
     </select>
 
 </mapper>

+ 0 - 2
src/main/resources/mapper/ShoppingCartMapper.xml

@@ -10,8 +10,6 @@
           userID,
           productCount,
           addTime,
-          isOutOfTime,
-          skuID,
           reBuyFlag,
           heUserId
         FROM