liu
This commit is contained in:
@@ -3,6 +3,9 @@ package com.zscat.mallplus.build.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -14,4 +17,6 @@ import com.zscat.mallplus.build.entity.BuildWuyeCompany;
|
||||
public interface IBuildWuyeCompanyService extends IService<BuildWuyeCompany> {
|
||||
|
||||
boolean saveCompany(BuildWuyeCompany entity);
|
||||
|
||||
Map<String, List<String>> nameMapWithCommunity();
|
||||
}
|
||||
|
||||
@@ -53,4 +53,6 @@ public interface IBuildingCommunityService extends IService<BuildingCommunity> {
|
||||
double latitude,
|
||||
double longitude,
|
||||
Integer pageSize);
|
||||
|
||||
List<BuildingCommunity> listOfCompany(Long id);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.zscat.mallplus.build.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
|
||||
import com.zscat.mallplus.build.entity.BuildingCommunity;
|
||||
import com.zscat.mallplus.build.mapper.BuildWuyeCompanyMapper;
|
||||
import com.zscat.mallplus.build.service.IBuildWuyeCompanyService;
|
||||
import com.zscat.mallplus.build.service.IBuildingCommunityService;
|
||||
import com.zscat.mallplus.exception.ApiMallPlusException;
|
||||
import com.zscat.mallplus.sys.entity.SysUser;
|
||||
import com.zscat.mallplus.sys.entity.SysUserRole;
|
||||
@@ -14,7 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -36,6 +39,9 @@ public class BuildWuyeCompanyServiceImpl extends ServiceImpl<BuildWuyeCompanyMap
|
||||
@Resource
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Resource
|
||||
private IBuildingCommunityService communityService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean saveCompany(BuildWuyeCompany entity) {
|
||||
@@ -67,4 +73,19 @@ public class BuildWuyeCompanyServiceImpl extends ServiceImpl<BuildWuyeCompanyMap
|
||||
userRoleMapper.insert(userRole);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<String>> nameMapWithCommunity() {
|
||||
Map<String, List<String>> map = new HashMap<>();
|
||||
List<BuildWuyeCompany> comList = this.list(new QueryWrapper<>());
|
||||
comList.forEach(company -> {
|
||||
List<BuildingCommunity> list = communityService.listOfCompany(company.getId());
|
||||
List<String> cList = new ArrayList<>();
|
||||
list.forEach(community -> {
|
||||
cList.add(community.getName());
|
||||
});
|
||||
map.put(company.getName(), cList);
|
||||
});
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +169,8 @@ public class BuildingCommunityServiceImpl extends ServiceImpl<BuildingCommunityM
|
||||
}
|
||||
buildAdvs = advMapper.selectList(new QueryWrapper<BuildAdv>().eq("community_id", community.getId()));
|
||||
buildNotices = noticeMapper.selectList(new QueryWrapper<BuildNotice>().eq("community_id", community.getId()));
|
||||
if (Double.valueOf(community.getLatitude())>0){
|
||||
List<BuildingCommunity> communityList = this.selectNearCommunity(40,Double.valueOf(community.getLatitude()),Double.valueOf(community.getLongitude()),10);
|
||||
if (Double.valueOf(community.getLatitude()) > 0) {
|
||||
List<BuildingCommunity> communityList = this.selectNearCommunity(40, Double.valueOf(community.getLatitude()), Double.valueOf(community.getLongitude()), 10);
|
||||
result.setCommunityList(communityList);
|
||||
}
|
||||
result.setCommunity(community);
|
||||
@@ -182,7 +182,14 @@ public class BuildingCommunityServiceImpl extends ServiceImpl<BuildingCommunityM
|
||||
|
||||
@Override
|
||||
public List<BuildingCommunity> selectNearCommunity(Integer distance, double latitude, double longitude, Integer pageSize) {
|
||||
return communityMapper.selectNearCommunity(distance,latitude,longitude,pageSize);
|
||||
return communityMapper.selectNearCommunity(distance, latitude, longitude, pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BuildingCommunity> listOfCompany(Long companyId) {
|
||||
QueryWrapper<BuildingCommunity> qw = new QueryWrapper<>();
|
||||
qw.eq("company_id", companyId);
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
|
||||
public List<ActivityVo> getActivityList() {
|
||||
|
||||
@@ -32,6 +32,7 @@ import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Auther: shenzhuan
|
||||
@@ -78,6 +79,15 @@ public class SingeBuildController extends ApiBaseAction {
|
||||
return new CommonResult().success(communityService.allCommunity());
|
||||
}
|
||||
|
||||
@SysLog(MODULE = "pms", REMARK = "物业及其社区")
|
||||
@IgnoreAuth
|
||||
@GetMapping(value = "/wuyeCompanyWithCommunity")
|
||||
@ApiOperation(value = "物业及其社区")
|
||||
public Object wuyeCompanyWithCommunity() {
|
||||
Map<String, List<String>> map = IBuildWuyeCompanyService.nameMapWithCommunity();
|
||||
return new CommonResult().success(map);
|
||||
}
|
||||
|
||||
@SysLog(MODULE = "pms", REMARK = "绑定小区和房间")
|
||||
@IgnoreAuth
|
||||
@PostMapping(value = "/bindCommunity")
|
||||
@@ -188,6 +198,7 @@ public class SingeBuildController extends ApiBaseAction {
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param entity
|
||||
* @param pageNum
|
||||
@@ -206,6 +217,7 @@ public class SingeBuildController extends ApiBaseAction {
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@SysLog(MODULE = "pms", REMARK = "查询团购商品列表")
|
||||
@IgnoreAuth
|
||||
@ApiOperation(value = "查询带团购商品列表")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
spring.jackson.time-zone=GMT+8
|
||||
#\u9ED8\u8BA4\u4E3A\u5F00\u53D1\u73AF\u5883
|
||||
#spring.profiles.active=test
|
||||
spring.profiles.active=dev
|
||||
spring.profiles.active=test
|
||||
#spring.profiles.active=dev
|
||||
#===server start===
|
||||
server.port=8083
|
||||
#server.port=8111
|
||||
|
||||
Reference in New Issue
Block a user