package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.OrdersEntity;
import com.entity.view.OrdersView;
import com.service.OrdersService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.MapUtils;
import com.utils.CommonUtil;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayApiException;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.config.AlipayConfig;
/**
* 订单
* 后端接口
* @author
* @email
* @date 2024-01-29 13:10:59
*/
@RestController
@RequestMapping("/orders")
public class OrdersController {
@Autowired
private OrdersService ordersService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,OrdersEntity orders,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("shangjia")) {
orders.setShangjiazhanghao((String)request.getSession().getAttribute("username"));
if(orders.getUserid()!=null) {
orders.setUserid(null);
}
}
else {
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
orders.setUserid((Long)request.getSession().getAttribute("userId"));
}
}
EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
PageUtils page = ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,OrdersEntity orders,
HttpServletRequest request){
EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
PageUtils page = ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( OrdersEntity orders){
EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
ew.allEq(MPUtil.allEQMapPre( orders, "orders"));
return R.ok().put("data", ordersService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(OrdersEntity orders){
EntityWrapper< OrdersEntity> ew = new EntityWrapper< OrdersEntity>();
ew.allEq(MPUtil.allEQMapPre( orders, "orders"));
OrdersView ordersView = ordersService.selectView(ew);
return R.ok("查询订单成功").put("data", ordersView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
OrdersEntity orders = ordersService.selectById(id);
return R.ok().put("data", orders);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
OrdersEntity orders = ordersService.selectById(id);
return R.ok().put("data", orders);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody OrdersEntity orders, HttpServletRequest request){
//ValidatorUtils.validateEntity(orders);
orders.setUserid((Long)request.getSession().getAttribute("userId"));
ordersService.insert(orders);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody OrdersEntity orders, HttpServletRequest request){
//ValidatorUtils.validateEntity(orders);
ordersService.insert(orders);
return R.ok();
}
/**
* 获取用户密保
*/
@RequestMapping("/security")
@IgnoreAuth
public R security(@RequestParam String username){
OrdersEntity orders = ordersService.selectOne(new EntityWrapper<OrdersEntity>().eq("", username));
return R.ok().put("data", orders);
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
@IgnoreAuth
public R update(@RequestBody OrdersEntity orders, HttpServletRequest request){
//ValidatorUtils.validateEntity(orders);
ordersService.updateById(orders);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
ordersService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,OrdersEntity orders, HttpServletRequest request,String pre){
EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicktime");
params.put("order", "desc");
PageUtils page = ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));
return R.ok().put("data", page);
}
@RequestMapping("/alipay")
public R payController(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) Integer isFront) throws IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.gatewayUrl, AlipayConfig.app_id, AlipayConfig.merchant_private_key, "json", AlipayConfig.charset, AlipayConfig.alipay_public_key, AlipayConfig.sign_type);
AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
alipayRequest.setReturnUrl(AlipayConfig.return_url2);
alipayRequest.setNotifyUrl(AlipayConfig.notify_url+"orders"+"/notify");
String out_trade_no = new String(request.getParamete
没有合适的资源?快使用搜索试试~ 我知道了~
java毕业设计基于spring boot扶贫助农系统设计与实现(springboot+vue+mysql+说明文档).zip
共691个文件
java:164个
svg:159个
vue:117个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 42 浏览量
2024-11-09
13:19:17
上传
评论
收藏 24.35MB ZIP 举报
温馨提示
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
资源推荐
资源详情
资源评论
收起资源包目录
java毕业设计基于spring boot扶贫助农系统设计与实现(springboot+vue+mysql+说明文档).zip (691个子文件)
main.js.bak 2KB
3-build.bat 15B
2-run.bat 14B
build.bat 14B
run.bat 14B
1-install.bat 12B
install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.d4a4c1c3.css 494KB
chunk-vendors.1622b503.css 312KB
app.94fd1570.css 209KB
chunk-vendors.1f0a25b2.css 37KB
swiper.min.css 13KB
swiper.min.css 13KB
iconfont.css 622B
canvas-bg-1.css 391B
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-2.css 83B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
canvas-bg-3.css 61B
.factorypath 15KB
.gitignore 364B
index.html 1KB
index.html 1KB
index.html 1KB
index.html 981B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
OrdersController.java 19KB
FupinshangpinController.java 11KB
NewsController.java 9KB
BaiduUtil.java 8KB
ShangjiaController.java 8KB
EncryptUtil.java 8KB
YonghuController.java 8KB
AddressController.java 8KB
CommonController.java 7KB
DiscussfupinshangpinController.java 7KB
OrdersEntity.java 7KB
SystemnoticeController.java 7KB
FupinshangpinEntity.java 7KB
SystemintroController.java 7KB
StoreupController.java 7KB
FriendlinkController.java 6KB
NewstypeController.java 6KB
MPUtil.java 6KB
CartController.java 6KB
AboutusController.java 6KB
OrdersModel.java 6KB
OrdersVO.java 6KB
FupinshangpinModel.java 5KB
FupinshangpinVO.java 5KB
ShangpinleixingController.java 5KB
UsersController.java 5KB
NewsEntity.java 5KB
MavenWrapperDownloader.java 5KB
ShangjiaEntity.java 5KB
FileController.java 4KB
CommonUtil.java 4KB
CartEntity.java 4KB
NewsModel.java 4KB
NewsVO.java 4KB
StoreupEntity.java 4KB
YonghuEntity.java 4KB
DiscussfupinshangpinEntity.java 3KB
AuthorizationInterceptor.java 3KB
ShangjiaModel.java 3KB
SystemintroEntity.java 3KB
AboutusEntity.java 3KB
ConfigController.java 3KB
ShangjiaVO.java 3KB
AddressEntity.java 3KB
CartModel.java 3KB
AlipayConfig.java 3KB
CartVO.java 3KB
HttpClientUtils.java 3KB
Query.java 3KB
StoreupModel.java 2KB
FriendlinkEntity.java 2KB
TokenServiceImpl.java 2KB
OrdersServiceImpl.java 2KB
StoreupVO.java 2KB
ShangpinleixingEntity.java 2KB
YonghuModel.java 2KB
YonghuVO.java 2KB
TokenEntity.java 2KB
DiscussfupinshangpinServiceImpl.java 2KB
DiscussfupinshangpinModel.java 2KB
SystemintroModel.java 2KB
AboutusModel.java 2KB
ShangpinleixingServiceImpl.java 2KB
NewstypeEntity.java 2KB
SystemnoticeEntity.java 2KB
共 691 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
计算机学长阿伟
- 粉丝: 3196
- 资源: 849
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功