diff --git a/mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql b/mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql index 13c094519..b3785585e 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql @@ -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`; \ No newline at end of file +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`; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java index 411553468..79007f550 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java @@ -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; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java index 535cd4cd6..9e0f6777e 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingOrderMapper.java @@ -21,6 +21,6 @@ public interface WxProfitSharingOrderMapper extends CommonMapper params); - List findOrderDetails(@Param("id")Long id,@Param("tenantId")String tenantId); + List findOrderDetails(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isPrivate")Integer isPrivate); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java index 748e265ed..cfa405186 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java @@ -571,7 +571,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ wxProfitSharingOrderQueryVo.setId(id); wxProfitSharingOrderQueryVo.setTenantId(tenantId); WxProfitSharingOrderVo wxProfitSharingOrderVo = wxProfitSharingOrderMapper.findOrderList(wxProfitSharingOrderQueryVo).get(0); - List orderDetails = wxProfitSharingOrderMapper.findOrderDetails(id,tenantId); + List orderDetails = wxProfitSharingOrderMapper.findOrderDetails(id,tenantId, EnumYesOrNo.NO.getCode()); result.put("order",wxProfitSharingOrderVo); result.put("details",orderDetails); return new ResultData(result); diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java index b43e7c908..c50bc5101 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java @@ -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 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 { diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java index fbc14818e..ea8ba2170 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java @@ -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 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 { diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java index d8e6941f4..96b613770 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareReq.java @@ -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,该笔订单剩余未分账的金额不会解冻回分账方商户,可以对该笔订单再次进行分账。 } diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml index 98b342623..f8d5050b9 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml @@ -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 + + and psr.`is_private` = #{isPrivate} + + diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml index 693345634..aa345939e 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml @@ -9,6 +9,7 @@ + @@ -18,7 +19,7 @@ - `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` @@ -54,8 +55,12 @@ and `pay_amount` = #{payAmount} - - + + + and `is_private` = #{isPrivate} + + + and `update_time` = #{updateTime}