yshop3.0正式发布

This commit is contained in:
hupeng
2020-07-14 16:05:21 +08:00
parent 27ceaf8969
commit ff162d34c0
28 changed files with 78 additions and 46 deletions

View File

@ -24,7 +24,7 @@ yshop基于当前流行技术组合的前后端分离商城系统 SpringBoot2
- 可以具体查看演示地址查看当前版本已经完成的功能,不再絮叨啦 - 可以具体查看演示地址查看当前版本已经完成的功能,不再絮叨啦
#### 项目结构 #### 项目结构
项目采用分模块开发方式 yshop3.0项目采用分模块开发方式
- yshop-app 移动端API模块H5+uniapp端的API - yshop-app 移动端API模块H5+uniapp端的API
- yshop-admin 管理后台模块 - yshop-admin 管理后台模块
- yshop-weixin 微信相关模块 - yshop-weixin 微信相关模块

View File

@ -7,7 +7,7 @@
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0-RC2</version> <version>3.0</version>
<modules> <modules>
<module>yshop-common</module> <module>yshop-common</module>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -21,7 +21,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-generator</artifactId> <artifactId>yshop-generator</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
@ -32,7 +32,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-message</artifactId> <artifactId>yshop-message</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
@ -43,7 +43,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-shop</artifactId> <artifactId>yshop-shop</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -21,7 +21,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-weixin</artifactId> <artifactId>yshop-weixin</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-message</artifactId> <artifactId>yshop-message</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>

View File

