use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class SendSMSSHJJTask method task.
@Scheduled(fixedRate = 1000 * 60 * 60 * 2)
public void task() {
// start------------处理双机互斥----------
if (null == taskFlag) {
taskFlag = systemConfigService.isTimedTaskHost();
}
if (taskFlag.equals(false)) {
return;
}
// end------------处理双机互斥----------
BillExample billExample = new BillExample();
BillExample.Criteria criteria = billExample.or();
// 订单状态是15的时候,表示是解锁审核拒绝的订单
criteria.andBillStatusEqualTo(ComNames.BILL_STATUS_15);
// 订单的短信发送时间是Null的时候,表示未发送过通知短信
criteria.andIsDeleteEqualTo(false);
criteria.andIsSmsEqualTo(false);
criteria.andSendTimeIsNull();
billExample.setLimit(20);
List<Bill> bills = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByExample", billExample);
Integer successNumer = 0;
for (Bill bill : bills) {
try {
if (reviewService.sendSmsBySHJJ(bill.getId())) {
// 修改订单
bill.setIsSms(true);
bill.setSendTime(new Date());
sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
successNumer++;
}
} catch (Exception e) {
LogUtil.syslog(sqlSession, "审核拒绝短信通知_解锁订单", "出现异常,异常信息:" + e.getMessage());
}
}
LogUtil.syslog(sqlSession, "审核拒绝短信通知_解锁订单", "本次发送成功:" + successNumer + ",条, 总计:" + (null == bills ? 0 : bills.size()) + "条");
}
Aggregations