use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class BillServiceImpl method getBillByBillId.
/**
* 根据用户证书id,获取对应的解锁订单,只获取最新的一张
* @param billId
* @return
*/
public Bill getBillByBillId(String billId) {
Bill bill = null;
BillExample example = new BillExample();
example.or().andBillIdEqualTo(billId);
example.setLimit(1);
example.setOrderByClause("create_time desc");
bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByExample", example);
return bill;
}
use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class BillServiceImpl method getBillByOrderNumber.
/**
* 根据申请流水号获取对面bill
* @param orderNumber
* @return
*/
public Bill getBillByOrderNumber(String orderNumber) {
BillExample billExample = new BillExample();
BillExample.Criteria criteria = billExample.or();
criteria.andOrderNumberEqualTo(orderNumber);
return sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByExample", billExample);
}
use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class BillServiceImpl method hasAuthticationLevel.
/**
* 判断该用户,该企业,该项目,已经通过了实名认证
* @param userInfoId
* @param enterpriseId
* @param projectId
* @return
*/
public List<Bill> hasAuthticationLevel(Long userInfoId, Long enterpriseId, Long projectId) {
boolean flag = false;
if (null == userInfoId || null == enterpriseId || null == projectId) {
return null;
}
BillExample billExample = new BillExample();
BillExample.Criteria criteria = billExample.or();
criteria.andUniqueIdEqualTo(userInfoId);
criteria.andEnterpriseEqualTo(enterpriseId);
criteria.andProjectEqualTo(projectId);
List<Integer> billStatus = new ArrayList<>();
billStatus.add(ComNames.BILL_STATUS_5);
billStatus.add(ComNames.BILL_STATUS_6);
billStatus.add(ComNames.BILL_STATUS_7);
billStatus.add(ComNames.BILL_STATUS_8);
billStatus.add(ComNames.BILL_STATUS_12);
billStatus.add(ComNames.BILL_STATUS_13);
criteria.andBillStatusIn(billStatus);
billExample.setOrderByClause("create_time desc");
List<Bill> bills = getBillsByExample(billExample);
return bills;
}
use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class SubmitReviewServiceImpl method getAuditBill.
/**
* 根据产品list 获取需要送审的订单(状态为3已支付,待审核 的所有订单list)
*
* @param productList
* @return
*/
public Map<Long, List<Bill>> getAuditBill(List<Product> productList) {
Map<Long, List<Bill>> billListMap = new HashMap<Long, List<Bill>>();
if (null != productList && !productList.isEmpty()) {
for (Product product : productList) {
BillExample example = new BillExample();
BillExample.Criteria criteria = example.or();
criteria.andProductEqualTo(product.getId());
criteria.andBillStatusEqualTo(ComNames.BILL_STATUS_3);
// 时间逆序排列
example.setOrderByClause("create_time asc");
List<Bill> billList = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByExample", example);
if (null != billList && !billList.isEmpty()) {
billListMap.put(product.getId(), billList);
}
}
}
return billListMap;
}
use of com.itrus.portal.db.BillExample in project portal by ixinportal.
the class SendReNewInfoTask method sendReNewInfo.
/**
* 心跳更新。启动时执行一次,之后每隔24小时执行一次
*/
@Scheduled(fixedRate = 1000 * 60 * 60 * 24)
public void sendReNewInfo() {
// 筛选出所有是待更新的,而且未发送短信的订单
BillExample billExample = new BillExample();
BillExample.Criteria criteria = billExample.or();
// 订单状态是12的时候,表示是待更新的订单
criteria.andBillStatusEqualTo(ComNames.BILL_STATUS_12);
// 订单的短信发送时间是Null的时候,表示未发送过通知短信
criteria.andRenewSendTimeIsNull();
criteria.andIsDeleteEqualTo(false);
// billExample.setLimit(100);
List<Bill> bills = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByExample", billExample);
if (null == bills || bills.size() < 1) {
return;
}
String billSn = "";
String mPhone = "";
try {
// 向每个订单发送短信通知
for (int i = 0; i < bills.size(); i++) {
billSn = bills.get(i).getBillId();
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bills.get(i).getUniqueId());
mPhone = userInfo.getmPhone();
UserCertExample userCertExample = new UserCertExample();
UserCertExample.Criteria ucriteria = userCertExample.or();
ucriteria.andIdEqualTo(bills.get(i).getOldUserCert());
UserCert userCert = sqlSession.selectOne("com.itrus.portal.db.UserCertMapper.selectByExample", userCertExample);
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bills.get(i).getEnterprise());
Long projectId = bills.get(i).getProject();
String keySn = "";
if (null == userCert.getKeySn()) {
keySn = "该证书未绑定key";
} else {
keySn = userCert.getKeySn();
}
String enterpriseName = enterprise.getEnterpriseName();
Date endTime = userCert.getCertEndTime();
// 获取订单对应的产品信息
Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bills.get(i).getProduct());
String productName = product.getName();
try {
makeCerServiceImpl.sendReNewInfo(bills.get(i), mPhone, projectId, "ZSGX", keySn, enterpriseName, endTime, productName);
} catch (UserInfoServiceException e) {
String type = "发送证书更新通知失败";
String info = "用户手机号:" + mPhone + ",订单号" + bills.get(i).getBillId() + "错误信息:" + e.getMessage();
LogUtil.syslog(sqlSession, type, info);
log.error("ERRORLOG证书更新通知 {}", info);
return;
} catch (Exception e) {
String type = "发送证书更新通知失败";
String info = "用户手机号:" + mPhone + ",订单号" + bills.get(i).getBillId() + "错误信息:" + e.getMessage();
LogUtil.syslog(sqlSession, type, info);
log.error("ERRORLOG证书更新通知 {}", info);
return;
}
}
} catch (Exception e) {
String type = "发送证书更新通知失败";
String info = "用户手机号:" + mPhone + ",订单号" + billSn + "错误信息:" + e.getMessage();
LogUtil.syslog(sqlSession, type, info);
log.error("ERRORLOG证书更新通知 {}", info);
return;
}
}
Aggregations