@ -132,7 +132,7 @@ public class AuthService {
//构建微信用户 //构建微信用户
WechatUserDto wechatUserDTO = WechatUserDto.builder() WechatUserDto wechatUserDTO = WechatUserDto.builder()
.nickname(nickname) .nickname(nickname)
.openid(wxMpUser.getOpenId()) .routineOpenid(wxMpUser.getOpenId())
.unionId(wxMpUser.getUnionId()) .unionId(wxMpUser.getUnionId())
.sex(Integer.valueOf(wxMpUser.getGender())) .sex(Integer.valueOf(wxMpUser.getGender()))
.language(wxMpUser.getLanguage()) .language(wxMpUser.getLanguage())
@ -151,7 +151,7 @@ public class AuthService {
} else { } else {
returnUser = yxUser; returnUser = yxUser;
WechatUserDto wechatUser =yxUser.getWxProfile(); WechatUserDto wechatUser =yxUser.getWxProfile();
if ((StrUtil.isBlank(wechatUser.getOpenid()) && StrUtil.isNotBlank(wxMpUser.getOpenId())) if ((StrUtil.isBlank(wechatUser.getRoutineOpenid()) && StrUtil.isNotBlank(wxMpUser.getOpenId()))
|| (StrUtil.isBlank(wechatUser.getUnionId()) && StrUtil.isNotBlank(wxMpUser.getUnionId()))) { || (StrUtil.isBlank(wechatUser.getUnionId()) && StrUtil.isNotBlank(wxMpUser.getUnionId()))) {
wechatUser.setRoutineOpenid(wxMpUser.getOpenId()); wechatUser.setRoutineOpenid(wxMpUser.getOpenId());
wechatUser.setUnionId(wxMpUser.getUnionId()); wechatUser.setUnionId(wxMpUser.getUnionId());
@ -245,6 +245,8 @@ public class AuthService {
userService.setSpread(spread,returnUser.getUid()); userService.setSpread(spread,returnUser.getUid());
log.error("spread:{}",spread);
return returnUser; return returnUser;
} catch (WxErrorException e) { } catch (WxErrorException e) {

View File

@ -191,6 +191,7 @@ public class OrderSupplyService {
jsConfig.put("package",wxPayMpOrderResult.getPackageValue()); jsConfig.put("package",wxPayMpOrderResult.getPackageValue());
jsConfig.put("signType",wxPayMpOrderResult.getSignType()); jsConfig.put("signType",wxPayMpOrderResult.getSignType());
orderDTO.setJsConfig(jsConfig); orderDTO.setJsConfig(jsConfig);
map.put("payMsg","订单创建成功");
map.put("result",orderDTO); map.put("result",orderDTO);
return map; return map;
}else if(AppFromEnum.APP.getValue().equals(from)){//app支付 }else if(AppFromEnum.APP.getValue().equals(from)){//app支付
@ -206,6 +207,7 @@ public class OrderSupplyService {
jsConfig.put("sign",wxPayAppOrderResult.getSign()); jsConfig.put("sign",wxPayAppOrderResult.getSign());
orderDTO.setJsConfig(jsConfig); orderDTO.setJsConfig(jsConfig);
map.put("result",orderDTO); map.put("result",orderDTO);
map.put("payMsg","订单创建成功");
return map; return map;
}else{//公众号 }else{//公众号
map.put("status","WECHAT_PAY"); map.put("status","WECHAT_PAY");

View File

@ -3,9 +3,7 @@ package co.yixiang.modules.user.param;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -22,8 +20,8 @@ public class RechargeParam implements Serializable {
private String from; private String from;
@NotNull(message = "金额必填") //@NotNull(message = "金额必填")
@Min(value = 1,message = "充值金额不能低于1") // @Min(value = 1,message = "充值金额不能低于1")
private Double price; private Double price;
@JsonProperty(value = "paid_price") @JsonProperty(value = "paid_price")

View File

@ -190,15 +190,13 @@ public class UserController {
} }
@AuthCheck
@PostMapping("/user/edit") @PostMapping("/user/edit")
@ApiOperation(value = "用户修改信息",notes = "用修改信息") @ApiOperation(value = "用户修改信息",notes = "用修改信息")
public ApiResult<Object> edit(@Validated @RequestBody UserEditParam param){ public ApiResult<Object> edit(@Validated @RequestBody UserEditParam param){
int uid = SecurityUtils.getUserId().intValue(); YxUser yxUser = LocalUser.getUser();
YxUser yxUser = new YxUser();
yxUser.setAvatar(param.getAvatar()); yxUser.setAvatar(param.getAvatar());
yxUser.setNickname(param.getNickname()); yxUser.setNickname(param.getNickname());
yxUser.setUid(Long.valueOf(String.valueOf(uid)));
yxUserService.updateById(yxUser); yxUserService.updateById(yxUser);

View File

@ -9,6 +9,7 @@
package co.yixiang.modules.user.rest; package co.yixiang.modules.user.rest;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import co.yixiang.api.ApiResult; import co.yixiang.api.ApiResult;
import co.yixiang.api.YshopException; import co.yixiang.api.YshopException;
import co.yixiang.common.bean.LocalUser; import co.yixiang.common.bean.LocalUser;
@ -16,6 +17,7 @@ import co.yixiang.common.interceptor.AuthCheck;
import co.yixiang.constant.ShopConstants; import co.yixiang.constant.ShopConstants;
import co.yixiang.enums.AppFromEnum; import co.yixiang.enums.AppFromEnum;
import co.yixiang.enums.BillDetailEnum; import co.yixiang.enums.BillDetailEnum;
import co.yixiang.exception.ErrorRequestException;
import co.yixiang.modules.shop.domain.YxSystemGroupData; import co.yixiang.modules.shop.domain.YxSystemGroupData;
import co.yixiang.modules.shop.service.YxSystemGroupDataService; import co.yixiang.modules.shop.service.YxSystemGroupDataService;
import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria; import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria;
@ -26,6 +28,7 @@ import co.yixiang.modules.user.service.YxUserRechargeService;
import co.yixiang.mp.service.WeixinPayService; import co.yixiang.mp.service.WeixinPayService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -108,6 +111,29 @@ public class UserRechargeController {
WxPayMwebOrderResult result = (WxPayMwebOrderResult)weixinPayService WxPayMwebOrderResult result = (WxPayMwebOrderResult)weixinPayService
.unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"H5充值"); .unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"H5充值");
map.put("data",result.getMwebUrl()); map.put("data",result.getMwebUrl());
}else if(AppFromEnum.ROUNTINE.getValue().equals(param.getFrom())){
WxPayMpOrderResult wxPayMpOrderResult = (WxPayMpOrderResult)weixinPayService
.unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"小程序充值");
Map<String,String> jsConfig = new HashMap<>();
jsConfig.put("timeStamp",wxPayMpOrderResult.getTimeStamp());
jsConfig.put("appId",wxPayMpOrderResult.getAppId());
jsConfig.put("paySign",wxPayMpOrderResult.getPaySign());
jsConfig.put("nonceStr",wxPayMpOrderResult.getNonceStr());
jsConfig.put("package",wxPayMpOrderResult.getPackageValue());
jsConfig.put("signType",wxPayMpOrderResult.getSignType());
map.put("data",jsConfig);
}else if(AppFromEnum.APP.getValue().equals(param.getFrom())){
WxPayAppOrderResult wxPayAppOrderResult = (WxPayAppOrderResult)weixinPayService
.unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"app充值");
Map<String,String> jsConfig = new HashMap<>();
jsConfig.put("partnerid",wxPayAppOrderResult.getPartnerId());
jsConfig.put("appid",wxPayAppOrderResult.getAppId());
jsConfig.put("prepayid",wxPayAppOrderResult.getPrepayId());
jsConfig.put("package",wxPayAppOrderResult.getPackageValue());
jsConfig.put("noncestr",wxPayAppOrderResult.getNonceStr());
jsConfig.put("timestamp",wxPayAppOrderResult.getTimeStamp());
jsConfig.put("sign",wxPayAppOrderResult.getSign());
map.put("data",jsConfig);
}else{ }else{
WxPayMpOrderResult result = (WxPayMpOrderResult)weixinPayService WxPayMpOrderResult result = (WxPayMpOrderResult)weixinPayService
.unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"公众号充值"); .unifyPay(orderSn,param.getFrom(), BillDetailEnum.TYPE_1.getValue(),"公众号充值");

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -37,7 +37,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-mproot</artifactId> <artifactId>yshop-mproot</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-common</artifactId> <artifactId>yshop-common</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<!--模板引擎--> <!--模板引擎-->

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -16,12 +16,12 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-common</artifactId> <artifactId>yshop-common</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-mproot</artifactId> <artifactId>yshop-mproot</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-tools</artifactId> <artifactId>yshop-tools</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -43,16 +44,17 @@ import java.util.*;
* @date 2020-05-13 * @date 2020-05-13
*/ */
@Service @Service
@AllArgsConstructor
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMapper, YxStoreSeckill> implements YxStoreSeckillService { public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMapper, YxStoreSeckill> implements YxStoreSeckillService {
private final IGenerator generator; @Autowired
private IGenerator generator;
private final YxStoreSeckillMapper yxStoreSeckillMapper; @Autowired
private YxStoreSeckillMapper yxStoreSeckillMapper;
@Autowired
private final YxStoreProductReplyService replyService; private YxStoreProductReplyService replyService;
/** /**

View File

@ -35,6 +35,11 @@ public interface YxStoreProductReplyService extends BaseService<YxStoreProductR
*/ */
ReplyCountVo getReplyCount(long productId); ReplyCountVo getReplyCount(long productId);
/**
* 处理评价
* @param replyQueryVo replyQueryVo
* @return YxStoreProductReplyQueryVo
*/
YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo); YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo);
/** /**

View File

@ -109,8 +109,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
/** /**
* 处理评价 * 处理评价
* @param replyQueryVo * @param replyQueryVo replyQueryVo
* @return * @return YxStoreProductReplyQueryVo
*/ */
@Override @Override
public YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo) { public YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo) {

View File

@ -81,8 +81,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
@Autowired @Autowired
private UserBillMapper userBillMapper; private UserBillMapper userBillMapper;
@Autowired
private YxUserBillService yxUserBillService;
@Autowired @Autowired
private YxSystemUserLevelService systemUserLevelService; private YxSystemUserLevelService systemUserLevelService;
@Autowired @Autowired

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-mall</artifactId> <artifactId>yshop-mall</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.rocketmq</groupId> <groupId>org.apache.rocketmq</groupId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<name>MyBatisPlus模块</name> <name>MyBatisPlus模块</name>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-weixin</artifactId> <artifactId>yshop-weixin</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -23,7 +23,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-logging</artifactId> <artifactId>yshop-logging</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
<!--邮件依赖--> <!--邮件依赖-->

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>yshop</artifactId> <artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<version>3.0-RC2</version> <version>3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>co.yixiang</groupId> <groupId>co.yixiang</groupId>
<artifactId>yshop-mall</artifactId> <artifactId>yshop-mall</artifactId>
<version>3.0-RC2</version> <version>3.0</version>
</dependency> </dependency>
</dependencies> </dependencies>