|
|
|
@@ -83,7 +83,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData addReceiver(WxMerchant merchant) { |
|
|
|
public ResultData addReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver) { |
|
|
|
|
|
|
|
WxAppinfo appInfo = new WxAppinfo(); |
|
|
|
appInfo.setTenantId(merchant.getTenantId()); |
|
|
|
@@ -92,16 +92,17 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
appInfo = wxAppinfoMapper.findList(appInfo).get(0); |
|
|
|
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId()); |
|
|
|
|
|
|
|
WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); |
|
|
|
receiver.setMerchantId(merchant.getId()); |
|
|
|
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); |
|
|
|
receiver.setId(IdWorker.get().nextId()); |
|
|
|
receiver.setCreateTime(new Date()); |
|
|
|
receiver.setUpdateTime(new Date()); |
|
|
|
//receiver.setReceiverAccount(merchant.getReceiverAccount().toString()); |
|
|
|
receiver.setReceiverComments(merchant.getName()); |
|
|
|
receiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode()); |
|
|
|
receiver.setTrueName(merchant.getName()); |
|
|
|
|
|
|
|
//passed from uplevel |
|
|
|
//receiver.setReceiverAccount(receiverParam.getReceiverAccount()); |
|
|
|
//receiver.setReceiverComments(receiverParam.getReceiverComments()); |
|
|
|
//receiver.setReceiverType(receiverParam.getReceiverType()); |
|
|
|
//receiver.setTrueName(receiverParam.getTrueName()); |
|
|
|
|
|
|
|
//添加分账账户 |
|
|
|
WxProfitSharingReceiverP wxProfitSharingReceiverP = new WxProfitSharingReceiverP(); |
|
|
|
@@ -113,9 +114,9 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
|
|
|
|
|
|
|
|
JSONObject receiverJSON = new JSONObject(); |
|
|
|
receiverJSON.put("type",EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getMessage()); |
|
|
|
//receiverJSON.put("account",merchant.getReceiverAccount()); |
|
|
|
receiverJSON.put("name",merchant.getName()); |
|
|
|
receiverJSON.put("type",EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage()); |
|
|
|
receiverJSON.put("account",receiver.getReceiverAccount()); |
|
|
|
receiverJSON.put("name",receiver.getTrueName()); |
|
|
|
|
|
|
|
wxProfitSharingReceiverP.setReceiver(receiverJSON.toJSONString()); |
|
|
|
String response; |
|
|
|
@@ -145,7 +146,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData delReceiver(WxMerchant merchant) { |
|
|
|
public ResultData delReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver) { |
|
|
|
WxAppinfo appInfo = new WxAppinfo(); |
|
|
|
appInfo.setTenantId(merchant.getTenantId()); |
|
|
|
appInfo.setType(EnumAppType.C.getCode()); |
|
|
|
@@ -153,11 +154,10 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
appInfo = wxAppinfoMapper.findList(appInfo).get(0); |
|
|
|
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId()); |
|
|
|
|
|
|
|
WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); |
|
|
|
receiver.setMerchantId(merchant.getId()); |
|
|
|
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode()); |
|
|
|
//receiver.setReceiverAccount(merchant.getReceiverAccount().toString()); |
|
|
|
receiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode()); |
|
|
|
//receiver.setReceiverAccount(receiverParam.getReceiverAccount()); |
|
|
|
//receiver.setReceiverType(receiverParam.getReceiverType()); |
|
|
|
|
|
|
|
receiver = wxProfitSharingReceiverMapper.selectOne(receiver); |
|
|
|
|
|
|
|
@@ -174,8 +174,8 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
|
|
|
|
|
|
|
|
|
JSONObject receiverJSON = new JSONObject(); |
|
|
|
receiverJSON.put("type",EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getMessage()); |
|
|
|
//receiverJSON.put("account",merchant.getReceiverAccount()); |
|
|
|
receiverJSON.put("type",EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage()); |
|
|
|
receiverJSON.put("account",receiver.getReceiverAccount()); |
|
|
|
|
|
|
|
wxProfitSharingReceiverP.setReceiver(receiverJSON.toJSONString()); |
|
|
|
String response; |
|
|
|
|