Search in sources :

Example 6 with OnlinePayExample

use of com.itrus.portal.db.OnlinePayExample in project portal by ixinportal.

the class OnlinePayServiceImpl method removeOnlinePayWinthClientFw.

/**
 * 移除服务型客户的在线支付,只返回不属于服务型客户的在线支付,即:web支付
 * @return
 */
public String[] removeOnlinePayWinthClientFw(String[] onpay) {
    String ClientFwPayConfigId = systemConfigService.getClientfwPayConfigIds();
    if (StringUtils.isNotBlank(ClientFwPayConfigId)) {
        String[] ClientFwPayConfigIds = ClientFwPayConfigId.split(",");
        List<Long> payConfigIds = new ArrayList<>();
        for (String string : ClientFwPayConfigIds) {
            payConfigIds.add(Long.valueOf(string));
        }
        OnlinePayExample example = new OnlinePayExample();
        OnlinePayExample.Criteria criteria = example.or();
        criteria.andPayConfigIn(payConfigIds);
        List<OnlinePay> onlinePayList = selectByExample(example);
        if (null == onlinePayList || onlinePayList.isEmpty()) {
            return onpay;
        }
        List<Long> onlinePayIds = new ArrayList<>();
        for (OnlinePay onlinePay : onlinePayList) {
            onlinePayIds.add(onlinePay.getId());
        }
        List<String> newOnpayList = new ArrayList<>();
        for (String string : onpay) {
            if (!onlinePayIds.contains(Long.valueOf(string))) {
                newOnpayList.add(string);
            }
        }
        String[] strings = new String[newOnpayList.size()];
        return newOnpayList.toArray(strings);
    } else {
        return onpay;
    }
}
Also used : OnlinePayExample(com.itrus.portal.db.OnlinePayExample) ArrayList(java.util.ArrayList) OnlinePay(com.itrus.portal.db.OnlinePay)

Aggregations

OnlinePayExample (com.itrus.portal.db.OnlinePayExample)6 OnlinePay (com.itrus.portal.db.OnlinePay)5 OnPayInfo (com.itrus.portal.db.OnPayInfo)3 Date (java.util.Date)3 Bill (com.itrus.portal.db.Bill)2 BillExample (com.itrus.portal.db.BillExample)2 PayConfig (com.itrus.portal.db.PayConfig)2 PayConfigExample (com.itrus.portal.db.PayConfigExample)2 ArrayList (java.util.ArrayList)2 TransactionStatus (org.springframework.transaction.TransactionStatus)2 DefaultTransactionDefinition (org.springframework.transaction.support.DefaultTransactionDefinition)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 DigitalCert (com.itrus.portal.db.DigitalCert)1 ExtraBill (com.itrus.portal.db.ExtraBill)1 Product (com.itrus.portal.db.Product)1 TransferExample (com.itrus.portal.db.TransferExample)1 List (java.util.List)1