| @@ -2,4 +2,7 @@ ALTER TABLE `mallink`.`wx_pay_account` | |||||
| ADD COLUMN `sell_rate` int(6) NOT NULL DEFAULT 0 COMMENT '销售提点' AFTER `system_rate`; | ADD COLUMN `sell_rate` int(6) NOT NULL DEFAULT 0 COMMENT '销售提点' AFTER `system_rate`; | ||||
| ALTER TABLE `mallink`.`wx_pay_account` | 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`; | |||||
| @@ -24,6 +24,8 @@ public class WxProfitSharingResult extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="分账金额(分)",name="payAmount") | @io.swagger.annotations.ApiModelProperty(value="分账金额(分)",name="payAmount") | ||||
| private Integer payAmount; | private Integer payAmount; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | ||||
| private Integer isPrivate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | |||||
| private Date updateTime; | private Date updateTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | ||||
| private Date createTime; | private Date createTime; | ||||
| @@ -21,6 +21,6 @@ public interface WxProfitSharingOrderMapper extends CommonMapper<WxProfitSharing | |||||
| Long queryOrderForMerchantCount(Map<String,Object> params); | 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); | |||||
| } | } | ||||
| @@ -571,7 +571,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| wxProfitSharingOrderQueryVo.setId(id); | wxProfitSharingOrderQueryVo.setId(id); | ||||
| wxProfitSharingOrderQueryVo.setTenantId(tenantId); | wxProfitSharingOrderQueryVo.setTenantId(tenantId); | ||||
| WxProfitSharingOrderVo wxProfitSharingOrderVo = wxProfitSharingOrderMapper.findOrderList(wxProfitSharingOrderQueryVo).get(0); | 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("order",wxProfitSharingOrderVo); | ||||
| result.put("details",orderDetails); | result.put("details",orderDetails); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| @@ -130,7 +130,20 @@ public class WxPayShareService extends PayShareBaseAdapterService{ | |||||
| psCmd.setTransaction_id(record.getTransactionId()); | psCmd.setTransaction_id(record.getTransactionId()); | ||||
| psCmd.setOut_order_no(record.getId().toString()); | psCmd.setOut_order_no(record.getId().toString()); | ||||
| psCmd.setSign_type("HMAC-SHA256"); | 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; | String response; | ||||
| try { | try { | ||||
| @@ -145,7 +145,20 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ | |||||
| req.setSub_appid(appInfo.getAppId()); | req.setSub_appid(appInfo.getAppId()); | ||||
| req.setTransaction_id(record.getTransactionId()); | req.setTransaction_id(record.getTransactionId()); | ||||
| req.setOut_order_no(String.valueOf(record.getOrderId())); | 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); | WxPayService payService = maUtil.getWxPayService(appInfo, payAccount); | ||||
| String response = null; | String response = null; | ||||
| try { | try { | ||||
| @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.util.List; | |||||
| @Data | @Data | ||||
| public class V3PayShareReq { | public class V3PayShareReq { | ||||
| @@ -12,6 +14,6 @@ public class V3PayShareReq { | |||||
| private String sub_appid;//微信分配的子商户公众账号ID,分账接收方类型包含PERSONAL_SUB_OPENID时必填 | private String sub_appid;//微信分配的子商户公众账号ID,分账接收方类型包含PERSONAL_SUB_OPENID时必填 | ||||
| private String transaction_id;//微信支付订单号 | private String transaction_id;//微信支付订单号 | ||||
| private String out_order_no;//商户分账单号 | private String out_order_no;//商户分账单号 | ||||
| private JSONArray receivers; | |||||
| private List receivers; | |||||
| private boolean unfreeze_unsplit = true;//是否解冻剩余未分资金.1、如果为true,该笔订单剩余未分账的金额会解冻回分账方商户;2、如果为false,该笔订单剩余未分账的金额不会解冻回分账方商户,可以对该笔订单再次进行分账。 | private boolean unfreeze_unsplit = true;//是否解冻剩余未分资金.1、如果为true,该笔订单剩余未分账的金额会解冻回分账方商户;2、如果为false,该笔订单剩余未分账的金额不会解冻回分账方商户,可以对该笔订单再次进行分账。 | ||||
| } | } | ||||
| @@ -267,6 +267,10 @@ | |||||
| 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} and psr.sharing_receiver_id != 0 | 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> | </select> | ||||
| </mapper> | </mapper> | ||||
| @@ -9,6 +9,7 @@ | |||||
| <result column="sharing_order_id" jdbcType="BIGINT" property="sharingOrderId" /> | <result column="sharing_order_id" jdbcType="BIGINT" property="sharingOrderId" /> | ||||
| <result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" /> | <result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" /> | ||||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> | <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="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | ||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | ||||
| <result column="sharing_status" jdbcType="INTEGER" property="sharingStatus" /> | <result column="sharing_status" jdbcType="INTEGER" property="sharingStatus" /> | ||||
| @@ -18,7 +19,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <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> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -54,8 +55,12 @@ | |||||
| <if test=" null != payAmount "> | <if test=" null != payAmount "> | ||||
| and `pay_amount` = #{payAmount} | and `pay_amount` = #{payAmount} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != isPrivate "> | |||||
| and `is_private` = #{isPrivate} | |||||
| </if> | |||||
| <if test=" null != updateTime "> | <if test=" null != updateTime "> | ||||
| and `update_time` = #{updateTime} | and `update_time` = #{updateTime} | ||||