yshop1.9,新增城市接口,修复小程序登陆与支付问题,发布mpvue1.0小程序

This commit is contained in:
hupeng
2020-01-19 09:59:40 +08:00
parent 1d0fef87b2
commit 90b29e6b86
18 changed files with 113 additions and 31 deletions

View File

@ -1425,8 +1425,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
//使用MQ延时消息
//mqProducer.sendMsg("yshop-topic",storeOrder.getId().toString());
//log.info("投递延时订单id [{}]", storeOrder.getId());
mqProducer.sendMsg("yshop-topic",storeOrder.getId().toString());
log.info("投递延时订单id [{}]", storeOrder.getId());
return storeOrder;
}

View File

@ -330,6 +330,19 @@ public class StoreOrderController extends BaseController {
map.put("result",orderDTO);
map.put("status","WECHAT_H5_PAY");
return ApiResult.ok(map);
}else if(param.getFrom().equals("routine")){
map.put("status","WECHAT_PAY");
WxPayMpOrderResult wxPayMpOrderResult = storeOrderService
.wxAppPay(orderId);
jsConfig.put("appId",wxPayMpOrderResult.getAppId());
jsConfig.put("timeStamp",wxPayMpOrderResult.getTimeStamp());
jsConfig.put("nonceStr",wxPayMpOrderResult.getNonceStr());
jsConfig.put("package",wxPayMpOrderResult.getPackageValue());
jsConfig.put("signType",wxPayMpOrderResult.getSignType());
jsConfig.put("paySign",wxPayMpOrderResult.getPaySign());
orderDTO.setJsConfig(jsConfig);
map.put("result",orderDTO);
return ApiResult.ok(map,"订单创建成功");
}else{
map.put("status","WECHAT_PAY");
WxPayMpOrderResult wxPayMpOrderResult = storeOrderService

View File

@ -298,13 +298,13 @@ public class AuthController {
wxMaService.setWxMaConfig(wxMaConfig);
WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(code);
YxWechatUser wechatUser = wechatUserService.getUserInfo(session.getOpenid());
YxWechatUser wechatUser = wechatUserService.getUserAppInfo(session.getOpenid());
;
JwtUser jwtUser = null;
if (ObjectUtil.isNotNull(wechatUser)) {
YxUserQueryVo yxUserQueryVo = userService.getYxUserById(wechatUser.getUid());
if (ObjectUtil.isNotNull(yxUserQueryVo)) {
jwtUser = (JwtUser) userDetailsService.loadUserByUsername(wechatUser.getOpenid());
jwtUser = (JwtUser) userDetailsService.loadUserByUsername(wechatUser.getRoutineOpenid());
} else {
if (ObjectUtil.isNotNull(wechatUser)) {
wechatUserService.removeById(wechatUser.getUid());

View File

@ -1,10 +1,15 @@
package co.yixiang.modules.shop.web.controller;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.core.io.resource.ClassPathResource;
import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.common.api.ApiResult;
import co.yixiang.modules.shop.service.YxStoreProductService;
import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@ -13,6 +18,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@ -90,6 +96,29 @@ public class IndexController {
return ApiResult.ok(null);
}
@AnonymousAccess
@GetMapping("/citys")
@ApiOperation(value = "获取城市json",notes = "获取城市json")
public ApiResult<String> cityJson(){
String path = "city.json";
String name = "city.json";
try {
File file = FileUtil.inputStreamToFile(new ClassPathResource(path).getStream(), name);
FileReader fileReader = new FileReader(file,"UTF-8");
String string = fileReader.readString();
System.out.println(string);
JSONObject jsonObject = JSON.parseObject(string);
return ApiResult.ok(jsonObject);
} catch (Exception e) {
e.printStackTrace();
return ApiResult.fail("无数据");
}
}
}

View File

@ -18,6 +18,8 @@ import java.io.Serializable;
*/
public interface YxWechatUserService extends BaseService<YxWechatUser> {
YxWechatUser getUserAppInfo(String openid);
YxWechatUser getUserInfo(String openid);
/**

View File

@ -35,6 +35,13 @@ public class YxWechatUserServiceImpl extends BaseServiceImpl<YxWechatUserMapper,
@Autowired
private YxWechatUserMapper yxWechatUserMapper;
@Override
public YxWechatUser getUserAppInfo(String openid) {
QueryWrapper<YxWechatUser> wrapper = new QueryWrapper<>();
wrapper.eq("routine_openid",openid);
return yxWechatUserMapper.selectOne(wrapper);
}
@Override
public YxWechatUser getUserInfo(String openid) {
QueryWrapper<YxWechatUser> wrapper = new QueryWrapper<>();

File diff suppressed because one or more lines are too long