xhxu 3 лет назад
Родитель
Сommit
a948faa4c5
3 измененных файлов: 21 добавлений и 4 удалений
  1. +15
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderDetailsVo.java
  2. +4
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  3. +2
    -1
      mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml

+ 15
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderDetailsVo.java Просмотреть файл

@@ -1,8 +1,12 @@
package com.iformall.domain.vo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumProfitSharingReceiverType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

@@ -21,9 +25,20 @@ public class WxProfitSharingOrderDetailsVo extends TenantEntity {
private String finishTime;
private String failedReason;
private String description;
private Long sharingReceiverId;
private Integer receiverType;
private String receiverAccount;
private String receiverComments;
private Integer sharingType;
private Integer status;

public String getReceiverAccount(){
if(StringUtils.isNotBlank(this.description) && sharingReceiverId.equals(0l)){
JSONObject jsonObject = JSON.parseObject(this.description);
if(jsonObject != null){
this.receiverAccount = jsonObject.getString("account");
}
}
return this.receiverAccount;
}
}

+ 4
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java Просмотреть файл

@@ -256,7 +256,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", sellerAmount);
jo.put("amount", systemAmount);
jo.put("merchantId",receiver.getMerchantId());
jo.put("description",receiver.getId());
jo.put("isPrivate",EnumYesOrNo.YES.getCode());
@@ -281,7 +281,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", sellerAmount);
jo.put("amount", mallAmount);
jo.put("merchantId",receiver.getMerchantId());
jo.put("description",receiver.getId());
receivers.add(jo);
@@ -345,7 +345,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
jo.put("account",payAccount.getSubMchId());
jo.put("amount", shareAmount);
jo.put("merchantId",0);
jo.put("description",receiver.getId());
jo.put("description",0);
receivers.add(jo);
}else if(EnumPayMchType.DIRECT.getCode().equals(payOrder.getMchType())){
//解冻给收款方(门店)
@@ -371,6 +371,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
result.setSharingReceiverId(Long.valueOf(o.getString("description")));
result.setPayAmount(o.getInteger("amount"));
result.setIsPrivate(o.getInteger("isPrivate"));
result.setDescription(o.toJSONString());
result.setCreateTime(currentDate);
result.setUpdateTime(currentDate);
result.setSharingStatus(EnumProfitSharingResultStatus.PROFIT_SHARING_RESULT_PENDING.getCode());


+ 2
- 1
mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml Просмотреть файл

@@ -253,6 +253,7 @@
<result column="finish_time" jdbcType="VARCHAR" property="finishTime" />
<result column="failed_reason" jdbcType="VARCHAR" property="failedReason" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" />
<result column="receiver_type" jdbcType="INTEGER" property="receiverType" />
<result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" />
<result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" />
@@ -263,7 +264,7 @@
<select id="findOrderDetails" parameterType="java.util.HashMap" resultMap="orderDetailsMap">
select psr.id,psr.tenant_id,psr.parent_tenant_id,psr.pay_amount,psr.create_time,sharing_status,finish_time,failed_reason,description,
psre.receiver_type,psre.receiver_account,psre.receiver_comments,psre.sharing_type,psre.`status`
psr.sharing_receiver_id,psre.receiver_type,psre.receiver_account,psre.receiver_comments,psre.sharing_type,psre.`status`
from wx_profit_sharing_result psr
left join wx_profit_sharing_receiver psre on psr.sharing_receiver_id = psre.id
where psr.sharing_order_id = #{id} and psr.tenant_id = #{tenantId}


Загрузка…
Отмена
Сохранить