package com.example.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.GoumaixinxiInfo;
import com.example.dao.GoumaixinxiInfoDao;
import com.example.service.GoumaixinxiInfoService;
import com.example.exception.CustomException;
import com.example.common.ResultCode;
import com.example.vo.EchartsData;
import com.example.vo.GoumaixinxiInfoVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.example.service.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Value;
import cn.hutool.core.util.StrUtil;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping(value = "/goumaixinxiInfo")
public class GoumaixinxiInfoController {
@Resource
private GoumaixinxiInfoService goumaixinxiInfoService;
@Resource
private GoumaixinxiInfoDao goumaixinxiInfoDao;
@PostMapping
public Result<GoumaixinxiInfo> add(@RequestBody GoumaixinxiInfoVo goumaixinxiInfo) {
//mixmajixami
goumaixinxiInfoService.add(goumaixinxiInfo);
return Result.success(goumaixinxiInfo);
}
//youtixing1
//youtixing2
@GetMapping("/getByDiqu")
public Result<List<Map<String,String>>> qidu() {
return Result.success(goumaixinxiInfoService.findByDiqu());
}
@DeleteMapping("/{id}")
public Result delete(@PathVariable Long id) {
goumaixinxiInfoService.delete(id);
return Result.success();
}
@GetMapping("/getByzhuceyonghuFaburen/{faburen}")
public Result<List<GoumaixinxiInfo>> getByzhuceyonghuFaburen(@PathVariable String faburen) {
List<GoumaixinxiInfo> goumaixinxiInfo = goumaixinxiInfoService.getByzhuceyonghuFaburen(faburen);
return Result.success(goumaixinxiInfo);
}
@GetMapping("/getByzhuceyonghuGoumairen/{goumairen}")
public Result<List<GoumaixinxiInfo>> getByzhuceyonghuGoumairen(@PathVariable String goumairen) {
List<GoumaixinxiInfo> goumaixinxiInfo = goumaixinxiInfoService.getByzhuceyonghuGoumairen(goumairen);
return Result.success(goumaixinxiInfo);
}
@PutMapping
public Result update(@RequestBody GoumaixinxiInfoVo goumaixinxiInfo) {
goumaixinxiInfoService.update(goumaixinxiInfo);
return Result.success();
}
//@PutMapping("/update2")
// public Result update2(@RequestBody GoumaixinxiInfoVo goumaixinxiInfo) {
// goumaixinxiInfoService.update2(goumaixinxiInfo);
// return Result.success();
// }
@GetMapping("/{id}")
public Result<GoumaixinxiInfo> detail(@PathVariable Long id) {
GoumaixinxiInfo goumaixinxiInfo = goumaixinxiInfoService.findById(id);
return Result.success(goumaixinxiInfo);
}
@GetMapping("/changeStatus/{id}")
public Result<GoumaixinxiInfo> changeStatus(@PathVariable Long id) {
goumaixinxiInfoService.changeStatus(id);
return Result.success();
}
@GetMapping("/changeIszf/{id}")
public Result<GoumaixinxiInfo> changeIszf(@PathVariable Long id) {
goumaixinxiInfoService.changeIszf(id);
return Result.success();
}
@GetMapping
public Result<List<GoumaixinxiInfoVo>> all() {
return Result.success(goumaixinxiInfoService.findAll());
}
@GetMapping("/page/{name}")
public Result<PageInfo<GoumaixinxiInfoVo>> page(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "5") Integer pageSize,
HttpServletRequest request) {
return Result.success(goumaixinxiInfoService.findPage(name, pageNum, pageSize, request));
}
@GetMapping("/pageqt/{name}")
public Result<PageInfo<GoumaixinxiInfoVo>> pageqt(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "8") Integer pageSize,
HttpServletRequest request) {
return Result.success(goumaixinxiInfoService.findPageqt(name, pageNum, pageSize, request));
}
// @PostMapping("/register")
// public Result<GoumaixinxiInfo> register(@RequestBody GoumaixinxiInfo goumaixinxiInfo) {
// if (StrUtil.isBlank(goumaixinxiInfo.getName()) || StrUtil.isBlank(goumaixinxiInfo.getPassword())) {
// throw new CustomException(ResultCode.PARAM_ERROR);
// }
// return Result.success(goumaixinxiInfoService.add(goumaixinxiInfo));
// }
/**
* 批量通过excel添加信息
* @param file excel文件
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<GoumaixinxiInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(GoumaixinxiInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<GoumaixinxiInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getWupinmingcheng())).collect(Collectors.toList());
for (GoumaixinxiInfo info : resultList) {
goumaixinxiInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("wupinbianhao", "A物品编号");
row.put("wupinmingcheng", "A物品名称");
row.put("wupinleibie", "A物品类别");
row.put("jiage", "A价格");
row.put("faburen", "A发布人");
row.put("goumairen", "A购买人");
row.put("status", "是");
row.put("level", "goumaixinxi");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=goumaixinxiInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
public void getExcel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("wupinbianhao", "A物品编号");
row.put("wupinmingcheng", "A物品名称");
row.put("wupinleibie", "A物品类别");
row.put("jiage", "A价格");
row.put("faburen", "A发布人");
row.put("goumairen", "A购买人");
row.put("status", "是");
row.put("level", "权限");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
List<Map<String, Object>> daochuexcellist = goumaixinxiInfoDao.daochuexcel();
Map<String, Double> typeMap = new HashMap<>();
for (Map<Str
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本资源是一个基于微信小程序的二手物品交易小程序,使用Java语言进行开发。该小程序旨在为用户提供一个便捷、安全的交易平台,让他们能够轻松买卖二手物品。这个二手物品交易小程序具有以下特点:用户注册与登录:用户可以通过手机号或微信账号进行注册和登录,确保交易的安全性和隐私保护。商品发布与管理:卖家可以发布自己的二手物品信息,包括图片、描述、价格等。同时,他们还可以管理已发布的商品,对商品进行编辑、下架等操作。商品搜索与浏览:用户可以根据关键词搜索感兴趣的二手物品,并查看商品详情、评价等信息。此外,还支持按照价格、发布时间等条件筛选商品。购物车与结算:用户可以将心仪的商品加入购物车,方便统一管理和结算。在结算过程中,系统会自动计算商品总价,并支持多种支付方式。个人中心:用户可以在个人中心查看自己的订单记录、收藏夹、优惠券等信息。同时,他们还可以修改个人信息、设置收货地址等。评价与反馈:买家和卖家可以在交易完成后对对方进行评价,以便其他用户参考。此外,用户还可以提交交易问题或建议,帮助平台不断优化服务。为了保证交易的安全性和可靠性,该小程序采用了严格的实名认证机制、支付安全措施以及数据加密技术。同时,开发者还注重用户体验,力求让用户在使用过程中感受到便捷、舒适的服务。
资源推荐
资源详情
资源评论
收起资源包目录
基于微信小程序的二手物品交易小程序(java)hsg.zip (1152个子文件)
02add20b581be471b8d17f887b8e8337070546 194B
034ccce28a21cdd1d8500e03a3a19950a24840 135B
06718f8e6a9de9438b6501aff2f83152c53f25 2KB
06bfdeb5ad13a02a29eb9b8b8b57e1d69cedf5 124B
07d6d5f654346606542e80ea09e9983f07705c 85B
0841a689acfc75f16b91e8e49d4daa3cb01df9 831B
0887a714f0134b8dc77a89f648ad7af5219624 2KB
0c0812bb527be6b50c8a043d1e291ddd0d0b0f 135B
0f96ef21c70252c670fbb021f9ddf4e17d7e2a 2KB
132b89c93c82fb7d83523022c3d606b0cdce55 78B
136700c3f750c5b13756b0dc040c0f73168f9c 1KB
17db6db9c5f9d9ffa753ba24dbae05c63a71c6 643B
1988e9f039d279a680e8b915fe5e1d56dd385c 7KB
1a4f51d6e7d104f36ebd32906ca09c7f7ef82a 8KB
1bddcf8c0d37b912fba31db4b7261959e166b2 4KB
1d566316c654a00f15a8fa8605adcc0887ca78 134B
1d5abdfb44d57b8c2e9f70fe5e82ddc71b6040 242B
27b9ee1bdfda2aff5098f63ce7668e0bfc2d51 395B
302da08c7b072cd19358dbb503c18d08fb2143 168B
333cd8c19ff05f2b316c1e8c7d067593702854 5KB
3475a344ade362d397c92f42bafce7f4357dbd 145B
35af0699ccec004cbe685ef938cd2d63ea7037 43B
36c5aae34facbdeb0bd8ee16feba3cdacc8a2e 670B
370e54f9f9ccbc0483f91ed17cd4d0ca7d1a70 361B
395ba95c5c84d41771f4cb2b9df6cc965ee60f 1KB
39747192cd7402c2784c27bb13b8d4e6021d7a 6KB
3b32372fa0114d56ecc4e9f1d0ea4ac1ce4f5e 3KB
42709e1cd615263236d0ee23117795e95a586e 82B
47196fb87ade0fd21217c28577b489ed536b34 2KB
499d747924a8c5aa0ad42ca020ab1dcba50613 417B
50f112453e93931726340632087f9f173cfec4 965B
538c295a79e1ccc89a476f6432a0f8bbef04f9 1KB
559ee67ff7916e39e897c0ec7e140669be3ff1 676B
59f2720d04769b18523ecfd19ab1ade5ccbb9d 998B
5bf3a9933976efe33f1364f35ea29bfc1e9b26 135B
62a356e02e047d41dc875951245df07784d393 85B
6355f833fa1631a2aff819ff01633262da105e 309B
640e0dc44a0e9b160f85b9124714ea071ae7b6 39B
66f3d96d389c73495bbc9cc29d885fc5686bbf 7KB
67afb3a76618078d09086794e323dfe3a29c67 464B
69302c397adc425d760404292f4e9f519553a3 547B
6adec7200d72d6e908125b68cd1c67870bb0f8 85B
6ae0a20376ab441fbb25ed51daef83edb01fa9 135B
7021ccbae905b1e6d5242870e02123f6802b0d 85B
70aad1425a244da356e277ad9bc0607ab5f1dd 3KB
70ab1985689e06f05f658e06e2c39d05753296 407B
71f0df9ae63c39b48b150016cf5a922d540a85 673B
720f7a8e2ffa773538b1ed03222a3b7b20308f 4KB
752381bbf3cf1e8fe80266ebdf35f072df4e98 419B
763277e84151db2255d4000b7dbb91ada84a2b 1KB
767e3032a1cf829c00c7e147d494447d90652e 90B
784a5ce22115b67892b535f3c60fe024cf0e74 2KB
7aa4936e5edd996855413f9ca3fd9edcef7603 794B
7e73b461960e9b46ab3930aa4ed7ea0b252f3e 316B
7f19b5f9c2c88d7c8d0c2f5dd31a9699997f1a 388B
8114571df8026ac96009c567edbe5fef81ed09 52B
858121553fb20a1275407abcd7ee57c634fb3f 135B
87a25525aa06dba166ccdba796671feaae184b 1KB
87db04fd8716eb3a4b88f97041126b9da7bde9 761B
894d1a278e3ed8c42e639570a0ceb1ac36326c 135B
89a34ee050b5e68e6ae70f41cbfd776421f541 84B
8b9b1520e9a72765a0721ad12c58acb627039f 928B
8bb93e7ebffecf9b3a7fe1582c2d54be32f75e 345B
8e4079810a018090ba597cc7a7afd41ea79bfb 2KB
8f6d71951e182e79255a2b94cb4ea4aa840da5 134B
8fb1d865a89e6d04e3a0c387535ad4d6aa34c0 1KB
92d638e2a2710cc72eac649710cbf560127d22 1KB
968af357ba7583984746b29aa400ff1bcb224c 245B
96f859f54e491950d60868ef72455f47fac058 464B
97c9bf6abab5bfb1d540e49408165e52cdeff3 151B
9960aa4c4d20d830655c87be19faa59a01682c 134B
9c108783e453961d68b9f44a7dd505927a380f 1KB
9cee8e7b376a4b493efd229ef5246561865764 135B
9d7c0880fe6a8db908fe6e365c370df7aaccb6 135B
9da67f1cdf39347ffd1ad0cb4012580cf34415 832B
9df324b450d0cb30d6cd6ee76845ba67ab748e 72B
a262d800b44df5ce408b97627d6711a064c07c 982B
a4ad3f5871c4b3815694f776d304ae29851227 48B
a7e960684704ca3d756a2719cd0e554aa5396c 850B
a803e63eeee1a27918f6c36ca41c80ea7933c8 85B
aba0b2d291bbf2ad9178ed9a8c621ca523b888 134B
ac38830e1d734727cdf659c6d6005674f8167e 805B
af40cadf2e21c8e03aa284fb4af3e7eeacc82b 788B
alignicon 4KB
alignicon 4KB
alldeletebtnhoverskin 743B
alldeletebtnhoverskin 743B
apple-touch-icon-120x120-precompos 7KB
apple-touch-icon-120x120-precompos 7KB
apple-touch-icon-196x196-precompos 12KB
apple-touch-icon-196x196-precompos 12KB
apple-touch-icon-57x57-precomposed 3KB
apple-touch-icon-57x57-precomposed 3KB
b9149ea2f49f24e39fd6a3e78241969a6b48a4 408B
b9902204bec6686f1c9b066ef459979346c4c4 2KB
bef88f62c0e917ecb8d4dda3e422983063e6bf 466B
bfff5b56c4101296ce2867851ade06ca86af48 226B
c0b5583ff1d87aefdd9035cf351b888ad41503 2KB
c47546807d4b6d68d54c46bb334ed13a21c4cb 136B
c4afc6d123f8ca861ce4ad3200fcc47c34e075 375B
共 1152 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
码农飞哥
- 粉丝: 14w+
- 资源: 1911
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功