use of com.itrus.portal.db.PayConfig in project portal by ixinportal.
the class PayExtraBillWebController 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);
// 本方的订单id
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;
}
// 可以在这里做处理.判断返回的订单号是属于哪种类型的订单.如果是TWCX,则按照原来处理,如果是TWEB,则表示是新的订单.进入新的订单处理流程
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;
}
use of com.itrus.portal.db.PayConfig in project portal by ixinportal.
the class TransferController method list.
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "message", required = false) Integer message, @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "page2", required = false) Integer page2, @RequestParam(value = "size2", required = false) Integer size2, Model uiModel) throws Exception {
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
// count,pages
Integer count = sqlSession.selectOne("com.itrus.portal.db.TransferMapper.countByExample", null);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
// query data
Integer offset = size * (page - 1);
TransferExample transferex = new TransferExample();
// projectex.or().andIdIsNotNull();
transferex.setOffset(offset);
transferex.setLimit(size);
List transferall = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", transferex);
uiModel.addAttribute("transfers", transferall);
// itemcount
uiModel.addAttribute("itemcount", transferall.size());
uiModel.addAttribute("message", message == null ? "" : "要删除的发票存在关联,无法删除");
// page,size
if (page2 == null || page2 < 1)
page2 = 1;
if (size2 == null || size2 < 1)
size2 = 10;
// count,pages
Integer count2 = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.countByExample", null);
uiModel.addAttribute("count2", count2);
uiModel.addAttribute("pages2", (count2 + size2 - 1) / size2);
// page, size
if (page2 > 1 && size2 * (page2 - 1) >= count2) {
page2 = (count2 + size2 - 1) / size;
}
uiModel.addAttribute("page2", page2);
uiModel.addAttribute("size2", size2);
// query data
Integer offset2 = size2 * (page2 - 1);
OnlinePayExample onlinepayex = new OnlinePayExample();
// projectex.or().andIdIsNotNull();
onlinepayex.setOffset(offset2);
onlinepayex.setLimit(size2);
List onlinepayexall = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectOnlinePays", onlinepayex);
uiModel.addAttribute("onlinepays", onlinepayexall);
PayConfigExample payconfigex = new PayConfigExample();
Map<Long, PayConfig> payconfigmap = sqlSession.selectMap("com.itrus.portal.db.PayConfigMapper.selectByExample", payconfigex, "id");
uiModel.addAttribute("payconfigmap", payconfigmap);
// itemcount
uiModel.addAttribute("itemcount", onlinepayexall.size());
uiModel.addAttribute("message", message == null ? "" : "要删除的发票存在关联,无法删除");
uiModel.addAttribute("status", status);
return "transfer/list";
}
use of com.itrus.portal.db.PayConfig in project portal by ixinportal.
the class TransferController method updateZxzfForm.
// 返回在线支付修改页面
@RequestMapping(value = "/zxzf/{id}", params = "form", produces = "text/html")
public String updateZxzfForm(@PathVariable("id") Long id, Model uiModel) {
OnlinePay onlinepay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", id);
List<PayConfig> payconfig = sqlSession.selectList("com.itrus.portal.db.PayConfigMapper.selectByExample");
uiModel.addAttribute("payconfigs", payconfig);
uiModel.addAttribute("onlinepay", onlinepay);
return "transfer/updatezxzf";
}
use of com.itrus.portal.db.PayConfig in project portal by ixinportal.
the class TransferController method showzxzf.
// 显示在线支付详情
@RequestMapping(value = "/zxzf/{id}", produces = "text/html")
public String showzxzf(@PathVariable("id") Long id, Model uiModel) {
OnlinePay onlinepay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", id);
PayConfigExample payconfigex = new PayConfigExample();
Map<Long, PayConfig> payconfigmap = sqlSession.selectMap("com.itrus.portal.db.PayConfigMapper.selectByExample", payconfigex, "id");
uiModel.addAttribute("payconfigmap", payconfigmap);
uiModel.addAttribute("onlinepay", onlinepay);
return "transfer/showzxzf";
}
use of com.itrus.portal.db.PayConfig in project portal by ixinportal.
the class PayConfigController method list.
// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "message", required = false) Integer message, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
// count,pages
Integer count = sqlSession.selectOne("com.itrus.portal.db.PayConfigMapper.countByExample", null);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
// query data
Integer offset = size * (page - 1);
PayConfigExample payconfigex = new PayConfigExample();
// projectex.or().andIdIsNotNull();
payconfigex.setOffset(offset);
payconfigex.setLimit(size);
List<PayConfig> payconfigexall = sqlSession.selectList("com.itrus.portal.db.PayConfigMapper.selectByExample", payconfigex);
uiModel.addAttribute("payconfigs", payconfigexall);
// itemcount
uiModel.addAttribute("itemcount", payconfigexall.size());
uiModel.addAttribute("message", message == null ? "" : "要删除的支付配置存在关联,无法删除");
return "payconfig/list";
}
Aggregations