|
|
|
@@ -616,5 +616,61 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//更新以前分账用户绑定微信号的分账数据,微信已经停止了微信号分账 |
|
|
|
@Override |
|
|
|
@Deprecated |
|
|
|
public void updatetttttttttttttt() { |
|
|
|
WxProfitSharingOrder wxProfitSharingOrder = new WxProfitSharingOrder(); |
|
|
|
wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); |
|
|
|
wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); |
|
|
|
List<WxProfitSharingOrder> list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); |
|
|
|
list.stream().forEach(sharingOrder->{ |
|
|
|
if (!sharingOrder.getType().equals(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
WxProfitShareAppInoDto dto = getAppinfo(sharingOrder); |
|
|
|
WxAppinfo appInfo = dto.getAppinfo(); |
|
|
|
WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); |
|
|
|
|
|
|
|
List<JSONObject> receivers; |
|
|
|
|
|
|
|
receivers = JSONArray.parseArray(sharingOrder.getReceivers(), JSONObject.class); |
|
|
|
if (receivers.size() != 1 ) |
|
|
|
return; |
|
|
|
|
|
|
|
Integer amount = receivers.get(0).getInteger("amount"); |
|
|
|
if (!EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getMessage().equals(receivers.get(0).getString("type"))) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//准备分账列表 |
|
|
|
WxProfitSharingReceiver psReceiverQ = new WxProfitSharingReceiver(); |
|
|
|
psReceiverQ.updateTenantInfo(payAccount); |
|
|
|
psReceiverQ.setMerchantId(sharingOrder.getMerchantId()); |
|
|
|
psReceiverQ.setSharingType(payServiceFactory.getPayShareAdapterService(dto.getPayWay()).getProfitSharingType()); |
|
|
|
psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); |
|
|
|
List<WxProfitSharingReceiver> psReceiverList = wxProfitSharingReceiverMapper.findList(psReceiverQ); |
|
|
|
if (null == psReceiverList || psReceiverList.size() !=1 ) { |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray realReceivers = new JSONArray(); |
|
|
|
psReceiverList.stream().forEach(receiver->{ |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("type",payServiceFactory.getPayShareAdapterService(dto.getPayWay()).getShareAccount(receiver.getReceiverType()).getMessage()); |
|
|
|
jo.put("account",receiver.getReceiverAccount()); |
|
|
|
jo.put("amount", amount); |
|
|
|
//jo.put("description",receiver.getReceiverComments()); //改为存ID, |
|
|
|
jo.put("description",receiver.getId().toString()); //为重试做准备 |
|
|
|
realReceivers.add(jo); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
sharingOrder.setReceivers(JSON.toJSONString(realReceivers)); |
|
|
|
wxProfitSharingOrderMapper.updateById(sharingOrder); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |