Search in sources :

Example 21 with OnlinePay

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

the class TransferController method zxzfdelete.

// 在线支付删除
@RequestMapping(value = "/zxzf/{id}", method = RequestMethod.DELETE, produces = "text/html")
public String zxzfdelete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, HttpServletRequest request, Model uiModel) {
    OnlinePay onlinepay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", id);
    String retPath = getReferer(request, "redirect:/transfer?status=2", true);
    if (onlinepay == null) {
        uiModel.addAttribute("message", "未找到要删除账号");
    } else {
        try {
            sqlSession.delete("com.itrus.portal.db.OnlinePayMapper.deleteByPrimaryKey", id);
            String oper = "删除在线支付账号";
            String info = ": " + onlinepay.getName();
            LogUtil.adminlog(sqlSession, oper, info);
        } catch (Exception e) {
            uiModel.addAttribute("message", "要删除账号【" + onlinepay.getName() + "】存在关联,无法删除");
        }
    }
    return retPath;
}
Also used : ExecutionException(java.util.concurrent.ExecutionException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 22 with OnlinePay

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

the class TransferController method updateZxzf.

// 在线支付修改处理
@RequestMapping(value = "/updatezxzf", method = RequestMethod.PUT, produces = "text/html")
public String updateZxzf(@Valid OnlinePay onlinepay, BindingResult bindingResult, Model uiModel) throws UnsupportedEncodingException {
    if (bindingResult.hasErrors()) {
        uiModel.addAttribute("onlinepay", onlinepay);
        return "transfer/updatezxzf";
    }
    OnlinePay onlinepay0 = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onlinepay.getId());
    onlinepay.setCreateTime(onlinepay0.getCreateTime());
    onlinepay.setCreator(onlinepay0.getCreator());
    onlinepay.setModifyTime(new Date());
    onlinepay.setModifier(getAdmin().getId());
    sqlSession.update("com.itrus.portal.db.OnlinePayMapper.updateByPrimaryKey", onlinepay);
    String oper = "修改在线支付账号";
    String info = "账号名称: " + onlinepay.getName();
    LogUtil.adminlog(sqlSession, oper, info);
    return "redirect:/transfer/zxzf/" + onlinepay.getId();
}
Also used : Date(java.util.Date) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 23 with OnlinePay

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

the class ExtraProductController method updateMorePage.

// 返回修改产品对应的服务信息页面:服务办理接口信息,服务应用方式,服务配置
@RequestMapping(value = "/updateMore/{id}", produces = "text/html")
public String updateMorePage(@PathVariable("id") Long id, Model uiModel) throws Exception {
    ExtraProduct extraProduct = extraProductService.selectByPrimaryKey(id);
    uiModel.addAttribute("extraProduct", extraProduct);
    List<ExtraProductSpec> extraProductSpecs = extraProductSpecService.getSpecByProductId(id);
    uiModel.addAttribute("extraProductSpecs", extraProductSpecs);
    // 服务提供商组成的map
    Map<Long, ServiceProvider> serviceProviderMap = serviceProviderService.selectMapByExample(null);
    uiModel.addAttribute("serviceProviderMap", serviceProviderMap);
    // 在线支付的map:微信和支付宝
    List<OnlinePay> onlinepays = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectByExample", null);
    uiModel.addAttribute("onlinepays", onlinepays);
    // 银行付款的List
    List<Transfer> bankPays = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", null);
    uiModel.addAttribute("bankPays", bankPays);
    // 电子发票的list
    List<Ereceipt> einvoices = sqlSession.selectList("com.itrus.portal.db.EreceiptMapper.selectByExample", null);
    uiModel.addAttribute("einvoices", einvoices);
    // 附加项的list
    List<ExtraMessage> extraMessages = extraMessageService.selectByExample(null);
    uiModel.addAttribute("extraMessages", extraMessages);
    return "extraproduct/update2";
}
Also used : Ereceipt(com.itrus.portal.db.Ereceipt) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) ExtraProduct(com.itrus.portal.db.ExtraProduct) ServiceProvider(com.itrus.portal.db.ServiceProvider) Transfer(com.itrus.portal.db.Transfer) ExtraMessage(com.itrus.portal.db.ExtraMessage) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 24 with OnlinePay

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

