赞
踩
✨作者主页:IT研究室✨
个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。
☑文末获取源码☑
精彩专栏推荐⬇⬇⬇
Java项目
Python项目
安卓项目
微信小程序项目
随着人们生活水平的提高,二手交易市场也变得越来越繁荣。然而,传统的二手交易方式存在一些问题,如信息不透明、交易安全性不高等,这些问题严重影响了用户的使用体验和交易效果。因此,开发一款便捷、安全的二手交易微信小程序/安卓APP具有重要的现实意义。
本课题旨在设计并实现一款基于微信小程序/安卓APP的二手交易平台,以满足现代消费者对二手商品的需求。该工具将采用移动端架构,用户可以通过手机访问工具,实现对商品信息、订单管理、支付等功能的实时监控和管理。通过商品信息展示、订单管理和支付等模块的设计,提高二手交易平台的效率和质量,增进二手交易市场的发展。
目前,一些二手交易平台已经采用了线上交易系统,但是这些系统存在一些问题。首先,部分系统的交易安全性不高,存在欺诈行为等问题;再次,部分系统的用户体验不佳,无法满足个性化需求。这些问题都严重影响了二手交易平台的效果和质量。
本课题的研究目的是设计并实现一款基于微信小程序/安卓APP的二手交易平台,以提高二手交易平台的效率和质量。具体来说,该工具可以实现以下功能:
本课题的研究意义主要体现在以下几个方面:
@RestController @RequestMapping("/alipay") public class AliPayController { @Resource private OrderMapper orderMapper; @GetMapping("/pay") public String pay(AliPay aliPay) { AlipayTradePagePayResponse response; try { // 发起API调用(以创建当面付收款二维码为例) response = Factory.Payment.Page() .pay(aliPay.getSubject(), aliPay.getTraceNo(), aliPay.getTotalAmount(), ""); } catch (Exception e) { System.err.println("调用遭遇异常,原因:" + e.getMessage()); throw new RuntimeException(e.getMessage(), e); } return response.getBody(); } @PostMapping("/notify") // 注意这里必须是POST接口 public String payNotify(HttpServletRequest request) throws Exception { if (request.getParameter("trade_status").equals("TRADE_SUCCESS")) { System.out.println("=========支付宝异步回调========"); Map<String, String> params = new HashMap<>(); Map<String, String[]> requestParams = request.getParameterMap(); for (String name : requestParams.keySet()) { params.put(name, request.getParameter(name)); // System.out.println(name + " = " + request.getParameter(name)); } String tradeNo = params.get("out_trade_no"); String gmtPayment = params.get("gmt_payment"); // 支付宝验签 if (Factory.Payment.Common().verifyNotify(params)) { // 验签通过 System.out.println("交易名称: " + params.get("subject")); System.out.println("交易状态: " + params.get("trade_status")); System.out.println("支付宝交易凭证号: " + params.get("trade_no")); System.out.println("商户订单号: " + params.get("out_trade_no")); System.out.println("交易金额: " + params.get("total_amount")); System.out.println("买家在支付宝唯一id: " + params.get("buyer_id")); System.out.println("买家付款时间: " + params.get("gmt_payment")); System.out.println("买家付款金额: " + params.get("buyer_pay_amount")); // 更新订单未已支付 orderMapper.updateState(tradeNo, 1, gmtPayment); } } return "success"; } }
@RestController @RequestMapping("/files") public class FileController { @Value("${server.port}") private String port; private static final String ip = "http://localhost"; @PostMapping("/upload") private Result<?> upload(MultipartFile file) throws IOException { String originalFilename = file.getOriginalFilename(); String flag = IdUtil.fastSimpleUUID(); String rootFilePath = System.getProperty("user.dir")+"/springboot/src/main/resources/files/"+flag+"_"+originalFilename; FileUtil.writeBytes(file.getBytes(),rootFilePath); return Result.success(ip+":"+port+"/files/"+flag); } @PostMapping("/editor/upload") private JSON editorUpload(MultipartFile file) throws IOException { String originalFilename = file.getOriginalFilename(); String flag = IdUtil.fastSimpleUUID(); String rootFilePath = System.getProperty("user.dir")+"/springboot/src/main/resources/files/"+flag+"_"+originalFilename; FileUtil.writeBytes(file.getBytes(),rootFilePath); String url = ip + ":" + port + "/files/" + flag; JSONObject json = new JSONObject(); json.set("errno",0); JSONArray arr = new JSONArray(); JSONObject data = new JSONObject(); arr.add(data); data.set("url",url); json.set("data",0); return json; } @GetMapping("/{flag}") public void getFiles(@PathVariable String flag, HttpServletResponse response) { OutputStream os; String basePath = System.getProperty("user.dir")+"/springboot/src/main/resources/files/"; List<String> fileNames = FileUtil.listFileNames(basePath); String fileName = fileNames.stream().filter(name -> name.contains(flag)).findAny().orElse(""); try { if (StrUtil.isNotEmpty(fileName)) { response.addHeader("Conten-Disposition","attachment;filename="+ URLEncoder.encode(fileName,"utf-8")); response.setContentType("application/octet-stream"); byte[] bytes = FileUtil.readBytes(basePath+fileName); os = response.getOutputStream(); os.write(bytes); os.flush(); os.close(); } } catch (Exception e) { System.out.println("文件下载失败"); } } }
@RestController @RequestMapping("/order") public class OrderController { @Resource OrderMapper OrderMapper; @Resource GoodsMapper goodskMapper; @PostMapping public Result<?> save(@RequestBody Order Order) { OrderMapper.insert(Order); return Result.success(); } @PutMapping public Result<?> update(@RequestBody Order Order) { OrderMapper.updateById(Order); return Result.success(); } @DeleteMapping("/{id}") public Result<?> delete(@PathVariable Long id) { OrderMapper.deleteById(id); return Result.success(); } @GetMapping("/{id}") public Result<?> getById(@PathVariable Long id) { return Result.success(OrderMapper.selectById(id)); } @GetMapping("/buy/{goodsId}") public Result<?> buy(@PathVariable Long goodsId) { Goods goods = goodskMapper.selectById(goodsId); String orderNo = IdUtil.getSnowflake().nextIdStr(); String payUrl = "http://localhost:9090/alipay/pay?subject=" + goods.getName() + "&traceNo=" + orderNo + "&totalAmount=" + goods.getPrice(); Order order = new Order(); order.setOrderNo(orderNo); order.setTotalPrice(goods.getPrice()); order.setPayPrice(goods.getPrice()); order.setTransportPrice(BigDecimal.ZERO); order.setName(goods.getName()); save(order); // 新建订单,扣减库存 return Result.success(payUrl); } @GetMapping public Result<?> findPage(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, @RequestParam(defaultValue = "") String search) { LambdaQueryWrapper<Order> wrapper = Wrappers.lambdaQuery(); if (StrUtil.isNotBlank(search)) { wrapper.like(Order::getOrderNo, search); } Page<Order> OrderPage = OrderMapper.selectPage(new Page<>(pageNum, pageSize), wrapper); return Result.success(OrderPage); } }
二手交易微信小程序/安卓APP项目视频:
计算机毕业设计选题推荐-二手交易微信小程序/安卓APP
计算机毕业设计选题推荐-二手交易微信小程序/安卓APP-项目实战
大家可以帮忙点赞、收藏、关注、评论啦~
源码获取:私信我
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。