Browse Source

feature:修正提交未处理手续费的情况;获取绘画者ai绘画详情接口名称调整

feature-1.1
Penny 3 years ago
parent
commit
1e40bb5b61
  1. 15
      bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/domain/WithdrawLog.java
  2. 2
      bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/dto/TextToImgDto.java
  3. 5
      bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/dto/WithdrawDto.java
  4. 4
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/TiktokMiniController.java
  5. 12
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/WithdrawLogServiceImpl.java
  6. 5
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/WithdrawLogVo.java
  7. 7
      bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/WithdrawLogMapper.xml
  8. 2
      bnyer-services/bnyer-system/src/main/java/com/bnyer/system/service/impl/WithdrawLogServiceImpl.java

15
bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/domain/WithdrawLog.java

@ -1,13 +1,9 @@
package com.bnyer.common.core.domain; package com.bnyer.common.core.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.bnyer.common.core.annotation.Desensitized; import com.bnyer.common.core.annotation.Desensitized;
import com.bnyer.common.core.enums.SensitiveTypeEnum; import com.bnyer.common.core.enums.SensitiveTypeEnum;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
@ -38,12 +34,19 @@ public class WithdrawLog extends BaseDomain {
private Long creatorId; private Long creatorId;
/** /**
* 提现金额 * 提现金额
*/ */
@TableField(value = "amt") @TableField(value = "amt")
@ApiModelProperty(value="提现金额") @ApiModelProperty(value="提现金额")
private BigDecimal amt; private BigDecimal amt;
/**
* 手续费
*/
@TableField(value = "fee")
@ApiModelProperty(value="手续费")
private BigDecimal fee;
/** /**
* 支付宝手机号(加密) * 支付宝手机号(加密)
*/ */

2
bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/dto/TextToImgDto.java

@ -43,7 +43,7 @@ public class TextToImgDto implements Serializable {
@ApiModelProperty(value="批量数量") @ApiModelProperty(value="批量数量")
private Integer batchSize; private Integer batchSize;
@ApiModelProperty(value="eta值") @ApiModelProperty(value="差异强度值")
private Double eta; private Double eta;
@ApiModelProperty(value="采样器") @ApiModelProperty(value="采样器")

5
bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/dto/WithdrawDto.java

@ -40,7 +40,10 @@ public class WithdrawDto implements Serializable {
public WithdrawLog extractParam(){ public WithdrawLog extractParam(){
WithdrawLog withdrawLog = new WithdrawLog(); WithdrawLog withdrawLog = new WithdrawLog();
BeanUtils.copyProperties(this,withdrawLog); withdrawLog.setCreatorId(this.getCreatorId());
withdrawLog.setAccountNo(this.getAccountNo());
withdrawLog.setChannel(this.getChannel());
withdrawLog.setAmt(this.getAmt());
return withdrawLog; return withdrawLog;
} }
} }

4
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/TiktokMiniController.java

@ -435,8 +435,8 @@ public class TiktokMiniController extends BaseController {
} }
@ApiOperation(value="获取绘画者ai绘画详情") @ApiOperation(value="获取绘画者ai绘画详情")
@GetMapping(value = "/getAiPaintDetials/{id}") @GetMapping(value = "/getAiPaintDetails/{id}")
public AjaxResult getAiPaintDetials(@PathVariable @ApiParam("ai绘画对象id") Long id){ public AjaxResult getAiPaintDetails(@PathVariable @ApiParam("ai绘画对象id") Long id){
return AjaxResult.success(aiPaintService.queryDetails(id)); return AjaxResult.success(aiPaintService.queryDetails(id));
} }

12
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/WithdrawLogServiceImpl.java

@ -47,14 +47,22 @@ public class WithdrawLogServiceImpl implements WithdrawLogService {
if(creator.getAmt().compareTo(withdrawLog.getAmt()) == -1){ if(creator.getAmt().compareTo(withdrawLog.getAmt()) == -1){
throw new ServiceException("该艺术家当前可提现余额不足,提现失败!", TiktokConstant.CREATOR_AMT_NOT_ENOUGH); throw new ServiceException("该艺术家当前可提现余额不足,提现失败!", TiktokConstant.CREATOR_AMT_NOT_ENOUGH);
} }
//原提现金额
BigDecimal amt = withdrawLog.getAmt();
//设置手续费
BigDecimal fee = amt.multiply(new BigDecimal("0.06"));
withdrawLog.setFee(fee);
//设置最终可提现金额
BigDecimal amtResult = amt.subtract(fee);
withdrawLog.setAmt(amtResult);
withdrawLog.setCreateTime(new Date()); withdrawLog.setCreateTime(new Date());
withdrawLog.setUpdateTime(new Date()); withdrawLog.setUpdateTime(new Date());
withdrawLog.setStatus("0"); withdrawLog.setStatus("0");
//生成订单id //生成订单id
withdrawLog.setOrderId(IdUtil.getSnowflakeNextIdStr()); withdrawLog.setOrderId(IdUtil.getSnowflakeNextIdStr());
//扣除账户余额 //扣除账户余额
BigDecimal amt = creator.getAmt().subtract(withdrawLog.getAmt()); BigDecimal creatorAmt = creator.getAmt().subtract(amt);
creator.setAmt(amt); creator.setAmt(creatorAmt);
creatorMapper.updateById(creator); creatorMapper.updateById(creator);
return withdrawLogMapper.insert(withdrawLog); return withdrawLogMapper.insert(withdrawLog);
} }

