Bladeren bron

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-oauth

changhaoning 1 jaar geleden
bovenliggende
commit
4cf329c77e

+ 14 - 0
src/main/java/com/dk/oauth/controller/integral/CouponReceiveController.java

@@ -66,5 +66,19 @@ public class CouponReceiveController{
         return couponReceiveService.insert(couponReceiveVO);
     }
 
+    /**
+     * @desc   : 获取链接助力人数
+     * @date   : 2024/8/8 13:18
+     * @author : 刘尧
+     */
+    @ApiOperation(
+            value = "获取链接助力人数",
+            notes = "获取链接助力人数"
+    )
+    @PostMapping({"get_receive_user_number"})
+    public ResponseResultVO<?> getReceiveUserNumber(@Valid @RequestBody CouponReceiveVO couponReceiveVO) {
+        return couponReceiveService.selectReceiveNumber(couponReceiveVO);
+    }
+
 
 }

+ 8 - 0
src/main/java/com/dk/oauth/controller/wxapi/basic/WechatPayController.java

@@ -13,8 +13,12 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.annotation.Resource;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -64,6 +68,10 @@ public class WechatPayController {
         log.info("parseOrderNotifyResult--0" + appId + "---" + xmlData);
         WxPayService wxPayService = wechatPayService.getWxPayService();
         final WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData);
+
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        RequestContextHolder.setRequestAttributes(attributes,true);
+
         // 另起线程处理业务
         executorService.execute(new Runnable() {
             @Override

+ 7 - 0
src/main/java/com/dk/oauth/mapper/integral/CouponReceiveMapper.java

@@ -1,5 +1,6 @@
 package com.dk.oauth.mapper.integral;
 
+import com.dk.oauth.model.VO.integral.CouponReceiveVO;
 import com.dk.oauth.model.pojo.integral.CouponReceive;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.oauth.model.query.integral.CouponReceiveQuery;
@@ -43,5 +44,11 @@ public interface CouponReceiveMapper extends BaseMapper<CouponReceive>{
      */
     Long countByCondNoExistCpId(CouponReceiveQuery couponReceiveQuery);
 
+    /**
+     * @desc   : 获取链接助力人数
+     * @date   : 2024/8/8 13:18
+     * @author : 刘尧
+     */
+    Long selectReceiveNumber(CouponReceiveVO couponReceiveVO);
 }
 

+ 7 - 0
src/main/java/com/dk/oauth/mapper/integral/CouponReceiveMapper.xml

@@ -153,6 +153,13 @@
         for update
     </select>
 
+    <select id="selectReceiveNumber" resultType="java.lang.Long">
+        SELECT
+        COUNT(1)
+        FROM dkic_a.t_mst_coupon_receive
+        WHERE send_id = #{sendId}::uuid
+    </select>
+
     <insert id="insertBatch">
         insert into dkic_a.t_mst_coupon_receive
         (

+ 4 - 0
src/main/java/com/dk/oauth/mapper/integral/IntegralItemMapper.xml

@@ -40,6 +40,7 @@
         <result column="flg_valid" property="flgValid"/>
         <result column="user_id" property="userId" typeHandler="UuidTypeHandler"/>
         <result column="staff_name" property="staffName"/>
+        <result column="trade_type" property="tradeType"/>
         <result column="remarks" property="remarks"/>
     </resultMap>
 
@@ -108,10 +109,13 @@
         ,tac.cp_name
         ,tacf.cp_name as cp_name_from,
         sys.f_get_name_i18n(tdk.kind_name_i18n,#{i18n}) as integral_type_name
+        ,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "trade_type"
         FROM dkic_a.t_mst_integral_item tmii
         LEFT JOIN sys.t_data_kind tdk ON tmii.integral_type = tdk.kind_code
         left join dkic_a.t_a_company tac on tac.cp_id = tmii.cp_id
         left join dkic_a.t_a_company tacf on tacf.cp_id = tmii.cp_id
+        left join dkic_a.t_cp_trade tct on tct.integral_share_id = tmii.item_id
+        left join sys.t_data_kind tdk2 ON tct.trade_type = tdk2.kind_code
         <include refid="Condition"/>
         order by tmii.acc_date desc, tmii.user_id
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">

+ 6 - 0
src/main/java/com/dk/oauth/model/response/integral/IntegralItemResponse.java

@@ -115,6 +115,12 @@ public class IntegralItemResponse{
     @ApiModelProperty(value = "操作员工")
     private String staffName;
 
+    /**
+     * 交易类型
+     */
+    @Excel(name = "交易类型")
+    @ApiModelProperty(value = "交易类型")
+    private String tradeType;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 8 - 0
src/main/java/com/dk/oauth/service/integral/CouponReceiveService.java

@@ -176,4 +176,12 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
     }
 
 
+    /**
+     * @desc   : 获取链接助力人数
+     * @date   : 2024/8/8 13:18
+     * @author : 刘尧
+     */
+    public ResponseResultVO<?> selectReceiveNumber(CouponReceiveVO couponReceiveVO) {
+        return ResponseResultUtil.success(couponReceiveMapper.selectReceiveNumber(couponReceiveVO));
+    }
 }

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

@@ -188,7 +188,9 @@
     <update id="updateById">
         update dkic_a.t_cp_trade
         set wx_trade_no  = #{wxTradeNo},
-            integral_share_id  = #{integralShareId},
+            <if test="integralShareId != null">
+                integral_share_id = #{integralShareId}::uuid,
+            </if>
             trade_status = #{tradeStatus}
         where trade_id = #{tradeId}
     </update>