use of com.ikoori.vip.common.persistence.model.RedpackLog in project vip by guangdada.
the class RedpackLogController method redpackLogUpdate.
/**
* 跳转到修改红包记录
*/
@RequestMapping("/redpackLog_update/{redpackLogId}")
@Permission
public String redpackLogUpdate(@PathVariable Long redpackLogId, Model model) {
RedpackLog redpackLog = redpackLogService.selectById(redpackLogId);
model.addAttribute(redpackLog);
return PREFIX + "redpackLog_edit.html";
}
use of com.ikoori.vip.common.persistence.model.RedpackLog in project vip by guangdada.
the class RedpackLogServiceImpl method saveRedPackLog.
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void saveRedPackLog(int amount, String unionid, String openid, String ip, Long merchantId, Long redpackId, String actName, String remark, String wishing) {
log.info("进入saveRedPackLog>>amount = " + amount);
log.info("进入saveRedPackLog>>unionid = " + unionid);
log.info("进入saveRedPackLog>>openid = " + openid);
log.info("进入saveRedPackLog>>ip = " + ip);
log.info("进入saveRedPackLog>>merchantId = " + merchantId);
log.info("进入saveRedPackLog>>redpackId = " + redpackId);
log.info("进入saveRedPackLog>>actName = " + actName);
log.info("进入saveRedPackLog>>remark = " + remark);
log.info("进入saveRedPackLog>>wishing = " + wishing);
log.info("进入saveRedPackLog>>certPath = " + gunsProperties.getCertPath());
if (!gunsProperties.getRedpackFlag()) {
log.info("发送红包开关没有打开");
return;
}
String billno = "kryhb" + new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(new Date());
RedPackResData rprd = RedPackUtil.redPackSend(amount, actName, remark, wishing, openid, billno, gunsProperties.getCertPath());
// 通信成功则记录发送日志
if (rprd != null && "SUCCESS".equals(rprd.getReturn_code())) {
RedpackLog log = new RedpackLog();
log.setBillno(billno);
log.setIp(ip);
log.setRedpackId(redpackId);
log.setMerchantId(merchantId);
log.setUnionid(unionid);
log.setReason(rprd.getErr_code_des());
log.setSendAmount(amount);
if ("SUCCESS".equals(rprd.getErr_code())) {
log.setSendStatus(RedPackSendStatus.SENDING.getCode());
} else {
log.setSendStatus(RedPackSendStatus.FAILED.getCode());
}
redpackLogMapper.insert(log);
// 修改发放信息
redpackDao.updateSendInfo(amount, redpackId);
}
}
use of com.ikoori.vip.common.persistence.model.RedpackLog in project vip by guangdada.
the class RedpackQueryJob method scheduler.
// 每小时执行一次
@Scheduled(cron = "0 0 0/1 * * ?")
public void scheduler() {
log.info(">>>>>>>>>>>>> 同步红包数据开始 ... " + DateUtil.getDayTime());
List<RedpackLog> rs = redpackService.selectBySendStatus(RedPackSendStatus.SENDING.getCode());
if (CollectionUtils.isNotEmpty(rs)) {
for (RedpackLog redpackLog : rs) {
try {
redpackService.updateRedPackLog(redpackLog);
} catch (Exception e) {
log.error("同步红包数据异常:", e);
}
}
}
log.info(">>>>>>>>>>>>> 同步红包数据结束... " + DateUtil.getDayTime());
}
Aggregations