package com.xiaoyuanbang.order.controller;
import com.xiaoyuanbang.model.Order;
import com.xiaoyuanbang.order.service.OrderService;
import com.xiaoyuanbang.common.entity.PageResult;
import com.xiaoyuanbang.common.entity.Result;
import com.xiaoyuanbang.common.entity.StatusCode;
import com.xiaoyuanbang.model.User;
import com.xiaoyuanbang.user.service.UserService;
import io.jsonwebtoken.Claims;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import com.xiaoyuanbang.common.util.JwtUtil;
import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.util.*;
/**
* 控制器层
*
* @author Administrator
*/
@RestController
@CrossOrigin
@RequestMapping("/order")
public class OrderController {
@Autowired
private OrderService orderService;
@Autowired
private HttpServletRequest request;
@Autowired
// private RestTemplate restTemplate;
private UserService userService;
@Autowired
private JwtUtil jwtUtil;
/**
* 查询全部数据
*
* @return
*/
@RequestMapping(method = RequestMethod.GET)
public Result findAll() {
return new Result(true, StatusCode.OK, "查询成功", orderService.findAll());
}
/**
* 根据ID查询
*
* @param id ID
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Result findById(@PathVariable String id) {
return new Result(true, StatusCode.OK, "查询成功", orderService.findById(id));
}
@RequestMapping(value = "/some/{id}", method = RequestMethod.GET)
public Result findSomeById(@PathVariable String id) {
Order order = orderService.findById(id);
Order newOrder = new Order();
newOrder.setCreate_time(order.getCreate_time());
newOrder.setReward(order.getReward());
newOrder.setOrder_type(order.getOrder_type());
newOrder.setBuy_request(order.getBuy_request());
newOrder.setId(order.getId());
newOrder.setUserid(order.getUserid());
newOrder.setBuy_price(order.getBuy_price());
newOrder.setBuy_weight(order.getBuy_weight());
newOrder.setId(order.getId());
return new Result(true, StatusCode.OK, "查询成功", newOrder);
}
@PutMapping(value = "/updateCancelOrder/{orderid}")
public Result updateCancelOrder(@PathVariable String orderid, @RequestBody String token) {
Claims claims = jwtUtil.parseJWT(token);
String id = claims.getId();
if (id.equals("user")) {
orderService.updateCancelOrder(orderid);
return new Result(true, StatusCode.OK, "修改成功");
} else {
return new Result(false, StatusCode.ERROR, "修改出错");
}
}
/**
* 分页+多条件查询
*
* @param searchMap 查询条件封装
* @param page 页码
* @param size 页大小
* @return 分页结果
*/
@RequestMapping(value = "/search/{page}/{size}", method = RequestMethod.POST)
public Result findSearch(@RequestBody Map searchMap, @PathVariable int page, @PathVariable int size) {
Page<Order> pageList = orderService.findSearch(searchMap, page, size);
return new Result(true, StatusCode.OK, "查询成功", new PageResult<Order>(pageList.getTotalElements(), pageList.getContent()));
}
@RequestMapping(value = "/publicsearch/{page}/{size}", method = RequestMethod.POST)
public Result publicfindSearch(@RequestBody Map searchMap, @PathVariable int page, @PathVariable int size) {
Page<Order> pageList = orderService.findSearch(searchMap, page, size);
return new Result(true, StatusCode.OK, "查询成功", new PageResult<Order>(pageList.getTotalElements(), pageList.getContent()));
}
/**
* 根据条件查询
*
* @param searchMap
* @return
*/
@RequestMapping(value = "/search", method = RequestMethod.POST)
public Result findSearch(@RequestBody Map searchMap) {
return new Result(true, StatusCode.OK, "查询成功", orderService.findSearch(searchMap));
}
/**
* 增加
*
* @param order
*/
@RequestMapping(method = RequestMethod.POST)
public Result add(@RequestBody Order order) {
orderService.add(order);
return new Result(true, StatusCode.OK, "增加成功");
}
/**
* 修改
*
* @param order
*/
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Result update(@RequestBody Order order, @PathVariable String id) {
order.setId(id);
orderService.update(order);
return new Result(true, StatusCode.OK, "修改成功");
}
@RequestMapping(value = "/orderStatus/{id}", method = RequestMethod.PUT)
public Result updateOrderStatus(@RequestBody Order order, @PathVariable String id) {
order.setId(id);
orderService.updateOrderStatusAndPaytime(order);
return new Result(true, StatusCode.OK, "修改成功");
}
/**
* 删除
*
* @param id
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public Result delete(@PathVariable String id) {
orderService.deleteById(id);
return new Result(true, StatusCode.OK, "删除成功");
}
@PostMapping(value = "/sendOrder")
public Result saveSendOrder(@RequestBody Order order) {
Object claims_user = request.getAttribute("claims_user");
System.out.println(claims_user);
Claims claims = (Claims) claims_user;
if (claims == null) {
return new Result(false, StatusCode.ACCESSERROR, "请登录后再下单");
}
order.setUserid(claims.getId());
order.setCreate_time(new Date());
order.setStatus("1");
order.setIs_userdelete("N");
order.setIs_errandsdelete("N");
order.setIs_errC("N");
order.setIs_userC("N");
order.setOrder_type(2);
orderService.add(order);
Map map = new HashMap();
map.put("orderid", order.getId());
map.put("money", order.getReward());
return new Result(true, StatusCode.OK, "下单成功", map);
}
@PostMapping(value = "/takeOrder")
public Result saveTakeOrder(@RequestBody Order order) {
Object claims_user = request.getAttribute("claims_user");
System.out.println(claims_user);
Claims claims = (Claims) claims_user;
if (claims == null) {
return new Result(false, StatusCode.ACCESSERROR, "请登录后再下单");
}
order.setUserid(claims.getId());
order.setCreate_time(new Date());
order.setStatus("1");
order.setIs_userdelete("N");
order.setIs_errandsdelete("N");
order.setIs_errC("N");
order.setIs_userC("N");
order.setOrder_type(3);
orderService.add(order);
Map map = new HashMap();
map.put("orderid", order.getId());
map.put("money", order.getReward());
return new Result(true, StatusCode.OK, "下单成功", map);
}
@PostMapping(value = "/queueOrder")
public Result saveQueueOrder(@RequestBody Order order) {
Object claims_user = request.getAttribute("claims_user");
System.out.println(claims_user);
Claims claims = (Claims) claims_user;
if (claims == null) {
return new Result(false, StatusCode.ACCESSERROR, "请登录后再下单");
}
order.setUserid(claims.getId());
order.setCreate_time(new Date());
order.setStatus("1");
order.setIs_userdelete("N");
order.setIs_errandsdelete("N");
order.setIs_errC("N");
order.setIs_userC("N");
order.setOrder_type(4);
orderService.add(order);
Map map = new HashMap();
map.put("orderid", order.getId());
map.put("money", orde
没有合适的资源?快使用搜索试试~ 我知道了~
毕业设计,仿uu跑腿的跑腿网站。网站前台+后台实现
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共2000个文件
js:873个
css:297个
png:283个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 4 浏览量
2024-02-24
12:35:54
上传
评论
收藏 18.62MB ZIP 举报
温馨提示
毕业设计,仿uu跑腿的跑腿网站。网站前台+后台实现。SpringBoot+Vue+Mybatis+Redis+RabbitMq,集成支付宝支付
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/f40b27f659cf4356877369aa7344c2b6_qqrrjj2011.jpg!1)
极致人生-010
- 粉丝: 3405
- 资源: 3073
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- tensorflow-1.1.0-cp36-cp36m-win-amd64.whl
- 啊哈算法哈磊 城市的最短转接次数搜索(BFS算法)-Java实现
- tensorflow-gpu-1.1.0-cp36-cp36m-win-amd64.whl
- 啊哈算法哈磊 图的最短路径搜索(DFS算法)-Java实现
- 自研Redis管理(WPF)小工具
- 587104662889319dormitoryms-eclipse1.zip
- Kotlin-初级篇(一):最详细的环境搭建.pdf
- 使用BP神经网络、RBF神经网络以及PSO优化的RBF神经网络进行数据的预测
- 三菱PLC FX5用户手册-模拟量篇.pdf
- SPP2305WS23RG-VB一款SOT23封装P-Channel场效应MOS管
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)