|
|
|
@@ -191,6 +191,9 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
if (wxProfitSharingReceiverList.size()<=0 || wxProfitSharingReceiverList.size() > 50) { |
|
|
|
throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getMessage()); |
|
|
|
} |
|
|
|
// 计算分账总金额,总金额-0.6% |
|
|
|
Double amountD = Math.ceil(record.getPayAmount()*1.0D*(1000-payAccount.getRate())/1000); |
|
|
|
Integer total_amount = amountD.intValue(); |
|
|
|
JSONArray receivers = new JSONArray(); |
|
|
|
List <WxProfitSharingResult> resultList = new ArrayList<WxProfitSharingResult>(); |
|
|
|
for (int i=0;i<wxProfitSharingReceiverList.size();i++){ |
|
|
|
@@ -199,7 +202,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("type",EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage()); |
|
|
|
jo.put("account",receiver.getReceiverAccount()); |
|
|
|
jo.put("amount",record.getPayAmount()); //temp: sharing all money with only owner |
|
|
|
jo.put("amount", total_amount); //temp: sharing all money with only owner |
|
|
|
jo.put("description",receiver.getReceiverComments()); |
|
|
|
receivers.add(jo); |
|
|
|
|
|
|
|
@@ -208,6 +211,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ |
|
|
|
result.setId(idworker.nextId()); |
|
|
|
result.setSharingOrderId(record.getId()); |
|
|
|
result.setSharingReceiverId(receiver.getId()); |
|
|
|
result.setPayAmount(total_amount); |
|
|
|
result.setCreateTime(currentDate); |
|
|
|
result.setUpdateTime(currentDate); |
|
|
|
resultList.add(result); |
|
|
|
|