the class PayService method excelFildData.

/**
 * 导入的内容
 *
 * @return
 */
public ArrayList<ArrayList<String>> excelFildData(List<Map> bills) {
    Map<Long, OnlinePay> onlinepays = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", null, "id");
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    // 数据集
    ArrayList<ArrayList<String>> fieldDatas = new ArrayList<ArrayList<String>>();
    for (int i = 0; i < bills.size(); i++) {
        // 单行数据集
        ArrayList<String> rowData = new ArrayList<String>();
        // 项目名称
        rowData.add(bills.get(i).get("projectName").toString());
        // 产品名称
        rowData.add(bills.get(i).get("pname").toString());
        String CreateTime = formatter.format(bills.get(i).get("create_time")).toString();
        // 下单时间
        rowData.add(CreateTime);
        // 订单号
        rowData.add(bills.get(i).get("bill_id").toString());
        // 企业名称
        rowData.add(bills.get(i).get("enterprise_name").toString());
        // 订单金额
        rowData.add(bills.get(i).get("bill_sum").toString());
        if (bills.get(i).get("on_pay_info") != null) {
            if ((int) bills.get(i).get("pay_status") == 1) {
                if ((int) onlinepays.get((long) bills.get(i).get("online_pay")).getWay() == 1) {
                    rowData.add("支付宝");
                } else if ((int) onlinepays.get((long) bills.get(i).get("online_pay")).getWay() == 2) {
                    rowData.add("微信");
                }
                // 支付流水号
                rowData.add(bills.get(i).get("pay_no").toString());
                // 支付完成时间
                rowData.add(formatter.format(bills.get(i).get("wc_time")).toString());
            } else if (bills.get(i).get("tname") != null && (bills.get(i).get("on_pay_info") == null || (int) bills.get(i).get("pay_status") == 0)) {
                rowData.add("银行汇款");
                // 支付流水号
                rowData.add("-");
                // 支付完成时间
                rowData.add(formatter.format(bills.get(i).get("pay_confirm_time")));
            }
        // 支付方式
        } else {
            rowData.add("银行汇款");
            // 支付流水号
            rowData.add("");
            // 支付完成时间
            rowData.add(formatter.format(bills.get(i).get("pay_confirm_time")));
        }
        // 是否需要开票
        if (bills.get(i).get("invoice") == null && bills.get(i).get("e_invoice") == null) {
            rowData.add("否");
            rowData.add("-");
        } else {
            rowData.add("是");
            // 发票类型
            if (bills.get(i).get("invoice") != null) {
                rowData.add("增值税普通发票");
            } else {
                rowData.add("增值税电子普通发票");
            }
        }
        fieldDatas.add(rowData);
    }
    return fieldDatas;
}
Also used : ArrayList(java.util.ArrayList) SimpleDateFormat(java.text.SimpleDateFormat) OnlinePay(com.itrus.portal.db.OnlinePay)

Example 25 with OnlinePay

use of com.itrus.portal.db.OnlinePay 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

OnlinePay (com.itrus.portal.db.OnlinePay)25 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)20 OnPayInfo (com.itrus.portal.db.OnPayInfo)12 Enterprise (com.itrus.portal.db.Enterprise)9 ExtraProduct (com.itrus.portal.db.ExtraProduct)9 UserInfo (com.itrus.portal.db.UserInfo)9 HttpSession (javax.servlet.http.HttpSession)8 Ereceipt (com.itrus.portal.db.Ereceipt)7 ExtraBill (com.itrus.portal.db.ExtraBill)7 ExtraProductSpec (com.itrus.portal.db.ExtraProductSpec)7 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 DigitalCert (com.itrus.portal.db.DigitalCert)6 PayInfo (com.itrus.portal.db.PayInfo)6 Product (com.itrus.portal.db.Product)6 PayConfig (com.itrus.portal.db.PayConfig)5 PayInfoExample (com.itrus.portal.db.PayInfoExample)5 ServiceProvider (com.itrus.portal.db.ServiceProvider)5 Transfer (com.itrus.portal.db.Transfer)5 Bill (com.itrus.portal.db.Bill)4