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";
}
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;
}
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();
}
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";
}
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;
}
Aggregations