package com.cl.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.cl.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.cl.annotation.IgnoreAuth;
import com.cl.entity.WodedingdanEntity;
import com.cl.entity.view.WodedingdanView;
import com.cl.service.WodedingdanService;
import com.cl.service.TokenService;
import com.cl.utils.PageUtils;
import com.cl.utils.R;
import com.cl.utils.MPUtil;
import com.cl.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.alipay.api.request.AlipayTradeAppPayRequest;
import com.cl.config.AlipayConfig;
/**
* 我的订单
* 后端接口
* @author
* @email
* @date 2024-03-19 14:11:38
*/
@RestController
@RequestMapping("/wodedingdan")
public class WodedingdanController {
@Autowired
private WodedingdanService wodedingdanService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WodedingdanEntity wodedingdan,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wodedingdan.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<WodedingdanEntity> ew = new EntityWrapper<WodedingdanEntity>();
PageUtils page = wodedingdanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wodedingdan), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WodedingdanEntity wodedingdan,
HttpServletRequest request){
EntityWrapper<WodedingdanEntity> ew = new EntityWrapper<WodedingdanEntity>();
PageUtils page = wodedingdanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wodedingdan), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WodedingdanEntity wodedingdan){
EntityWrapper<WodedingdanEntity> ew = new EntityWrapper<WodedingdanEntity>();
ew.allEq(MPUtil.allEQMapPre( wodedingdan, "wodedingdan"));
return R.ok().put("data", wodedingdanService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WodedingdanEntity wodedingdan){
EntityWrapper< WodedingdanEntity> ew = new EntityWrapper< WodedingdanEntity>();
ew.allEq(MPUtil.allEQMapPre( wodedingdan, "wodedingdan"));
WodedingdanView wodedingdanView = wodedingdanService.selectView(ew);
return R.ok("查询我的订单成功").put("data", wodedingdanView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WodedingdanEntity wodedingdan = wodedingdanService.selectById(id);
wodedingdan = wodedingdanService.selectView(new EntityWrapper<WodedingdanEntity>().eq("id", id));
return R.ok().put("data", wodedingdan);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WodedingdanEntity wodedingdan = wodedingdanService.selectById(id);
wodedingdan = wodedingdanService.selectView(new EntityWrapper<WodedingdanEntity>().eq("id", id));
return R.ok().put("data", wodedingdan);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WodedingdanEntity wodedingdan, HttpServletRequest request){
wodedingdan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wodedingdan);
wodedingdan.setUserid((Long)request.getSession().getAttribute("userId"));
wodedingdanService.insert(wodedingdan);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WodedingdanEntity wodedingdan, HttpServletRequest request){
wodedingdan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wodedingdan);
wodedingdanService.insert(wodedingdan);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody WodedingdanEntity wodedingdan, HttpServletRequest request){
//ValidatorUtils.validateEntity(wodedingdan);
wodedingdanService.updateById(wodedingdan);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wodedingdanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
@RequestMapping("/page/alipay")
public R pagePayController(HttpServletRequest request, HttpServletResponse response) 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_url+"wodedingdan");
alipayRequest.setNotifyUrl(AlipayConfig.notify_url+"wodedingdan"+"/notify");
String out_trade_no = new String(request.getParameter("tradeno"));
String total_amount = new String(request.getParameter("totalamount").getBytes("ISO-8859-1"),"UTF-8");
String subject = new String(request.getParameter("subject"));
String body = "";
alipayRequest.setBizContent("{\"out_trade_no\":\"" + out_trade_no + "\","
+ "\"total_amount\":\"" + total_amount + "\","
+ "\"subject\":\"" + subject + "\","
+ "\"body\":\"" + body + "\","
+ "\"product_code\":\"FAST_INSTANT_TRADE_PAY\"}");
String form = "";
try {
form = alipayClient.pageExecute(alipayRequest).getBody(); //调用SDK生成表单
} catch (AlipayApiException e) {
e.printStackTrace();
}
return R.ok().put("data",form);
}
@RequestMapping("/app/alipay")
public R appPayController(HttpServletRequest request, HttpServletResponse response) throws IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf
没有合适的资源?快使用搜索试试~ 我知道了~
基于springboot的百货中心管理系统源代码(完整前后端+mysql+说明文档).zip
共342个文件
java:88个
vue:72个
png:46个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 107 浏览量
2024-12-13
09:56:29
上传
评论
收藏 11.35MB ZIP 举报
温馨提示
项目均经过测试,可正常运行! 环境说明: 开发语言:java JDK版本:jdk1.8 框架:springboot 数据库:mysql 5.7/8 数据库工具:navicat 开发软件:eclipse/idea
资源推荐
资源详情
资源评论
收起资源包目录
基于springboot的百货中心管理系统源代码(完整前后端+mysql+说明文档).zip (342个子文件)
chunk-vendors.83167ee3.css 339KB
chunk-vendors.9650af1e.css 319KB
app.61aec69e.css 153KB
app.41fa8fec.css 110KB
573.3fe93835.css 11KB
708.eee27018.css 3KB
990.dd4f0738.css 2KB
387.ab8d3b88.css 1KB
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-5.css 61B
canvas-bg-4.css 61B
canvas-bg-3.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
canvas-bg-4.css 61B
.env.development 197B
.env.development 197B
数据库表结构文档.doc 793KB
.gitignore 231B
index.html 777B
index.html 774B
index.html 692B
index.html 689B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
WodedingdanController.java 18KB
BaiduUtil.java 8KB
EncryptUtil.java 8KB
YonghuController.java 8KB
CommonController.java 7KB
DiscusswodedingdanController.java 7KB
MenuController.java 6KB
ShangpinleixingController.java 6KB
ShangpinxinxiController.java 6KB
ShangpinrukuController.java 6KB
WodedingdanEntity.java 5KB
UsersController.java 5KB
MPUtil.java 5KB
NewsController.java 5KB
FileController.java 4KB
CommonUtil.java 4KB
ShangpinxinxiEntity.java 4KB
ShangpinrukuEntity.java 4KB
YonghuEntity.java 3KB
AuthorizationInterceptor.java 3KB
DiscusswodedingdanEntity.java 3KB
ConfigController.java 3KB
HttpClientUtils.java 3KB
NewsEntity.java 3KB
AlipayConfig.java 3KB
Query.java 3KB
TokenServiceImpl.java 2KB
WodedingdanServiceImpl.java 2KB
TokenEntity.java 2KB
ShangpinleixingEntity.java 2KB
MenuEntity.java 2KB
PageUtils.java 2KB
DiscusswodedingdanServiceImpl.java 2KB
ShangpinleixingServiceImpl.java 2KB
ShangpinxinxiServiceImpl.java 2KB
ShangpinrukuServiceImpl.java 2KB
YonghuServiceImpl.java 2KB
MenuServiceImpl.java 2KB
NewsServiceImpl.java 2KB
InterceptorConfig.java 1KB
CommonServiceImpl.java 1KB
UsersServiceImpl.java 1KB
UsersEntity.java 1KB
WodedingdanDao.java 1KB
WodedingdanService.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
DiscusswodedingdanView.java 1KB
SQLFilter.java 1KB
ShangpinleixingView.java 1KB
ShangpinxinxiView.java 1KB
ShangpinrukuView.java 1020B
WodedingdanView.java 1011B
YonghuView.java 960B
NewsView.java 948B
MenuView.java 942B
ConfigServiceImpl.java 934B
DiscusswodedingdanService.java 910B
DiscusswodedingdanDao.java 899B
R.java 887B
ShangpinleixingService.java 874B
ShangpinleixingDao.java 860B
ShangpinxinxiService.java 856B
ConfigEntity.java 854B
ShangpinrukuService.java 847B
EIException.java 846B
ShangpinxinxiDao.java 840B
ShangpinrukuDao.java 830B
SpringbootSchemaApplication.java 808B
共 342 条
- 1
- 2
- 3
- 4
资源评论
码农落落
- 粉丝: 992
- 资源: 3454
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功