Search in sources :

Example 6 with PayConfig

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

the class PayConfigController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    PayConfig payconfig = sqlSession.selectOne("com.itrus.portal.db.PayConfigMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("payconfig", payconfig);
    return "payconfig/show";
}
Also used : PayConfig(com.itrus.portal.db.PayConfig) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with PayConfig

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

the class PayConfigController method delete.

// 删除
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
@ResponseBody
public String delete(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
    PayConfig payconfig = sqlSession.selectOne("com.itrus.portal.db.PayConfigMapper.selectByPrimaryKey", id);
    if (payconfig == null) {
        // uiModel.addAttribute("message", "未找到要删除快递");
        return "未找到要删除的支付配置";
    } else {
        try {
            sqlSession.delete("com.itrus.portal.db.PayConfigMapper.deleteByPrimaryKey", id);
            String oper = "删除第三方支付配置";
            String info = "支付配置的ID: " + payconfig.getId();
            LogUtil.adminlog(sqlSession, oper, info);
        } catch (Exception e) {
            /*uiModel.addAttribute("message", "要删除快递【" + ukey.getName()
						+ "】存在关联,无法删除");*/
            return "要删除的支付配置【" + payconfig.getName() + "】存在关联,无法删除";
        }
    }
    return null;
}
Also used : PayConfig(com.itrus.portal.db.PayConfig) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 8 with PayConfig

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

the class PayConfigController method update.

// 修改处理
@RequestMapping(method = RequestMethod.PUT, produces = "text/html")
public String update(@Valid PayConfig payconfig, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
        uiModel.addAttribute("payconfig", payconfig);
        return "payconfig/update";
    }
    PayConfig payconfig0 = sqlSession.selectOne("com.itrus.portal.db.PayConfigMapper.selectByPrimaryKey", payconfig.getId());
    payconfig.setCreator(payconfig0.getCreator());
    payconfig.setCreateTime(payconfig0.getCreateTime());
    payconfig.setModifyTime(new Date());
    payconfig.setModifier(getAdmin().getId());
    sqlSession.update("com.itrus.portal.db.PayConfigMapper.updateByPrimaryKey", payconfig);
    String oper = "修改第三方支付配置";
    String info = "支付配置名称: " + payconfig.getName();
    LogUtil.adminlog(sqlSession, oper, info);
    return "redirect:/payconfig/" + payconfig.getId();
}
Also used : PayConfig(com.itrus.portal.db.PayConfig) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 9 with PayConfig

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

the class PayConfigController method updateForm.

// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) {
    PayConfig payconfig = sqlSession.selectOne("com.itrus.portal.db.PayConfigMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("payconfig", payconfig);
    return "payconfig/update";
}
Also used : PayConfig(com.itrus.portal.db.PayConfig) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with PayConfig

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

the class ClientPayWebController method notifyUrl.

/**
 * 客户服务器回调页面
 *
 * @param request
 * @param response
 * @return
 */
@RequestMapping(value = "/notifyUrl")
@ResponseBody
public Map<String, String> notifyUrl(HttpServletRequest request, HttpServletResponse response, String code, String message, String payType, String orderId, String transactionId, String totalFee, String payTime, String sign, String appId) {
    try {
        log.error("[notify]{}", orderId + code + message + appId);
        SortedMap<String, String> sortMap = new TreeMap<String, String>();
        sortMap.put("code", code);
        sortMap.put("message", message);
        sortMap.put("appId", appId);
        sortMap.put("payType", payType);
        sortMap.put("orderId", orderId);
        sortMap.put("transactionId", transactionId);
        sortMap.put("totalFee", totalFee);
        sortMap.put("payTime", payTime);
        // TODO appId
        PayConfig payConfig = getPayConfig(appId);
        String mySign = SignUtil.createSign(sortMap, payConfig.getSecretKey());
        Map<String, String> returnMap = new HashMap<String, String>();
        if (!mySign.equals(sign)) {
            returnMap.put("code", ERROR);
            returnMap.put("message", "验证签名失败");
            return returnMap;
        }
        updatePayInfo(orderId, payConfig.getId(), transactionId, payType, payTime);
        returnMap.put("code", SUCCESS);
        return returnMap;
    } catch (Exception e) {
        LogUtil.syslog(sqlSession, "在线支付", orderId + "回调错误:" + code + message + e.toString());
        e.printStackTrace();
    }
    return null;
}
Also used : PayConfig(com.itrus.portal.db.PayConfig) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

PayConfig (com.itrus.portal.db.PayConfig)13 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 OnlinePay (com.itrus.portal.db.OnlinePay)5 PayConfigExample (com.itrus.portal.db.PayConfigExample)4 HashMap (java.util.HashMap)4 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 Bill (com.itrus.portal.db.Bill)2 OnlinePayExample (com.itrus.portal.db.OnlinePayExample)2 Transfer (com.itrus.portal.db.Transfer)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 TreeMap (java.util.TreeMap)2 HttpSession (javax.servlet.http.HttpSession)2 BillExample (com.itrus.portal.db.BillExample)1 DigitalCert (com.itrus.portal.db.DigitalCert)1 Enterprise (com.itrus.portal.db.Enterprise)1 EnterpriseQq (com.itrus.portal.db.EnterpriseQq)1 EnterpriseQqExample (com.itrus.portal.db.EnterpriseQqExample)1 ExtraBill (com.itrus.portal.db.ExtraBill)1 ExtraProduct (com.itrus.portal.db.ExtraProduct)1