5
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/WithdrawLogVo.java

@ -28,9 +28,12 @@ public class WithdrawLogVo implements Serializable {
@ApiModelProperty(value="艺术家id") @ApiModelProperty(value="艺术家id")
private Long creatorId; private Long creatorId;
@ApiModelProperty(value="提现金额") @ApiModelProperty(value="提现金额")
private BigDecimal amt; private BigDecimal amt;
@ApiModelProperty(value="手续费")
private BigDecimal fee;
@ApiModelProperty(value="收款账号(加密)") @ApiModelProperty(value="收款账号(加密)")
@Desensitized(type = SensitiveTypeEnum.MOBILE_PHONE) @Desensitized(type = SensitiveTypeEnum.MOBILE_PHONE)
private String accountNo; private String accountNo;

7
bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/WithdrawLogMapper.xml

@ -8,6 +8,7 @@
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> <result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" /> <result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="amt" jdbcType="DECIMAL" property="amt" /> <result column="amt" jdbcType="DECIMAL" property="amt" />
<result column="fee" jdbcType="DECIMAL" property="fee" />
<result column="account_no" jdbcType="VARCHAR" property="accountNo" /> <result column="account_no" jdbcType="VARCHAR" property="accountNo" />
<result column="reason" jdbcType="VARCHAR" property="reason" /> <result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="status" jdbcType="CHAR" property="status" /> <result column="status" jdbcType="CHAR" property="status" />
@ -19,12 +20,12 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, creator_id, amt, account_no, `status`, create_time, update_time, sort,is_show,order_id,channel,reason id, creator_id, amt,fee, account_no, `status`, create_time, update_time, sort,is_show,order_id,channel,reason
</sql> </sql>
<select id="queryFrontList" resultType="com.bnyer.img.vo.WithdrawLogVo"> <select id="queryFrontList" resultType="com.bnyer.img.vo.WithdrawLogVo">
select select
id, creator_id, amt, account_no,status,create_time,update_time,order_id,channel,reason id, creator_id, amt,fee,account_no,status,create_time,update_time,order_id,channel,reason
from img_withdraw_log from img_withdraw_log
where is_show = '1' and creator_id = #{creatorId} where is_show = '1' and creator_id = #{creatorId}
order by create_time desc order by create_time desc
@ -32,7 +33,7 @@
<select id="queryFrontDetails" resultType="com.bnyer.img.vo.WithdrawLogVo"> <select id="queryFrontDetails" resultType="com.bnyer.img.vo.WithdrawLogVo">
select select
id, creator_id, amt, account_no,status,create_time,update_time,order_id,channel,reason id, creator_id, amt,fee,account_no,status,create_time,update_time,order_id,channel,reason
from img_withdraw_log from img_withdraw_log
where is_show = '1' and order_id = #{orderId} where is_show = '1' and order_id = #{orderId}
</select> </select>

2
bnyer-services/bnyer-system/src/main/java/com/bnyer/system/service/impl/WithdrawLogServiceImpl.java

@ -211,7 +211,7 @@ public class WithdrawLogServiceImpl implements IWithdrawLogService {
throw new ServiceException("该艺术家未绑定支付宝账户!请手动设置!"); throw new ServiceException("该艺术家未绑定支付宝账户!请手动设置!");
} }
}else if(withdrawLog.getChannel().equals(WithdrawConstant.WECHAT)){ }else if(withdrawLog.getChannel().equals(WithdrawConstant.WECHAT)){
//TODO 转账到微信待开发 //TODO 转账到微信待开发,现有为扫码付款,后续要手动给他改这个状态
} }
log.info("艺术家【{}】订单【{}】提现【{}】元成功!",withdrawLog.getCreatorId(),withdrawLog.getOrderId(),withdrawLog.getAmt()); log.info("艺术家【{}】订单【{}】提现【{}】元成功!",withdrawLog.getCreatorId(),withdrawLog.getOrderId(),withdrawLog.getAmt());
//TODO 微信推送/企业微信推送提现成功通知 //TODO 微信推送/企业微信推送提现成功通知

Loading…
Cancel
Save