فهرست منبع

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

zhoux 1 سال پیش
والد
کامیت
a04ac3e373

+ 12 - 0
src/main/java/com/dk/oauth/controller/CompanyController.java

@@ -104,6 +104,18 @@ public class CompanyController {
     }
     }
 
 
     /**
     /**
+     * @desc   : 注册商户
+     * @author : 常皓宁
+     * @date   : 2024/8/8 10:14
+     */
+    @ApiOperation( value = "注册商户", notes = "注册商户" )
+    @PostMapping(value = "/web_register_company")
+    public ResponseResultVO<?> webRegisterCompany(@RequestBody CompanyVO companyVO) {
+        return companyService.webRegisterCompany(companyVO);
+    }
+
+
+    /**
      * @desc   : 续费
      * @desc   : 续费
      * @author : 周兴
      * @author : 周兴
      * @date   : 2024/5/17 14:55
      * @date   : 2024/5/17 14:55

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

@@ -66,5 +66,19 @@ public class CouponReceiveController{
         return couponReceiveService.insert(couponReceiveVO);
         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 io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 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.annotation.Resource;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Executors;
@@ -64,6 +68,10 @@ public class WechatPayController {
         log.info("parseOrderNotifyResult--0" + appId + "---" + xmlData);
         log.info("parseOrderNotifyResult--0" + appId + "---" + xmlData);
         WxPayService wxPayService = wechatPayService.getWxPayService();
         WxPayService wxPayService = wechatPayService.getWxPayService();
         final WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData);
         final WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData);
+
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        RequestContextHolder.setRequestAttributes(attributes,true);
+
         // 另起线程处理业务
         // 另起线程处理业务
         executorService.execute(new Runnable() {
         executorService.execute(new Runnable() {
             @Override
             @Override

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

@@ -1,5 +1,6 @@
 package com.dk.oauth.mapper.integral;
 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.oauth.model.pojo.integral.CouponReceive;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.oauth.model.query.integral.CouponReceiveQuery;
 import com.dk.oauth.model.query.integral.CouponReceiveQuery;
@@ -43,5 +44,11 @@ public interface CouponReceiveMapper extends BaseMapper<CouponReceive>{
      */
      */
     Long countByCondNoExistCpId(CouponReceiveQuery couponReceiveQuery);
     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
         for update
     </select>
     </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 id="insertBatch">
         insert into dkic_a.t_mst_coupon_receive
         insert into dkic_a.t_mst_coupon_receive
         (
         (

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

@@ -35,6 +35,13 @@ public interface CouponUseMapper extends BaseMapper<CouponUse>{
      * @author : 寇珊珊
      * @author : 寇珊珊
      */
      */
     Long countByCond(CouponUseQuery couponUseQuery);
     Long countByCond(CouponUseQuery couponUseQuery);
+
+    /**
+     * @desc   : 条件查询--查詢所有的优惠券状态-未使用
+     * @date   : 2024/7/24 9:02
+     * @author : 寇珊珊
+     */
+    List<CouponUseResponse> selectAllStatusByCond(CouponUseQuery couponUseQuery);
 	
 	
 }
 }
 
 

+ 10 - 1
src/main/java/com/dk/oauth/mapper/integral/CouponUseMapper.xml

@@ -53,7 +53,7 @@
     <!-- 通用条件列 -->
     <!-- 通用条件列 -->
     <sql id="Condition">
     <sql id="Condition">
         <where>
         <where>
-            <if test="cpId != null and cpId != ''">
+            <if test="cpId != null and cpId != '' and cpId != 0">
                 AND tmcu.cp_id = #{cpId}
                 AND tmcu.cp_id = #{cpId}
             </if>
             </if>
             <if test="sendId != null and sendId != ''">
             <if test="sendId != null and sendId != ''">
@@ -127,6 +127,15 @@
         <include refid="Condition"/>
         <include refid="Condition"/>
     </select>
     </select>
 
 
+    <!-- 查询表t_mst_coupon_use,(条件查询+分页)列表 -->
+    <select id="selectAllStatusByCond" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        FROM dkic_a.t_mst_coupon_use tmcu
+        where tmcu.flg_valid AND tmcu.coupon_status = #{couponStatus}
+
+    </select>
+
     <!-- 根据主键查询表t_mst_coupon_use的一行数据 -->
     <!-- 根据主键查询表t_mst_coupon_use的一行数据 -->
     <select id="selectById" resultMap="BaseResultMapResponse">
     <select id="selectById" resultMap="BaseResultMapResponse">
         SELECT
         SELECT

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

@@ -40,6 +40,7 @@
         <result column="flg_valid" property="flgValid"/>
         <result column="flg_valid" property="flgValid"/>
         <result column="user_id" property="userId" typeHandler="UuidTypeHandler"/>
         <result column="user_id" property="userId" typeHandler="UuidTypeHandler"/>
         <result column="staff_name" property="staffName"/>
         <result column="staff_name" property="staffName"/>
+        <result column="trade_type" property="tradeType"/>
         <result column="remarks" property="remarks"/>
         <result column="remarks" property="remarks"/>
     </resultMap>
     </resultMap>
 
 
@@ -108,10 +109,13 @@
         ,tac.cp_name
         ,tac.cp_name
         ,tacf.cp_name as cp_name_from,
         ,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(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
         FROM dkic_a.t_mst_integral_item tmii
         LEFT JOIN sys.t_data_kind tdk ON tmii.integral_type = tdk.kind_code
         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 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_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"/>
         <include refid="Condition"/>
         order by tmii.acc_date desc, tmii.user_id
         order by tmii.acc_date desc, tmii.user_id
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
         <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 = "操作员工")
     @ApiModelProperty(value = "操作员工")
     private String staffName;
     private String staffName;
 
 
+    /**
+     * 交易类型
+     */
+    @Excel(name = "交易类型")
+    @ApiModelProperty(value = "交易类型")
+    private String tradeType;
     /*
     /*
      * 相关属性
      * 相关属性
      * @TableField(exist = false)
      * @TableField(exist = false)

+ 2 - 0
src/main/java/com/dk/oauth/service/ICompanyService.java

@@ -19,6 +19,8 @@ public interface ICompanyService  extends IService<Company> {
 
 
     ResponseResultVO registerCompany(CompanyVO companyVO);
     ResponseResultVO registerCompany(CompanyVO companyVO);
 
 
+    ResponseResultVO webRegisterCompany(CompanyVO companyVO);
+
     ResponseResultVO reNewCompany(CompanyVO companyVO);
     ResponseResultVO reNewCompany(CompanyVO companyVO);
 
 
     ResponseResultVO saveFunc(CompanyVO companyVO);
     ResponseResultVO saveFunc(CompanyVO companyVO);

+ 141 - 3
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -14,9 +14,8 @@ import com.dk.common.model.vo.mst.StaffVO;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.common.util.AESUtil;
-import com.dk.common.util.HaipHttpUtils;
-import com.dk.common.util.StringUtils;
+import com.dk.common.util.*;
+import com.dk.oauth.config.WechatPayConfigInfo;
 import com.dk.oauth.convert.CompanyConvert;
 import com.dk.oauth.convert.CompanyConvert;
 import com.dk.oauth.entity.*;
 import com.dk.oauth.entity.*;
 import com.dk.oauth.feign.service.OrgFeign;
 import com.dk.oauth.feign.service.OrgFeign;
@@ -37,8 +36,16 @@ import com.dk.oauth.model.response.integral.IntegralTacticResponse;
 import com.dk.oauth.query.*;
 import com.dk.oauth.query.*;
 import com.dk.oauth.response.*;
 import com.dk.oauth.response.*;
 import com.dk.oauth.service.ICompanyService;
 import com.dk.oauth.service.ICompanyService;
+import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
+import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
+import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
+import com.github.binarywang.wxpay.config.WxPayConfig;
+import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.service.WxPayService;
+import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
 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.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.RequestContextHolder;
@@ -51,6 +58,7 @@ import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.*;
+import java.util.UUID;
 
 
 /**
 /**
  * 公司实现类
  * 公司实现类
@@ -100,6 +108,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     @Autowired
     @Autowired
     private CouponUseMapper couponUseMapper;
     private CouponUseMapper couponUseMapper;
 
 
+    @Autowired
+    private WechatPayConfigInfo wechatPayConfigInfo;
+
 
 
     /**
     /**
      * @desc : 通过ID查询
      * @desc : 通过ID查询
@@ -229,6 +240,118 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     }
     }
 
 
     /**
     /**
+     * @desc   : web注册商户
+     * @author : 常皓宁
+     * @date   : 2024/8/8 10:14
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseResultVO webRegisterCompany(CompanyVO companyVO) {
+        //校验当前手机号是否注册过
+        UserLogin userLogin = userMapper.getByPhone(companyVO.getCpPhone());
+        //没有微信用户 需要新建微信用户
+        if (userLogin == null) {
+            UserLogin wxUser = new UserLogin();
+            wxUser.setUserName(companyVO.getCpManager());
+            wxUser.setUserPhone(companyVO.getCpPhone());
+            wxUser.setUserPwd(Md5Utils.hash(Constant.StringConstant.LOGIN_INIT_PWD.getName()));
+            userMapper.insert(wxUser);
+            companyVO.setOwner(wxUser.getUserId());
+            companyVO.setWxUserId(wxUser.getUserId());
+            //注册商户
+            this.registerCompany(companyVO);
+        }
+        //有微信用户需要查看company是否存在持有人
+        else {
+            List<Company> owner = companyMapper.selectByCond(new Company().setOwner(userLogin.getUserId()));
+            //说明company存在当前持有人 则需要查看是否支付
+            if (owner != null && owner.size() > 0) {
+                //临时license为null非临时不为null则说明已经支付
+                if (owner.get(0).getLicenseSocial() == null && owner.get(0).getLicense() != null) {
+                    return ResponseResultUtil.error(ErrorCodeEnum.PHONE_REGISTER_COMPANY.getCode(),
+                            ErrorCodeEnum.PHONE_REGISTER_COMPANY.getMessage());
+                }
+                //未支付则找到对应的交易记录进行支付操作
+                else {
+                    // 获取交易记录并返回前台进行支付操作
+                    List<TradeResponse> tradeResponses = tradeMapper.selectTrade(new Trade().setCpId(owner.get(0).getCpId()));
+                    if (tradeResponses != null && tradeResponses.size() > 0) {
+                        companyVO.setTradeNo(tradeResponses.get(0).getTradeNo());
+                        companyVO.setTradeAmount(tradeResponses.get(0).getTradeAmount());
+                    }
+                }
+            }
+            //company没有对应的持有人数据 则直接新建
+            else {
+                companyVO.setOwner(userLogin.getUserId());
+                companyVO.setWxUserId(userLogin.getUserId());
+                this.registerCompany(companyVO);
+            }
+        }
+        return this.getQRCode(companyVO);
+    }
+
+    /**
+     * @desc   : 获取支付二维码
+     * @author : 常皓宁
+     * @date   : 2024/8/8 16:03
+     */
+    public ResponseResultVO getQRCode(CompanyVO companyVO) {
+        try {
+            //todo 支付金额用时需放开
+            //BigDecimal payFee = companyVO.getTradeAmount();
+            String payFee = "0.01";
+            //获取微信二维码
+            WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
+            //商品描述
+            orderRequest.setBody("东科智云-注册商户");
+            //单号
+            orderRequest.setOutTradeNo(companyVO.getTradeNo());
+            //金额
+            orderRequest.setTotalFee(BaseWxPayRequest.yuanToFen(payFee.toString()));//元转成分
+            orderRequest.setSpbillCreateIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
+            orderRequest.setNotifyUrl(wechatPayConfigInfo.getWechatNotifyUrl() + "/" + wechatPayConfigInfo.getAppId());
+            //交易类型
+            orderRequest.setTradeType("NATIVE");
+            //商品ID 二维码支付时必填(不到什么东西 随机给)
+            orderRequest.setProductId(UUID.randomUUID().toString().replace("-", ""));
+            WxPayService wxPayService = this.getWxPayService();
+            WxPayUnifiedOrderResult result = null;
+            result = wxPayService.unifiedOrder(orderRequest);
+            if ("SUCCESS".equals(result.getReturnCode())) {//与支付成功
+                return ResponseResultUtil.success(result);
+            } else {
+                return ResponseResultUtil.error(result.getReturnMsg());
+            }
+
+
+        } catch (WxPayException e) {
+            e.printStackTrace();
+            return ResponseResultUtil.error("生成收款码失败.请稍后重试");
+        }
+    }
+
+
+    public WxPayService getWxPayService() {
+        log.info("getWxPayService----------" + wechatPayConfigInfo.toString());
+        WxPayConfig payConfig = new WxPayConfig();
+        payConfig.setAppId(StringUtils.trimToNull(wechatPayConfigInfo.getAppId()));
+        payConfig.setMchId(StringUtils.trimToNull(wechatPayConfigInfo.getMchId()));
+        payConfig.setMchKey(StringUtils.trimToNull(wechatPayConfigInfo.getMchKey()));
+//        payConfig.setSubAppId(null);
+//        payConfig.setSubMchId(null);
+        ClassPathResource classPathResource = new ClassPathResource("apiclient_cert.p12");
+        payConfig.setKeyPath(StringUtils.trimToNull(classPathResource.getPath()));
+        log.info("getWxPayService=>" + classPathResource.toString());
+//        payConfig.setKeyPath(StringUtils.trimToNull(wechatPayConfigInfo.getKeyPath()));
+        // 可以指定是否使用沙箱环境
+        payConfig.setUseSandboxEnv(false);
+        WxPayService wxPayService = new WxPayServiceImpl();
+        wxPayService.setConfig(payConfig);
+        return wxPayService;
+    }
+
+    /**
      * @desc : 注册-商户
      * @desc : 注册-商户
      * @author : 姜永辉
      * @author : 姜永辉
      * @date : 2024-02-20 13:55
      * @date : 2024-02-20 13:55
@@ -619,6 +742,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
 
 
             // 使用员工   // 积分的使用
             // 使用员工   // 积分的使用
             if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
             if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
+                // 公司积分--查询
+                IntegralResponse integralResponse = integralMapper.selectById(companyVO.getCpId());
+                if (integralResponse!=null && integralResponse.getIntegral() < companyVO.getIntegral()){
+                    // 积分不足,不允许进行该操作!
+                    throw new BaseBusinessException(ErrorCodeEnum.INTEGRAL_MAX.getCode(),
+                            ErrorCodeEnum.INTEGRAL_MAX.getMessage());
+                }
                 // 积分明细
                 // 积分明细
                 IntegralItem integralItem = new IntegralItem();
                 IntegralItem integralItem = new IntegralItem();
                 integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());
                 integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());
@@ -701,6 +831,14 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
 
 
             // 使用员工   // 积分的使用
             // 使用员工   // 积分的使用
             if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
             if (companyVO.getIntegral() != null && companyVO.getIntegral() > 0) {
+                // 公司积分--查询
+                IntegralResponse integralResponse = integralMapper.selectById(companyVO.getCpId());
+                if (integralResponse!=null && integralResponse.getIntegral() < companyVO.getIntegral()){
+                    // 积分不足,不允许进行该操作!
+                    throw new BaseBusinessException(ErrorCodeEnum.INTEGRAL_MAX.getCode(),
+                            ErrorCodeEnum.INTEGRAL_MAX.getMessage());
+                }
+
                 // 积分明细
                 // 积分明细
                 IntegralItem integralItem = new IntegralItem();
                 IntegralItem integralItem = new IntegralItem();
                 integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());
                 integralItem.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_USE.getName());

+ 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));
+    }
 }
 }

+ 2 - 2
src/main/java/com/dk/oauth/service/integral/CouponUseService.java

@@ -135,8 +135,8 @@ public class CouponUseService extends BaseService<CouponUse> {
     @Transactional(rollbackFor = {Exception.class})
     @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<?> retrievalCouponStatus() {
     public ResponseResultVO<?> retrievalCouponStatus() {
         //查询全部优惠券使用
         //查询全部优惠券使用
-        List<CouponUseResponse> couponUseResponseList = couponUseMapper.selectByCond(new CouponUseQuery()
-                .setCouponStatus(Constant.couponStatus.WEI_SHI_YONG.getName()));
+        List<CouponUseResponse> couponUseResponseList = couponUseMapper.selectAllStatusByCond(new CouponUseQuery()
+                .setCouponStatus(Constant.couponStatus.WEI_SHI_YONG.getName()).setFlgValid(true));
         log.info("retrievalCouponStatus查询全部优惠券使用:{}", couponUseResponseList);
         log.info("retrievalCouponStatus查询全部优惠券使用:{}", couponUseResponseList);
         //数据存在
         //数据存在
         if (couponUseResponseList != null && couponUseResponseList.size() > 0) {
         if (couponUseResponseList != null && couponUseResponseList.size() > 0) {

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

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