Skip to content

Commit

Permalink
Merge pull request lilishop#83
Browse files Browse the repository at this point in the history
pg
  • Loading branch information
LeiGaoRobot authored Apr 17, 2023
2 parents 799aa8f + 4179677 commit 06d0fb5
Show file tree
Hide file tree
Showing 35 changed files with 349 additions and 191 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

##### 体验 公众号/小程序/APP 体验,扫描二维码

![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
![image-20210511171611793](https://static.pickmall.cn/images/h5-qrcode.png)

[![star](https://gitee.com/beijing_hongye_huicheng/lilishop/badge/star.svg?theme=dark)](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
  ![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717)
Expand Down Expand Up @@ -56,7 +56,7 @@ PS:手机验证码为 ‘111111’

**商城 小程序/公众号/APP**:扫描二维码

![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
![image-20210511171611793](https://static.pickmall.cn/images/h5-qrcode.png)

### 快速本地部署

Expand All @@ -75,24 +75,24 @@ PS:手机验证码为 ‘111111’

#### 平台管理端功能

![平台管理端功能](https://pickmall.cn/assets/imgs/other/managerList1.jpg)
![平台管理端功能](https://static.pickmall.cn/images/other/managerList1.jpg)



#### 卖家功能

![商家端功能](https://pickmall.cn/assets/imgs/other/storeList.jpg)
![商家端功能](https://static.pickmall.cn/images/other/storeList.jpg)


### 商城前端功能展示

#### 商城移动端

<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
<img src="https://static.pickmall.cn/images/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />

#### 平台管理端

![管理端功能展示](https://pickmall.cn/assets/imgs/other/manager.gif)
![管理端功能展示](https://static.pickmall.cn/images/other/manager.gif)


### 技术选型
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
import cn.lili.modules.statistics.aop.PageViewPoint;
import cn.lili.modules.statistics.aop.enums.PageViewEnum;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -104,10 +103,9 @@ public ResultMessage<IPage<Goods>> getByPage(GoodsSearchParams goodsSearchParams

@ApiOperation(value = "从ES中获取商品信息")
@GetMapping("/es")
public ResultMessage<SearchPage<EsGoodsIndex>> getGoodsByPageFromEs(EsGoodsSearchDTO goodsSearchParams, PageVO pageVO) {
public ResultMessage<Page<EsGoodsIndex>> getGoodsByPageFromEs(EsGoodsSearchDTO goodsSearchParams, PageVO pageVO) {
pageVO.setNotConvert(true);
SearchPage<EsGoodsIndex> esGoodsIndices = goodsSearchService.searchGoods(goodsSearchParams, pageVO);
return ResultUtil.data(esGoodsIndices);
return ResultUtil.data(goodsSearchService.searchGoodsByPage(goodsSearchParams, pageVO));
}

@ApiOperation(value = "从ES中获取相关商品品牌名称,分类名称及属性")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public ResultMessage<MemberAddress> addShippingAddress(@Valid MemberAddress ship
@ApiOperation(value = "修改会员收件地址")
@PutMapping
public ResultMessage<MemberAddress> editShippingAddress(@Valid MemberAddress shippingAddress) {
OperationalJudgment.judgment(memberAddressService.getById(shippingAddress.getId()));
shippingAddress.setMemberId(Objects.requireNonNull(UserContext.getCurrentUser()).getId());
return ResultUtil.data(memberAddressService.updateMemberAddress(shippingAddress));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ private void updateGoodsIndex(Goods goods) {
searchParams.setGoodsId(goods.getId());
searchParams.setPageNumber(i);
searchParams.setPageSize(BATCH_SIZE);
searchParams.setGeQuantity(0);
IPage<GoodsSku> goodsSkuByPage = this.goodsSkuService.getGoodsSkuByPage(searchParams);
if (goodsSkuByPage == null || goodsSkuByPage.getRecords().isEmpty()) {
break;
Expand Down
8 changes: 8 additions & 0 deletions framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,14 @@
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/maven-repository/SF-CSIM-EXPRESS-SDK-V2.1.7.jar</systemPath>
</dependency>
<!-- netty-resolver-dns-native-macos -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>4.1.90.Final</version>
<scope>runtime</scope>
<classifier>osx-aarch_64</classifier>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public enum ResultCode {
HAVE_INVALID_SALES_MODEL(11023, "批发规则存在小于等于0的无效数据!"),
MUST_HAVE_GOODS_SKU_VALUE(11024, "规格值不能为空!"),
DO_NOT_MATCH_WHOLESALE(11025, "批发商品购买数量不能低于起拍量!"),
GOODS_NOT_ERROR(11026, "商品不存在"),

GOODS_PARAMS_ERROR(11013, "商品参数错误,刷新后重试"),
PHYSICAL_GOODS_NEED_TEMP(11014, "实物商品需选择配送模板"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import cn.lili.common.security.context.UserContext;
import cn.lili.common.security.token.Token;
import cn.lili.common.utils.HttpUtils;
import cn.lili.common.utils.UuidUtils;
import cn.lili.modules.connect.entity.Connect;
import cn.lili.modules.connect.entity.dto.AuthToken;
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
Expand Down Expand Up @@ -179,16 +180,26 @@ public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params,
String iv = params.getIv();
JSONObject userInfo = this.getUserInfo(encryptedData, sessionKey, iv);
log.info("联合登陆返回:{}", userInfo.toString());
String phone = (String) userInfo.get("purePhoneNumber");


ConnectAuthUser connectAuthUser = new ConnectAuthUser();
connectAuthUser.setUuid(openId);
connectAuthUser.setNickname(params.getNickName());
connectAuthUser.setAvatar(params.getImage());
connectAuthUser.setUsername("m" + phone);
connectAuthUser.setPhone(phone);
connectAuthUser.setSource(ConnectEnum.WECHAT.name());
connectAuthUser.setType(ClientTypeEnum.WECHAT_MP.name());

if (userInfo.containsKey("purePhoneNumber")) {
String phone = (String) userInfo.get("purePhoneNumber");
connectAuthUser.setUsername("m" + phone);
connectAuthUser.setPhone(phone);
connectAuthUser.setSource(ConnectEnum.WECHAT.name());
connectAuthUser.setType(ClientTypeEnum.WECHAT_MP.name());

} else {
connectAuthUser.setUsername(UuidUtils.getUUID());
connectAuthUser.setSource(ConnectEnum.WECHAT.name());
connectAuthUser.setType(ClientTypeEnum.WECHAT_MP.name());
}


AuthToken authToken = new AuthToken();
authToken.setUnionId(unionId);
Expand All @@ -204,9 +215,12 @@ public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params,
public Connect queryConnect(ConnectQueryDTO connectQueryDTO) {

LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
queryWrapper.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId,
connectQueryDTO.getUserId())
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType,
connectQueryDTO.getUnionType())
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId,
connectQueryDTO.getUnionId());
return this.getOne(queryWrapper);
}

Expand Down Expand Up @@ -265,7 +279,8 @@ private Token unionLoginCallback(ConnectAuthUser authUser, boolean longTerm) {
.eq(Connect::getUnionType, authUser.getSource());
} else {
//使用OpenID登录
SourceEnum sourceEnum = SourceEnum.getSourceEnum(ConnectEnum.valueOf(authUser.getType()), ClientTypeEnum.valueOf(authUser.getSource()));
SourceEnum sourceEnum = SourceEnum.getSourceEnum(ConnectEnum.valueOf(authUser.getType()),
ClientTypeEnum.valueOf(authUser.getSource()));
queryWrapper.eq(Connect::getUnionId, authUser.getToken().getUnionId())
.eq(Connect::getUnionType, sourceEnum.name());
}
Expand All @@ -289,9 +304,11 @@ private Token unionLoginCallback(ConnectAuthUser authUser, boolean longTerm) {
MemberConnectLoginMessage memberConnectLoginMessage = new MemberConnectLoginMessage();
memberConnectLoginMessage.setMember(member);
memberConnectLoginMessage.setConnectAuthUser(authUser);
String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_CONNECT_LOGIN.name();
String destination =
rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_CONNECT_LOGIN.name();
//发送用户第三方登录消息
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(memberConnectLoginMessage), RocketmqSendCallbackBuilder.commonCallback());
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(memberConnectLoginMessage),
RocketmqSendCallbackBuilder.commonCallback());

return memberTokenGenerate.createToken(member, longTerm);
} catch (Exception e) {
Expand All @@ -308,7 +325,8 @@ private Token unionLoginCallback(ConnectAuthUser authUser, boolean longTerm) {
private WechatConnectSettingItem getWechatMPSetting() {
Setting setting = settingService.get(SettingEnum.WECHAT_CONNECT.name());

WechatConnectSetting wechatConnectSetting = JSONUtil.toBean(setting.getSettingValue(), WechatConnectSetting.class);
WechatConnectSetting wechatConnectSetting = JSONUtil.toBean(setting.getSettingValue(),
WechatConnectSetting.class);

if (wechatConnectSetting == null) {
throw new ServiceException(ResultCode.WECHAT_CONNECT_NOT_EXIST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private COSClient getCOSClient() {
// 1 初始化用户身份信息(secretId, secretKey)。
COSCredentials cred = new BasicCOSCredentials(ossSetting.getTencentCOSSecretId(), ossSetting.getTencentCOSSecretKey());
// 2 设置 bucket 的地域, COS 地域的简称请参见 https://cloud.tencent.com/document/product/436/6224
ClientConfig clientConfig = new ClientConfig(new Region("COS_REGION"));
ClientConfig clientConfig = new ClientConfig(new Region(ossSetting.getTencentCOSRegion()));
// 这里建议设置使用 https 协议
clientConfig.setHttpProtocol(HttpProtocol.https);
// 3 生成 cos 客户端。
Expand All @@ -66,7 +66,8 @@ private COSClient getCOSClient() {
* @return
*/
private String getUrlPrefix() {
return "https://" + ossSetting.getTencentCOSBucket() + "." + ossSetting.getTencentCOSEndPoint() + "/";
// return "https://" + ossSetting.getTencentCOSBucket() + "." + ossSetting.getTencentCOSEndPoint() + "/";
return "https://" + ossSetting.getTencentCOSBucket() + ".cos" + ossSetting.getTencentCOSEndPoint() + ".myqcloud.com/";
}

@Override
Expand Down
Loading

0 comments on commit 06d0fb5

Please sign in to comment.