SQL Group问题

This commit is contained in:
wanggeng 2022-11-23 18:51:44 +08:00
parent a4e04fb19e
commit 1f5b67b4f5
3 changed files with 102 additions and 90 deletions

View File

@ -175,7 +175,7 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
@Override @Override
public List<VenuesInfoDTO> listVenuesInfo(Map<String, Object> params) throws SearchException { public List<VenuesInfoDTO> listVenuesInfo(Map<String, Object> params) throws SearchException {
setDataAuthorityInfo(params); setDataAuthorityInfo(params);
params.put("creator",securityComponent.getCurrentUser().getUserId()); params.put("creator", securityComponent.getCurrentUser().getUserId());
return venuesInfoDao.listVenuesInfo(params); return venuesInfoDao.listVenuesInfo(params);
} }
@ -183,7 +183,7 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfo(ListPage page) throws SearchException { public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfo(ListPage page) throws SearchException {
setDataAuthorityInfo(page.getParams()); setDataAuthorityInfo(page.getParams());
String creator = securityComponent.getCurrentUser().getUserId(); String creator = securityComponent.getCurrentUser().getUserId();
page.getParams().put("creator",creator); page.getParams().put("creator", creator);
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<VenuesInfoDTO> venuesInfoDTOs = venuesInfoDao.listVenuesInfo(page.getParams()); List<VenuesInfoDTO> venuesInfoDTOs = venuesInfoDao.listVenuesInfo(page.getParams());
PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs); PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs);
@ -192,10 +192,10 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
@Override @Override
public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfoResources(ListPage page) { public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfoResources(ListPage page) {
PageHelper.startPage(page.getPage(),page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<VenuesInfoDTO> venuesInfoDTOs = venuesInfoDao.listVenuesInfo(page.getParams()); List<VenuesInfoDTO> venuesInfoDTOs = venuesInfoDao.listVenuesInfo(page.getParams());
PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs); PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs);
return new SuccessResultList<>(venuesInfoDTOs,pageInfo.getPageNum(),pageInfo.getTotal()); return new SuccessResultList<>(venuesInfoDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
} }
@Override @Override
@ -203,11 +203,11 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
String projectCategory = StringUtils.isEmpty(params.get("categoryId").toString()) ? "" : params.get("categoryId").toString(); String projectCategory = StringUtils.isEmpty(params.get("categoryId").toString()) ? "" : params.get("categoryId").toString();
String venueCity = StringUtils.isEmpty(params.get("cityId").toString()) ? "" : params.get("cityId").toString(); String venueCity = StringUtils.isEmpty(params.get("cityId").toString()) ? "" : params.get("cityId").toString();
String venueArea = StringUtils.isEmpty(params.get("areaId").toString()) ? "" : params.get("areaId").toString(); String venueArea = StringUtils.isEmpty(params.get("areaId").toString()) ? "" : params.get("areaId").toString();
params.put("projectCategory",projectCategory); params.put("projectCategory", projectCategory);
params.put("venueCity",venueCity); params.put("venueCity", venueCity);
params.put("venueArea",venueArea); params.put("venueArea", venueArea);
List<VenuesInfoDTO> list = venuesInfoDao.listVenuesByKeyWords(params); List<VenuesInfoDTO> list = venuesInfoDao.listVenuesByKeyWords(params);
for (VenuesInfoDTO item : list){ for (VenuesInfoDTO item : list) {
item.setVenuePanorama(item.getVenuePanorama().split(",")[0]); item.setVenuePanorama(item.getVenuePanorama().split(",")[0]);
} }
return new SuccessResultData(list); return new SuccessResultData(list);
@ -215,59 +215,59 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
@Override @Override
public Object getVenuesDetailById(String token, Map<String, Object> params) throws SearchException { public Object getVenuesDetailById(String token, Map<String, Object> params) throws SearchException {
Map<String,Object> result = getHashMap(0); Map<String, Object> result = getHashMap(0);
if(StringUtils.isEmpty(params.get("venuesInfoId").toString())){ if (StringUtils.isEmpty(params.get("venuesInfoId").toString())) {
return result; return result;
} }
//场馆列表 //场馆列表
Map<String,Object> venuesInfo = venuesInfoDao.getVenuesInfoForWeChatProgram(params); Map<String, Object> venuesInfo = venuesInfoDao.getVenuesInfoForWeChatProgram(params);
if (venuesInfo != null && venuesInfo.size() > 0){ if (venuesInfo != null && venuesInfo.size() > 0) {
venuesInfo.put("venueBanner",venuesInfo.get("venueBanner").toString().replaceAll(",",",")); venuesInfo.put("venueBanner", venuesInfo.get("venueBanner").toString().replaceAll(",", ","));
} }
result.put("venueInfo",venuesInfo); result.put("venueInfo", venuesInfo);
//所有项目 //所有项目
List<Map<String,Object>> projectList = venuesProjectDao.listVenuesProjectForWeChatProgram(params); List<Map<String, Object>> projectList = venuesProjectDao.listVenuesProjectForWeChatProgram(params);
result.put("projectList",projectList); result.put("projectList", projectList);
return result; return result;
} }
@Override @Override
public Map<String, Object> getVenuesProjectDetailById(String token, Map<String, Object> params) { public Map<String, Object> getVenuesProjectDetailById(String token, Map<String, Object> params) {
Map<String,Object> result = getHashMap(0); Map<String, Object> result = getHashMap(0);
if(StringUtils.isEmpty(params.get("venuesProjectId").toString())){ if (StringUtils.isEmpty(params.get("venuesProjectId").toString())) {
return result; return result;
} }
VenuesProjectDTO venuesProjectDTO = venuesProjectDao.getVenuesProjectDetailById(params); VenuesProjectDTO venuesProjectDTO = venuesProjectDao.getVenuesProjectDetailById(params);
result.put("venuesProjectInfo",venuesProjectDTO); result.put("venuesProjectInfo", venuesProjectDTO);
//返回近三天的预定状态 //返回近三天的预定状态
List<Map<String, Object>> dayList = new ArrayList<>(0); List<Map<String, Object>> dayList = new ArrayList<>(0);
SimpleDateFormat sf = new SimpleDateFormat("M月d日"); SimpleDateFormat sf = new SimpleDateFormat("M月d日");
String[] dayGroup = new String[]{DateUtil.getTime(),DateUtil.getAfterDayDate("1"),DateUtil.getAfterDayDate("2")}; String[] dayGroup = new String[]{DateUtil.getTime(), DateUtil.getAfterDayDate("1"), DateUtil.getAfterDayDate("2")};
for (int i = 0; i < dayGroup.length;i++) { for (int i = 0; i < dayGroup.length; i++) {
Map<String, Object> dayMap = getHashMap(0); Map<String, Object> dayMap = getHashMap(0);
dayMap.put("week",DateUtil.getAfterDayWeek(i + "")); dayMap.put("week", DateUtil.getAfterDayWeek(i + ""));
dayMap.put("dateFormat",sf.format(DateUtil.fomatDate(dayGroup[i]))); dayMap.put("dateFormat", sf.format(DateUtil.fomatDate(dayGroup[i])));
dayMap.put("date",dayGroup[i].substring(0,10)); dayMap.put("date", dayGroup[i].substring(0, 10));
//判断是否可以预订 //判断是否可以预订
dayMap.put("bookingType","true"); dayMap.put("bookingType", "true");
if(i == 0){ if (i == 0) {
dayMap.put("week","今天"); dayMap.put("week", "今天");
} }
dayList.add(dayMap); dayList.add(dayMap);
} }
result.put("dayList",dayList); result.put("dayList", dayList);
return result; return result;
} }
@Override @Override
public Object getCityInfoByName(Map<String, Object> param) throws SearchException { public Object getCityInfoByName(Map<String, Object> param) throws SearchException {
String cityName = StringUtils.isEmpty(param.get("cityName").toString()) ? "" : param.get("cityName").toString(); String cityName = StringUtils.isEmpty(param.get("cityName").toString()) ? "" : param.get("cityName").toString();
param.put("cityName",cityName); param.put("cityName", cityName);
return venuesInfoDao.getCityInfoByName(param); return venuesInfoDao.getCityInfoByName(param);
} }
@Override @Override
public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfoFroApp(String token,ListPage page) throws SearchException { public SuccessResultList<List<VenuesInfoDTO>> listPageVenuesInfoFroApp(String token, ListPage page) throws SearchException {
Map<String, Object> params = page.getParams(); Map<String, Object> params = page.getParams();
List<VenuesInfoDTO> venuesInfoDTOs; List<VenuesInfoDTO> venuesInfoDTOs;
@ -277,38 +277,34 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
// end // end
orderKye = orderKye.trim(); orderKye = orderKye.trim();
Point myPoint = setPoint(params); Point myPoint = setPoint(params);
//如果传入的定位来自于腾讯地图需要转换否则会导致距离计算出现1公里左右偏差 //如果传入的定位来自于腾讯地图需要转换否则会导致距离计算出现1公里左右偏差
String selfLocation = params.get("selfLocation") == null ? "" : params.get("selfLocation").toString(); String selfLocation = params.get("selfLocation") == null ? "" : params.get("selfLocation").toString();
//String selfLocation = StringUtils.isEmpty(params.get("selfLocation").toString()) ? "" : params.get("selfLocation").toString(); //String selfLocation = StringUtils.isEmpty(params.get("selfLocation").toString()) ? "" : params.get("selfLocation").toString();
if(MAP_TYPE_TX.equals(selfLocation) if (MAP_TYPE_TX.equals(selfLocation)
&& myPoint.getX() == 0 && myPoint.getX() == 0
&& myPoint.getY() == 0){ && myPoint.getY() == 0) {
MapLocationTransformUtil util = new MapLocationTransformUtil(); MapLocationTransformUtil util = new MapLocationTransformUtil();
myPoint = util.map_tx2bd(myPoint); myPoint = util.map_tx2bd(myPoint);
} }
//按热度查询 //按热度查询
if(VENUE_SEARCH_HOT.equals(orderKye)){ if (VENUE_SEARCH_HOT.equals(orderKye)) {
//TODO 访问量功能实现后添加 //TODO 访问量功能实现后添加
} }
//根据定位排序 //根据定位排序
if(VENUE_SEARCH_APART.equals(orderKye)){ if (VENUE_SEARCH_APART.equals(orderKye)) {
VenuesListSingleData venuesListSingleData = VenuesListSingleData.getInstance(); VenuesListSingleData venuesListSingleData = VenuesListSingleData.getInstance();
//venuesInfoDTOs = venuesListSingleData.getVenuesList(venuesInfoDao,params); //venuesInfoDTOs = venuesListSingleData.getVenuesList(venuesInfoDao,params);
venuesInfoDTOs = venuesInfoDao.listVenuesByKeyWords(params); venuesInfoDTOs = venuesInfoDao.listVenuesByKeyWords(params);
formatPosition(myPoint,venuesInfoDTOs); formatPosition(myPoint, venuesInfoDTOs);
pointListCompareToAse(venuesInfoDTOs); pointListCompareToAse(venuesInfoDTOs);
List<VenuesInfoDTO> subList = venuesInfoDTOs.subList(0,venuesInfoDTOs.size() > 10 ? 10 : venuesInfoDTOs.size()); List<VenuesInfoDTO> subList = venuesInfoDTOs.subList(0, venuesInfoDTOs.size() > 10 ? 10 : venuesInfoDTOs.size());
return new SuccessResultList<>(subList, page.getPage(), Long.parseLong(subList.size()+ "")); return new SuccessResultList<>(subList, page.getPage(), Long.parseLong(subList.size() + ""));
} }
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
venuesInfoDTOs = venuesInfoDao.listVenuesByKeyWords(page.getParams()); venuesInfoDTOs = venuesInfoDao.listVenuesByKeyWords(page.getParams());
formatPosition(myPoint,venuesInfoDTOs); formatPosition(myPoint, venuesInfoDTOs);
PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs); PageInfo<VenuesInfoDTO> pageInfo = new PageInfo<>(venuesInfoDTOs);
return new SuccessResultList<>(venuesInfoDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(venuesInfoDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
} }
@ -319,17 +315,17 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
List<VenuesInfoMiniAppVO> venuesInfoMiniAppVOS; List<VenuesInfoMiniAppVO> venuesInfoMiniAppVOS;
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
venuesInfoMiniAppVOS = venuesInfoDao.listPageVenuesInfoApp(params); venuesInfoMiniAppVOS = venuesInfoDao.listPageVenuesInfoApp(params);
for (VenuesInfoMiniAppVO item : venuesInfoMiniAppVOS){ for (VenuesInfoMiniAppVO item : venuesInfoMiniAppVOS) {
//查询区域名 //查询区域名
AreaDTO areaDTO = dataAreaService.get(item.getVenueArea()); AreaDTO areaDTO = dataAreaService.get(item.getVenueArea());
item.setVenueArea(areaDTO.getAreaName()); item.setVenueArea(areaDTO.getAreaName());
//查询项目 //查询项目
params.put("venuesInfoId",item.getVenuesInfoId()); params.put("venuesInfoId", item.getVenuesInfoId());
List<VenuesProjectV2DTO> venuesProjectV2DTOS = venuesProjectV2Service.listProject(params); List<VenuesProjectV2DTO> venuesProjectV2DTOS = venuesProjectV2Service.listProject(params);
String sb = ""; String sb = "";
for ( int i = 0 ; i < venuesProjectV2DTOS.size(); i++){ for (int i = 0; i < venuesProjectV2DTOS.size(); i++) {
if(i >= 3){ if (i >= 3) {
sb = sb.substring(0,sb.length() - 1); sb = sb.substring(0, sb.length() - 1);
break; break;
} }
sb += venuesProjectV2DTOS.get(i).getProjectName() + ','; sb += venuesProjectV2DTOS.get(i).getProjectName() + ',';
@ -339,10 +335,10 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
String price = groundInfoService.getMinBookingPriceByVenuesInfoId(params); String price = groundInfoService.getMinBookingPriceByVenuesInfoId(params);
item.setMinBookingPrice(price == null ? "" : price); item.setMinBookingPrice(price == null ? "" : price);
//处理距离 //处理距离
if(StringUtils.isEmpty(params.get("longitude").toString()) if (StringUtils.isEmpty(params.get("longitude").toString())
|| StringUtils.isEmpty(params.get("latitude").toString()) || StringUtils.isEmpty(params.get("latitude").toString())
|| StringUtils.isEmpty(item.getLongitude()) || StringUtils.isEmpty(item.getLongitude())
|| StringUtils.isEmpty(item.getLatitude())){ || StringUtils.isEmpty(item.getLatitude())) {
item.setApart(""); item.setApart("");
continue; continue;
} else { } else {
@ -352,7 +348,7 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
Point targetPoint = new Point(); Point targetPoint = new Point();
targetPoint.setX(Double.parseDouble(item.getLatitude())); targetPoint.setX(Double.parseDouble(item.getLatitude()));
targetPoint.setY(Double.parseDouble(item.getLongitude())); targetPoint.setY(Double.parseDouble(item.getLongitude()));
item.setApart(formatPosition(myPoint,targetPoint)); item.setApart(formatPosition(myPoint, targetPoint));
} }
} }
@ -363,10 +359,10 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
@Override @Override
public SuccessResultData<List<VenuesInfoDTO>> listRangeVenuesInfo(Map<String, Object> params) { public SuccessResultData<List<VenuesInfoDTO>> listRangeVenuesInfo(Map<String, Object> params) {
VenuesListSingleData venuesListSingleData = VenuesListSingleData.getInstance(); VenuesListSingleData venuesListSingleData = VenuesListSingleData.getInstance();
List<VenuesInfoDTO> venuesInfoDTOs = venuesListSingleData.getVenuesList(venuesInfoDao,params); List<VenuesInfoDTO> venuesInfoDTOs = venuesListSingleData.getVenuesList(venuesInfoDao, params);
String venueType = params.get("venueType") == null ? "" : params.get("venueType").toString(); String venueType = params.get("venueType") == null ? "" : params.get("venueType").toString();
List<VenuesInfoDTO> screeningResult = new ArrayList<>(); List<VenuesInfoDTO> screeningResult = new ArrayList<>();
if(!"".equals(venueType)){ if (!"".equals(venueType)) {
for (VenuesInfoDTO item : venuesInfoDTOs) { for (VenuesInfoDTO item : venuesInfoDTOs) {
if (venueType.equals(item.getVenueType())) { if (venueType.equals(item.getVenueType())) {
screeningResult.add(item); screeningResult.add(item);
@ -375,7 +371,7 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
} else { } else {
screeningResult.addAll(venuesInfoDTOs); screeningResult.addAll(venuesInfoDTOs);
} }
if(params.get("range") == null){ if (params.get("range") == null) {
return new SuccessResultData(screeningResult); return new SuccessResultData(screeningResult);
} }
double range = Double.parseDouble(params.get("range").toString()); double range = Double.parseDouble(params.get("range").toString());
@ -383,10 +379,10 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
Point myPoint = setPoint(params); Point myPoint = setPoint(params);
formatPosition(myPoint, screeningResult); formatPosition(myPoint, screeningResult);
List<VenuesInfoDTO> rangeList = new ArrayList<>(); List<VenuesInfoDTO> rangeList = new ArrayList<>();
if(screeningResult != null && screeningResult.size() > 0){ if (screeningResult != null && screeningResult.size() > 0) {
for (VenuesInfoDTO item : screeningResult){ for (VenuesInfoDTO item : screeningResult) {
apart = Double.parseDouble(item.getApart()); apart = Double.parseDouble(item.getApart());
if(apart <= range){ if (apart <= range) {
rangeList.add(item); rangeList.add(item);
} }
} }
@ -396,45 +392,47 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
/** /**
* 计算距离 * 计算距离
*
* @param list * @param list
*/ */
private void formatPosition(Point myPoint, List<VenuesInfoDTO> list){ private void formatPosition(Point myPoint, List<VenuesInfoDTO> list) {
Point point = new Point(); Point point = new Point();
for (VenuesInfoDTO item : list){ for (VenuesInfoDTO item : list) {
if(myPoint.getX() == 0 && myPoint.getY() == 0){ if (myPoint.getX() == 0 && myPoint.getY() == 0) {
item.setApart("0"); item.setApart("0");
continue; continue;
} }
if(StringUtils.isEmpty(item.getLongitude()) if (StringUtils.isEmpty(item.getLongitude())
&& StringUtils.isEmpty(item.getLatitude())){ && StringUtils.isEmpty(item.getLatitude())) {
item.setApart("0"); item.setApart("0");
continue; continue;
} }
point.setX(Double.parseDouble(item.getLatitude())); point.setX(Double.parseDouble(item.getLatitude()));
point.setY(Double.parseDouble(item.getLongitude())); point.setY(Double.parseDouble(item.getLongitude()));
double lineApart = PointUtil.getDistance(myPoint,point); double lineApart = PointUtil.getDistance(myPoint, point);
BigDecimal bg = new BigDecimal(lineApart); BigDecimal bg = new BigDecimal(lineApart);
item.setApart(bg.setScale(2,BigDecimal.ROUND_HALF_UP).toString()); item.setApart(bg.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
} }
} }
private String formatPosition(Point myPoint, Point targetPoint){ private String formatPosition(Point myPoint, Point targetPoint) {
double lineApart = PointUtil.getDistance(myPoint,targetPoint); double lineApart = PointUtil.getDistance(myPoint, targetPoint);
BigDecimal bg = new BigDecimal(lineApart); BigDecimal bg = new BigDecimal(lineApart);
return bg.setScale(2,BigDecimal.ROUND_HALF_UP).toString(); return bg.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
} }
/** /**
* 距离排序 * 距离排序
*
* @param list * @param list
*/ */
private void pointListCompareToAse(List<VenuesInfoDTO> list){ private void pointListCompareToAse(List<VenuesInfoDTO> list) {
Collections.sort(list, new Comparator<VenuesInfoDTO>() { Collections.sort(list, new Comparator<VenuesInfoDTO>() {
@Override @Override
public int compare(VenuesInfoDTO o1, VenuesInfoDTO o2) { public int compare(VenuesInfoDTO o1, VenuesInfoDTO o2) {
double apart1 = Double.parseDouble(o1.getApart()); double apart1 = Double.parseDouble(o1.getApart());
double apart2 = Double.parseDouble(o2.getApart()); double apart2 = Double.parseDouble(o2.getApart());
if(apart1 == apart2){ if (apart1 == apart2) {
return 0; return 0;
} }
return apart1 > apart2 ? 1 : -1; return apart1 > apart2 ? 1 : -1;
@ -442,11 +440,13 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
}); });
} }
private Point setPoint(Map<String, Object> params){ private Point setPoint(Map<String, Object> params) {
double longitude = NO_POINT.equals(params.get(VENUE_SEARCH_LONGITUDE).toString()) ? Object longitudeObj = params.get(VENUE_SEARCH_LONGITUDE);
0 : Double.parseDouble(params.get(VENUE_SEARCH_LONGITUDE).toString()); Object latitudeObj = params.get(VENUE_SEARCH_LATITUDE);
double latitude = NO_POINT.equals(params.get(VENUE_SEARCH_LATITUDE).toString()) ? double longitude = longitudeObj == null || NO_POINT.equals(longitudeObj.toString()) ?
0 : Double.parseDouble(params.get(VENUE_SEARCH_LATITUDE).toString()); 0 : Double.parseDouble(longitudeObj.toString());
double latitude = latitudeObj == null || NO_POINT.equals(latitudeObj.toString()) ?
0 : Double.parseDouble(latitudeObj.toString());
Point Point = new Point(); Point Point = new Point();
Point.setX(latitude); Point.setX(latitude);
Point.setY(longitude); Point.setY(longitude);
@ -456,26 +456,27 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
/** /**
* 后台-场馆zTree * 后台-场馆zTree
* 有数据权限校验 * 有数据权限校验
*
* @return 返回场馆zTree集合 * @return 返回场馆zTree集合
*/ */
@Override @Override
public List<ZTreeDTO> listVenuesInfoZTree() { public List<ZTreeDTO> listVenuesInfoZTree() {
Map<String, Object> params = getHashMap(16); Map<String, Object> params = getHashMap(16);
setDataAuthorityInfo(params); setDataAuthorityInfo(params);
params.put("creator",securityComponent.getCurrentUser().getUserId()); params.put("creator", securityComponent.getCurrentUser().getUserId());
List<VenuesInfoDTO> venuesInfoDTO = venuesInfoDao.listVenuesInfo(params); List<VenuesInfoDTO> venuesInfoDTO = venuesInfoDao.listVenuesInfo(params);
List<ZTreeDTO> zTreeDTOs = new ArrayList<>(); List<ZTreeDTO> zTreeDTOs = new ArrayList<>();
for (VenuesInfoDTO item : venuesInfoDTO){ for (VenuesInfoDTO item : venuesInfoDTO) {
ZTreeDTO zTreeDTO = new ZTreeDTO(); ZTreeDTO zTreeDTO = new ZTreeDTO();
zTreeDTO.setName(item.getVenueName()); zTreeDTO.setName(item.getVenueName());
if("arrive".equals(item.getVenueCharge())){ if ("arrive".equals(item.getVenueCharge())) {
zTreeDTO.setName(item.getVenueName() + "(直接到场)"); zTreeDTO.setName(item.getVenueName() + "(直接到场)");
zTreeDTO.setTarget(item.getVenueCharge()); zTreeDTO.setTarget(item.getVenueCharge());
} }
if("booking".equals(item.getVenueCharge())){ if ("booking".equals(item.getVenueCharge())) {
zTreeDTO.setName(item.getVenueName()); zTreeDTO.setName(item.getVenueName());
} }
if("ticket".equals(item.getVenueCharge())){ if ("ticket".equals(item.getVenueCharge())) {
zTreeDTO.setName(item.getVenueName()); zTreeDTO.setName(item.getVenueName());
} }
zTreeDTO.setpId("0"); zTreeDTO.setpId("0");
@ -488,19 +489,19 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
@Override @Override
public VenuesInfoDTO getVenuesInfoByIdForApp(String token, Map<String, Object> param) throws SearchException { public VenuesInfoDTO getVenuesInfoByIdForApp(String token, Map<String, Object> param) throws SearchException {
VenuesInfoDTO venuesInfoDTO = venuesInfoDao.getVenuesInfoForApp(param); VenuesInfoDTO venuesInfoDTO = venuesInfoDao.getVenuesInfoForApp(param);
if(venuesInfoDTO == null){ if (venuesInfoDTO == null) {
return new VenuesInfoDTO(); return new VenuesInfoDTO();
} }
//查询是否有项目信息 //查询是否有项目信息
venuesInfoDTO.setHasProject("0"); venuesInfoDTO.setHasProject("0");
param.put("venuesInfoId",venuesInfoDTO.getVenuesInfoId()); param.put("venuesInfoId", venuesInfoDTO.getVenuesInfoId());
List<VenuesProjectDTO> projectList = venuesProjectDao.listVenuesProject(param); List<VenuesProjectDTO> projectList = venuesProjectDao.listVenuesProject(param);
if(projectList != null && projectList.size() > 0){ if (projectList != null && projectList.size() > 0) {
venuesInfoDTO.setHasProject("1"); venuesInfoDTO.setHasProject("1");
} }
String resultLocation = param.get("resultLocation") == null ? "" : param.get("resultLocation").toString(); String resultLocation = param.get("resultLocation") == null ? "" : param.get("resultLocation").toString();
//返回的场馆定位需要转换为腾讯地图坐标 //返回的场馆定位需要转换为腾讯地图坐标
if(MAP_TYPE_TX.equals(resultLocation)){ if (MAP_TYPE_TX.equals(resultLocation)) {
Point point = new Point(); Point point = new Point();
MapLocationTransformUtil util = new MapLocationTransformUtil(); MapLocationTransformUtil util = new MapLocationTransformUtil();
point.setX(Double.parseDouble(venuesInfoDTO.getLatitude())); point.setX(Double.parseDouble(venuesInfoDTO.getLatitude()));
@ -513,17 +514,17 @@ public class VenuesInfoServiceImpl extends DefaultBaseService implements IVenues
} }
@Override @Override
public SuccessResult saveEntranceTicket(EntranceTicketDTO entranceTicketDTO) throws Exception{ public SuccessResult saveEntranceTicket(EntranceTicketDTO entranceTicketDTO) throws Exception {
Map<String,Object> param= HashMapUtil.beanToMap(entranceTicketDTO); Map<String, Object> param = HashMapUtil.beanToMap(entranceTicketDTO);
String entranceTicketId = UUIDUtil.get32UUID(); String entranceTicketId = UUIDUtil.get32UUID();
param.put("entranceTicketId",entranceTicketId); param.put("entranceTicketId", entranceTicketId);
setSaveInfo(param); setSaveInfo(param);
venuesInfoDao.saveEntranceTicket(param); venuesInfoDao.saveEntranceTicket(param);
return new SuccessResult(); return new SuccessResult();
} }
@Override @Override
public SuccessResult updateEntranceTicket(EntranceTicketDTO entranceTicketDTO) throws Exception{ public SuccessResult updateEntranceTicket(EntranceTicketDTO entranceTicketDTO) throws Exception {
Map<String, Object> param = HashMapUtil.beanToMap(entranceTicketDTO); Map<String, Object> param = HashMapUtil.beanToMap(entranceTicketDTO);
setUpdateInfo(param); setUpdateInfo(param);
venuesInfoDao.updateEntranceTicket(param); venuesInfoDao.updateEntranceTicket(param);

View File

@ -482,12 +482,21 @@
t1.is_delete = 0 t1.is_delete = 0
AND t1.venues_info_id = #{venuesInfoId} AND t1.venues_info_id = #{venuesInfoId}
GROUP BY GROUP BY
t1.venues_info_id,
t1.venue_charge,
t1.venue_panorama, t1.venue_panorama,
t1.venue_plan,
t1.venue_name, t1.venue_name,
t1.venue_position,
t1.longitude,
t1.latitude,
t1.venue_telephone, t1.venue_telephone,
t1.venue_route, t1.venue_route,
t1.venue_other_service t1.venue_position,
t2.dictionary_name,
t1.venue_other_service,
t1.venue_description,
t1.business_hours,
t1.booking_tips
</select> </select>
</mapper> </mapper>

View File

@ -270,7 +270,9 @@
t1.venues_project_id, t1.venues_project_id,
t1.venue_id, t1.venue_id,
t1.project_category, t1.project_category,
t2.data_name,
t1.business_hours, t1.business_hours,
t1.project_description t1.project_description,
t3.data_name
</select> </select>
</mapper> </mapper>