data = new HashMap<>(2);
45 | String property = commandStats.getProperty(key);
46 | data.put("name", StringUtils.removeStart(key, "cmdstat_"));
47 | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
48 | pieList.add(data);
49 | });
50 | result.put("commandStats", pieList);
51 | return AjaxResult.success(result);
52 | }
53 | }
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/monitor/ChainController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.monitor;
2 |
3 | import cn.hutool.http.HttpUtil;
4 | import cn.hutool.json.JSONArray;
5 | import cn.hutool.json.JSONObject;
6 | import cn.hutool.json.JSONUtil;
7 | import com.qhx.common.model.AjaxResult;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Value;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RequestMethod;
13 | import org.springframework.web.bind.annotation.RestController;
14 |
15 | /**
16 | * @author: jzm
17 | * @date: 2024-03-28 09:17
18 | **/
19 |
20 | @RestController
21 | @RequestMapping("/monitor/chain")
22 | @Api("区块链监控") // TODO 抽时间替换fisco-java-sdk
23 | public class ChainController
24 | {
25 |
26 | private String urlPre;
27 |
28 | @Value("${fisco.url}")
29 | public void setUrlPre(String url){
30 | this.urlPre = url + ":5002/WeBASE-Front/1/web3";
31 | }
32 |
33 | @RequestMapping(value = "/getNodeList",method = RequestMethod.GET)
34 | @ApiOperation("获取节点信息")
35 | public AjaxResult getNodeStatusList(){
36 | String body = HttpUtil.createGet(urlPre + "/getNodeStatusList").execute().body();
37 | JSONArray jsonAry = JSONUtil.parseArray(body);
38 | return AjaxResult.success(jsonAry);
39 | }
40 |
41 | @RequestMapping(value = "/getTxTotal",method = RequestMethod.GET)
42 | @ApiOperation("获取tx数量")
43 | public AjaxResult getTransactionTotal(){
44 | // 交易数量、区块数量
45 | String body = HttpUtil.createGet(urlPre + "/transaction-total").execute().body();
46 | JSONObject resObj = JSONUtil.parseObj(body);
47 | // 节点数量
48 | JSONArray nodeAry = JSONUtil.parseArray(HttpUtil.createGet(urlPre + "/groupPeers").execute().body());
49 | resObj.set("nodeTotal",nodeAry.size());
50 | // 待交易数量
51 | String pendTxTotal = HttpUtil.createGet(urlPre + "/pending-transactions-count").execute().body();
52 | resObj.set("pendTxSum",pendTxTotal);
53 | return AjaxResult.success(resObj);
54 | }
55 |
56 |
57 | @RequestMapping(value = "/searchBlock",method = RequestMethod.GET)
58 | @ApiOperation("查询区块详细信息")
59 | public AjaxResult searchBlock( String blockId){
60 | String body = HttpUtil.createGet(urlPre + "/search?input="+blockId).execute().body();
61 | JSONObject jsonObj = JSONUtil.parseObj(body);
62 | return AjaxResult.success(jsonObj);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/monitor/ServerController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.monitor;
2 |
3 | import com.qhx.admin.domain.web.Server;
4 | import com.qhx.common.model.AjaxResult;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | /**
10 | * @author: jzm
11 | * @date: 2024-03-20 08:42
12 | **/
13 |
14 | @RestController
15 | @RequestMapping("/monitor/server")
16 | public class ServerController
17 | {
18 | @RequestMapping(method = RequestMethod.GET)
19 | public AjaxResult getInfo() throws Exception
20 | {
21 | Server server = new Server();
22 | server.copyTo();
23 | return AjaxResult.success(server);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/system/CaptchaController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.system;
2 |
3 | import com.qhx.admin.service.CaptchaService;
4 | import com.qhx.common.model.AjaxResult;
5 | import io.swagger.annotations.ApiOperation;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 | import org.springframework.web.bind.annotation.RestController;
10 |
11 | /**
12 | * 验证码控制器
13 | *
14 | * @author: jzm
15 | * @date: 2024-03-01 19:52
16 | **/
17 | @RestController
18 | public class CaptchaController
19 | {
20 | @Autowired
21 | private CaptchaService captchaService;
22 |
23 | @RequestMapping (path = "/get/captcha",method = RequestMethod.GET)
24 | @ApiOperation("获取验证码")
25 | public AjaxResult getCaptcha(){
26 | return captchaService.getCaptcha();
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/system/MessageController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.system;
2 |
3 | import com.qhx.common.controller.BaseController;
4 | import io.swagger.annotations.Api;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | /**
9 | *
10 | * 前端控制器
11 | *
12 | *
13 | * @author qhx2004
14 | * @since 2024-03-11
15 | */
16 | @RestController
17 | @RequestMapping("/message")
18 | @Api("消息控制器暂定---")
19 | public class MessageController extends BaseController
20 | {
21 | //
22 | //@Autowired
23 | //private MessageService messageService;
24 | //
25 | //
26 | //@RequestMapping(path = "/getAll")
27 | //@ApiOperation("获取全部消息")
28 | //public PageResult getAll(MessQueryTo messQueryTo){
29 | // Integer page = messQueryTo.getPage();
30 | // Integer pageSize = messQueryTo.getPageSize();
31 | // PageInfo pageInfo = startOrderPage(page, pageSize, () ->
32 | // {
33 | // messageService.getAllMes(messQueryTo);
34 | // });
35 | // return toAjax(pageInfo);
36 | //}
37 | //
38 | //
39 | //@RequestMapping(path = "/delete",method = RequestMethod.POST)
40 | //@ApiOperation("删除消息")
41 | //public AjaxResult delete(MessDeleteTo messDeleteTo){
42 | // boolean end = messageService.deleteMes(messDeleteTo);
43 | // return toAjax(end);
44 | //}
45 | //
46 | //
47 | //@RequestMapping(path = "/updateStatus")
48 | //@ApiOperation("修改消息状态(审核消息)")
49 | //public AjaxResult updateStatus(@RequestBody Message message){
50 | // boolean end = messageService.updateStatus(message);
51 | // return toAjax(end);
52 | //}
53 | //
54 | //
55 | //
56 | //
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/system/ShopController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.system;
2 |
3 | import com.qhx.admin.domain.Shop;
4 | import com.qhx.admin.service.LoginService;
5 | import com.qhx.admin.service.ShopService;
6 | import com.qhx.common.controller.BaseController;
7 | import com.qhx.common.model.AjaxResult;
8 | import com.qhx.common.util.StringUtil;
9 | import com.qhx.common.util.user.UserUtil;
10 | import io.swagger.annotations.ApiOperation;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.web.bind.annotation.RequestBody;
13 | import org.springframework.web.bind.annotation.RequestMapping;
14 | import org.springframework.web.bind.annotation.RequestMethod;
15 | import org.springframework.web.bind.annotation.RestController;
16 |
17 | /**
18 | * 商家控制器(是后台用户个人信息修改的附属展示。)
19 | *
20 | * @author: jzm
21 | * @date: 2024-03-19 21:13
22 | **/
23 |
24 | @RestController
25 | @RequestMapping("/shop")
26 | // 商家是农户的附加账号
27 | public class ShopController extends BaseController
28 | {
29 |
30 | @Autowired
31 | private LoginService loginService;
32 |
33 | @Autowired
34 | private ShopService shopService;
35 |
36 |
37 | @RequestMapping(path = "/update",method = RequestMethod.POST)
38 | @ApiOperation("修改商家信息")
39 | public AjaxResult updateShop(@RequestBody Shop shop){
40 | boolean end = shopService.updateShop(shop);
41 | return toAjax(end);
42 | }
43 |
44 |
45 |
46 | @RequestMapping(path = "/get/one" ,method = RequestMethod.GET)
47 | @ApiOperation("获取商家信息")
48 | public AjaxResult getShop(){
49 | Long userId = loginService.getUserId();
50 | return toAjax(shopService.getShop(userId));
51 | }
52 |
53 | @RequestMapping(path = "/open",method = RequestMethod.POST)
54 | @ApiOperation("开通商家信息")
55 | public AjaxResult openShop(@RequestBody Shop shop){
56 | shop.setUserId(loginService.getUserId());
57 | if(StringUtil.isEmpty(shop.getShopName())){
58 | return error("商家名称不能为空!");
59 | }
60 | boolean end = shopService.createShop(shop);
61 | return AjaxResult.success(end);
62 | }
63 |
64 | @RequestMapping(path = "/update/avatar",method = RequestMethod.POST)
65 | @ApiOperation("修改商家头像")
66 | public AjaxResult updateShopAvatar(@RequestBody Shop shop){
67 | if(StringUtil.isEmpty(shop.getShopAvatar()) || !UserUtil.checkAvatar(shop.getShopAvatar())){
68 | return error("上传头像地址不合法!");
69 | }
70 | boolean end = shopService.updateShopAvatar(shop);
71 | return AjaxResult.success(end);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/controller/system/UploadController.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.controller.system;
2 |
3 | import com.qhx.common.controller.BaseUploadController;
4 | import com.qhx.common.model.AjaxResult;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RequestMethod;
8 | import org.springframework.web.bind.annotation.RequestParam;
9 | import org.springframework.web.bind.annotation.RestController;
10 | import org.springframework.web.multipart.MultipartFile;
11 |
12 | /**
13 | * 上传控制器
14 | *
15 | * @author: jzm
16 | * @date: 2024-03-03 11:05
17 | **/
18 | @Slf4j
19 | @RestController
20 | @RequestMapping("/upload")
21 | public class UploadController extends BaseUploadController
22 | {
23 | private static final String[] imgTypes = new String[]{"jpg","png"};
24 |
25 | private static final String AVATAR_PATH_prefix = "img/avatar/";
26 | private static final String GoodsImg_PATH_prefix = "img/goods/";
27 |
28 | @RequestMapping(value = "/avatar",method = RequestMethod.POST)
29 | public AjaxResult uploadAvatar(@RequestParam MultipartFile file){
30 | return uploadImg(AVATAR_PATH_prefix,MAX_FILE_SIZE,imgTypes,file);
31 | }
32 |
33 | @RequestMapping(value = "/goods/img",method = RequestMethod.POST)
34 | public AjaxResult uploadGoodsImg(@RequestParam MultipartFile[] file){
35 | return uploadImg(GoodsImg_PATH_prefix,MAX_FILE_SIZE,imgTypes,file);
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/BackUser.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.qhx.common.domain.User;
5 | import io.swagger.annotations.ApiModel;
6 | import lombok.Getter;
7 | import lombok.Setter;
8 |
9 | /**
10 | *
11 | * 用户信息表
12 | *
13 | *
14 | * @author qhx2004
15 | * @since 2024-02-27
16 | */
17 | @Getter
18 | @Setter
19 | @TableName("ap_back_user")
20 | @ApiModel(value = "BackUser对象", description = "用户信息表")
21 | public class BackUser extends User
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Category.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import java.io.Serializable;
7 | import java.time.LocalDateTime;
8 |
9 | import com.qhx.common.domain.BaseEntity;
10 | import io.swagger.annotations.ApiModel;
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Getter;
13 | import lombok.Setter;
14 |
15 | /**
16 | *
17 | *
18 | *
19 | *
20 | * @author qhx2004
21 | * @since 2024-03-07
22 | */
23 | @Getter
24 | @Setter
25 | @TableName("ap_category")
26 | @ApiModel(value = "Category对象", description = "")
27 | public class Category extends BaseEntity implements Serializable {
28 |
29 | private static final long serialVersionUID = 1L;
30 |
31 | @ApiModelProperty("分类id")
32 | @TableId(value = "category_id", type = IdType.AUTO)
33 | private Integer categoryId;
34 |
35 | @ApiModelProperty("分类名称")
36 | private String categoryName;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/FrontUser.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.qhx.common.domain.User;
5 | import io.swagger.annotations.ApiModel;
6 | import io.swagger.annotations.ApiModelProperty;
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | /**
11 | *
12 | * 用户信息表
13 | *
14 | *
15 | * @author qhx2004
16 | * @since 2024-03-07
17 | */
18 | @Getter
19 | @Setter
20 | @TableName("ap_front_user")
21 | @ApiModel(value = "FrontUser对象", description = "用户信息表")
22 | public class FrontUser extends User{
23 |
24 | @ApiModelProperty("邀请码")
25 | private String invitationCode;
26 | }
27 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Goods.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import com.qhx.common.annotation.NotEmpty;
7 | import com.qhx.common.domain.BaseEntity;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Getter;
11 | import lombok.Setter;
12 |
13 | import java.io.Serializable;
14 | import java.math.BigDecimal;
15 |
16 | /**
17 | *
18 | *
19 | *
20 | *
21 | * @author qhx2004
22 | * @since 2024-03-19
23 | */
24 | @Getter
25 | @Setter
26 | @TableName("ap_goods")
27 | @ApiModel(value = "Goods对象", description = "")
28 | public class Goods extends BaseEntity implements Serializable {
29 |
30 | private static final long serialVersionUID = 1L;
31 |
32 |
33 | @ApiModelProperty("农产品id")
34 | @TableId(value = "goods_id", type = IdType.AUTO)
35 | private Long goodsId;
36 |
37 | @ApiModelProperty("农产品名称")
38 | @NotEmpty(extra = "农产品名称")
39 | private String goodsName;
40 |
41 | @ApiModelProperty("产品描述")
42 | private String description;
43 |
44 | @ApiModelProperty("价格")
45 | @NotEmpty(extra = "价格")
46 | private BigDecimal price;
47 |
48 | @ApiModelProperty("商品所属商家id。")
49 | private Long shopId;
50 |
51 | @ApiModelProperty("产品库存数量")
52 | @NotEmpty(extra = "产品库存数量")
53 | private Integer balance;
54 |
55 |
56 | @ApiModelProperty("已售产品数量")
57 | @NotEmpty(extra = "已售产品数量")
58 | private Integer sold;
59 |
60 | @ApiModelProperty("状态(0正常 1停用)")
61 | private String status;
62 |
63 | // 后端自定义生成的
64 | @ApiModelProperty("产品的唯一编码")
65 | private String goodsNum;
66 | }
67 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/GoodsCategory.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.AllArgsConstructor;
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | import java.io.Serializable;
11 |
12 | /**
13 | *
14 | *
15 | *
16 | *
17 | * @author qhx2004
18 | * @since 2024-03-08
19 | */
20 | @Getter
21 | @Setter
22 | @TableName("ap_goods_category")
23 | @ApiModel(value = "GoodsCategory对象", description = "")
24 | @AllArgsConstructor
25 | public class GoodsCategory implements Serializable {
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | @ApiModelProperty("产品id")
30 | private Long goodsId;
31 |
32 | @ApiModelProperty("产品分类id")
33 | private Integer categoryId;
34 | }
35 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/GoodsImg.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.*;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.Getter;
7 | import lombok.Setter;
8 |
9 | import java.io.Serializable;
10 | import java.time.LocalDateTime;
11 |
12 | /**
13 | *
14 | *
15 | *
16 | *
17 | * @author qhx2004
18 | * @since 2024-03-17
19 | */
20 | @Getter
21 | @Setter
22 | @TableName("ap_goods_img")
23 | @ApiModel(value = "GoodsImg对象", description = "") // 添加孩子欧
24 | public class GoodsImg implements Serializable {
25 |
26 | private static final long serialVersionUID = 1L;
27 |
28 | @ApiModelProperty("商品图片id")
29 | @TableId(value = "img_id", type = IdType.AUTO)
30 | private Long imgId;
31 |
32 | @ApiModelProperty("图片网络地址")
33 | private String imgUrl;
34 |
35 | @ApiModelProperty("商品id")
36 | private Long goodsId;
37 |
38 | @ApiModelProperty("创建者")
39 | @TableField(fill = FieldFill.INSERT)
40 | private Long createBy;
41 |
42 | @ApiModelProperty("创建时间")
43 | @TableField(fill = FieldFill.INSERT)
44 | private LocalDateTime createTime;
45 |
46 | @ApiModelProperty("更新者")
47 | @TableField(fill = FieldFill.INSERT_UPDATE)
48 | private Long updateBy;
49 |
50 | @ApiModelProperty("更新时间")
51 | @TableField(fill = FieldFill.INSERT_UPDATE)
52 | private LocalDateTime updateTime;
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Menu.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import io.swagger.annotations.ApiModel;
7 | import io.swagger.annotations.ApiModelProperty;
8 | import lombok.Getter;
9 | import lombok.Setter;
10 |
11 | import java.io.Serializable;
12 |
13 | /**
14 | * @author: jzm
15 | * @date: 2024-03-10 09:00
16 | **/
17 |
18 | @Getter
19 | @Setter
20 | @TableName("ap_menu")
21 | @ApiModel(value = "menu对象", description = "")
22 | public class Menu implements Serializable
23 | {
24 | private static final long serialVersionUID = 1L;
25 |
26 | @ApiModelProperty("菜单id")
27 | @TableId(value = "menu_id", type = IdType.AUTO)
28 | private Integer menuId;
29 |
30 | @ApiModelProperty("菜单路径")
31 | private String menuPath;
32 |
33 | @ApiModelProperty("菜单名字")
34 | private String menuName;
35 |
36 | @ApiModelProperty("菜单图标")
37 | private String menuIcon;
38 |
39 | @ApiModelProperty("根菜单id")
40 | private Integer rootId;
41 | }
42 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Message.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import java.io.Serializable;
7 | import java.time.LocalDateTime;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Getter;
11 | import lombok.Setter;
12 |
13 | /**
14 | *
15 | *
16 | *
17 | *
18 | * @author qhx2004
19 | * @since 2024-03-11
20 | */
21 | @Getter
22 | @Setter
23 | @TableName("ap_message")
24 | @ApiModel(value = "Message对象", description = "")
25 | public class Message implements Serializable {
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | @ApiModelProperty("消息id")
30 | @TableId(value = "message_id", type = IdType.AUTO)
31 | private Integer messageId;
32 |
33 | @ApiModelProperty("消息发送者id")
34 | private Long senderId;
35 |
36 | @ApiModelProperty("消息接受者(一般农户id)")
37 | private Long receiverId;
38 |
39 | @ApiModelProperty("消息内容")
40 | private String content;
41 |
42 | @ApiModelProperty("发送这条消息的时间")
43 | private LocalDateTime senderTime;
44 |
45 | @ApiModelProperty("消息接受时间")
46 | private LocalDateTime receiverTime;
47 |
48 | @ApiModelProperty("状态(0正常 1停用)")
49 | private String status;
50 |
51 | @ApiModelProperty("删除标志(0代表存在 1代表删除)")
52 | private String delFlag;
53 | }
54 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Order.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import com.qhx.common.annotation.NotEmpty;
7 | import com.qhx.common.domain.BaseEntity;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Getter;
11 | import lombok.Setter;
12 |
13 | import java.io.Serializable;
14 | import java.math.BigDecimal;
15 |
16 | /**
17 | *
18 | * @author qhx2004
19 | * @since 2024-03-19
20 | */
21 | @Getter
22 | @Setter
23 | @TableName("ap_order")
24 | @ApiModel(value = "Order对象", description = "")
25 | public class Order extends BaseEntity implements Serializable {
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | @ApiModelProperty("订单id")
30 | @NotEmpty(extra = "订单编号")
31 | @TableId(value = "order_id", type = IdType.AUTO)
32 | private Long orderId;
33 |
34 | @ApiModelProperty("购买者用户id")
35 | @NotEmpty(extra = "购买者用户编号")
36 | private Long buyerId;
37 |
38 | @ApiModelProperty("商家id(后台农户id)")
39 | @NotEmpty(extra = "商家编号")
40 | private Long shopId;
41 |
42 | @ApiModelProperty("农产品id")
43 | @NotEmpty(extra = "农产品编号")
44 | private Long goodsId;
45 |
46 | @ApiModelProperty("订单交易数量")
47 | @NotEmpty(extra = "订单交易数量")
48 | private Integer amount;
49 |
50 | @ApiModelProperty("订单总价")
51 | @NotEmpty(extra = "订单总价")
52 | private BigDecimal totalPrice;
53 |
54 | @ApiModelProperty("订单状态(0 待支付,1 未发货 , 2 已发货 , 3 已完成)")
55 | private String status;
56 |
57 | @ApiModelProperty("收货人姓名")
58 | @NotEmpty(extra = "收货人姓名")
59 | private String receiverName;
60 |
61 | @ApiModelProperty("收货人电话")
62 | @NotEmpty(extra = "收货人电话")
63 | private String receiverPhone;
64 |
65 | @ApiModelProperty("收货地址")
66 | @NotEmpty(extra = "收货人地址")
67 | private String receiverAddress;
68 |
69 | @ApiModelProperty("快递名称")
70 | private String expressName;
71 |
72 | @ApiModelProperty("快递单号")
73 | private String expressNum;
74 |
75 | @ApiModelProperty("发货人地址")
76 | private String senderAddress;
77 |
78 | @ApiModelProperty("发货人姓名")
79 | private String senderName;
80 |
81 | @ApiModelProperty("发货人电话")
82 | private String senderPhone;
83 |
84 | @ApiModelProperty("是否退款('0' 代表未退款,'1'代表退款)")
85 | private String refund;
86 |
87 | @ApiModelProperty("是否取消订单('0' 代表取消订单,'1'代表为取消订单)")
88 | private String cancel;
89 |
90 | @ApiModelProperty("订单序列号")
91 | private String orderNum;
92 |
93 |
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/Shop.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.Getter;
7 | import lombok.Setter;
8 |
9 | import java.io.Serializable;
10 |
11 | /**
12 | *
13 | *
14 | *
15 | *
16 | * @author qhx2004
17 | * @since 2024-03-19
18 | */
19 | @Getter
20 | @Setter
21 | @TableName("ap_shop")
22 | @ApiModel(value = "Shop对象", description = "")
23 | public class Shop implements Serializable {
24 |
25 | private static final long serialVersionUID = 1L;
26 |
27 | @ApiModelProperty("后台用户id(绑定的是后台农户)")
28 | private Long userId;
29 |
30 | @ApiModelProperty("商家名称(指店铺名称,不是用户名称)")
31 | private String shopName;
32 |
33 | @ApiModelProperty("评分人数")
34 | private Long scoreNum;
35 |
36 | @ApiModelProperty("购买人数")
37 | private Long buyNum;
38 |
39 | @ApiModelProperty("收藏人数")
40 | private Long collectNum;
41 |
42 | @ApiModelProperty("总评分")
43 | private Short totalScore;
44 |
45 | @ApiModelProperty("商家头像")
46 | private String shopAvatar;
47 |
48 |
49 | @ApiModelProperty("开通时间")
50 | private String createTime;
51 |
52 | @ApiModelProperty("修改时间")
53 | private String updateTime;
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/UserRole.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import java.io.Serializable;
5 | import io.swagger.annotations.ApiModel;
6 | import io.swagger.annotations.ApiModelProperty;
7 | import lombok.AllArgsConstructor;
8 | import lombok.Getter;
9 | import lombok.Setter;
10 |
11 | /**
12 | *
13 | *
14 | *
15 | *
16 | * @author qhx2004
17 | * @since 2024-03-01
18 | */
19 | @Getter
20 | @Setter
21 | @AllArgsConstructor
22 | @TableName("ap_user_role")
23 | @ApiModel(value = "UserRole对象", description = "")
24 | public class UserRole implements Serializable {
25 |
26 | private static final long serialVersionUID = 1L;
27 |
28 | @ApiModelProperty("后台用户id")
29 | private Long userId;
30 |
31 | @ApiModelProperty("角色id")
32 | private Integer roleId;
33 | }
34 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/web/server/Cpu.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain.web.server;
2 |
3 |
4 | import com.qhx.common.util.Arith;
5 |
6 | /**
7 | * CPU相关信息
8 | *
9 | * @author ruoyi
10 | */
11 | public class Cpu
12 | {
13 | /**
14 | * 核心数
15 | */
16 | private int cpuNum;
17 |
18 | /**
19 | * CPU总的使用率
20 | */
21 | private double total;
22 |
23 | /**
24 | * CPU系统使用率
25 | */
26 | private double sys;
27 |
28 | /**
29 | * CPU用户使用率
30 | */
31 | private double used;
32 |
33 | /**
34 | * CPU当前等待率
35 | */
36 | private double wait;
37 |
38 | /**
39 | * CPU当前空闲率
40 | */
41 | private double free;
42 |
43 | public int getCpuNum()
44 | {
45 | return cpuNum;
46 | }
47 |
48 | public void setCpuNum(int cpuNum)
49 | {
50 | this.cpuNum = cpuNum;
51 | }
52 |
53 | public double getTotal()
54 | {
55 | return Arith.round(Arith.mul(total, 100), 2);
56 | }
57 |
58 | public void setTotal(double total)
59 | {
60 | this.total = total;
61 | }
62 |
63 | public double getSys()
64 | {
65 | return Arith.round(Arith.mul(sys / total, 100), 2);
66 | }
67 |
68 | public void setSys(double sys)
69 | {
70 | this.sys = sys;
71 | }
72 |
73 | public double getUsed()
74 | {
75 | return Arith.round(Arith.mul(used / total, 100), 2);
76 | }
77 |
78 | public void setUsed(double used)
79 | {
80 | this.used = used;
81 | }
82 |
83 | public double getWait()
84 | {
85 | return Arith.round(Arith.mul(wait / total, 100), 2);
86 | }
87 |
88 | public void setWait(double wait)
89 | {
90 | this.wait = wait;
91 | }
92 |
93 | public double getFree()
94 | {
95 | return Arith.round(Arith.mul(free / total, 100), 2);
96 | }
97 |
98 | public void setFree(double free)
99 | {
100 | this.free = free;
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/web/server/Mem.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain.web.server;
2 |
3 |
4 | import com.qhx.common.util.Arith;
5 |
6 | /**
7 | * 內存相关信息
8 | *
9 | * @author ruoyi
10 | */
11 | public class Mem
12 | {
13 | /**
14 | * 内存总量
15 | */
16 | private double total;
17 |
18 | /**
19 | * 已用内存
20 | */
21 | private double used;
22 |
23 | /**
24 | * 剩余内存
25 | */
26 | private double free;
27 |
28 | public double getTotal()
29 | {
30 | return Arith.div(total, (1024 * 1024 * 1024), 2);
31 | }
32 |
33 | public void setTotal(long total)
34 | {
35 | this.total = total;
36 | }
37 |
38 | public double getUsed()
39 | {
40 | return Arith.div(used, (1024 * 1024 * 1024), 2);
41 | }
42 |
43 | public void setUsed(long used)
44 | {
45 | this.used = used;
46 | }
47 |
48 | public double getFree()
49 | {
50 | return Arith.div(free, (1024 * 1024 * 1024), 2);
51 | }
52 |
53 | public void setFree(long free)
54 | {
55 | this.free = free;
56 | }
57 |
58 | public double getUsage()
59 | {
60 | return Arith.mul(Arith.div(used, total, 4), 100);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/web/server/Sys.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain.web.server;
2 |
3 | /**
4 | * 系统相关信息
5 | *
6 | * @author ruoyi
7 | */
8 | public class Sys
9 | {
10 | /**
11 | * 服务器名称
12 | */
13 | private String computerName;
14 |
15 | /**
16 | * 服务器Ip
17 | */
18 | private String computerIp;
19 |
20 | /**
21 | * 项目路径
22 | */
23 | private String userDir;
24 |
25 | /**
26 | * 操作系统
27 | */
28 | private String osName;
29 |
30 | /**
31 | * 系统架构
32 | */
33 | private String osArch;
34 |
35 | public String getComputerName()
36 | {
37 | return computerName;
38 | }
39 |
40 | public void setComputerName(String computerName)
41 | {
42 | this.computerName = computerName;
43 | }
44 |
45 | public String getComputerIp()
46 | {
47 | return computerIp;
48 | }
49 |
50 | public void setComputerIp(String computerIp)
51 | {
52 | this.computerIp = computerIp;
53 | }
54 |
55 | public String getUserDir()
56 | {
57 | return userDir;
58 | }
59 |
60 | public void setUserDir(String userDir)
61 | {
62 | this.userDir = userDir;
63 | }
64 |
65 | public String getOsName()
66 | {
67 | return osName;
68 | }
69 |
70 | public void setOsName(String osName)
71 | {
72 | this.osName = osName;
73 | }
74 |
75 | public String getOsArch()
76 | {
77 | return osArch;
78 | }
79 |
80 | public void setOsArch(String osArch)
81 | {
82 | this.osArch = osArch;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/domain/web/server/SysFile.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.domain.web.server;
2 |
3 | /**
4 | * 系统文件相关信息
5 | *
6 | * @author ruoyi
7 | */
8 | public class SysFile
9 | {
10 | /**
11 | * 盘符路径
12 | */
13 | private String dirName;
14 |
15 | /**
16 | * 盘符类型
17 | */
18 | private String sysTypeName;
19 |
20 | /**
21 | * 文件类型
22 | */
23 | private String typeName;
24 |
25 | /**
26 | * 总大小
27 | */
28 | private String total;
29 |
30 | /**
31 | * 剩余大小
32 | */
33 | private String free;
34 |
35 | /**
36 | * 已经使用量
37 | */
38 | private String used;
39 |
40 | /**
41 | * 资源的使用率
42 | */
43 | private double usage;
44 |
45 | public String getDirName()
46 | {
47 | return dirName;
48 | }
49 |
50 | public void setDirName(String dirName)
51 | {
52 | this.dirName = dirName;
53 | }
54 |
55 | public String getSysTypeName()
56 | {
57 | return sysTypeName;
58 | }
59 |
60 | public void setSysTypeName(String sysTypeName)
61 | {
62 | this.sysTypeName = sysTypeName;
63 | }
64 |
65 | public String getTypeName()
66 | {
67 | return typeName;
68 | }
69 |
70 | public void setTypeName(String typeName)
71 | {
72 | this.typeName = typeName;
73 | }
74 |
75 | public String getTotal()
76 | {
77 | return total;
78 | }
79 |
80 | public void setTotal(String total)
81 | {
82 | this.total = total;
83 | }
84 |
85 | public String getFree()
86 | {
87 | return free;
88 | }
89 |
90 | public void setFree(String free)
91 | {
92 | this.free = free;
93 | }
94 |
95 | public String getUsed()
96 | {
97 | return used;
98 | }
99 |
100 | public void setUsed(String used)
101 | {
102 | this.used = used;
103 | }
104 |
105 | public double getUsage()
106 | {
107 | return usage;
108 | }
109 |
110 | public void setUsage(double usage)
111 | {
112 | this.usage = usage;
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/back-me/admin/src/main/java/com/qhx/admin/mapper/BackUserMapper.java:
--------------------------------------------------------------------------------
1 | package com.qhx.admin.mapper;
2 |
3 | import com.qhx.admin.domain.BackUser;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 | import com.qhx.admin.domain.Menu;
6 | import org.apache.ibatis.annotations.Mapper;
7 | import org.apache.ibatis.annotations.Param;
8 |
9 | import java.util.HashMap;
10 | import java.util.List;
11 |
12 | /**
13 | *
14 | * 用户信息表 Mapper 接口
15 | *
16 | *
17 | * @author qhx2004
18 | * @since 2024-02-27
19 | */
20 | @Mapper
21 | public interface BackUserMapper extends BaseMapper {
22 |
23 | List