Commit 5105aab0 authored by mengbali153's avatar mengbali153

注册接口修改

parent 2e51eb7f
......@@ -33,7 +33,7 @@ public class JdbcConfig {
public DataSource createDataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://127.0.0.1:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false");
dataSource.setUrl("jdbc:mysql://127.0.0.1:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8");
dataSource.setUsername("root");
dataSource.setPassword("admin!@#123");
return dataSource;
......
......@@ -118,6 +118,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/exhibition/commentPage",
"/**/app/cashier/shop/**",
"/**/app/exhibition",
"/**/app/user/**",
"/**/app/eshop/goods/goodsPage/**",
"/**/app/merchant/transportation/**",
"/**/app/exhibition/detail/**",
......
......@@ -186,6 +186,7 @@
<result column="avatar" property="avatar"/>
<result column="wx_openid" property="wxOpenid"/>
<result column="ali_openid" property="aliOpenid"/>
<result column="create_time" property="createTime"/>
<result column="lock_flag" property="lockFlag"/>
<result column="deptId" property="deptId"/>
<result column="deptName" property="deptName"/>
......
......@@ -262,6 +262,15 @@ public class UserControler extends UserController {
.filed1(openIdRegisterQuery.getSex())
.filed2(openIdRegisterQuery.getCity())
.build();
if (openIdRegisterQuery.getType() == 0){
sysUserBuild.setDescrib("微信端:"+openIdRegisterQuery.getOpenId());
}else if (openIdRegisterQuery.getType() == 1){
sysUserBuild.setDescrib("阿里端:"+openIdRegisterQuery.getOpenId());
}else {
sysUserBuild.setDescrib("未知");
}
this.openIdByType(sysUserBuild, openIdRegisterQuery.getType(), openIdRegisterQuery.getOpenId());
boolean save = userService.save(sysUserBuild);
......@@ -295,6 +304,50 @@ public class UserControler extends UserController {
}
@PostMapping("/updateRegister")
@ApiOperation(value = "小程序:openID注册会员添加修改会员信息")
@ApiImplicitParams(
{
@ApiImplicitParam(name = "OpenIdRegisterQuery", value = "微信或者阿里注册参数对象", dataType = "OpenIdRegisterQuery", paramType = "body")
}
)
public BaseResponse updateRegister(@RequestBody OpenIdRegisterQuery openIdRegisterQuery) {
QueryWrapper queryWrapper =new QueryWrapper();
if (openIdRegisterQuery.getType() == 0){
queryWrapper.eq("wx_openid",openIdRegisterQuery.getOpenId());
SysUser one = userService.getOne(queryWrapper);
one.setUsername(openIdRegisterQuery.getUsername());
one.setAvatar(openIdRegisterQuery.getMultiAvatar());
one.setFiled1(openIdRegisterQuery.getSex());
one.setFiled2(openIdRegisterQuery.getCity());
boolean update = userService.updateById(one);
if (!update){
return BaseResponse.error("修改失败", SysUser.class.getName());
}
}
if (openIdRegisterQuery.getType() == 1){
queryWrapper.eq("ali_openid",openIdRegisterQuery.getOpenId());
SysUser one = userService.getOne(queryWrapper);
one.setUsername(openIdRegisterQuery.getUsername());
one.setAvatar(openIdRegisterQuery.getMultiAvatar());
one.setFiled1(openIdRegisterQuery.getSex());
one.setFiled2(openIdRegisterQuery.getCity());
boolean update = userService.updateById(one);
if (!update){
return BaseResponse.error("修改失败", SysUser.class.getName());
}
}
return BaseResponse.ok(this.getClass());
}
@PutMapping("/binding/phone")
@ApiOperation(value = "根据openId绑定用户手机号")
@ApiImplicitParams(
......
......@@ -27,10 +27,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @description: 在线点单 商铺
......@@ -77,115 +74,119 @@ public class AppShopController {
}
@GetMapping("/goods/{shopId}")
@GetMapping({"/goods/{shopId}"})
@ApiOperation("获取商铺下的商品列表")
public BaseResponse<List<GoodsVO>> getGoodsByShopId(@PathVariable("shopId") Long shopId, Long tableId, String type) {
BaseResponse<List<HashMap>> goodsBaseResponse = iGoodsService.list(shopId.intValue(), "", type, 1);
List<HashMap> list = goodsBaseResponse.getData();
List<GoodsVO> rts = new ArrayList<>();
for (HashMap map : list) {
GoodsVO goodsVO = BeanUtil.mapToBean(map, GoodsVO.class, true);
goodsVO.setCover(fastDfsUtil.fullUrl(goodsVO.getCover()));
BaseResponse<List<HashMap>> goodsBaseResponse = this.iGoodsService.list(shopId.intValue(), "", type, 1);
List<HashMap> list = (List)goodsBaseResponse.getData();
List<GoodsVO> rts = new ArrayList();
Iterator var7 = list.iterator();
while(var7.hasNext()) {
HashMap map = (HashMap)var7.next();
GoodsVO goodsVO = (GoodsVO)BeanUtil.mapToBean(map, GoodsVO.class, true);
goodsVO.setCover(this.fastDfsUtil.fullUrl(goodsVO.getCover()));
rts.add(goodsVO);
}
return BaseResponse.ok(rts);
}
@PostMapping("/newOrder")
@ApiOperation("新增一个订单")
@ApiImplicitParam(name = "orderDetailQuery",value = "订单请求",paramType = "body",dataType = "OrderDetailQuery")
public BaseResponse newOrder(@RequestBody OrderDetailQuery orderDetailQuery){
orderDetailQuery.setStatus(OrderStatus.WAIT_PAY.name());
if (orderDetailQuery.getPayPrice() == 0){
BaseResponse response = iCashierOrdersService.newOrder(orderDetailQuery);
if (response.getCode() == 200){
Orders order = (Orders) response.getData();
orderDetailQuery.setOrderNo(order.getOrderNo());
orderDetailQuery.setPayStatus(PayStatus.PAY_YES.name());
orderDetailQuery.setStatus(OrderStatus.COMPLETE.name());
orderDetailQuery.setPayment("赠送");
return iCashierOrdersService.editEntryOrder(orderDetailQuery);
}else {
return BaseResponse.ok("赠送超时!请重试","");
}
}else {
orderDetailQuery.setPaas("APP");
return iCashierOrdersService.newOrder(orderDetailQuery);
}
}
public static void main(String[] args) {
OrderDetailQuery orderDetailQuery = new OrderDetailQuery();
orderDetailQuery.setOrderNo("123456789");
orderDetailQuery.setCreateTime(1576746683827L);
orderDetailQuery.setPayment("支付宝");
orderDetailQuery.setPayPrice(80.00);
orderDetailQuery.setUserId(1234L);
orderDetailQuery.setUserPhone("13123456789");
orderDetailQuery.setRemark("测试");
orderDetailQuery.setPaas("app");
System.out.println(JSON.toJSONString(orderDetailQuery));
}
@DeleteMapping("{orderNo}")
@ApiOperation("取消订单")
@ApiImplicitParam(name = "orderNo", value = "订单号儿", paramType = "path", dataType = "String")
public BaseResponse delOrder(@PathVariable("orderNo") String orderNo) {
return iCashierOrdersService.delOrder(orderNo);
}
@GetMapping("listApp/user/{userId}/{status}")
@ApiOperation("查询用户订单")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "用户id",paramType = "path",dataType = "Integer"),
@ApiImplicitParam(name = "status",value = "订单状态",paramType = "path",dataType = "Integer")
})
public BaseResponse listUsers(@PathVariable("userId") Integer userId , @PathVariable("status") Integer status){
BaseResponse responseEntity;
responseEntity = iCashierOrdersService.listUsers(userId,status);
return responseEntity;
}
@GetMapping("pageApp/user/{userId}/{status}")
@ApiOperation("查询用户订单/分页")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "用户id",paramType = "path",dataType = "String"),
@ApiImplicitParam(name = "status",value = "订单状态",paramType = "path",dataType = "Integer")
})
public BaseResponse pageAppUser(@PathVariable("userId") String userId,@PathVariable("status") Integer status,PageQuery pageQuery){
BaseResponse responseEntity;
responseEntity = iCashierOrdersService.getOrdersPage(userId,status,pageQuery);
return responseEntity;
return BaseResponse.ok(rts);
}
@PutMapping("/afterApp/success/{orderNo}")
@ApiOperation("支付成功后的回调")
public BaseResponse afterSuccess(@PathVariable("orderNo")String orderNo){
BaseResponse response = iCashierOrdersService.afterSuccess(orderNo);
if (response.code == 200){
Map map = new HashMap();
map.put("order_no",orderNo);
OrderResponse oneOrderResponse = ordersService.getOneOrder(JSON.toJSONString(map));
Orders orders = oneOrderResponse.getData();
//佣金推送
if (orders != null && oneOrderResponse.getCode() == 200){
if (OrderStatus.WAIT_COMMENT.name().equals(orders.getOrderStatus())){
merchantProfitService.addMoneyData(orders.getSellerId(),
orders.getId(),orders.getPaymentMethodName(),orders.getPayPrice(),
orders.getCreateTime());
}
}
}
return response;
}
@PutMapping("/afterApp/fail/{orderNo}")
@ApiOperation("支付失败后的回调")
public BaseResponse afterFail(@PathVariable("orderNo") String orderNo) {
return iCashierOrdersService.afterFail(orderNo);
}
// @PostMapping("/newOrder")
// @ApiOperation("新增一个订单")
// @ApiImplicitParam(name = "orderDetailQuery",value = "订单请求",paramType = "body",dataType = "OrderDetailQuery")
// public BaseResponse newOrder(@RequestBody OrderDetailQuery orderDetailQuery){
// orderDetailQuery.setStatus(OrderStatus.WAIT_PAY.name());
//
// if (orderDetailQuery.getPayPrice() == 0){
// BaseResponse response = iCashierOrdersService.newOrder(orderDetailQuery);
// if (response.getCode() == 200){
// Orders order = (Orders) response.getData();
// orderDetailQuery.setOrderNo(order.getOrderNo());
// orderDetailQuery.setPayStatus(PayStatus.PAY_YES.name());
// orderDetailQuery.setStatus(OrderStatus.COMPLETE.name());
// orderDetailQuery.setPayment("赠送");
// return iCashierOrdersService.editEntryOrder(orderDetailQuery);
// }else {
// return BaseResponse.ok("赠送超时!请重试","");
// }
// }else {
// orderDetailQuery.setPaas("APP");
// return iCashierOrdersService.newOrder(orderDetailQuery);
// }
// }
//
// public static void main(String[] args) {
// OrderDetailQuery orderDetailQuery = new OrderDetailQuery();
// orderDetailQuery.setOrderNo("123456789");
// orderDetailQuery.setCreateTime(1576746683827L);
// orderDetailQuery.setPayment("支付宝");
// orderDetailQuery.setPayPrice(80.00);
// orderDetailQuery.setUserId(1234L);
// orderDetailQuery.setUserPhone("13123456789");
// orderDetailQuery.setRemark("测试");
// orderDetailQuery.setPaas("app");
// System.out.println(JSON.toJSONString(orderDetailQuery));
// }
//
//
// @DeleteMapping("{orderNo}")
// @ApiOperation("取消订单")
// @ApiImplicitParam(name = "orderNo", value = "订单号儿", paramType = "path", dataType = "String")
// public BaseResponse delOrder(@PathVariable("orderNo") String orderNo) {
// return iCashierOrdersService.delOrder(orderNo);
// }
//
// @GetMapping("listApp/user/{userId}/{status}")
// @ApiOperation("查询用户订单")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "userId",value = "用户id",paramType = "path",dataType = "Integer"),
// @ApiImplicitParam(name = "status",value = "订单状态",paramType = "path",dataType = "Integer")
// })
// public BaseResponse listUsers(@PathVariable("userId") Integer userId , @PathVariable("status") Integer status){
// BaseResponse responseEntity;
// responseEntity = iCashierOrdersService.listUsers(userId,status);
// return responseEntity;
// }
//
// @GetMapping("pageApp/user/{userId}/{status}")
// @ApiOperation("查询用户订单/分页")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "userId",value = "用户id",paramType = "path",dataType = "String"),
// @ApiImplicitParam(name = "status",value = "订单状态",paramType = "path",dataType = "Integer")
// })
// public BaseResponse pageAppUser(@PathVariable("userId") String userId,@PathVariable("status") Integer status,PageQuery pageQuery){
// BaseResponse responseEntity;
// responseEntity = iCashierOrdersService.getOrdersPage(userId,status,pageQuery);
// return responseEntity;
// }
//
// @PutMapping("/afterApp/success/{orderNo}")
// @ApiOperation("支付成功后的回调")
// public BaseResponse afterSuccess(@PathVariable("orderNo")String orderNo){
// BaseResponse response = iCashierOrdersService.afterSuccess(orderNo);
// if (response.code == 200){
// Map map = new HashMap();
// map.put("order_no",orderNo);
// OrderResponse oneOrderResponse = ordersService.getOneOrder(JSON.toJSONString(map));
// Orders orders = oneOrderResponse.getData();
//
// //佣金推送
// if (orders != null && oneOrderResponse.getCode() == 200){
// if (OrderStatus.WAIT_COMMENT.name().equals(orders.getOrderStatus())){
// merchantProfitService.addMoneyData(orders.getSellerId(),
// orders.getId(),orders.getPaymentMethodName(),orders.getPayPrice(),
// orders.getCreateTime());
// }
// }
// }
// return response;
// }
//
// @PutMapping("/afterApp/fail/{orderNo}")
// @ApiOperation("支付失败后的回调")
// public BaseResponse afterFail(@PathVariable("orderNo") String orderNo) {
// return iCashierOrdersService.afterFail(orderNo);
// }
}
......@@ -49,14 +49,14 @@ public class OpenIdRegisterQuery implements Serializable {
/**
* 性别
*/
@NotEmpty(message = "性别不能为空")
// @NotEmpty(message = "性别不能为空")
@ApiModelProperty(value = "性别",required = true)
private String sex;
/**
* 城市
*/
@NotEmpty(message = "所在城市不能为空!")
// @NotEmpty(message = "所在城市不能为空!")
@ApiModelProperty(value = "城市",required = true)
private String city;
}
......@@ -30,7 +30,6 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
url: jdbc:mysql://127.0.0.1:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://81.68.92.175:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: admin!@#123
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -112,19 +111,3 @@ logging:
com.alibaba.nacos.client.naming: error
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
---
##nacos部署地址
spring:
profiles: dev-line
cloud:
nacos:
discovery:
namespace: e9d52f53-3cc4-4748-86bf-d28c16ad36fd
config:
#命名空间
namespace: e9d52f53-3cc4-4748-86bf-d28c16ad36fd
nacos:
ip: 42.159.86.77
server:
port: 9002
......@@ -58,23 +58,24 @@ public class MerchDiscountController {
return iMerchDiscountService.addNewMerchDiscount(merchDiscount);
}
public static void main(String[] args) {
MerchDiscount merchDiscount = new MerchDiscount();
merchDiscount.setId(1L);
merchDiscount.setSellerId(1L);
List<MerchDiscount.DiscountSetting> list = new ArrayList<>();
MerchDiscount.DiscountSetting a = new MerchDiscount.DiscountSetting();
a.setDiscount(200D);
a.setId("1");
MerchDiscount.DiscountSetting b = new MerchDiscount.DiscountSetting();
b.setDiscount(200D);
b.setId("1");
list.add(a);
list.add(b);
String str = JSON.toJSONString(list);
merchDiscount.setDiscountStr(str);
System.out.println(JSON.toJSONString(merchDiscount));
}
// public static void main(String[] args) {
// MerchDiscount merchDiscount = new MerchDiscount();
// merchDiscount.setId(1L);
// merchDiscount.setSellerId(1L);
// List<MerchDiscount.DiscountSetting> list = new ArrayList<>();
// MerchDiscount.DiscountSetting a = new MerchDiscount.DiscountSetting();
// a.setDiscount(200D);
// a.setId("1");
// MerchDiscount.DiscountSetting b = new MerchDiscount.DiscountSetting();
// b.setDiscount(200D);
// b.setId("1");
// list.add(a);
// list.add(b);
// String str = JSON.toJSONString(list);
// merchDiscount.setDiscountStr(str);
// System.out.println(JSON.toJSONString(merchDiscount));
// }
@PostMapping("/delete/{id}")
@ApiOperation("删除一个折扣信息")
BaseResponse<Boolean> deleteMerchDiscount(@PathVariable("id") Long id){
......
......@@ -192,9 +192,13 @@ public class UserControler extends UserController {
List<LinkedHashMap> result = userPointsMShipExtraService.getAllUserExtra(userId).getList();
List<UserExtra> userExtras = JSON.parseArray(JSON.toJSONString(result), UserExtra.class);
List<SysUserInfoVO> res = new ArrayList<>();
users.stream()
.forEach(
arg -> {
System.out.println("=======================arg================= \n" + arg.getUserId());
UserExtra user =
userExtras.stream()
.filter(parm -> Integer.toUnsignedLong(arg.getUserId()) == parm.getUserId())
......@@ -203,6 +207,7 @@ public class UserControler extends UserController {
SysUserInfoVO sysUserInfoVO = new SysUserInfoVO();
BeanUtil.copyProperties(user, sysUserInfoVO);
BeanUtil.copyProperties(arg, sysUserInfoVO);
sysUserInfoVO.setCreateTime(arg.getCreateTime());
res.add(sysUserInfoVO);
});
Page pageResult = new Page(page.getCurrent(), page.getSize(), page.getTotal());
......
......@@ -30,15 +30,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
......@@ -447,7 +439,7 @@ public class GoodsController {
@ApiImplicitParam(name = "id", value = "类型id", paramType = "path", dataType = "Long"),
@ApiImplicitParam(name = "field1", value = "商品价格", paramType = "path", dataType = "String")
})
public BaseResponse<String> updateField1(Long id,String field1){
public BaseResponse<String> updateField1(@RequestParam("id")Long id,@RequestParam("field1")String field1){
return iGoodsService.updateField1(id,field1);
}
}
......@@ -3,8 +3,8 @@ server:
spring:
main:
allow-bean-definition-overriding: true
# profiles:
# active: @activatedProperties@
profiles:
active: @activatedProperties@
#项目工程名,同时用于服务发现
application:
name: saas-v1-order
......
......@@ -15,6 +15,7 @@ import cn.wise.sc.pay.domain.point.cnst.PointTypeConsts;
import cn.wise.sc.pay.domain.point.query.PointDetailQuery;
import cn.wise.sc.pay.domain.point.query.UserExreaQuery;
import cn.wise.sc.pay.domain.point.vo.UserExtraVOApp;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -124,6 +125,10 @@ public class UserExtraServiceImpl extends ServiceImpl<UserExtraMapper, UserExtra
try {
List<UserExtra> list = userExtraMapper.getList(userIds);
System.out.println("=======================list================================");
System.out.println(JSON.toJSONString(userIds));
System.out.println(JSON.toJSONString(list));
return BaseResponse.ok(list, UserExtra.class);
} catch (Exception ex) {
return BaseResponse.error("查询失败", UserExtra.class.getName());
......
......@@ -24,7 +24,7 @@ spring:
allow-bean-definition-overriding: true
datasource:
druid:
url: jdbc:mysql://81.68.92.175:3306/oxo_orders?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
url: jdbc:mysql://127.0.0.1:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: admin!@#123
initial-size: 8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment