for(int i=0;i<cardNum;i++){
FlowCard flowCard = new FlowCard();
flowCard.setCardBatchId(flowCardBatch.getBatchNo());
List cardList = flowCardDAO.queryFlowCard();
if(cardList.size()==0){
flowCard.setCardNumber(1000000000000001L);
}else{
FlowCard flowCardNum = flowCardDAO.queryCardMax();
flowCard.setCardNumber(flowCardNum.getCardNumber()+1);
}
flowCard.setBeginTime(flowCardBatch.getPeriodStart());
flowCard.setEndTime(flowCardBatch.getPeriodEnd());
flowCard.setLogTime(date1);
flowCard.setProductId(flowCardBatch.getProductId());
flowCard.setPrice(flowCardBatch.getPrice());
flowCard.setUserId(123);
flowCard.setState(0);
int sum = (int)((Math.random()*9+1)*100000000);
String str = sdf.format(new Date());
String cardPassword = str+""+sum;
flowCard.setCardPassword(cardPassword);
flowCardDAO.addFlowCard(flowCard);
}
FlowCard flowCard = new FlowCard();
flowCard.setCardBatchId(flowCardBatch.getBatchNo());
List cardList = flowCardDAO.queryFlowCard();
if(cardList.size()==0){
flowCard.setCardNumber(1000000000000001L);
}else{
FlowCard flowCardNum = flowCardDAO.queryCardMax();
flowCard.setCardNumber(flowCardNum.getCardNumber()+1);
}
flowCard.setBeginTime(flowCardBatch.getPeriodStart());
flowCard.setEndTime(flowCardBatch.getPeriodEnd());
flowCard.setLogTime(date1);
flowCard.setProductId(flowCardBatch.getProductId());
flowCard.setPrice(flowCardBatch.getPrice());
flowCard.setUserId(123);
flowCard.setState(0);
int sum = (int)((Math.random()*9+1)*100000000);
String str = sdf.format(new Date());
String cardPassword = str+""+sum;
flowCard.setCardPassword(cardPassword);
flowCardDAO.addFlowCard(flowCard);
}