| @@ -1,8 +1,12 @@ | |||||
| package com.iformall.domain.vo; | 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.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumProfitSharingReceiverType; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -21,9 +25,20 @@ public class WxProfitSharingOrderDetailsVo extends TenantEntity { | |||||
| private String finishTime; | private String finishTime; | ||||
| private String failedReason; | private String failedReason; | ||||
| private String description; | private String description; | ||||
| private Long sharingReceiverId; | |||||
| private Integer receiverType; | private Integer receiverType; | ||||
| private String receiverAccount; | private String receiverAccount; | ||||
| private String receiverComments; | private String receiverComments; | ||||
| private Integer sharingType; | private Integer sharingType; | ||||
| private Integer status; | 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; | |||||
| } | |||||
| } | } | ||||
| @@ -256,7 +256,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| JSONObject jo = new JSONObject(); | JSONObject jo = new JSONObject(); | ||||
| jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage()); | jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage()); | ||||
| jo.put("account",receiver.getReceiverAccount()); | jo.put("account",receiver.getReceiverAccount()); | ||||
| jo.put("amount", sellerAmount); | |||||
| jo.put("amount", systemAmount); | |||||
| jo.put("merchantId",receiver.getMerchantId()); | jo.put("merchantId",receiver.getMerchantId()); | ||||
| jo.put("description",receiver.getId()); | jo.put("description",receiver.getId()); | ||||
| jo.put("isPrivate",EnumYesOrNo.YES.getCode()); | jo.put("isPrivate",EnumYesOrNo.YES.getCode()); | ||||
| @@ -281,7 +281,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| JSONObject jo = new JSONObject(); | JSONObject jo = new JSONObject(); | ||||
| jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage()); | jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage()); | ||||
| jo.put("account",receiver.getReceiverAccount()); | jo.put("account",receiver.getReceiverAccount()); | ||||
| jo.put("amount", sellerAmount); | |||||
| jo.put("amount", mallAmount); | |||||
| jo.put("merchantId",receiver.getMerchantId()); | jo.put("merchantId",receiver.getMerchantId()); | ||||
| jo.put("description",receiver.getId()); | jo.put("description",receiver.getId()); | ||||
| receivers.add(jo); | receivers.add(jo); | ||||
| @@ -345,7 +345,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| jo.put("account",payAccount.getSubMchId()); | jo.put("account",payAccount.getSubMchId()); | ||||
| jo.put("amount", shareAmount); | jo.put("amount", shareAmount); | ||||
| jo.put("merchantId",0); | jo.put("merchantId",0); | ||||
| jo.put("description",receiver.getId()); | |||||
| jo.put("description",0); | |||||
| receivers.add(jo); | receivers.add(jo); | ||||
| }else if(EnumPayMchType.DIRECT.getCode().equals(payOrder.getMchType())){ | }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.setSharingReceiverId(Long.valueOf(o.getString("description"))); | ||||
| result.setPayAmount(o.getInteger("amount")); | result.setPayAmount(o.getInteger("amount")); | ||||
| result.setIsPrivate(o.getInteger("isPrivate")); | result.setIsPrivate(o.getInteger("isPrivate")); | ||||
| result.setDescription(o.toJSONString()); | |||||
| result.setCreateTime(currentDate); | result.setCreateTime(currentDate); | ||||
| result.setUpdateTime(currentDate); | result.setUpdateTime(currentDate); | ||||
| result.setSharingStatus(EnumProfitSharingResultStatus.PROFIT_SHARING_RESULT_PENDING.getCode()); | result.setSharingStatus(EnumProfitSharingResultStatus.PROFIT_SHARING_RESULT_PENDING.getCode()); | ||||
| @@ -253,6 +253,7 @@ | |||||
| <result column="finish_time" jdbcType="VARCHAR" property="finishTime" /> | <result column="finish_time" jdbcType="VARCHAR" property="finishTime" /> | ||||
| <result column="failed_reason" jdbcType="VARCHAR" property="failedReason" /> | <result column="failed_reason" jdbcType="VARCHAR" property="failedReason" /> | ||||
| <result column="description" jdbcType="VARCHAR" property="description" /> | <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_type" jdbcType="INTEGER" property="receiverType" /> | ||||
| <result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" /> | <result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" /> | ||||
| <result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" /> | <result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" /> | ||||
| @@ -263,7 +264,7 @@ | |||||
| <select id="findOrderDetails" parameterType="java.util.HashMap" resultMap="orderDetailsMap"> | <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, | 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 | from wx_profit_sharing_result psr | ||||
| left join wx_profit_sharing_receiver psre on psr.sharing_receiver_id = psre.id | 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} | where psr.sharing_order_id = #{id} and psr.tenant_id = #{tenantId} | ||||