use of com.itrus.portal.db.Bill in project portal by ixinportal.
the class BillServiceImpl method getBillByUnlockUserCertId.
/**
* 根据用户证书id,获取对应的解锁订单,只获取最新的一张
* @param userCertId
* @return
*/
public Bill getBillByUnlockUserCertId(Long userCertId) {
Bill bill = null;
BillExample example = new BillExample();
example.or().andUnlockUserCertEqualTo(userCertId);
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.Bill in project portal by ixinportal.
the class BillServiceImpl method getProductMapByBills.
/**
* 根据订单list获取对应产品Map
*
* @param bills
* @return
*/
public Map<Long, Product> getProductMapByBills(List<Bill> bills) {
Map<Long, Product> productMap = new HashMap<Long, Product>();
List<Long> productIds = new ArrayList<Long>();
for (Bill bill : bills) {
productIds.add(bill.getProduct());
}
if (!productIds.isEmpty()) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andIdIn(productIds);
productMap = sqlSession.selectMap("com.itrus.portal.db.ProductMapper.selectByExample", example, "id");
}
return productMap;
}
use of com.itrus.portal.db.Bill in project portal by ixinportal.
the class BillServiceImpl method getBillWaitingForUnlock.
/**
* 根据用户证书id,获取对应的解锁订单,只获取最新的一张,且订单状态是提交到已解锁待开票
* @param userCertId
* @return
*/
public Bill getBillWaitingForUnlock(Long userCertId) {
List<Integer> status = new ArrayList<>();
status.add(ComNames.BILL_STATUS_1);
status.add(ComNames.BILL_STATUS_2);
status.add(ComNames.BILL_STATUS_11);
status.add(ComNames.BILL_STATUS_14);
status.add(ComNames.BILL_STATUS_15);
status.add(ComNames.BILL_STATUS_16);
status.add(ComNames.BILL_STATUS_17);
Bill bill = null;
BillExample example = new BillExample();
example.or().andUnlockUserCertEqualTo(userCertId).andBillStatusIn(status);
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.Bill in project portal by ixinportal.
the class BillServiceImpl method getEnterpriseMapByBills.
/**
* 根据订单list获取对应的企业Map
*
* @param bills
* @return
*/
public Map<Long, Enterprise> getEnterpriseMapByBills(List<Bill> bills) {
Map<Long, Enterprise> enterpriseMap = new HashMap<Long, Enterprise>();
List<Long> enterpriseIds = new ArrayList<Long>();
for (Bill bill : bills) {
enterpriseIds.add(bill.getEnterprise());
}
if (!enterpriseIds.isEmpty()) {
EnterpriseExample example = new EnterpriseExample();
EnterpriseExample.Criteria criteria = example.or();
criteria.andIdIn(enterpriseIds);
enterpriseMap = sqlSession.selectMap("com.itrus.portal.db.EnterpriseMapper.selectByExample", example, "id");
}
return enterpriseMap;
}
use of com.itrus.portal.db.Bill in project portal by ixinportal.
the class BillServiceImpl method getProjectByBillId.
/**
* 根据订单ID查找出对应的project
*
* @param billId
* @return
*/
public Project getProjectByBillId(Long billId) {
Bill bill = getBill(billId);
Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
return project;
}
Aggregations