public int baseUpdateMchNotifyFail(String orderId, String result, byte notifyCount) { MchNotify mchNotify = new MchNotify(); mchNotify.setStatus(PayConstant.MCH_NOTIFY_STATUS_FAIL); mchNotify.setResult(result); mchNotify.setNotifyCount(notifyCount); mchNotify.setLastNotifyTime(new Date()); MchNotifyExample example = new MchNotifyExample(); MchNotifyExample.Criteria criteria = example.createCriteria(); criteria.andOrderIdEqualTo(orderId); List values = new LinkedList<>(); values.add(PayConstant.MCH_NOTIFY_STATUS_NOTIFYING); values.add(PayConstant.MCH_NOTIFY_STATUS_FAIL); return mchNotifyMapper.updateByExampleSelective(mchNotify, example); }
public int baseUpdateMchNotifySuccess(String orderId, String result, byte notifyCount) { MchNotify mchNotify = new MchNotify(); mchNotify.setStatus(PayConstant.MCH_NOTIFY_STATUS_SUCCESS); mchNotify.setResult(result); mchNotify.setNotifyCount(notifyCount); mchNotify.setLastNotifyTime(new Date()); MchNotifyExample example = new MchNotifyExample(); MchNotifyExample.Criteria criteria = example.createCriteria(); criteria.andOrderIdEqualTo(orderId); List values = new LinkedList<>(); values.add(PayConstant.MCH_NOTIFY_STATUS_NOTIFYING); values.add(PayConstant.MCH_NOTIFY_STATUS_FAIL); criteria.andStatusIn(values); return mchNotifyMapper.updateByExampleSelective(mchNotify, example); }
@RequestMapping("/view.html") public String viewInput(String orderId, ModelMap model) { MchNotify item = null; if(StringUtils.isNotBlank(orderId)) { item = mchNotifyService.selectMchNotify(orderId); } if(item == null) { item = new MchNotify(); model.put("item", item); return "mch_notify/view"; } JSONObject object = (JSONObject) JSON.toJSON(item); if(item.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(item.getCreateTime())); if(item.getUpdateTime() != null) object.put("updateTime", DateUtil.date2Str(item.getUpdateTime())); if(item.getLastNotifyTime() != null) object.put("lastNotifyTime", DateUtil.date2Str(item.getLastNotifyTime())); model.put("item", object); return "mch_notify/view"; }
public int baseInsertMchNotify(String orderId, String mchId, String mchOrderNo, String orderType, String notifyUrl) { MchNotify mchNotify = new MchNotify(); mchNotify.setOrderId(orderId); mchNotify.setMchId(mchId); mchNotify.setMchOrderNo(mchOrderNo); mchNotify.setOrderType(orderType); mchNotify.setNotifyUrl(notifyUrl); return mchNotifyMapper.insertSelectiveOnDuplicateKeyUpdate(mchNotify); }