Browse Source

//shar

release_toaliyun_real
xhxu 3 years ago
parent
commit
1087dd9216
9 changed files with 51 additions and 9 deletions
  1. +4
    -1
      mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  5. +14
    -1
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java
  6. +14
    -1
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java
  7. +3
    -1
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java
  8. +4
    -0
      mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml
  9. +8
    -3
      mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml

+ 4
- 1
mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql View File

@@ -2,4 +2,7 @@ ALTER TABLE `mallink`.`wx_pay_account`
ADD COLUMN `sell_rate` int(6) NOT NULL DEFAULT 0 COMMENT '销售提点' AFTER `system_rate`;

ALTER TABLE `mallink`.`wx_pay_account`
ADD COLUMN `is_commission` smallint(2) NOT NULL DEFAULT 0 COMMENT '是否抽佣' AFTER `real_rate`;
ADD COLUMN `is_commission` smallint(2) NOT NULL DEFAULT 0 COMMENT '是否抽佣' AFTER `real_rate`;

ALTER TABLE `mallink`.`wx_profit_sharing_result`
ADD COLUMN `is_private` smallint(2) NOT NULL DEFAULT 0 COMMENT '是否隐藏' AFTER `pay_amount`;

+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java View File

@@ -24,6 +24,8 @@ public class WxProfitSharingResult extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="分账金额(分)",name="payAmount")
private Integer payAmount;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime")
private Integer isPrivate;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime")
private Date updateTime;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime")
private Date createTime;


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java View File

@@ -21,6 +21,6 @@ public interface WxProfitSharingOrderMapper extends CommonMapper<WxProfitSharing

Long queryOrderForMerchantCount(Map<String,Object> params);

List<WxProfitSharingOrderDetailsVo> findOrderDetails(@Param("id")Long id,@Param("tenantId")String tenantId);
List<WxProfitSharingOrderDetailsVo> findOrderDetails(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isPrivate")Integer isPrivate);

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java View File

@@ -571,7 +571,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
wxProfitSharingOrderQueryVo.setId(id);
wxProfitSharingOrderQueryVo.setTenantId(tenantId);
WxProfitSharingOrderVo wxProfitSharingOrderVo = wxProfitSharingOrderMapper.findOrderList(wxProfitSharingOrderQueryVo).get(0);
List<WxProfitSharingOrderDetailsVo> orderDetails = wxProfitSharingOrderMapper.findOrderDetails(id,tenantId);
List<WxProfitSharingOrderDetailsVo> orderDetails = wxProfitSharingOrderMapper.findOrderDetails(id,tenantId, EnumYesOrNo.NO.getCode());
result.put("order",wxProfitSharingOrderVo);
result.put("details",orderDetails);
return new ResultData(result);


+ 14
- 1
mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java View File

@@ -130,7 +130,20 @@ public class WxPayShareService extends PayShareBaseAdapterService{
psCmd.setTransaction_id(record.getTransactionId());
psCmd.setOut_order_no(record.getId().toString());
psCmd.setSign_type("HMAC-SHA256");
psCmd.setReceivers(receivers.toJSONString());
List list = new ArrayList<>();
for (Object o: receivers) {
JSONObject jo = (JSONObject) o;
Map<String,Object> settleParams = new HashMap<>();
settleParams.put("type",jo.getString("type"));
settleParams.put("account",jo.getString("account"));
settleParams.put("amount",jo.getInteger("amount"));
settleParams.put("description",jo.getString("description"));
if(StringUtils.isNotBlank(jo.getString("name"))){
settleParams.put("name",jo.getString("name"));
}
list.add(settleParams);
}
psCmd.setReceivers(JSON.toJSONString(list));
String response;
try {


+ 14
- 1
mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java View File

@@ -145,7 +145,20 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{
req.setSub_appid(appInfo.getAppId());
req.setTransaction_id(record.getTransactionId());
req.setOut_order_no(String.valueOf(record.getOrderId()));
req.setReceivers(receivers);
List list = new ArrayList<>();
for (Object o: receivers) {
JSONObject jo = (JSONObject) o;
Map<String,Object> settleParams = new HashMap<>();
settleParams.put("type",jo.getString("type"));
settleParams.put("account",jo.getString("account"));
settleParams.put("amount",jo.getInteger("amount"));
settleParams.put("description",jo.getString("description"));
if(StringUtils.isNotBlank(jo.getString("name"))){
settleParams.put("name",jo.getString("name"));
}
list.add(settleParams);
}
req.setReceivers(list);
WxPayService payService = maUtil.getWxPayService(appInfo, payAccount);
String response = null;
try {


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java View File

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;

import lombok.Data;

import java.util.List;

@Data
public class V3PayShareReq {

@@ -12,6 +14,6 @@ public class V3PayShareReq {
private String sub_appid;//微信分配的子商户公众账号ID,分账接收方类型包含PERSONAL_SUB_OPENID时必填
private String transaction_id;//微信支付订单号
private String out_order_no;//商户分账单号
private JSONArray receivers;
private List receivers;
private boolean unfreeze_unsplit = true;//是否解冻剩余未分资金.1、如果为true,该笔订单剩余未分账的金额会解冻回分账方商户;2、如果为false,该笔订单剩余未分账的金额不会解冻回分账方商户,可以对该笔订单再次进行分账。
}

+ 4
- 0
mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml View File

@@ -267,6 +267,10 @@
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} and psr.sharing_receiver_id != 0
<if test=" null != isPrivate ">
and psr.`is_private` = #{isPrivate}

</if>
</select>

</mapper>

+ 8
- 3
mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml View File

@@ -9,6 +9,7 @@
<result column="sharing_order_id" jdbcType="BIGINT" property="sharingOrderId" />
<result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" />
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" />
<result column="is_private" jdbcType="INTEGER" property="isPrivate" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="sharing_status" jdbcType="INTEGER" property="sharingStatus" />
@@ -18,7 +19,7 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`sharing_order_id`,`sharing_receiver_id`,`pay_amount`,`update_time`,`create_time`,`sharing_status`,`finish_time`,`failed_reason`,`description`
`id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`sharing_order_id`,`sharing_receiver_id`,`pay_amount`,`is_private`,`update_time`,`create_time`,`sharing_status`,`finish_time`,`failed_reason`,`description`
</sql>

<sql id="dynamicWhereConditions">
@@ -54,8 +55,12 @@
<if test=" null != payAmount ">
and `pay_amount` = #{payAmount}
</if>
</if>
<if test=" null != isPrivate ">
and `is_private` = #{isPrivate}

</if>

<if test=" null != updateTime ">
and `update_time` = #{updateTime}


Loading…
Cancel
Save