diff --git a/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java b/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java index ddf1294..51d6c06 100644 --- a/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java +++ b/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java @@ -168,7 +168,7 @@ public class BsStoreGroupController { storeGroupDetail.setName(object.getString("name")); storeGroupDetail.setProductImg(storeProduct.getImg()); storeGroupDetail.setProductName(storeProduct.getName()); - storeGroupDetail.setProductSpec(storeProduct.getSpec()); + storeGroupDetail.setProductSpec(data.getInteger("count") + storeProduct.getSpec()); storeGroupDetail.setStoreProductId(data.getString("productId")); storeGroupDetail.setCreateTime(new Date()); storeGroupDetail.setStatus(1); diff --git a/cweb/src/main/java/com/cweb/controller/group/BsStoreImgController.java b/cweb/src/main/java/com/cweb/controller/group/BsStoreImgController.java index ecb2a1c..b34c771 100644 --- a/cweb/src/main/java/com/cweb/controller/group/BsStoreImgController.java +++ b/cweb/src/main/java/com/cweb/controller/group/BsStoreImgController.java @@ -11,6 +11,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.model.UserInfoModel; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -104,14 +105,16 @@ public class BsStoreImgController { if (userInfoModel == null || userInfoModel.getSalesman() == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); } - - storeImg.setStatus(1); - storeImg.setCreateTime(new Date()); - storeImg.setUpdateTime(new Date()); - storeImg.setOpId(userInfoModel.getSalesman().getId()); - storeImg.setOpName(userInfoModel.getSalesman().getName()); - - storeGroupService.insertStoreImg(storeImg); + String[] imgList = storeImg.getImg().split(","); + for (String i : imgList) { + storeImg.setStatus(1); + storeImg.setCreateTime(new Date()); + storeImg.setUpdateTime(new Date()); + storeImg.setOpId(userInfoModel.getSalesman().getId()); + storeImg.setOpName(userInfoModel.getSalesman().getName()); + storeImg.setImg(i); + storeGroupService.insertStoreImg(storeImg); + } return ResponseMsgUtil.success("操作成功"); diff --git a/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java index b2ca19c..f487f43 100644 --- a/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java +++ b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java @@ -7,10 +7,7 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.CoordCommonUtil; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.entity.BsMer; -import com.hfkj.entity.BsStore; -import com.hfkj.entity.BsStoreGroupContent; -import com.hfkj.entity.BsStoreGroupDetail; +import com.hfkj.entity.*; import com.hfkj.group.BsStoreGroupProductService; import com.hfkj.group.BsStoreGroupService; import com.hfkj.model.GroupContentModel; @@ -68,6 +65,7 @@ public class OpenGroupController { for (OpenStoreModel storeModel : list) { Map map = new HashMap<>(); map.put("storeId" , storeModel.getStoreId()); + map.put("status" , 1); List storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map); if (longitude != null && latitude != null && storeModel.getLatitude() != null && storeModel.getLongitude() != null) { double distance = CoordCommonUtil.getDistance(Double.valueOf(storeModel.getLatitude()), Double.valueOf(storeModel.getLongitude()), Double.valueOf(latitude), Double.valueOf(longitude)); @@ -81,6 +79,7 @@ public class OpenGroupController { } storeModel.setStoreGroupContentList(storeGroupContent); + storeModel.setBsStoreExtMsg(storeGroupService.findStoreExtMsgByStoreId(Long.valueOf(storeModel.getStoreId()))); } list = list.stream().filter(data -> !data.getStoreGroupContentList().isEmpty()).sorted(Comparator.comparing(OpenStoreModel::getDistance)).collect(Collectors.toList()); @@ -106,7 +105,7 @@ public class OpenGroupController { List list = storeGroupProductService.getGroupDetailByList(map); - Map> collect = list.stream().collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); + Map> collect = list.stream().sorted(Comparator.comparing(BsStoreGroupDetail::getCreateTime)).collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); List groupDetails = collect.keySet().stream().map(key -> { JSONObject detailObject = new JSONObject(true); @@ -134,6 +133,7 @@ public class OpenGroupController { Map map = new HashMap<>(); map.put("storeId" , storeId); + map.put("status" , 1); BsStore bsStore = bsStoreService.getStoreById(storeId); diff --git a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java index 76746be..de30e3c 100644 --- a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java +++ b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java @@ -47,7 +47,12 @@ public class BsStoreGroupProductServiceImpl implements BsStoreGroupProductServic if (org.apache.commons.collections4.MapUtils.getLong(map, "storeId") != null) { criteria.andStoreIdEqualTo(MapUtils.getLong(map, "storeId")); } - criteria.andStatusNotEqualTo(0); + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } + return storeGroupContentMapper.selectByExample(example); } @@ -96,8 +101,13 @@ public class BsStoreGroupProductServiceImpl implements BsStoreGroupProductServic if (MapUtils.getLong(map, "groupId") != null) { criteria.andGroupIdEqualTo(MapUtils.getLong(map, "groupId")); } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } + - criteria.andStatusNotEqualTo(0); return storeGroupDetailMapper.selectByExample(example); } diff --git a/service/src/main/java/com/hfkj/model/OpenStoreModel.java b/service/src/main/java/com/hfkj/model/OpenStoreModel.java index 749130d..55b6a4d 100644 --- a/service/src/main/java/com/hfkj/model/OpenStoreModel.java +++ b/service/src/main/java/com/hfkj/model/OpenStoreModel.java @@ -1,6 +1,7 @@ package com.hfkj.model; import ch.qos.logback.core.db.dialect.DBUtil; +import com.hfkj.entity.BsStoreExtMsg; import com.hfkj.entity.BsStoreGroupContent; import javax.xml.crypto.Data; @@ -56,4 +57,6 @@ public class OpenStoreModel { private List storeGroupContentList; + private BsStoreExtMsg bsStoreExtMsg; + }