胡锐 1 year ago
commit 68de8cc2ba
  1. 2
      cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java
  2. 19
      cweb/src/main/java/com/cweb/controller/group/BsStoreImgController.java
  3. 10
      cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java
  4. 14
      service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java
  5. 3
      service/src/main/java/com/hfkj/model/OpenStoreModel.java

@ -168,7 +168,7 @@ public class BsStoreGroupController {
storeGroupDetail.setName(object.getString("name")); storeGroupDetail.setName(object.getString("name"));
storeGroupDetail.setProductImg(storeProduct.getImg()); storeGroupDetail.setProductImg(storeProduct.getImg());
storeGroupDetail.setProductName(storeProduct.getName()); storeGroupDetail.setProductName(storeProduct.getName());
storeGroupDetail.setProductSpec(storeProduct.getSpec()); storeGroupDetail.setProductSpec(data.getInteger("count") + storeProduct.getSpec());
storeGroupDetail.setStoreProductId(data.getString("productId")); storeGroupDetail.setStoreProductId(data.getString("productId"));
storeGroupDetail.setCreateTime(new Date()); storeGroupDetail.setCreateTime(new Date());
storeGroupDetail.setStatus(1); storeGroupDetail.setStatus(1);

@ -11,6 +11,7 @@ import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel; import com.hfkj.model.UserInfoModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -104,14 +105,16 @@ public class BsStoreImgController {
if (userInfoModel == null || userInfoModel.getSalesman() == null) { if (userInfoModel == null || userInfoModel.getSalesman() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限");
} }
String[] imgList = storeImg.getImg().split(",");
storeImg.setStatus(1); for (String i : imgList) {
storeImg.setCreateTime(new Date()); storeImg.setStatus(1);
storeImg.setUpdateTime(new Date()); storeImg.setCreateTime(new Date());
storeImg.setOpId(userInfoModel.getSalesman().getId()); storeImg.setUpdateTime(new Date());
storeImg.setOpName(userInfoModel.getSalesman().getName()); storeImg.setOpId(userInfoModel.getSalesman().getId());
storeImg.setOpName(userInfoModel.getSalesman().getName());
storeGroupService.insertStoreImg(storeImg); storeImg.setImg(i);
storeGroupService.insertStoreImg(storeImg);
}
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

@ -7,10 +7,7 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.CoordCommonUtil; import com.hfkj.common.utils.CoordCommonUtil;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsMer; import com.hfkj.entity.*;
import com.hfkj.entity.BsStore;
import com.hfkj.entity.BsStoreGroupContent;
import com.hfkj.entity.BsStoreGroupDetail;
import com.hfkj.group.BsStoreGroupProductService; import com.hfkj.group.BsStoreGroupProductService;
import com.hfkj.group.BsStoreGroupService; import com.hfkj.group.BsStoreGroupService;
import com.hfkj.model.GroupContentModel; import com.hfkj.model.GroupContentModel;
@ -68,6 +65,7 @@ public class OpenGroupController {
for (OpenStoreModel storeModel : list) { for (OpenStoreModel storeModel : list) {
Map<String , Object > map = new HashMap<>(); Map<String , Object > map = new HashMap<>();
map.put("storeId" , storeModel.getStoreId()); map.put("storeId" , storeModel.getStoreId());
map.put("status" , 1);
List<BsStoreGroupContent> storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map); List<BsStoreGroupContent> storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map);
if (longitude != null && latitude != null && storeModel.getLatitude() != null && storeModel.getLongitude() != null) { 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)); 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.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()); list = list.stream().filter(data -> !data.getStoreGroupContentList().isEmpty()).sorted(Comparator.comparing(OpenStoreModel::getDistance)).collect(Collectors.toList());
@ -106,7 +105,7 @@ public class OpenGroupController {
List<BsStoreGroupDetail> list = storeGroupProductService.getGroupDetailByList(map); List<BsStoreGroupDetail> list = storeGroupProductService.getGroupDetailByList(map);
Map<String, List<BsStoreGroupDetail>> collect = list.stream().collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); Map<String, List<BsStoreGroupDetail>> collect = list.stream().sorted(Comparator.comparing(BsStoreGroupDetail::getCreateTime)).collect(Collectors.groupingBy(BsStoreGroupDetail::getName));
List<JSONObject> groupDetails = collect.keySet().stream().map(key -> { List<JSONObject> groupDetails = collect.keySet().stream().map(key -> {
JSONObject detailObject = new JSONObject(true); JSONObject detailObject = new JSONObject(true);
@ -134,6 +133,7 @@ public class OpenGroupController {
Map<String , Object > map = new HashMap<>(); Map<String , Object > map = new HashMap<>();
map.put("storeId" , storeId); map.put("storeId" , storeId);
map.put("status" , 1);
BsStore bsStore = bsStoreService.getStoreById(storeId); BsStore bsStore = bsStoreService.getStoreById(storeId);

@ -47,7 +47,12 @@ public class BsStoreGroupProductServiceImpl implements BsStoreGroupProductServic
if (org.apache.commons.collections4.MapUtils.getLong(map, "storeId") != null) { if (org.apache.commons.collections4.MapUtils.getLong(map, "storeId") != null) {
criteria.andStoreIdEqualTo(MapUtils.getLong(map, "storeId")); 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); return storeGroupContentMapper.selectByExample(example);
} }
@ -96,8 +101,13 @@ public class BsStoreGroupProductServiceImpl implements BsStoreGroupProductServic
if (MapUtils.getLong(map, "groupId") != null) { if (MapUtils.getLong(map, "groupId") != null) {
criteria.andGroupIdEqualTo(MapUtils.getLong(map, "groupId")); 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); return storeGroupDetailMapper.selectByExample(example);
} }

@ -1,6 +1,7 @@
package com.hfkj.model; package com.hfkj.model;
import ch.qos.logback.core.db.dialect.DBUtil; import ch.qos.logback.core.db.dialect.DBUtil;
import com.hfkj.entity.BsStoreExtMsg;
import com.hfkj.entity.BsStoreGroupContent; import com.hfkj.entity.BsStoreGroupContent;
import javax.xml.crypto.Data; import javax.xml.crypto.Data;
@ -56,4 +57,6 @@ public class OpenStoreModel {
private List<BsStoreGroupContent> storeGroupContentList; private List<BsStoreGroupContent> storeGroupContentList;
private BsStoreExtMsg bsStoreExtMsg;
} }

Loading…
Cancel
Save