Commit e79c514d by unknown

add the commnuneguest price condition

parent f64ee4f5
...@@ -195,13 +195,13 @@ public class CourseResourceDao extends GenericHibernateDao<CourseResource, Integ ...@@ -195,13 +195,13 @@ public class CourseResourceDao extends GenericHibernateDao<CourseResource, Integ
return false; return false;
return true; return true;
} }
public List<Integer> checkEventActivityValidResource(int productId, int teetime, Date playDate, Double communePrice) { public List<Integer> checkEventActivityValidResource(int productId, int teetime, Date playDate, Double communePrice, Double guestPrice) {
String dateStr = DateUtil.getDateStr(playDate); String dateStr = DateUtil.getDateStr(playDate);
String sql = "select cr.ID from prd_courseResource as cr, prd_resourceprice as rp where cr.productId = " String sql = "select cr.ID from prd_courseResource as cr, prd_resourceprice as rp where cr.productId = "
+ productId + " and cr.teeTime="+teetime + productId + " and cr.teeTime="+teetime
+ " and cr.status != " + " and cr.status != "
+ CourseResourceStatusEnum.INVALID.getValue() + CourseResourceStatusEnum.INVALID.getValue()
+ " and cr.id = rp.ResourceID " + " and rp.priceDate = \"" + dateStr + "\"" + " and rp.communePrice="+communePrice; + " and cr.id = rp.ResourceID " + " and rp.priceDate = \"" + dateStr + "\"" + " and rp.communePrice="+communePrice+" and rp.communeGuestPrice="+guestPrice;
List<Integer> list = this.getSession().createSQLQuery(sql).list(); List<Integer> list = this.getSession().createSQLQuery(sql).list();
return list; return list;
} }
......
...@@ -1060,7 +1060,7 @@ public class OpEventActivityOrderService ...@@ -1060,7 +1060,7 @@ public class OpEventActivityOrderService
String[] teetimes = newTeeTime.split(":"); String[] teetimes = newTeeTime.split(":");
if(teetimes != null && teetimes.length ==2 ){ if(teetimes != null && teetimes.length ==2 ){
int groupNum = Integer.valueOf(teetimes[0])*60 + Integer.valueOf(teetimes[1]); int groupNum = Integer.valueOf(teetimes[0])*60 + Integer.valueOf(teetimes[1]);
List<Integer> resourceIds = this.courseResourceService.getResourceByTeeTimeAndDate(orderProcessBean.getProductId(), groupNum, orderItem.getPlayDate(), orderItem.getCommunePrice()); List<Integer> resourceIds = this.courseResourceService.getResourceByTeeTimeAndDate(orderProcessBean.getProductId(), groupNum, orderItem.getPlayDate(), orderItem.getCommunePrice(), orderItem.getCommuneGuestPrice());
if(resourceIds != null && resourceIds.size() > 0){ if(resourceIds != null && resourceIds.size() > 0){
orderProcessBean.setProcessDesc(desc.toString()); orderProcessBean.setProcessDesc(desc.toString());
Integer oldResourceId = orderItem.getResourceId(); Integer oldResourceId = orderItem.getResourceId();
......
...@@ -1311,8 +1311,8 @@ public class CourseResourceService extends ...@@ -1311,8 +1311,8 @@ public class CourseResourceService extends
*add by caosy: get the resource by teetime *add by caosy: get the resource by teetime
* *
* */ * */
public List<Integer> getResourceByTeeTimeAndDate(int productId, int teetime, Date playDate, Double communePrice){ public List<Integer> getResourceByTeeTimeAndDate(int productId, int teetime, Date playDate, Double communePrice, Double guestPrice){
return this.courseResourceDao.checkEventActivityValidResource(productId, teetime, playDate, communePrice); return this.courseResourceDao.checkEventActivityValidResource(productId, teetime, playDate, communePrice, guestPrice);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment