|
|
@@ -152,7 +152,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
private final StoreImgService storeImgService;
|
|
|
|
|
|
|
|
|
- /** 商户证照历史记录数据访问对象 */
|
|
|
+ /**
|
|
|
+ * 商户证照历史记录数据访问对象
|
|
|
+ */
|
|
|
private final StoreLicenseHistoryMapper licenseHistoryMapper;
|
|
|
|
|
|
@Resource
|
|
|
@@ -186,8 +188,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
public StoreMainInfoVo getDetail(Integer id) {
|
|
|
|
|
|
StoreInfo storeInfo = storeInfoMapper.selectById(id);
|
|
|
- if(storeInfo == null){
|
|
|
- return null;
|
|
|
+ if (storeInfo == null) {
|
|
|
+ return null;
|
|
|
}
|
|
|
StoreMainInfoVo storeMainInfoVo = storeInfoMapper.getStoreInfo(id);
|
|
|
|
|
|
@@ -195,10 +197,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (ObjectUtils.isNotEmpty(storeMainInfoVo.getExpirationTime())) {
|
|
|
if (new Date().after(storeMainInfoVo.getExpirationTime())) {
|
|
|
storeMainInfoVo.setExpirationFlag(0);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
storeMainInfoVo.setExpirationFlag(1);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
storeMainInfoVo.setExpirationFlag(1);
|
|
|
}
|
|
|
|
|
|
@@ -217,15 +219,15 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<StoreImg> albumUrlList = storeImgMapper.selectList(albumUrlQueryWrapper);
|
|
|
storeMainInfoVo.setAlbumUrl(albumUrlList.stream().sorted(Comparator.comparing(StoreImg::getImgSort)).map(StoreImg::getImgUrl).collect(Collectors.toList()));
|
|
|
//推荐菜
|
|
|
- storeMainInfoVo.setRecommendUrl(storeMenuMapper.getStoreMenuInfoList(id, 1,1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
+ storeMainInfoVo.setRecommendUrl(storeMenuMapper.getStoreMenuInfoList(id, 1, 1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
//菜单
|
|
|
- storeMainInfoVo.setMenuUrl(storeMenuMapper.getStoreMenuInfoList(id, 0,1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
+ storeMainInfoVo.setMenuUrl(storeMenuMapper.getStoreMenuInfoList(id, 0, 1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
|
|
|
// todo 需要根据门店类型来判断
|
|
|
// 推荐酒水
|
|
|
- storeMainInfoVo.setRecommendBeverageUrl(storeMenuMapper.getStoreMenuInfoList(id, 1,1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
+ storeMainInfoVo.setRecommendBeverageUrl(storeMenuMapper.getStoreMenuInfoList(id, 1, 1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
//酒单
|
|
|
- storeMainInfoVo.setBeverageUrl(storeMenuMapper.getStoreMenuInfoList(id, 0,1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
+ storeMainInfoVo.setBeverageUrl(storeMenuMapper.getStoreMenuInfoList(id, 0, 1).stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList()));
|
|
|
|
|
|
//门店标签
|
|
|
storeMainInfoVo.setStoreLabel(storeLabelMapper.selectOne(new LambdaQueryWrapper<StoreLabel>().eq(StoreLabel::getStoreId, id)));
|
|
|
@@ -368,13 +370,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 获取当前时间
|
|
|
LocalDate nowDay = LocalDate.now();
|
|
|
//经营许可证到期状态筛选 0 查询食品经营许可证已到期
|
|
|
- if(CommonConstant.FOOD_LICENCE_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)){
|
|
|
- queryWrapper.lt("a.food_licence_expiration_time",nowDay);
|
|
|
- } else if(CommonConstant.FOOD_LICENCE_ABOUT_TO_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)){//经营许可证筛选状态 1 查询食品经营许可证即将到期 距离到期时间30天内
|
|
|
- queryWrapper.lt("a.food_licence_expiration_time",nowDay.plusDays(31))
|
|
|
- .ge("a.food_licence_expiration_time",nowDay);
|
|
|
- }else if(CommonConstant.FOOD_LICENCE_NOT_EXPIRED_STATUS.equals(foodLicenceWhetherExpiredStatus)){//经营许可证筛选状态 2 查询食品经营许可证未到期 距离到期时间大于30天以上
|
|
|
- queryWrapper.gt("a.food_licence_expiration_time",nowDay.plusDays(31));
|
|
|
+ if (CommonConstant.FOOD_LICENCE_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)) {
|
|
|
+ queryWrapper.lt("a.food_licence_expiration_time", nowDay);
|
|
|
+ } else if (CommonConstant.FOOD_LICENCE_ABOUT_TO_EXPIRE_STATUS.equals(foodLicenceWhetherExpiredStatus)) {//经营许可证筛选状态 1 查询食品经营许可证即将到期 距离到期时间30天内
|
|
|
+ queryWrapper.lt("a.food_licence_expiration_time", nowDay.plusDays(31))
|
|
|
+ .ge("a.food_licence_expiration_time", nowDay);
|
|
|
+ } else if (CommonConstant.FOOD_LICENCE_NOT_EXPIRED_STATUS.equals(foodLicenceWhetherExpiredStatus)) {//经营许可证筛选状态 2 查询食品经营许可证未到期 距离到期时间大于30天以上
|
|
|
+ queryWrapper.gt("a.food_licence_expiration_time", nowDay.plusDays(31));
|
|
|
}
|
|
|
IPage<StoreInfoVo> storeInfoVoPage = storeInfoMapper.getStoreInfoVoPage(iPage, queryWrapper);
|
|
|
List<StoreInfoVo> records = storeInfoVoPage.getRecords();
|
|
|
@@ -444,20 +446,20 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
// 处理经营许可证到期时间回显状态 根据经营许可证筛选状态筛选
|
|
|
Date foodDate = record.getFoodLicenceExpirationTime();
|
|
|
- if(foodDate != null){
|
|
|
+ if (foodDate != null) {
|
|
|
// 获取当前时间
|
|
|
LocalDate nowLocal = LocalDate.now();
|
|
|
LocalDate localDate = foodDate.toInstant() // Date -> Instant(UTC时间戳)
|
|
|
.atZone(ZoneId.systemDefault()) // Instant -> ZonedDateTime(系统默认时区)
|
|
|
.toLocalDate();
|
|
|
long remainingDays = ChronoUnit.DAYS.between(nowLocal, localDate);
|
|
|
- if(remainingDays == -1){
|
|
|
+ if (remainingDays == -1) {
|
|
|
record.setFoodLicenceRemainingDays("0天");
|
|
|
record.setFoodLicenceExpireStatus("已到期");
|
|
|
- }else if(remainingDays >= 0 && remainingDays <= 30){
|
|
|
+ } else if (remainingDays >= 0 && remainingDays <= 30) {
|
|
|
record.setFoodLicenceRemainingDays(remainingDays + "天");
|
|
|
record.setFoodLicenceExpireStatus("即将到期");
|
|
|
- }else if(remainingDays > 30){
|
|
|
+ } else if (remainingDays > 30) {
|
|
|
record.setFoodLicenceRemainingDays(remainingDays + "天");
|
|
|
record.setFoodLicenceExpireStatus("未到期");
|
|
|
}
|
|
|
@@ -830,10 +832,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
|
StoreUser storeUser = storeUserMapper.selectById(userAccount);
|
|
|
storeUser.setStoreId(storeInfo.getId());
|
|
|
- if(StringUtils.isNotEmpty(storeInfoDto.getStoreContact())){
|
|
|
+ if (StringUtils.isNotEmpty(storeInfoDto.getStoreContact())) {
|
|
|
storeUser.setName(storeInfoDto.getStoreContact());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(storeInfoDto.getIdCard())){
|
|
|
+ if (StringUtils.isNotEmpty(storeInfoDto.getIdCard())) {
|
|
|
storeUser.setIdCard(storeInfoDto.getIdCard());
|
|
|
}
|
|
|
storeUserMapper.updateById(storeUser);
|
|
|
@@ -849,7 +851,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeImgMapper.insert(storeImg);
|
|
|
}
|
|
|
//存入店铺合同图片
|
|
|
- if(!CollectionUtils.isEmpty(storeInfoDto.getContractImageList())){
|
|
|
+ if (!CollectionUtils.isEmpty(storeInfoDto.getContractImageList())) {
|
|
|
List<String> contractImageList = storeInfoDto.getContractImageList();
|
|
|
//先移除此前数据
|
|
|
storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeInfo.getId()).eq(StoreImg::getImgType, 15));
|
|
|
@@ -865,14 +867,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
//存入店铺经营许可证图片
|
|
|
- if(StringUtils.isNotEmpty(storeInfoDto.getFoodLicenceUrl())){
|
|
|
- StoreImg storeImg = new StoreImg();
|
|
|
- storeImg.setStoreId(storeInfo.getId());
|
|
|
- storeImg.setImgType(25);
|
|
|
- storeImg.setImgSort(0);
|
|
|
- storeImg.setImgDescription("经营许可证审核通过图片");
|
|
|
- storeImg.setImgUrl(storeInfoDto.getFoodLicenceUrl());
|
|
|
- storeImgMapper.insert(storeImg);
|
|
|
+ if (StringUtils.isNotEmpty(storeInfoDto.getFoodLicenceUrl())) {
|
|
|
+ StoreImg storeImg = new StoreImg();
|
|
|
+ storeImg.setStoreId(storeInfo.getId());
|
|
|
+ storeImg.setImgType(25);
|
|
|
+ storeImg.setImgSort(0);
|
|
|
+ storeImg.setImgDescription("经营许可证审核通过图片");
|
|
|
+ storeImg.setImgUrl(storeInfoDto.getFoodLicenceUrl());
|
|
|
+ storeImgMapper.insert(storeImg);
|
|
|
}
|
|
|
//存入店铺娱乐经营许可证图片
|
|
|
if (StringUtils.isNotEmpty(storeInfoDto.getEntertainmentLicenceUrl())) {
|
|
|
@@ -890,7 +892,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
tagStoreRelationLambdaQueryWrapper.eq(TagStoreRelation::getStoreId, storeInfo.getId());
|
|
|
tagStoreRelationLambdaQueryWrapper.eq(TagStoreRelation::getDeleteFlag, 0);
|
|
|
int tagStoreCount = tagStoreRelationMapper.selectCount(tagStoreRelationLambdaQueryWrapper);
|
|
|
- if(tagStoreCount == 0){
|
|
|
+ if (tagStoreCount == 0) {
|
|
|
TagStoreRelation tagStoreRelation = new TagStoreRelation();
|
|
|
tagStoreRelation.setStoreId(storeInfo.getId());
|
|
|
tagStoreRelation.setDeleteFlag(0);
|
|
|
@@ -901,7 +903,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 发送通知
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String commonDate = simpleDateFormat.format(new Date());
|
|
|
- String text = "您在"+commonDate+"提交的入驻店铺申请,平台已受理,1-3个工作日将审核结果发送至应用内的消息-通知中,请注意查收。";
|
|
|
+ String text = "您在" + commonDate + "提交的入驻店铺申请,平台已受理,1-3个工作日将审核结果发送至应用内的消息-通知中,请注意查收。";
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = new com.alibaba.fastjson2.JSONObject();
|
|
|
jsonObject.put("message", text);
|
|
|
LifeNotice lifeMessage = new LifeNotice();
|
|
|
@@ -1039,7 +1041,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeUserMapper.updateById(storeUser);
|
|
|
BeanUtils.copyProperties(storeInfoDto, result);
|
|
|
//存入店铺营业执照图片
|
|
|
- if(!CollectionUtils.isEmpty(storeInfoDto.getBusinessLicenseAddress())){
|
|
|
+ if (!CollectionUtils.isEmpty(storeInfoDto.getBusinessLicenseAddress())) {
|
|
|
List<String> businessLicenseAddress = storeInfoDto.getBusinessLicenseAddress();
|
|
|
//先移除此前数据
|
|
|
storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeInfo.getId()).eq(StoreImg::getImgType, 14));
|
|
|
@@ -1056,7 +1058,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
//存入店铺合同图片
|
|
|
List<String> contractImageList = storeInfoDto.getContractImageList();
|
|
|
- if(!CollectionUtils.isEmpty(contractImageList)){
|
|
|
+ if (!CollectionUtils.isEmpty(contractImageList)) {
|
|
|
//先移除此前数据
|
|
|
storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeInfo.getId()).eq(StoreImg::getImgType, 15));
|
|
|
for (String licenseAddress : contractImageList) {
|
|
|
@@ -1071,7 +1073,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
//存入店铺经营许可证图片
|
|
|
- if(StringUtils.isNotEmpty(storeInfoDto.getFoodLicenceUrl())){
|
|
|
+ if (StringUtils.isNotEmpty(storeInfoDto.getFoodLicenceUrl())) {
|
|
|
//先移除此前数据 type:25 审核通过后的图片
|
|
|
storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeInfo.getId()).eq(StoreImg::getImgType, 25));
|
|
|
//先移除此前数据 type:24 审核前的或者审核拒绝的图片
|
|
|
@@ -1284,7 +1286,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
double storeWei = Double.parseDouble(result.getStorePosition().split(",")[1]);
|
|
|
double storeDistance = DistanceUtil.haversineCalculateDistance(Double.parseDouble(jingdu), Double.parseDouble(weidu), storeJing, storeWei);*/
|
|
|
|
|
|
- Double distance = storeInfoMapper.getStoreDistance(jingdu + "," + weidu,result.getId());
|
|
|
+ Double distance = storeInfoMapper.getStoreDistance(jingdu + "," + weidu, result.getId());
|
|
|
|
|
|
result.setDistance(distance);
|
|
|
}
|
|
|
@@ -1328,10 +1330,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
));
|
|
|
if (!collect.isEmpty()) {
|
|
|
List<LifeUserOrderVo> quanCount = lifeUserOrderMapper.getQuanCount(new QueryWrapper<LifeUserOrderVo>()
|
|
|
- .eq("luo.store_id",storeId)
|
|
|
+ .eq("luo.store_id", storeId)
|
|
|
.eq("luo.coupon_type", CouponTypeEnum.COUPON.getCode())
|
|
|
- .eq("luo.delete_flag",0)
|
|
|
- .in("ocm.status",excludeStatuses)
|
|
|
+ .eq("luo.delete_flag", 0)
|
|
|
+ .in("ocm.status", excludeStatuses)
|
|
|
.groupBy("ocm.coupon_id"));
|
|
|
quanList.forEach(a -> {
|
|
|
LifeCouponVo lifeCouponVo = new LifeCouponVo();
|
|
|
@@ -1418,13 +1420,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//List<LifeUserDynamicsVo> storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, dynamicsWrapper);
|
|
|
|
|
|
LambdaQueryWrapper<LifeBlacklist> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper1.eq(LifeBlacklist :: getBlockerId, userId);
|
|
|
- lambdaQueryWrapper1.eq(LifeBlacklist :: getBlockedPhoneId, "store_" + result.getStorePhone());
|
|
|
+ lambdaQueryWrapper1.eq(LifeBlacklist::getBlockerId, userId);
|
|
|
+ lambdaQueryWrapper1.eq(LifeBlacklist::getBlockedPhoneId, "store_" + result.getStorePhone());
|
|
|
LifeBlacklist blacklist = lifeBlacklistMapper.selectOne(lambdaQueryWrapper1);
|
|
|
List<LifeUserDynamicsVo> storeDynamicslist = new ArrayList<>();
|
|
|
|
|
|
//判断没有拉黑当前门店账户 查出门店动态
|
|
|
- if(blacklist == null){
|
|
|
+ if (blacklist == null) {
|
|
|
storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, "store_" + result.getStorePhone());
|
|
|
}
|
|
|
|
|
|
@@ -1482,7 +1484,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
result.setStoreBusinessInfo(storeBusinessInfos.get(0));
|
|
|
result.setStoreBusinessInfos(storeBusinessInfos);
|
|
|
//StoreBusinessInfo storeBusinessInfo = result.getStoreBusinessInfo();
|
|
|
- StoreBusinessInfo storeBusinessInfo = result.getStoreBusinessInfos().stream().filter(item -> item.getBusinessType() == 1).findFirst().orElse(null) ;
|
|
|
+ StoreBusinessInfo storeBusinessInfo = result.getStoreBusinessInfos().stream().filter(item -> item.getBusinessType() == 1).findFirst().orElse(null);
|
|
|
if (ObjectUtils.isNotEmpty(storeBusinessInfo)) {
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); // 获取Calendar实例
|
|
|
@@ -1550,9 +1552,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = new com.alibaba.fastjson2.JSONObject();
|
|
|
if (2 == approvalStatus) {
|
|
|
- jsonObject.put("message", "您在"+createDate+"提交的入驻店铺申请,审核失败。失败原因:"+reason+"。");
|
|
|
+ jsonObject.put("message", "您在" + createDate + "提交的入驻店铺申请,审核失败。失败原因:" + reason + "。");
|
|
|
} else {
|
|
|
- jsonObject.put("message", "您在"+createDate+"提交的入驻店铺申请,已通过审核,欢迎您的加入。");
|
|
|
+ jsonObject.put("message", "您在" + createDate + "提交的入驻店铺申请,已通过审核,欢迎您的加入。");
|
|
|
}
|
|
|
lifeNotice.setContext(jsonObject.toJSONString());
|
|
|
lifeNotice.setNoticeType(1); // 系统通知
|
|
|
@@ -1904,7 +1906,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 构建查询优惠券的条件对象
|
|
|
LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
|
// 添加门店ID筛选条件
|
|
|
- quanWrapper.in(ObjectUtils.isNotEmpty(storeIds),LifeCoupon::getStoreId, storeIds)
|
|
|
+ quanWrapper.in(ObjectUtils.isNotEmpty(storeIds), LifeCoupon::getStoreId, storeIds)
|
|
|
// 添加优惠券状态筛选条件
|
|
|
.eq(LifeCoupon::getStatus, CouponStatusEnum.ONGOING.getCode())
|
|
|
// 按照创建时间降序排序
|
|
|
@@ -1914,7 +1916,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 构建查询团购套餐条件对象
|
|
|
LambdaUpdateWrapper<LifeGroupBuyMain> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
// 添加门店ID筛选条件
|
|
|
- lambdaUpdateWrapper.in(ObjectUtils.isNotEmpty(storeIds),LifeGroupBuyMain::getStoreId, storeIds)
|
|
|
+ lambdaUpdateWrapper.in(ObjectUtils.isNotEmpty(storeIds), LifeGroupBuyMain::getStoreId, storeIds)
|
|
|
// 添加团购套餐状态筛选条件
|
|
|
.eq(LifeGroupBuyMain::getStatus, 5)
|
|
|
.orderByDesc(LifeGroupBuyMain::getCreatedTime);
|
|
|
@@ -2142,7 +2144,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String storeDate = simpleDateFormat.format(new Date());
|
|
|
- String text = "您在"+storeDate+"撤销了注销账号,所有数据均已保留,您可继续在平台使用。";
|
|
|
+ String text = "您在" + storeDate + "撤销了注销账号,所有数据均已保留,您可继续在平台使用。";
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = new com.alibaba.fastjson2.JSONObject();
|
|
|
jsonObject.put("message", text);
|
|
|
lifeMessage.setContext(jsonObject.toJSONString());
|
|
|
@@ -2332,7 +2334,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, -4);
|
|
|
Date startDay = calendar.getTime();
|
|
|
String startDayS = sdf.format(startDay);
|
|
|
- JSONObject jsonObject =storeIncomeDetailsRecordService.noYetPayment(id, 0, 0,startDayS,formattedDate, 1, 10);
|
|
|
+ JSONObject jsonObject = storeIncomeDetailsRecordService.noYetPayment(id, 0, 0, startDayS, formattedDate, 1, 10);
|
|
|
String moneyNew = jsonObject.getString("money");
|
|
|
if (storeInfo != null) {
|
|
|
Map<String, Object> map = storeIncomeDetailsRecordService.accountBalance(id);
|
|
|
@@ -2355,7 +2357,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//判断店铺存在正在售卖的商品 0:未通过 1:通过 storeGoodsStatus 代金券 storeGroupStatus 团购
|
|
|
List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId, id).eq(LifeGroupBuyMain::getStatus, 5).eq(LifeGroupBuyMain::getDeleteFlag, 0));
|
|
|
List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 5).and(qw -> qw.gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType, 1).eq(LifeCoupon::getDeleteFlag, 0));
|
|
|
- if (!CollectionUtils.isEmpty(lifeCoupons) ) {
|
|
|
+ if (!CollectionUtils.isEmpty(lifeCoupons)) {
|
|
|
storeInfoMap.put("storeGoodsStatus", "0");
|
|
|
} else {
|
|
|
storeInfoMap.put("storeGoodsStatus", "1");
|
|
|
@@ -2377,8 +2379,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
StoreInfo storeInfo = storeInfoMapper.selectOne(queryWrapper);
|
|
|
if (storeInfo != null && storeInfo.getStoreStatus() == -1) {
|
|
|
storeInfoMapper.deleteById(id);
|
|
|
- StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId,id));
|
|
|
- if(storeUser!= null){
|
|
|
+ StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, id));
|
|
|
+ if (storeUser != null) {
|
|
|
UpdateWrapper<StoreUser> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.eq("id", storeUser.getId());
|
|
|
updateWrapper.set("store_id", null);
|
|
|
@@ -2394,7 +2396,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
int value = storeId.orElse(0);
|
|
|
int num = 0;
|
|
|
//先清除数据
|
|
|
- storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType,22).eq(StoreImg::getStoreId,value));
|
|
|
+ storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 22).eq(StoreImg::getStoreId, value));
|
|
|
for (StoreImg renewContract : storeImgList) {
|
|
|
StoreImg storeImg = new StoreImg();
|
|
|
storeImg.setStoreId(renewContract.getStoreId());
|
|
|
@@ -2417,25 +2419,25 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
@Override
|
|
|
public int uploadfoodLicence(StoreImg storeImg) {
|
|
|
- storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType,24).eq(StoreImg::getStoreId,storeImg.getStoreId()));
|
|
|
- storeImg.setImgType(24);
|
|
|
- storeImg.setImgDescription("经营许可证审核通过前图片");
|
|
|
- storeImgMapper.insert(storeImg);
|
|
|
-
|
|
|
- // 经营许可证历史表插入
|
|
|
- StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
|
|
|
- licenseHistory.setStoreId(storeImg.getStoreId());
|
|
|
- licenseHistory.setLicenseStatus(2);
|
|
|
- licenseHistory.setLicenseExecuteStatus(2);
|
|
|
- licenseHistory.setImgUrl(storeImg.getImgUrl());
|
|
|
- licenseHistory.setDeleteFlag(0);
|
|
|
- licenseHistoryMapper.insert(licenseHistory);
|
|
|
-
|
|
|
- //更新店铺
|
|
|
- StoreInfo storeInfo = new StoreInfo();
|
|
|
- storeInfo.setFoodLicenceStatus(2);
|
|
|
- storeInfo.setId(storeImg.getStoreId());
|
|
|
- storeInfo.setUpdateFoodLicenceTime(new Date());
|
|
|
+ storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 24).eq(StoreImg::getStoreId, storeImg.getStoreId()));
|
|
|
+ storeImg.setImgType(24);
|
|
|
+ storeImg.setImgDescription("经营许可证审核通过前图片");
|
|
|
+ storeImgMapper.insert(storeImg);
|
|
|
+
|
|
|
+ // 经营许可证历史表插入
|
|
|
+ StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
|
|
|
+ licenseHistory.setStoreId(storeImg.getStoreId());
|
|
|
+ licenseHistory.setLicenseStatus(2);
|
|
|
+ licenseHistory.setLicenseExecuteStatus(2);
|
|
|
+ licenseHistory.setImgUrl(storeImg.getImgUrl());
|
|
|
+ licenseHistory.setDeleteFlag(0);
|
|
|
+ licenseHistoryMapper.insert(licenseHistory);
|
|
|
+
|
|
|
+ //更新店铺
|
|
|
+ StoreInfo storeInfo = new StoreInfo();
|
|
|
+ storeInfo.setFoodLicenceStatus(2);
|
|
|
+ storeInfo.setId(storeImg.getStoreId());
|
|
|
+ storeInfo.setUpdateFoodLicenceTime(new Date());
|
|
|
return storeInfoMapper.updateById(storeInfo);
|
|
|
}
|
|
|
|
|
|
@@ -2476,10 +2478,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
//食品经营许可证照片列表
|
|
|
List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 24).eq(StoreImg::getStoreId, id));
|
|
|
- if (!CollectionUtils.isEmpty(storeImgList)) {
|
|
|
- map.put("foodLicenceImgList", storeImgList);
|
|
|
- } else {
|
|
|
- map.put("foodLicenceImgList", "");
|
|
|
+ if (!CollectionUtils.isEmpty(storeImgList)) {
|
|
|
+ map.put("foodLicenceImgList", storeImgList);
|
|
|
+ } else {
|
|
|
+ map.put("foodLicenceImgList", "");
|
|
|
}
|
|
|
if (storeInfo.getFoodLicenceReason() != null) {
|
|
|
map.put("foodLicenceReason", storeInfo.getFoodLicenceReason());
|
|
|
@@ -2500,7 +2502,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, id).eq(StoreImg::getImgType, 22));
|
|
|
List<Integer> imgList = storeImgList.stream().map(StoreImg::getId).collect(Collectors.toList());
|
|
|
LambdaUpdateWrapper<StoreImg> lambdaUpdateWrapper = new LambdaUpdateWrapper();
|
|
|
- lambdaUpdateWrapper.in(StoreImg::getId, imgList).set(StoreImg::getImgType, 15).set(StoreImg::getImgDescription,"合同图片");
|
|
|
+ lambdaUpdateWrapper.in(StoreImg::getId, imgList).set(StoreImg::getImgType, 15).set(StoreImg::getImgDescription, "合同图片");
|
|
|
int num = storeImgMapper.update(null, lambdaUpdateWrapper);
|
|
|
return num;
|
|
|
}
|
|
|
@@ -2511,13 +2513,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
LambdaUpdateWrapper<StoreImg> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
lambdaUpdateWrapper.eq(StoreImg::getStoreId, id);
|
|
|
lambdaUpdateWrapper.eq(StoreImg::getImgType, 25);
|
|
|
- lambdaUpdateWrapper.set(StoreImg::getDeleteFlag,1);
|
|
|
- storeImgMapper.update(null,lambdaUpdateWrapper);
|
|
|
+ lambdaUpdateWrapper.set(StoreImg::getDeleteFlag, 1);
|
|
|
+ storeImgMapper.update(null, lambdaUpdateWrapper);
|
|
|
//修改续签合同类型为合同类型
|
|
|
List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, id).eq(StoreImg::getImgType, 24));
|
|
|
List<Integer> imgList = storeImgList.stream().map(StoreImg::getId).collect(Collectors.toList());
|
|
|
LambdaUpdateWrapper<StoreImg> imgLambdaUpdateWrapper = new LambdaUpdateWrapper();
|
|
|
- imgLambdaUpdateWrapper.in(StoreImg::getId, imgList).set(StoreImg::getImgType, 25).set(StoreImg::getImgDescription,"经营许可证审核通过图片");
|
|
|
+ imgLambdaUpdateWrapper.in(StoreImg::getId, imgList).set(StoreImg::getImgType, 25).set(StoreImg::getImgDescription, "经营许可证审核通过图片");
|
|
|
int num = storeImgMapper.update(null, imgLambdaUpdateWrapper);
|
|
|
|
|
|
|
|
|
@@ -2630,9 +2632,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.eq(StoreInfo::getCreatedUserId, aiApproveStoreInfo.getUserId()).eq(StoreInfo::getStoreApplicationStatus, 0).eq(StoreInfo::getDeleteFlag, 0));
|
|
|
for (StoreInfo storeInfo : storeInfos) {
|
|
|
if ("approved".equals(data.getString("status"))) {
|
|
|
- approveStoreInfo(storeInfo.getId().toString(),1, "审核通过");
|
|
|
+ approveStoreInfo(storeInfo.getId().toString(), 1, "审核通过");
|
|
|
} else if ("rejected".equals(data.getString("status"))) {
|
|
|
- approveStoreInfo(storeInfo.getId().toString(),2, data.getString("audit_summary"));
|
|
|
+ approveStoreInfo(storeInfo.getId().toString(), 2, data.getString("audit_summary"));
|
|
|
} else {
|
|
|
System.out.println("未知状态");
|
|
|
}
|
|
|
@@ -2641,7 +2643,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
throw new RuntimeException("AI门店审核接口调用失败 code:" + jsonObject.getInteger("code"));
|
|
|
}
|
|
|
}
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
throw new RuntimeException("调用门店审核接口异常", e);
|
|
|
}
|
|
|
}
|
|
|
@@ -2701,7 +2703,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
* 获取活动banner图
|
|
|
*/
|
|
|
|
|
|
- public List<StoreImg> getBannerUrl(String storeId){
|
|
|
+ public List<StoreImg> getBannerUrl(String storeId) {
|
|
|
LambdaQueryWrapper<StoreImg> queryWrapper = new LambdaQueryWrapper<StoreImg>()
|
|
|
.eq(StoreImg::getStoreId, Integer.parseInt(storeId))
|
|
|
.eq(StoreImg::getImgType, 26)
|
|
|
@@ -2710,12 +2712,11 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取活动详情banner图
|
|
|
*/
|
|
|
|
|
|
- public List<StoreImg> getBannerUrlInfo(String storeId, Integer businessId){
|
|
|
+ public List<StoreImg> getBannerUrlInfo(String storeId, Integer businessId) {
|
|
|
LambdaQueryWrapper<StoreImg> queryWrapper = new LambdaQueryWrapper<StoreImg>()
|
|
|
.eq(StoreImg::getStoreId, Integer.parseInt(storeId))
|
|
|
.eq(StoreImg::getImgType, 27)
|
|
|
@@ -2725,8 +2726,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public IPage<StoreInfoVo> getLifeServicesByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer categoryId, int pageNum, int pageSize) {
|
|
|
// 参数校验
|
|
|
@@ -2768,7 +2767,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
String typeName = dict.getTypeName();
|
|
|
- String dictIdStr =dict.getDictId();
|
|
|
+ String dictIdStr = dict.getDictId();
|
|
|
|
|
|
if ("business_section".equals(typeName)) {
|
|
|
// 如果是经营板块,直接匹配business_section
|
|
|
@@ -2831,7 +2830,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
} else {
|
|
|
// 如果没有指定businessType,则查询所有两种类型的店铺
|
|
|
// 需要查询字典表获取所有四种类型的dictId
|
|
|
- List<String> storeTypeNames = Arrays.asList("丽人美发","运动健身");
|
|
|
+ List<String> storeTypeNames = Arrays.asList("丽人美发", "运动健身");
|
|
|
List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(
|
|
|
new LambdaQueryWrapper<StoreDictionary>()
|
|
|
.eq(StoreDictionary::getTypeName, "business_section")
|
|
|
@@ -3064,7 +3063,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
store.setDistance(storeDistance);
|
|
|
// 使用反射或扩展字段存储finalScore,这里我们使用一个临时字段
|
|
|
// 由于StoreInfoVo没有finalScore字段,我们使用distance字段临时存储,排序后再恢复
|
|
|
- return new Object[] { store, finalScore };
|
|
|
+ return new Object[]{store, finalScore};
|
|
|
})
|
|
|
.filter(item -> {
|
|
|
// 距离优先模式:过滤掉超出范围的
|
|
|
@@ -3163,9 +3162,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
/**
|
|
|
* 查询OCR图片上传记录并转换为JSONObject
|
|
|
*
|
|
|
- * @param storeUserId 店铺用户ID
|
|
|
- * @param ocrType OCR类型
|
|
|
- * @param likeKeyword 模糊查询关键词,可为null
|
|
|
+ * @param storeUserId 店铺用户ID
|
|
|
+ * @param ocrType OCR类型
|
|
|
+ * @param likeKeyword 模糊查询关键词,可为null
|
|
|
* @param includeImageUrl 是否包含imageUrl字段
|
|
|
* @return JSONObject,如果查询结果为空则返回空的JSONObject
|
|
|
*/
|
|
|
@@ -3175,37 +3174,36 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.eq(OcrImageUpload::getOcrType, ocrType)
|
|
|
.orderByDesc(OcrImageUpload::getCreateTime)
|
|
|
.last("limit 1");
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(likeKeyword)) {
|
|
|
wrapper.like(OcrImageUpload::getOcrResult, likeKeyword);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
OcrImageUpload ocrImageUpload = ocrImageUploadMapper.selectOne(wrapper);
|
|
|
-
|
|
|
+
|
|
|
if (ocrImageUpload == null || StringUtils.isEmpty(ocrImageUpload.getOcrResult())) {
|
|
|
return new com.alibaba.fastjson2.JSONObject();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = com.alibaba.fastjson2.JSONObject.parseObject(ocrImageUpload.getOcrResult());
|
|
|
if (includeImageUrl && StringUtils.isNotEmpty(ocrImageUpload.getImageUrl())) {
|
|
|
jsonObject.put("imageUrl", ocrImageUpload.getImageUrl());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 你可能还喜欢(推荐店铺)
|
|
|
* 根据一级分类、二级分类、三级分类进行店铺筛选
|
|
|
* 筛选顺序:先三级,然后二级,最后一级
|
|
|
*
|
|
|
- * @param businessSection 一级分类(经营板块)
|
|
|
- * @param businessTypes 二级分类(经营种类)
|
|
|
+ * @param businessSection 一级分类(经营板块)
|
|
|
+ * @param businessTypes 二级分类(经营种类)
|
|
|
* @param businessClassify 三级分类(分类)
|
|
|
- * @param lon 经度
|
|
|
- * @param lat 纬度
|
|
|
+ * @param lon 经度
|
|
|
+ * @param lat 纬度
|
|
|
* @return List<StoreInfoVo> 店铺信息列表
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -3399,7 +3397,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 构建树形结构(优化版)
|
|
|
*
|
|
|
@@ -3484,7 +3481,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
new LambdaQueryWrapper<StoreDictionary>()
|
|
|
.in(StoreDictionary::getParentId, mainCategoryIds)
|
|
|
.eq(StoreDictionary::getDeleteFlag, 0)
|
|
|
- .in(StoreDictionary::getTypeName, "business_section","business_type","business_classify")
|
|
|
+ .in(StoreDictionary::getTypeName, "business_section", "business_type", "business_classify")
|
|
|
);
|
|
|
|
|
|
// 按parentId分组
|
|
|
@@ -3556,7 +3553,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
|
|
|
|
String typeName = dict.getTypeName();
|
|
|
- String dictIdStr =dict.getDictId();
|
|
|
+ String dictIdStr = dict.getDictId();
|
|
|
|
|
|
if ("business_section".equals(typeName)) {
|
|
|
// 如果是经营板块,直接匹配business_section
|
|
|
@@ -3852,7 +3849,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
store.setDistance(storeDistance);
|
|
|
// 使用反射或扩展字段存储finalScore,这里我们使用一个临时字段
|
|
|
// 由于StoreInfoVo没有finalScore字段,我们使用distance字段临时存储,排序后再恢复
|
|
|
- return new Object[] { store, finalScore };
|
|
|
+ return new Object[]{store, finalScore};
|
|
|
})
|
|
|
.filter(item -> {
|
|
|
// 距离优先模式:过滤掉超出范围的
|
|
|
@@ -3952,7 +3949,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
public List<StoreDictionary> getAllBusinessSection() {
|
|
|
// 查询所有经营种类数据
|
|
|
LambdaQueryWrapper<StoreDictionary> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.in(StoreDictionary::getTypeName, "business_section","business_type","business_classify");
|
|
|
+ queryWrapper.in(StoreDictionary::getTypeName, "business_section", "business_type", "business_classify");
|
|
|
queryWrapper.eq(StoreDictionary::getDeleteFlag, 0);
|
|
|
queryWrapper.orderByAsc(StoreDictionary::getSortId);
|
|
|
List<StoreDictionary> storeDictionaryList = storeDictionaryMapper.selectList(queryWrapper);
|
|
|
@@ -4025,11 +4022,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
/**
|
|
|
* web-分页查询店铺信息
|
|
|
*
|
|
|
-
|
|
|
* @return IPage<StoreInfoVo>
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<StoreInfoVo> getMoreRecommendedStores(Double lon , Double lat, String businessSection, String businessTypes, String businessClassify) {
|
|
|
+ public List<StoreInfoVo> getMoreRecommendedStores(Double lon, Double lat, String businessSection, String businessTypes, String businessClassify) {
|
|
|
// 参数校验
|
|
|
if (lon == null || lat == null) {
|
|
|
log.warn("获取更多推荐店铺失败,经纬度为空");
|
|
|
@@ -4061,13 +4057,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.gt("a.food_licence_expiration_time", currentDate));
|
|
|
|
|
|
// 构建一级分类
|
|
|
- if(StringUtils.isNotEmpty(businessSection)){
|
|
|
+ if (StringUtils.isNotEmpty(businessSection)) {
|
|
|
queryWrapper.eq("a.business_section", businessSection);
|
|
|
// 构建二级分类
|
|
|
- if(StringUtils.isNotEmpty(businessTypes)){
|
|
|
+ if (StringUtils.isNotEmpty(businessTypes)) {
|
|
|
queryWrapper.eq("a.business_types", businessTypes);
|
|
|
// 构建三级分类
|
|
|
- if(StringUtils.isNotEmpty(businessClassify)){
|
|
|
+ if (StringUtils.isNotEmpty(businessClassify)) {
|
|
|
// 解析businessClassify参数(格式:1,2,3)
|
|
|
String[] classifyArray = businessClassify.split(",");
|
|
|
// 使用FIND_IN_SET函数检查数据库字段是否包含参数中的任何一个值
|
|
|
@@ -4122,7 +4118,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<StoreImg> storeImgList = storeImgMapper.selectList(new QueryWrapper<StoreImg>().in("store_id", storeIds).eq("img_type", 1));
|
|
|
- Map<Integer, List<StoreImg>> storeCollect = storeImgList.stream()
|
|
|
+ Map<Integer, List<StoreImg>> storeCollect = storeImgList.stream()
|
|
|
.collect(Collectors.groupingBy(StoreImg::getStoreId));
|
|
|
|
|
|
|
|
|
@@ -4137,9 +4133,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
|
// 加入头图
|
|
|
- if(!CollectionUtils.isEmpty(storeCollect) && storeCollect.containsKey(record.getId())){
|
|
|
+ if (!CollectionUtils.isEmpty(storeCollect) && storeCollect.containsKey(record.getId())) {
|
|
|
List<StoreImg> storeImgs = storeCollect.get(record.getId());
|
|
|
- if(!CollectionUtils.isEmpty(storeImgs)){
|
|
|
+ if (!CollectionUtils.isEmpty(storeImgs)) {
|
|
|
record.setEntranceImage(storeImgs.get(0).getImgUrl());
|
|
|
}
|
|
|
}
|
|
|
@@ -4277,13 +4273,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
// 获取店铺相册
|
|
|
List<StoreImg> storeAlbumList = new ArrayList<>();
|
|
|
- if(storeInfo.getImgMode() != null && storeInfo.getImgMode() == 0){
|
|
|
- storeAlbumList = storeImgService.getStoreImg(Integer.parseInt(storeId), 20);
|
|
|
+ if (storeInfo.getImgMode() != null && storeInfo.getImgMode() == 0) {
|
|
|
+ storeAlbumList = storeImgService.getStoreImg(Integer.parseInt(storeId), 20);
|
|
|
} else {
|
|
|
- storeAlbumList = storeImgService.getStoreImg(Integer.parseInt(storeId), 21);
|
|
|
+ storeAlbumList = storeImgService.getStoreImg(Integer.parseInt(storeId), 21);
|
|
|
}
|
|
|
|
|
|
- if(!CollectionUtils.isEmpty(storeAlbumList)){
|
|
|
+ if (!CollectionUtils.isEmpty(storeAlbumList)) {
|
|
|
List<String> storeAlbumUrlList = storeAlbumList.stream().map(StoreImg::getImgUrl) // 假设 StoreImg 有 getStoreUrl() 方法
|
|
|
.filter(url -> url != null && !url.trim().isEmpty()) // 过滤空值
|
|
|
.collect(Collectors.toList());
|
|
|
@@ -4301,7 +4297,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
double storeWei = Double.parseDouble(result.getStorePosition().split(",")[1]);
|
|
|
double storeDistance = DistanceUtil.haversineCalculateDistance(Double.parseDouble(jingdu), Double.parseDouble(weidu), storeJing, storeWei);*/
|
|
|
|
|
|
- Double distance = storeInfoMapper.getStoreDistance(jingdu + "," + weidu,result.getId());
|
|
|
+ Double distance = storeInfoMapper.getStoreDistance(jingdu + "," + weidu, result.getId());
|
|
|
|
|
|
result.setDistance(distance);
|
|
|
}
|
|
|
@@ -4702,4 +4698,38 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<StoreDictionaryVo> getBusinessClassifyData(Integer parentId) {
|
|
|
+ // 构建查询条件
|
|
|
+ LambdaQueryWrapper<StoreDictionary> queryWrapper = new LambdaQueryWrapper<StoreDictionary>()
|
|
|
+ .eq(StoreDictionary::getTypeName, "business_classify")
|
|
|
+ .eq(StoreDictionary::getDeleteFlag, 0)
|
|
|
+ .orderByAsc(StoreDictionary::getDictId);
|
|
|
+
|
|
|
+ // 如果指定了parentId,则只查询该父分类下的子分类
|
|
|
+ if (parentId != null) {
|
|
|
+ queryWrapper.eq(StoreDictionary::getParentId, parentId);
|
|
|
+ } else {
|
|
|
+ // 如果没有指定parentId,则查询所有子分类(parentId不为0或null的分类)
|
|
|
+ queryWrapper.isNotNull(StoreDictionary::getParentId)
|
|
|
+ .ne(StoreDictionary::getParentId, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询字典数据
|
|
|
+ List<StoreDictionary> allClassifies = storeDictionaryMapper.selectList(queryWrapper);
|
|
|
+
|
|
|
+ // 构建扁平化的结果列表(仅返回子分类,用于多选功能)
|
|
|
+ List<StoreDictionaryVo> result = new ArrayList<>();
|
|
|
+
|
|
|
+ for (StoreDictionary classify : allClassifies) {
|
|
|
+ StoreDictionaryVo vo = new StoreDictionaryVo();
|
|
|
+ BeanUtils.copyProperties(classify, vo);
|
|
|
+ // 不设置subDataList,返回扁平化列表
|
|
|
+ result.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|