|
|
@@ -98,8 +98,6 @@ public class GroupApiController {
|
|
|
private ICardCheckListService checkListService;
|
|
|
@Autowired
|
|
|
private ISysDictDataService dictDataService;
|
|
|
- @Value("${pay.wxpay.app.appID}")
|
|
|
- private String appId;
|
|
|
@Resource
|
|
|
private CommonCacheService commonCacheService;
|
|
|
@Autowired
|
|
|
@@ -108,8 +106,6 @@ public class GroupApiController {
|
|
|
private TzyMerchantAssessService tzyMerchantAssessService;
|
|
|
@Resource
|
|
|
private ITzyCardBaseInfoService cardBaseInfoService;
|
|
|
- @Autowired
|
|
|
- private PayService payService;
|
|
|
@Resource
|
|
|
private GroupActService groupActService;
|
|
|
@Resource
|
|
|
@@ -336,467 +332,7 @@ public class GroupApiController {
|
|
|
OutDTO outDTO = groupApiService.findGroupBySearch(inDto, cardGroupInfo);
|
|
|
return outDTO;
|
|
|
}
|
|
|
- /**
|
|
|
- * 组团
|
|
|
- *
|
|
|
- * @param inDto
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiLog(title = "组团详情", businessType = BusinessType.SEARCH, indto = "{{inDto}}")
|
|
|
- @ApiLimitRule(seconds = 1,limitCount = 30)
|
|
|
- @ResponseBody
|
|
|
- @RequestMapping(value = "/info", method = RequestMethod.POST)
|
|
|
- public OutDTO info(@RequestBody InDto inDto) {
|
|
|
- Integer id = inDto.getIntegerParam("id");
|
|
|
- if (null == id) {
|
|
|
- return OutDTO.error500("参数[id]不能为空");
|
|
|
- }
|
|
|
- GroupInfo groupInfo = groupApiService.getGroupInfoById(id);
|
|
|
-
|
|
|
- if (groupInfo == null) {
|
|
|
- return OutDTO.error500("拼团不存在!");
|
|
|
- }
|
|
|
- UserInfo user = UserUtils.getSimpleUserInfo();
|
|
|
- Long userOrderId = null;
|
|
|
- boolean isAdmin = false;
|
|
|
- boolean isShipping = false;
|
|
|
- if (user != null) {
|
|
|
- isAdmin = UserType.USER_ROLE_ADMIN.equals(user.getRoleCode());
|
|
|
- isShipping = UserType.USER_ROLE_SHIPPING.equals(user.getRoleCode());
|
|
|
- userOrderId = groupApiService.getUserLastOrderId(user.getId(), id);
|
|
|
- //appUserBrowseRecordService.addUserBrowseRecord(user.getId().longValue(), id.longValue(), "group", groupInfo.getMerchantId());
|
|
|
- List<SysDictData> sysDictDatas = commonCacheService.getCommonDictData("app_user_browse_record_cache",
|
|
|
- "isEnabled", "1", null, -1);
|
|
|
- if(!sysDictDatas.isEmpty()) {
|
|
|
- //int isEnabled = Integer.parseInt(sysDictDatas.get(0).getDictValue());
|
|
|
- // 浏览记录入库,不影响接口正常返回
|
|
|
- try {
|
|
|
- appUserBrowseRecordService.addUserBrowseRecord(user.getId().longValue(), id.longValue(), "group", groupInfo.getMerchantId());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("添加浏览记录异常", e);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- if (groupInfo.getStatus() == 201 && user != null) {
|
|
|
- groupInfo.setFirstActAmount(groupApiService.getFirstActPrice(groupInfo.getId(), groupInfo.getFirstActConfig(), groupInfo.getType(),
|
|
|
- user.getId()));
|
|
|
- }
|
|
|
- //查询附件
|
|
|
- List<FileDto> tzyEnclosures = groupApiService.searchByFromCode(groupInfo.getCode());
|
|
|
- //查询已参与组团的用户
|
|
|
- int orderNum = inDto.get("orderNum") == null ? 5 : (Integer) inDto.get("orderNum");
|
|
|
- List<GroupUserOrderDto> orders = groupApiService.searchOrderByGroupId(id, orderNum);
|
|
|
- orders.forEach(o -> {
|
|
|
- if (o.getAnonymous() != null && o.getAnonymous()) {
|
|
|
- o.setNickname(Constants.ANONYMOUS_NAME);
|
|
|
- o.setAvatar(Constants.ANONYMOUS_AVATAR);
|
|
|
- } else {
|
|
|
- o.setNickname(StringUtils.isEmpty(o.getNickname()) ? "***" : o.getNickname().substring(0, 1) + "***");
|
|
|
- }
|
|
|
- });
|
|
|
- //查询未付款的用户数(订单)
|
|
|
- CardGroupOrderInfo cardGroupOrderInfo = new CardGroupOrderInfo();
|
|
|
- cardGroupOrderInfo.setStatus(100L);
|
|
|
- cardGroupOrderInfo.setGroupInfoId(groupInfo.getId());
|
|
|
- int noPayment = orderInfoService.selectUnPaymentCount(cardGroupOrderInfo);
|
|
|
- List<CardGroupGoodsIdx> cardGroupGoodsIdxes = new ArrayList<>();
|
|
|
- List<BuyTeamDTO> goodsData = new ArrayList<>();
|
|
|
- //如果组团方式是 随机球队
|
|
|
- Object minMaxPrice = "";
|
|
|
- Map<String, List<GroupTeamDTO>> selectTeams=null;
|
|
|
- if (Constants.INFO_TYPE_TEAM.equals(groupInfo.getType())) {
|
|
|
- //查询选中列表
|
|
|
- CardGroupGoodsIdx cardGroupGoodsIdx = new CardGroupGoodsIdx();
|
|
|
- cardGroupGoodsIdx.setGroupInfoId(groupInfo.getId());
|
|
|
- cardGroupGoodsIdxes = cardGroupGoodsIdxService.selectCardGroupGoodsIdxList(cardGroupGoodsIdx);
|
|
|
- } else if (Constants.INFO_TYPE_BUY_TEAM.equals(groupInfo.getType())) {
|
|
|
- CardGroupGoods condition = new CardGroupGoods();
|
|
|
- condition.setGroupInfoId(groupInfo.getId());
|
|
|
- List<CardGroupGoods> cardGroupGoods = cardGroupGoodsService.selectCardGroupGoodsList(condition);
|
|
|
- minMaxPrice=groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- //新版订单购买未付款被占卡密
|
|
|
- List<String> selectedIds = groupApiService.getUnSoldSelectedGoodsId(groupInfo.getId());
|
|
|
- if (!selectedIds.isEmpty()) {
|
|
|
- cardGroupGoods.stream().filter(g -> g.getSelected() == 0 && selectedIds.contains(g.getId().toString()))
|
|
|
- .forEach(g -> g.setSelected(1));
|
|
|
- }
|
|
|
- Map<String, List<CardGroupGoodsDTO>> goodsDataMap = cardGroupGoods.stream().sorted(Comparator.comparing(CardGroupGoods::getSelected))
|
|
|
- .map(CardGroupGoodsDTO::buildByGoods)
|
|
|
- .collect(groupingBy(CardGroupGoodsDTO::getTeam));
|
|
|
- Set<String> typeSets = goodsDataMap.keySet();
|
|
|
- typeSets.forEach(type -> goodsData.add(new BuyTeamDTO(type, goodsDataMap.get(type))));
|
|
|
- } else if (Constants.INFO_TYPE_SELECT_TEAM.equals(groupInfo.getType())) {
|
|
|
- minMaxPrice = groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- if (Constants.INFO_TYPE_TEAM_TO_RANDOM.equals(groupInfo.getChangeType())) {
|
|
|
- selectTeams = groupApiService.getGroupTeamToRandom(id);
|
|
|
- }
|
|
|
- }
|
|
|
- Integer userOrderNums=0;
|
|
|
- if(inDto.getUserId()!=null){
|
|
|
- groupInfo.setFollowStatus(merchantApiService.getUserFollowStatus(inDto.getUserId(),groupInfo.getMerchantId().intValue()));
|
|
|
- userOrderNums=orderInfoService.selectUserOrderNums(inDto.getUserId(),groupInfo.getId());
|
|
|
- }
|
|
|
-
|
|
|
- //营销信息
|
|
|
- JSONArray marketing = GroupApiServiceImpl.buildInfoMarketJson(groupInfo.getMarketingInfo());
|
|
|
-
|
|
|
- String actConfigJson = groupInfo.getActConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(actConfigJson)){
|
|
|
- InfoActConfig infoActConfig = JSONTools.jsonStr2obj(actConfigJson, InfoActConfig.class);
|
|
|
- if(InfoActConfig.ACT_TYPE_GUESS_TEAM.equals(infoActConfig.getType())){
|
|
|
- groupInfo.setGuessAct(true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //审核相关信息
|
|
|
- if(groupInfo.getStatus()>=100 && groupInfo.getStatus()<=103){
|
|
|
- groupInfo.setPriceInterval(groupApiService.getPriceInterval(groupInfo.getPaniniListId()));
|
|
|
- groupInfo.setTypeCounts(groupApiService.getCountByInfo(groupInfo));
|
|
|
- }
|
|
|
-
|
|
|
- MerInfoCountDTO merInfoCountDTO = merchantApiService.getMerInfoCount(groupInfo.getMerchantId());
|
|
|
- tzyEnclosures.add(0, new FileDto("coverPicture", groupInfo.getCoverPicture()));
|
|
|
- groupInfo.setJumpAppletFlag(appId.equals(groupInfo.getLiveAppid()));
|
|
|
-
|
|
|
- if(!isAdmin){
|
|
|
- tzyEnclosures=tzyEnclosures.stream().filter(file -> !("video".equals(file.getCategory()))).collect(Collectors.toList());
|
|
|
- String configJson = groupInfo.getConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(configJson)){
|
|
|
- JSONObject jsonObject = JSON.parseObject(configJson);
|
|
|
- jsonObject.put("weightUrl","");
|
|
|
- jsonObject.put("video","");
|
|
|
- groupInfo.setConfigJson(jsonObject.toJSONString());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //判断当前登陆的用户是否是商家角色
|
|
|
- boolean confirmStatus = isShipping && groupInfo.getMerchantId() == user.getMerchantId().longValue();
|
|
|
- boolean livingOpenAble = true;
|
|
|
-
|
|
|
- List<CodeRecordDTO> codeRecords = groupApiService.getRefCodeRecord(groupInfo.getId(), null);
|
|
|
- boolean hasSaleCode = !CollectionUtils.isEmpty(codeRecords);
|
|
|
- if (isShipping || isAdmin) {
|
|
|
- if (!CollectionUtils.isEmpty(codeRecords)) {
|
|
|
- // 判断生态购
|
|
|
- livingOpenAble = codeRecords.stream().noneMatch(c -> c.getStatus() == 0);
|
|
|
- }
|
|
|
- } else {
|
|
|
- codeRecords = CollectionUtils.isEmpty(codeRecords) ? new ArrayList<>() : Collections.singletonList(new CodeRecordDTO());
|
|
|
- }
|
|
|
-
|
|
|
- //新版生态购
|
|
|
- GroupSaleCodeDTO saleCodeConfig = groupActService.getGroupSaleCodeConfig(groupInfo.getId(),groupInfo.getStatus()>=201);
|
|
|
- List<CountDTO> codeCountByType=new ArrayList<>();
|
|
|
- ChecklistBaseConfigDto baseConfig = sysBaseService.selectChecklistBaseConfigAndPriceV2(id);
|
|
|
- if (saleCodeConfig.isHasBoxConfig()) {
|
|
|
- hasSaleCode = true;
|
|
|
- livingOpenAble = groupActService.checkGroupSaleCodeCount(groupInfo.getId(), groupInfo.getMerchantId().intValue(), saleCodeConfig);
|
|
|
- if(groupInfo.getStatus()==203){
|
|
|
- codeCountByType=groupActService.selectUseAbleCountByType(groupInfo.getMerchantId().intValue(),
|
|
|
- baseConfig.getSetsVersion(), groupInfo.getPaniniListId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(!tzyEnclosures.isEmpty()&&StringUtils.isEmpty(groupInfo.getCarouses())){
|
|
|
- String urls = tzyEnclosures.stream().filter(file -> ("CarouseMap".equals(file.getCategory())))
|
|
|
- .map(FileDto::getUrl).collect(Collectors.joining(","));
|
|
|
- groupInfo.setCarouses(urls);
|
|
|
- }
|
|
|
- long unlockNUm=0;
|
|
|
- if(groupInfo.isPreSale()){
|
|
|
- unlockNUm=groupInfo.getSoldCopies()-noPayment-groupInfo.getRealSoldNum();
|
|
|
- groupInfo.setSoldCopies(groupInfo.getRealSoldNum());
|
|
|
- }else {
|
|
|
- groupInfo.setSoldCopies(noPayment+groupInfo.getRealSoldNum());
|
|
|
- }
|
|
|
- // 查询商家店铺会员信息
|
|
|
- MerchantScoreDTO merchantScoreDTO = tzyMerchantAssessService.getMerchantMemberInfoV3(groupInfo.getMerchantId());
|
|
|
- //拼团积分
|
|
|
- BigDecimal groupPoint = BigDecimal.ZERO;
|
|
|
- if (user != null && StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- Long point = mineApiService.getUserPointByType(user.getId(), groupInfo.getPointType(), groupInfo.getMerchantId().intValue());
|
|
|
- groupPoint = new BigDecimal(point.toString()).divide(Constants.HUNDRED, 2, RoundingMode.HALF_DOWN);
|
|
|
- }
|
|
|
- String refSkuIds="";
|
|
|
- Long refSpuId=null;
|
|
|
- if (StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- List<SimpleSku> skuList = groupApiService.getRefSkus(groupInfo.getId());
|
|
|
- if (!CollectionUtils.isEmpty(skuList)) {
|
|
|
- refSkuIds = skuList.stream().map(s -> s.getId().toString()).collect(Collectors.joining(","));
|
|
|
- SimpleSku sku = skuList.get(0);
|
|
|
- refSpuId = sku.getSpuId();
|
|
|
- if (StringUtils.isEmpty(groupInfo.getGroupShowName())) {
|
|
|
- groupInfo.setGroupShowName(sku.getSkuName());
|
|
|
- groupInfo.setGroupShowImgs(sku.getCarouselImgUrl());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<GroupRelatedInfoDto> relatedGroupInfo = groupApiService.getRelatedGroupInfoById(groupInfo.getListId(),groupInfo.getId(),groupInfo.getMerchantId(),baseConfig.getParentId(),baseConfig.getPaniniConfigId(),groupInfo.getCode(),groupInfo.getType());
|
|
|
- //groupApiService.getGroupInfoRank(groupInfo);
|
|
|
- return OutDTO.ok().put("groupInfo", groupInfo)
|
|
|
- .put("relatedGroupInfo", relatedGroupInfo)
|
|
|
- .put("file", tzyEnclosures)
|
|
|
- .put("merInfoCount", merInfoCountDTO)
|
|
|
- .put("favorablePrice", groupApiService.getLowActPrice(groupInfo.getUnitPrice(), groupInfo.getMarketingInfo()))
|
|
|
- .put("marketing", marketing)
|
|
|
- .put("orders", orders)
|
|
|
- .put("userOrderId", userOrderId)
|
|
|
- .put("minMaxPrice", minMaxPrice)
|
|
|
- .put("noPayment", noPayment)
|
|
|
- .put("unlockNUm", unlockNUm)
|
|
|
- .put("lastTeams", selectTeams)
|
|
|
- .put("cardGroupGoodsIdxes", cardGroupGoodsIdxes)
|
|
|
- .put("goodsData", goodsData)
|
|
|
- .put("userOrderNums", userOrderNums)
|
|
|
- .put("merchantBond", merchantApiService.getMerchantBond(groupInfo.getMerchantId()))
|
|
|
- .put("confirmStatus", confirmStatus)
|
|
|
- .put("merchantScore", merchantScoreDTO)
|
|
|
- .put("baseConfig", isAdmin ? baseConfig : new ChecklistBaseConfigDto())
|
|
|
- .put("custom", sysBaseService.selectChecklistBaseCustom(id))
|
|
|
- .put("groupPoint", groupPoint)
|
|
|
- .put("refSkuIds", refSkuIds)
|
|
|
- .put("refSpuId", refSpuId)
|
|
|
- .put("codeRecords", codeRecords)
|
|
|
- .put("firstActConfig", isAdmin ? groupInfo.getFirstActConfig() : null)
|
|
|
- .put("livingOpenAble", livingOpenAble)
|
|
|
- .put("saleCodeConfig", saleCodeConfig)
|
|
|
- .put("hasSaleCode", hasSaleCode)
|
|
|
- .put("codeCountByType", codeCountByType)
|
|
|
- .put("followFlag", mineApiService.isFollowed(Constants.GROUP_DETAIL_FOLLOW, id, inDto.getUserId()))
|
|
|
- ;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 组团
|
|
|
- *
|
|
|
- * @param inDto
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiLog(title = "组团详情", businessType = BusinessType.SEARCH, indto = "{{inDto}}")
|
|
|
- @ApiLimitRule(seconds = 1,limitCount = 30)
|
|
|
- @ResponseBody
|
|
|
- @RequestMapping(value = "/info/test", method = RequestMethod.POST)
|
|
|
- public OutDTO infoTest(@RequestBody InDto inDto) {
|
|
|
- Integer id = inDto.getIntegerParam("id");
|
|
|
- if (null == id) {
|
|
|
- return OutDTO.error500("参数[id]不能为空");
|
|
|
- }
|
|
|
- GroupInfo groupInfo = groupApiService.getGroupInfoById(id);
|
|
|
-
|
|
|
- if (groupInfo == null) {
|
|
|
- return OutDTO.error500("拼团不存在!");
|
|
|
- }
|
|
|
- UserInfo user = UserUtils.getSimpleUserInfo();
|
|
|
- Long userOrderId = null;
|
|
|
- boolean isAdmin = false;
|
|
|
- boolean isShipping = false;
|
|
|
- if (user != null) {
|
|
|
- isAdmin = UserType.USER_ROLE_ADMIN.equals(user.getRoleCode());
|
|
|
- isShipping = UserType.USER_ROLE_SHIPPING.equals(user.getRoleCode());
|
|
|
- userOrderId = groupApiService.getUserLastOrderId(user.getId(), id);
|
|
|
- pools.execute(() -> {
|
|
|
- // 浏览记录入库,不影响接口正常返回
|
|
|
- try {
|
|
|
- appUserBrowseRecordService.addUserBrowseRecord(user.getId().longValue(), id.longValue(), "group", groupInfo.getMerchantId());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("添加浏览记录异常", e);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (groupInfo.getStatus() == 201 && user != null) {
|
|
|
- groupInfo.setFirstActAmount(groupApiService.getFirstActPrice(groupInfo.getId(), groupInfo.getFirstActConfig(), groupInfo.getType(),
|
|
|
- user.getId()));
|
|
|
- }
|
|
|
- //查询附件
|
|
|
- List<FileDto> tzyEnclosures = groupApiService.searchByFromCode(groupInfo.getCode());
|
|
|
- //查询已参与组团的用户
|
|
|
- int orderNum = inDto.get("orderNum") == null ? 5 : (Integer) inDto.get("orderNum");
|
|
|
- List<GroupUserOrderDto> orders = groupApiService.searchOrderByGroupId(id, orderNum);
|
|
|
- orders.forEach(o -> {
|
|
|
- if (o.getAnonymous() != null && o.getAnonymous()) {
|
|
|
- o.setNickname(Constants.ANONYMOUS_NAME);
|
|
|
- o.setAvatar(Constants.ANONYMOUS_AVATAR);
|
|
|
- } else {
|
|
|
- o.setNickname(StringUtils.isEmpty(o.getNickname()) ? "***" : o.getNickname().substring(0, 1) + "***");
|
|
|
- }
|
|
|
- });
|
|
|
- //查询未付款的用户数(订单)
|
|
|
- CardGroupOrderInfo cardGroupOrderInfo = new CardGroupOrderInfo();
|
|
|
- cardGroupOrderInfo.setStatus(100L);
|
|
|
- cardGroupOrderInfo.setGroupInfoId(groupInfo.getId());
|
|
|
- int noPayment = orderInfoService.selectUnPaymentCount(cardGroupOrderInfo);
|
|
|
- List<CardGroupGoodsIdx> cardGroupGoodsIdxes = new ArrayList<>();
|
|
|
- List<BuyTeamDTO> goodsData = new ArrayList<>();
|
|
|
- //如果组团方式是 随机球队
|
|
|
- Object minMaxPrice = "";
|
|
|
- Map<String, List<GroupTeamDTO>> selectTeams=null;
|
|
|
- if (Constants.INFO_TYPE_TEAM.equals(groupInfo.getType())) {
|
|
|
- //查询选中列表
|
|
|
- CardGroupGoodsIdx cardGroupGoodsIdx = new CardGroupGoodsIdx();
|
|
|
- cardGroupGoodsIdx.setGroupInfoId(groupInfo.getId());
|
|
|
- cardGroupGoodsIdxes = cardGroupGoodsIdxService.selectCardGroupGoodsIdxList(cardGroupGoodsIdx);
|
|
|
- } else if (Constants.INFO_TYPE_BUY_TEAM.equals(groupInfo.getType())) {
|
|
|
- CardGroupGoods condition = new CardGroupGoods();
|
|
|
- condition.setGroupInfoId(groupInfo.getId());
|
|
|
- List<CardGroupGoods> cardGroupGoods = cardGroupGoodsService.selectCardGroupGoodsList(condition);
|
|
|
- minMaxPrice=groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- //新版订单购买未付款被占卡密
|
|
|
- List<String> selectedIds = groupApiService.getUnSoldSelectedGoodsId(groupInfo.getId());
|
|
|
- if (!selectedIds.isEmpty()) {
|
|
|
- cardGroupGoods.stream().filter(g -> g.getSelected() == 0 && selectedIds.contains(g.getId().toString()))
|
|
|
- .forEach(g -> g.setSelected(1));
|
|
|
- }
|
|
|
- Map<String, List<CardGroupGoodsDTO>> goodsDataMap = cardGroupGoods.stream().sorted(Comparator.comparing(CardGroupGoods::getSelected))
|
|
|
- .map(CardGroupGoodsDTO::buildByGoods)
|
|
|
- .collect(groupingBy(CardGroupGoodsDTO::getTeam));
|
|
|
- Set<String> typeSets = goodsDataMap.keySet();
|
|
|
- typeSets.forEach(type -> goodsData.add(new BuyTeamDTO(type, goodsDataMap.get(type))));
|
|
|
- } else if (Constants.INFO_TYPE_SELECT_TEAM.equals(groupInfo.getType())) {
|
|
|
- minMaxPrice = groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- if (Constants.INFO_TYPE_TEAM_TO_RANDOM.equals(groupInfo.getChangeType())) {
|
|
|
- selectTeams = groupApiService.getGroupTeamToRandom(id);
|
|
|
- }
|
|
|
- }
|
|
|
- Integer userOrderNums=0;
|
|
|
- if(inDto.getUserId()!=null){
|
|
|
- groupInfo.setFollowStatus(merchantApiService.getUserFollowStatus(inDto.getUserId(),groupInfo.getMerchantId().intValue()));
|
|
|
- userOrderNums=orderInfoService.selectUserOrderNums(inDto.getUserId(),groupInfo.getId());
|
|
|
- }
|
|
|
-
|
|
|
- //营销信息
|
|
|
- JSONArray marketing = GroupApiServiceImpl.buildInfoMarketJson(groupInfo.getMarketingInfo());
|
|
|
|
|
|
- String actConfigJson = groupInfo.getActConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(actConfigJson)){
|
|
|
- InfoActConfig infoActConfig = JSONTools.jsonStr2obj(actConfigJson, InfoActConfig.class);
|
|
|
- if(InfoActConfig.ACT_TYPE_GUESS_TEAM.equals(infoActConfig.getType())){
|
|
|
- groupInfo.setGuessAct(true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //审核相关信息
|
|
|
- if(groupInfo.getStatus()>=100 && groupInfo.getStatus()<=103){
|
|
|
- groupInfo.setPriceInterval(groupApiService.getPriceInterval(groupInfo.getPaniniListId()));
|
|
|
- groupInfo.setTypeCounts(groupApiService.getCountByInfo(groupInfo));
|
|
|
- }
|
|
|
-
|
|
|
- MerInfoCountDTO merInfoCountDTO = merchantApiService.getMerInfoCount(groupInfo.getMerchantId());
|
|
|
- tzyEnclosures.add(0, new FileDto("coverPicture", groupInfo.getCoverPicture()));
|
|
|
- groupInfo.setJumpAppletFlag(appId.equals(groupInfo.getLiveAppid()));
|
|
|
-
|
|
|
- if(!isAdmin){
|
|
|
- tzyEnclosures=tzyEnclosures.stream().filter(file -> !("video".equals(file.getCategory()))).collect(Collectors.toList());
|
|
|
- String configJson = groupInfo.getConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(configJson)){
|
|
|
- JSONObject jsonObject = JSON.parseObject(configJson);
|
|
|
- jsonObject.put("weightUrl","");
|
|
|
- jsonObject.put("video","");
|
|
|
- groupInfo.setConfigJson(jsonObject.toJSONString());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //判断当前登陆的用户是否是商家角色
|
|
|
- boolean confirmStatus = isShipping && groupInfo.getMerchantId() == user.getMerchantId().longValue();
|
|
|
- boolean livingOpenAble = true;
|
|
|
-
|
|
|
- List<CodeRecordDTO> codeRecords = groupApiService.getRefCodeRecord(groupInfo.getId(), null);
|
|
|
- boolean hasSaleCode = !CollectionUtils.isEmpty(codeRecords);
|
|
|
- if (isShipping || isAdmin) {
|
|
|
- if (!CollectionUtils.isEmpty(codeRecords)) {
|
|
|
- // 判断生态购
|
|
|
- livingOpenAble = codeRecords.stream().noneMatch(c -> c.getStatus() == 0);
|
|
|
- }
|
|
|
- } else {
|
|
|
- codeRecords = CollectionUtils.isEmpty(codeRecords) ? new ArrayList<>() : Collections.singletonList(new CodeRecordDTO());
|
|
|
- }
|
|
|
-
|
|
|
- //新版生态购
|
|
|
- GroupSaleCodeDTO saleCodeConfig = groupActService.getGroupSaleCodeConfig(groupInfo.getId(),groupInfo.getStatus()>=201);
|
|
|
- List<CountDTO> codeCountByType=new ArrayList<>();
|
|
|
- ChecklistBaseConfigDto baseConfig = sysBaseService.selectChecklistBaseConfigAndPriceV2(id);
|
|
|
- if (saleCodeConfig.isHasBoxConfig()) {
|
|
|
- hasSaleCode = true;
|
|
|
- livingOpenAble = groupActService.checkGroupSaleCodeCount(groupInfo.getId(), groupInfo.getMerchantId().intValue(), saleCodeConfig);
|
|
|
- if(groupInfo.getStatus()==203){
|
|
|
- codeCountByType=groupActService.selectUseAbleCountByType(groupInfo.getMerchantId().intValue(),
|
|
|
- baseConfig.getSetsVersion(), groupInfo.getPaniniListId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(!tzyEnclosures.isEmpty()&&StringUtils.isEmpty(groupInfo.getCarouses())){
|
|
|
- String urls = tzyEnclosures.stream().filter(file -> ("CarouseMap".equals(file.getCategory())))
|
|
|
- .map(FileDto::getUrl).collect(Collectors.joining(","));
|
|
|
- groupInfo.setCarouses(urls);
|
|
|
- }
|
|
|
- long unlockNUm=0;
|
|
|
- if(groupInfo.isPreSale()){
|
|
|
- unlockNUm=groupInfo.getSoldCopies()-noPayment-groupInfo.getRealSoldNum();
|
|
|
- groupInfo.setSoldCopies(groupInfo.getRealSoldNum());
|
|
|
- }else {
|
|
|
- groupInfo.setSoldCopies(noPayment+groupInfo.getRealSoldNum());
|
|
|
- }
|
|
|
- // 查询商家店铺会员信息
|
|
|
- MerchantScoreDTO merchantScoreDTO = tzyMerchantAssessService.getMerchantMemberInfoV3(groupInfo.getMerchantId());
|
|
|
- //拼团积分
|
|
|
- BigDecimal groupPoint = BigDecimal.ZERO;
|
|
|
- if (user != null && StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- Long point = mineApiService.getUserPointByType(user.getId(), groupInfo.getPointType(), groupInfo.getMerchantId().intValue());
|
|
|
- groupPoint = new BigDecimal(point.toString()).divide(Constants.HUNDRED, 2, RoundingMode.HALF_DOWN);
|
|
|
- }
|
|
|
- String refSkuIds="";
|
|
|
- Long refSpuId=null;
|
|
|
- if (StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- List<SimpleSku> skuList = groupApiService.getRefSkus(groupInfo.getId());
|
|
|
- if (!CollectionUtils.isEmpty(skuList)) {
|
|
|
- refSkuIds = skuList.stream().map(s -> s.getId().toString()).collect(Collectors.joining(","));
|
|
|
- SimpleSku sku = skuList.get(0);
|
|
|
- refSpuId = sku.getSpuId();
|
|
|
- if (StringUtils.isEmpty(groupInfo.getGroupShowName())) {
|
|
|
- groupInfo.setGroupShowName(sku.getSkuName());
|
|
|
- groupInfo.setGroupShowImgs(sku.getCarouselImgUrl());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<GroupRelatedInfoDto> relatedGroupInfo = groupApiService.getRelatedGroupInfoById(groupInfo.getListId(),groupInfo.getId(),groupInfo.getMerchantId(),baseConfig.getParentId(),baseConfig.getPaniniConfigId(),groupInfo.getCode(),groupInfo.getType());
|
|
|
- //groupApiService.getGroupInfoRank(groupInfo);
|
|
|
- return OutDTO.ok().put("groupInfo", groupInfo)
|
|
|
- .put("relatedGroupInfo", relatedGroupInfo)
|
|
|
- .put("file", tzyEnclosures)
|
|
|
- .put("merInfoCount", merInfoCountDTO)
|
|
|
- .put("favorablePrice", groupApiService.getLowActPrice(groupInfo.getUnitPrice(), groupInfo.getMarketingInfo()))
|
|
|
- .put("marketing", marketing)
|
|
|
- .put("orders", orders)
|
|
|
- .put("userOrderId", userOrderId)
|
|
|
- .put("minMaxPrice", minMaxPrice)
|
|
|
- .put("noPayment", noPayment)
|
|
|
- .put("unlockNUm", unlockNUm)
|
|
|
- .put("lastTeams", selectTeams)
|
|
|
- .put("cardGroupGoodsIdxes", cardGroupGoodsIdxes)
|
|
|
- .put("goodsData", goodsData)
|
|
|
- .put("userOrderNums", userOrderNums)
|
|
|
- .put("merchantBond", merchantApiService.getMerchantBond(groupInfo.getMerchantId()))
|
|
|
- .put("confirmStatus", confirmStatus)
|
|
|
- .put("merchantScore", merchantScoreDTO)
|
|
|
- .put("baseConfig", isAdmin ? baseConfig : new ChecklistBaseConfigDto())
|
|
|
- .put("custom", sysBaseService.selectChecklistBaseCustom(id))
|
|
|
- .put("groupPoint", groupPoint)
|
|
|
- .put("refSkuIds", refSkuIds)
|
|
|
- .put("refSpuId", refSpuId)
|
|
|
- .put("codeRecords", codeRecords)
|
|
|
- .put("firstActConfig", isAdmin ? groupInfo.getFirstActConfig() : null)
|
|
|
- .put("livingOpenAble", livingOpenAble)
|
|
|
- .put("saleCodeConfig", saleCodeConfig)
|
|
|
- .put("hasSaleCode", hasSaleCode)
|
|
|
- .put("codeCountByType", codeCountByType)
|
|
|
- .put("followFlag", mineApiService.isFollowed(Constants.GROUP_DETAIL_FOLLOW, id, inDto.getUserId()))
|
|
|
- .put("existRefundMsg", redisUtils.get(GROUP_REFUND_REQ + id))
|
|
|
- ;
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -1532,274 +1068,6 @@ public class GroupApiController {
|
|
|
return OutDTO.ok().put("cardList", cardList);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取银行卡列表
|
|
|
- *
|
|
|
- * @param inDto
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiLog(title = "获取银行卡列表-v2", businessType = BusinessType.SEARCH, indto = "{{inDto}}")
|
|
|
- @ResponseBody
|
|
|
- @RequestMapping(value = "/v2/getBankList", method = RequestMethod.POST)
|
|
|
- public OutDTO getBankListV2(@RequestBody InDto inDto) {
|
|
|
- AppUserInfoDto appUserInfoDto = mineApiService.checkUserNew(inDto);
|
|
|
- //查询订单信息
|
|
|
- Object orderIdObj = inDto.get("orderId");
|
|
|
- if(null == orderIdObj ) return OutDTO.error(10040,"参数[orderId]不能为空");
|
|
|
- Integer orderId = (Integer) orderIdObj;
|
|
|
- CardGroupOrderInfo orderInfo = orderInfoService.selectCardGroupOrderInfoById(Long.valueOf(orderId));
|
|
|
- if(null == orderInfo)return OutDTO.error(10050,"未找到订单信息");
|
|
|
-
|
|
|
- if(System.currentTimeMillis()>orderInfo.getExpireTime().getTime()){
|
|
|
- return OutDTO.error(10050,"订单已超时");
|
|
|
- }
|
|
|
- Long groupInfoId = orderInfo.getGroupInfoId();
|
|
|
- //1.查询团卡工单信息
|
|
|
- CardGroupInfo cardGroupInfo = cardGroupInfoService.selectCardGroupInfoById(groupInfoId);
|
|
|
- //判断组团
|
|
|
- if(null == cardGroupInfo && "group".equals(orderInfo.getOrderType())){
|
|
|
- return OutDTO.error(10040,"未找到组团信息");
|
|
|
- }
|
|
|
- //判断是否超过限购
|
|
|
- if(null != cardGroupInfo && !groupApiService.checkQuota(cardGroupInfo,inDto.getUserId(), 0)){
|
|
|
- return OutDTO.error(20031, "超过限购");
|
|
|
- }
|
|
|
- //如果是选择手机银行支付
|
|
|
- return payService.getBankList(inDto, appUserInfoDto, orderInfo, cardGroupInfo);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 组团
|
|
|
- *
|
|
|
- * @param inDto
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiLog(title = "组团详情简化", businessType = BusinessType.SEARCH, indto = "{{inDto}}")
|
|
|
- @ApiLimitRule(seconds = 1,limitCount = 400)
|
|
|
- @ResponseBody
|
|
|
- @ApiVersion(4.3)
|
|
|
- @RequestMapping(value = "/{version}/info", method = RequestMethod.POST)
|
|
|
- public OutDTO infoSimple(@RequestBody InDto inDto) {
|
|
|
- Integer id = inDto.getIntegerParam("id");
|
|
|
- if (null == id) {
|
|
|
- return OutDTO.error500("参数[id]不能为空");
|
|
|
- }
|
|
|
- GroupInfo groupInfo = groupApiService.getGroupInfoById(id);
|
|
|
-
|
|
|
- if (groupInfo == null) {
|
|
|
- return OutDTO.error500("拼团不存在!");
|
|
|
- }
|
|
|
- UserInfo user = UserUtils.getSimpleUserInfo();
|
|
|
- Long userOrderId = null;
|
|
|
- boolean isAdmin = false;
|
|
|
- boolean isShipping = false;
|
|
|
- if (user != null) {
|
|
|
- isAdmin = UserType.USER_ROLE_ADMIN.equals(user.getRoleCode());
|
|
|
- isShipping = UserType.USER_ROLE_SHIPPING.equals(user.getRoleCode());
|
|
|
- userOrderId = groupApiService.getUserLastOrderId(user.getId(), id);
|
|
|
- log.warn("userOrderId {} with user{}", userOrderId,user.getId());
|
|
|
- List<SysDictData> sysDictDatas = commonCacheService.getCommonDictData("app_user_browse_record_cache",
|
|
|
- "isEnabled", "1", null, -1);
|
|
|
- if(!sysDictDatas.isEmpty()) {
|
|
|
- // 浏览记录入库,不影响接口正常返回
|
|
|
- try {
|
|
|
- appUserBrowseRecordService.addUserBrowseRecord(user.getId().longValue(), id.longValue(), "group", groupInfo.getMerchantId());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("添加浏览记录异常", e);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (groupInfo.getStatus() == 201 && user != null) {
|
|
|
- groupInfo.setFirstActAmount(groupApiService.getFirstActPrice(groupInfo.getId(), groupInfo.getFirstActConfig(), groupInfo.getType(),
|
|
|
- user.getId()));
|
|
|
- }
|
|
|
- //查询附件
|
|
|
- List<FileDto> tzyEnclosures = groupApiService.searchByFromCode(groupInfo.getCode());
|
|
|
- //查询已参与组团的用户
|
|
|
- int orderNum = inDto.get("orderNum") == null ? 5 : (Integer) inDto.get("orderNum");
|
|
|
- List<GroupUserOrderDto> orders = groupApiService.searchOrderByGroupId(id, orderNum);
|
|
|
- orders.forEach(o -> {
|
|
|
- if (o.getAnonymous() != null && o.getAnonymous()) {
|
|
|
- o.setNickname(Constants.ANONYMOUS_NAME);
|
|
|
- o.setAvatar(Constants.ANONYMOUS_AVATAR);
|
|
|
- } else {
|
|
|
- o.setNickname(StringUtils.isEmpty(o.getNickname()) ? "***" : o.getNickname().substring(0, 1) + "***");
|
|
|
- }
|
|
|
- });
|
|
|
- //查询未付款的用户数(订单)
|
|
|
- CardGroupOrderInfo cardGroupOrderInfo = new CardGroupOrderInfo();
|
|
|
- cardGroupOrderInfo.setStatus(100L);
|
|
|
- cardGroupOrderInfo.setGroupInfoId(groupInfo.getId());
|
|
|
- int noPayment = orderInfoService.selectUnPaymentCount(cardGroupOrderInfo);
|
|
|
- List<BuyTeamDTO> goodsData = new ArrayList<>();
|
|
|
- //如果组团方式是 随机球队
|
|
|
- Object minMaxPrice = "";
|
|
|
- Map<String, List<GroupTeamDTO>> selectTeams=null;
|
|
|
- if (Constants.INFO_TYPE_TEAM.equals(groupInfo.getType())) {
|
|
|
- //查询选中列表
|
|
|
- CardGroupGoodsIdx cardGroupGoodsIdx = new CardGroupGoodsIdx();
|
|
|
- cardGroupGoodsIdx.setGroupInfoId(groupInfo.getId());
|
|
|
- } else if (Constants.INFO_TYPE_BUY_TEAM.equals(groupInfo.getType())) {
|
|
|
- CardGroupGoods condition = new CardGroupGoods();
|
|
|
- condition.setGroupInfoId(groupInfo.getId());
|
|
|
- List<CardGroupGoods> cardGroupGoods = cardGroupGoodsService.selectCardGroupGoodsList(condition);
|
|
|
- minMaxPrice=groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- //新版订单购买未付款被占卡密
|
|
|
- List<String> selectedIds = groupApiService.getUnSoldSelectedGoodsId(groupInfo.getId());
|
|
|
- if (!selectedIds.isEmpty()) {
|
|
|
- cardGroupGoods.stream().filter(g -> g.getSelected() == 0 && selectedIds.contains(g.getId().toString()))
|
|
|
- .forEach(g -> g.setSelected(1));
|
|
|
- }
|
|
|
- Map<String, List<CardGroupGoodsDTO>> goodsDataMap = cardGroupGoods.stream().sorted(Comparator.comparing(CardGroupGoods::getSelected))
|
|
|
- .map(CardGroupGoodsDTO::buildByGoods)
|
|
|
- .collect(groupingBy(CardGroupGoodsDTO::getTeam));
|
|
|
- Set<String> typeSets = goodsDataMap.keySet();
|
|
|
- typeSets.forEach(type -> goodsData.add(new BuyTeamDTO(type, goodsDataMap.get(type))));
|
|
|
- } else if (Constants.INFO_TYPE_SELECT_TEAM.equals(groupInfo.getType())) {
|
|
|
- minMaxPrice = groupApiService.getMinMaxPrice(groupInfo.getId());
|
|
|
- if (Constants.INFO_TYPE_TEAM_TO_RANDOM.equals(groupInfo.getChangeType())) {
|
|
|
- }
|
|
|
- }
|
|
|
- Integer userOrderNums=0;
|
|
|
- if(inDto.getUserId()!=null){
|
|
|
- groupInfo.setFollowStatus(merchantApiService.getUserFollowStatus(inDto.getUserId(),groupInfo.getMerchantId().intValue()));
|
|
|
- userOrderNums=orderInfoService.selectUserOrderNums(inDto.getUserId(),groupInfo.getId());
|
|
|
- }
|
|
|
-
|
|
|
- //营销信息
|
|
|
- JSONArray marketing = GroupApiServiceImpl.buildInfoMarketJson(groupInfo.getMarketingInfo());
|
|
|
-
|
|
|
- String actConfigJson = groupInfo.getActConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(actConfigJson)){
|
|
|
- InfoActConfig infoActConfig = JSONTools.jsonStr2obj(actConfigJson, InfoActConfig.class);
|
|
|
- if(InfoActConfig.ACT_TYPE_GUESS_TEAM.equals(infoActConfig.getType())){
|
|
|
- groupInfo.setGuessAct(true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //审核相关信息
|
|
|
- if(groupInfo.getStatus()>=100 && groupInfo.getStatus()<=103){
|
|
|
- groupInfo.setPriceInterval(groupApiService.getPriceInterval(groupInfo.getPaniniListId()));
|
|
|
- groupInfo.setTypeCounts(groupApiService.getCountByInfo(groupInfo));
|
|
|
- }
|
|
|
-
|
|
|
- tzyEnclosures.add(0, new FileDto("coverPicture", groupInfo.getCoverPicture()));
|
|
|
- groupInfo.setJumpAppletFlag(appId.equals(groupInfo.getLiveAppid()));
|
|
|
-
|
|
|
- if(!isAdmin){
|
|
|
- tzyEnclosures=tzyEnclosures.stream().filter(file -> !("video".equals(file.getCategory()))).collect(Collectors.toList());
|
|
|
- String configJson = groupInfo.getConfigJson();
|
|
|
- if(StringUtils.isNotEmpty(configJson)){
|
|
|
- JSONObject jsonObject = JSON.parseObject(configJson);
|
|
|
- jsonObject.put("weightUrl","");
|
|
|
- jsonObject.put("video","");
|
|
|
- groupInfo.setConfigJson(jsonObject.toJSONString());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //判断当前登陆的用户是否是商家角色
|
|
|
- boolean confirmStatus = isShipping && groupInfo.getMerchantId() == user.getMerchantId().longValue();
|
|
|
- boolean livingOpenAble = true;
|
|
|
-
|
|
|
- List<CodeRecordDTO> codeRecords = groupApiService.getRefCodeRecord(groupInfo.getId(), null);
|
|
|
- boolean hasSaleCode = !CollectionUtils.isEmpty(codeRecords);
|
|
|
- if (isShipping || isAdmin) {
|
|
|
- if (!CollectionUtils.isEmpty(codeRecords)) {
|
|
|
- // 判断生态购
|
|
|
- livingOpenAble = codeRecords.stream().noneMatch(c -> c.getStatus() == 0);
|
|
|
- }
|
|
|
- } else {
|
|
|
- codeRecords = CollectionUtils.isEmpty(codeRecords) ? new ArrayList<>() : Collections.singletonList(new CodeRecordDTO());
|
|
|
- }
|
|
|
-
|
|
|
- //新版生态购
|
|
|
- GroupSaleCodeDTO saleCodeConfig = groupActService.getGroupSaleCodeConfig(groupInfo.getId(),groupInfo.getStatus()>=201);
|
|
|
- List<CountDTO> codeCountByType=new ArrayList<>();
|
|
|
- ChecklistBaseConfigDto baseConfig = sysBaseService.selectChecklistBaseConfigAndPriceV2(id);
|
|
|
- if (saleCodeConfig.isHasBoxConfig()) {
|
|
|
- hasSaleCode = true;
|
|
|
- livingOpenAble = groupActService.checkGroupSaleCodeCount(groupInfo.getId(), groupInfo.getMerchantId().intValue(), saleCodeConfig);
|
|
|
- if(groupInfo.getStatus()==203){
|
|
|
- codeCountByType=groupActService.selectUseAbleCountByType(groupInfo.getMerchantId().intValue(),
|
|
|
- baseConfig.getSetsVersion(), groupInfo.getPaniniListId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(!tzyEnclosures.isEmpty()&&StringUtils.isEmpty(groupInfo.getCarouses())){
|
|
|
- String urls = tzyEnclosures.stream().filter(file -> ("CarouseMap".equals(file.getCategory())))
|
|
|
- .map(FileDto::getUrl).collect(Collectors.joining(","));
|
|
|
- groupInfo.setCarouses(urls);
|
|
|
- }
|
|
|
- long unlockNUm=0;
|
|
|
- if(groupInfo.isPreSale()){
|
|
|
- unlockNUm=groupInfo.getSoldCopies()-noPayment-groupInfo.getRealSoldNum();
|
|
|
- groupInfo.setSoldCopies(groupInfo.getRealSoldNum());
|
|
|
- }else {
|
|
|
- groupInfo.setSoldCopies(noPayment+groupInfo.getRealSoldNum());
|
|
|
- }
|
|
|
- //拼团积分
|
|
|
- BigDecimal groupPoint = BigDecimal.ZERO;
|
|
|
- if (user != null && StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- Long point = mineApiService.getUserPointByType(user.getId(), groupInfo.getPointType(), groupInfo.getMerchantId().intValue());
|
|
|
- groupPoint = new BigDecimal(point.toString()).divide(Constants.HUNDRED, 2, RoundingMode.HALF_DOWN);
|
|
|
- }
|
|
|
- String refSkuIds="";
|
|
|
- Long refSpuId=null;
|
|
|
- if (StringUtils.isNotEmpty(groupInfo.getPointType())) {
|
|
|
- List<SimpleSku> skuList = groupApiService.getRefSkus(groupInfo.getId());
|
|
|
- if (!CollectionUtils.isEmpty(skuList)) {
|
|
|
- refSkuIds = skuList.stream().map(s -> s.getId().toString()).collect(Collectors.joining(","));
|
|
|
- SimpleSku sku = skuList.get(0);
|
|
|
- refSpuId = sku.getSpuId();
|
|
|
- if (StringUtils.isEmpty(groupInfo.getGroupShowName())) {
|
|
|
- groupInfo.setGroupShowName(sku.getSkuName());
|
|
|
- groupInfo.setGroupShowImgs(sku.getCarouselImgUrl());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 品牌会员信息
|
|
|
- CommonBrandMemberDTO commonBrandMember = brandMemberBenefitsService.getBrandMemberDetails(groupInfo.getMerchantId(), user);
|
|
|
- // 拼团是否有优惠券
|
|
|
- boolean hasGroupCoupon = cardBaseInfoService.countByGroupInfoIdV2(id.longValue());
|
|
|
- // 保证金缓存(3分钟)
|
|
|
- MerchantBond merchantBond;
|
|
|
- String key = "merchant_total_bond_" + groupInfo.getMerchantId();
|
|
|
- if(redisUtils.hasKey(key)){
|
|
|
- merchantBond = (MerchantBond) redisUtils.get(key);
|
|
|
- }else{
|
|
|
- merchantBond = merchantApiService.getMerchantBond(groupInfo.getMerchantId());
|
|
|
- redisUtils.set(key, merchantBond, 180);
|
|
|
- }
|
|
|
- //todo 添加降级查询
|
|
|
- return OutDTO.ok().put("groupInfo", groupInfo)
|
|
|
- .put("favorablePrice", groupApiService.getLowActPrice(groupInfo.getUnitPrice(), groupInfo.getMarketingInfo()))
|
|
|
- .put("marketing", marketing)
|
|
|
- .put("userOrderId", userOrderId)
|
|
|
- .put("minMaxPrice", minMaxPrice)
|
|
|
- .put("noPayment", noPayment)
|
|
|
- .put("unlockNUm", unlockNUm)
|
|
|
- .put("goodsData", goodsData)
|
|
|
- .put("userOrderNums", userOrderNums)
|
|
|
- .put("merchantBond", merchantBond)
|
|
|
- .put("confirmStatus", confirmStatus)
|
|
|
- .put("baseConfig", isAdmin ? baseConfig : new ChecklistBaseConfigDto())
|
|
|
- .put("custom", sysBaseService.selectChecklistBaseCustom(id))
|
|
|
- .put("groupPoint", groupPoint)
|
|
|
- .put("refSkuIds", refSkuIds)
|
|
|
- .put("refSpuId", refSpuId)
|
|
|
- .put("codeRecords", codeRecords)
|
|
|
- .put("firstActConfig", isAdmin ? groupInfo.getFirstActConfig() : null)
|
|
|
- .put("livingOpenAble", livingOpenAble)
|
|
|
- .put("saleCodeConfig", saleCodeConfig)
|
|
|
- .put("hasSaleCode", hasSaleCode)
|
|
|
- .put("codeCountByType", codeCountByType)
|
|
|
- .put("followFlag", mineApiService.isFollowed(Constants.GROUP_DETAIL_FOLLOW, id, inDto.getUserId()))
|
|
|
- .put("commonBrandMember", commonBrandMember)
|
|
|
- .put("hasGroupCoupon", hasGroupCoupon)
|
|
|
- ;
|
|
|
- }
|
|
|
/**
|
|
|
* 组团推荐
|
|
|
*
|