| | |
| | | import com.ruoyi.system.api.constant.DelayTaskEnum; |
| | | import com.ruoyi.system.api.constant.SecurityConstant; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.activity.Activity; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityRecord; |
| | | import com.ruoyi.system.api.domain.poji.config.DelayTask; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | |
| | | //处理订单回显 |
| | | for (AppUserOrderPageVo appUserOrderPageVo : appUserOrderPageVoList) { |
| | | if(member.getBindingFlag()==0&&appUserOrderPageVo.getOrderFrom()==2){ |
| | | appUserOrderPageVo.setShopName("全部店铺"); |
| | | //查询秒杀活动的参与店铺 |
| | | R<Activity> activity = remoteActivityService.getActivity(appUserOrderPageVo.getActivityId()); |
| | | if(activity.getCode() != 200){ |
| | | throw new RuntimeException(activity.getMsg()); |
| | | } |
| | | Activity data = activity.getData(); |
| | | if(data.getAreaFlag() == 1){ |
| | | appUserOrderPageVo.setShopNumber(0); |
| | | appUserOrderPageVo.setShopName("全部店铺"); |
| | | } |
| | | if(data.getAreaFlag() == 2 && data.getShopFlag() == 1){ |
| | | String designatedArea = data.getDesignatedArea(); |
| | | String[] split = designatedArea.split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | R<List<Shop>> listR = remoteShopService.listShopByCityCode(list); |
| | | if(listR.getCode() != 200){ |
| | | throw new RuntimeException(listR.getMsg()); |
| | | } |
| | | List<Shop> data1 = listR.getData(); |
| | | appUserOrderPageVo.setShopNumber(1); |
| | | appUserOrderPageVo.setShopName(JSON.toJSONString(data1)); |
| | | } |
| | | if(data.getShopFlag() == 2){ |
| | | String applicableShop = data.getApplicableShop(); |
| | | String[] split = applicableShop.split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | R<List<Shop>> listR = remoteShopService.listShopByIds(list); |
| | | if(listR.getCode() != 200){ |
| | | throw new RuntimeException(listR.getMsg()); |
| | | } |
| | | List<Shop> data1 = listR.getData(); |
| | | appUserOrderPageVo.setShopNumber(1); |
| | | appUserOrderPageVo.setShopName(JSON.toJSONString(data1)); |
| | | } |
| | | }else if(member.getBindingFlag()==1&&appUserOrderPageVo.getOrderFrom()==2){ |
| | | Long relationShopId = member.getRelationShopId(); |
| | | R<Shop> shop = remoteShopService.getShop(relationShopId); |
| | | if(shop.getCode() != 200){ |
| | | throw new RuntimeException(shop.getMsg()); |
| | | } |
| | | Shop data1 = shop.getData(); |
| | | //查询秒杀活动的参与店铺 |
| | | R<Activity> activity = remoteActivityService.getActivity(appUserOrderPageVo.getActivityId()); |
| | | if(activity.getCode() != 200){ |
| | | throw new RuntimeException(activity.getMsg()); |
| | | } |
| | | Activity data = activity.getData(); |
| | | if(data.getAreaFlag() == 1){ |
| | | appUserOrderPageVo.setShopNumber(2); |
| | | appUserOrderPageVo.setShopName(data1.getShopName()); |
| | | appUserOrderPageVo.setShopServicePhone(data1.getShopServicePhone()); |
| | | } |
| | | if(data.getAreaFlag() == 2 && data.getShopFlag() == 1){ |
| | | String designatedArea = data.getDesignatedArea(); |
| | | String[] split = designatedArea.split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | R<List<Shop>> listR = remoteShopService.listShopByCityCode(list); |
| | | if(listR.getCode() != 200){ |
| | | throw new RuntimeException(listR.getMsg()); |
| | | } |
| | | List<Shop> data2 = listR.getData(); |
| | | List<Long> collect = data2.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | if(collect.contains(relationShopId)){ |
| | | appUserOrderPageVo.setShopNumber(2); |
| | | appUserOrderPageVo.setShopName(data1.getShopName()); |
| | | appUserOrderPageVo.setShopServicePhone(data1.getShopServicePhone()); |
| | | }else{ |
| | | appUserOrderPageVo.setShopNumber(1); |
| | | appUserOrderPageVo.setShopName(JSON.toJSONString(data2)); |
| | | } |
| | | } |
| | | if(data.getShopFlag() == 2){ |
| | | String applicableShop = data.getApplicableShop(); |
| | | String[] split = applicableShop.split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | R<List<Shop>> listR = remoteShopService.listShopByIds(list); |
| | | if(listR.getCode() != 200){ |
| | | throw new RuntimeException(listR.getMsg()); |
| | | } |
| | | List<Shop> data2 = listR.getData(); |
| | | List<Long> collect = data2.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | if(collect.contains(relationShopId)){ |
| | | appUserOrderPageVo.setShopNumber(2); |
| | | appUserOrderPageVo.setShopName(data1.getShopName()); |
| | | appUserOrderPageVo.setShopServicePhone(data1.getShopServicePhone()); |
| | | }else{ |
| | | appUserOrderPageVo.setShopNumber(1); |
| | | appUserOrderPageVo.setShopName(JSON.toJSONString(data2)); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }else{ |
| | | simpleShopVo = shopMap.get(appUserOrderPageVo.getShopId()); |
| | | appUserOrderPageVo.setShopName(simpleShopVo.getShopName()); |
| | | appUserOrderPageVo.setShopServicePhone(simpleShopVo.getShopServicePhone()); |
| | | appUserOrderPageVo.setShopNumber(2); |
| | | if (appUserOrderPageVo.getShopId().equals(appUserOrderPageDto.getShopId())) { |
| | | appUserOrderPageVo.setSameShop(1); |
| | | } else { |