From f0bfc4aa35b91825b85ea234b445131a7e170b9c Mon Sep 17 00:00:00 2001 From: daiyongfei <974332738@qq.com> Date: Thu, 10 Jul 2025 09:39:57 +0800 Subject: [PATCH] =?UTF-8?q?app=EF=BC=9A=E6=9F=A5=E7=9C=8BAPP=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/APPDeviceController.java | 23 +++- .../mapper/app/equipment/APPDeviceMapper.xml | 12 +- .../controller/DeviceAPPController.java | 24 ++-- .../equipment/domain/APPDevice1.java | 106 ++++++++++++++++++ .../domain/query/APPDeviceQueryCriteria1.java | 65 +++++++++++ 5 files changed, 213 insertions(+), 17 deletions(-) create mode 100644 fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/APPDevice1.java create mode 100644 fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/query/APPDeviceQueryCriteria1.java diff --git a/fys-modules/fys-app/src/main/java/com/fuyuanshen/app/controller/equipment/APPDeviceController.java b/fys-modules/fys-app/src/main/java/com/fuyuanshen/app/controller/equipment/APPDeviceController.java index e19290f..d14485e 100644 --- a/fys-modules/fys-app/src/main/java/com/fuyuanshen/app/controller/equipment/APPDeviceController.java +++ b/fys-modules/fys-app/src/main/java/com/fuyuanshen/app/controller/equipment/APPDeviceController.java @@ -6,8 +6,16 @@ import com.fuyuanshen.app.domain.APPDeviceType; import com.fuyuanshen.app.domain.dto.APPUnbindDTO; import com.fuyuanshen.app.domain.query.APPDeviceQueryCriteria; import com.fuyuanshen.app.service.equipment.APPDeviceService; +import com.fuyuanshen.common.core.domain.R; import com.fuyuanshen.common.core.domain.ResponseVO; +import com.fuyuanshen.common.core.validate.EditGroup; +import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit; +import com.fuyuanshen.common.log.annotation.Log; +import com.fuyuanshen.common.log.enums.BusinessType; import com.fuyuanshen.common.mybatis.core.page.TableDataInfo; +import com.fuyuanshen.common.web.core.BaseController; +import com.fuyuanshen.equipment.domain.bo.UserAppBo; +import com.fuyuanshen.equipment.service.AppUserService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -27,9 +35,10 @@ import java.util.List; @RestController @RequiredArgsConstructor @RequestMapping("/api/app/device") -public class APPDeviceController { +public class APPDeviceController extends BaseController { private final APPDeviceService appDeviceService; + private final AppUserService appUserService; @PostMapping(value = "/list") @@ -76,4 +85,16 @@ public class APPDeviceController { + /** + * 修改APP用户信息 + */ + // @SaCheckPermission("app:user:edit") + @Log(title = "APP用户信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody UserAppBo bo) { + return toAjax(appUserService.updateByBo(bo)); + } + + } diff --git a/fys-modules/fys-app/src/main/resources/mapper/app/equipment/APPDeviceMapper.xml b/fys-modules/fys-app/src/main/resources/mapper/app/equipment/APPDeviceMapper.xml index d481a1e..a5dd3de 100644 --- a/fys-modules/fys-app/src/main/resources/mapper/app/equipment/APPDeviceMapper.xml +++ b/fys-modules/fys-app/src/main/resources/mapper/app/equipment/APPDeviceMapper.xml @@ -79,17 +79,19 @@ and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]} - - AND tenant_id = #{criteria.tenantId} - and d.customer_id = #{criteria.customerId} order by d.create_time desc diff --git a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/controller/DeviceAPPController.java b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/controller/DeviceAPPController.java index 1e892dd..d28d7f2 100644 --- a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/controller/DeviceAPPController.java +++ b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/controller/DeviceAPPController.java @@ -30,19 +30,21 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/api/app/device") public class DeviceAPPController extends BaseController { - private final AppUserService appUserService; - /** - * 修改APP用户信息 - */ - // @SaCheckPermission("app:user:edit") - @Log(title = "APP用户信息", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody UserAppBo bo) { - return toAjax(appUserService.updateByBo(bo)); - } + + + // + // + // @GetMapping + // @Operation(summary = "WEB端查看APP客户设备绑定") + // public TableDataInfo queryAPPDevice(APPDeviceQueryCriteria criteria) { + // Page page = new Page<>(criteria.getPage(), criteria.getSize()); + // TableDataInfo devices = null; + // devices = appDeviceService.queryAll(page, criteria); + // return devices; + // } + } diff --git a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/APPDevice1.java b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/APPDevice1.java new file mode 100644 index 0000000..15b9245 --- /dev/null +++ b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/APPDevice1.java @@ -0,0 +1,106 @@ +package com.fuyuanshen.equipment.domain; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fuyuanshen.common.tenant.core.TenantEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @Description: 设备表 + * @Author: WY + * @Date: 2025/5/16 + **/ +@Data +@TableName("app_device") +public class APPDevice1 extends TenantEntity { + + @TableId(value = "app_device_id", type = IdType.AUTO) + @Schema(name = "ID") + private Long id; + + @Schema(name = "设备类型") + private Long deviceType; + + @Schema(name = "设备类型名称") + private String deviceTypeName; + + @Schema(name = "客户号") + private Long customerId; + + @Schema(name = "所属客户") + private String customerName; + + /*@Schema(name = "设备编号") + private String deviceNo;*/ + + @Schema(name = "设备名称") + private String deviceName; + + @Schema(name = "设备图片") + private String devicePic; + + @Schema(name = "设备MAC") + private String deviceMac; + + @Schema(name = "设备IMEI") + private String deviceImei; + + @Schema(name = "设备SN") + private String deviceSn; + + @Schema(name = "经度") + private String longitude; + + @Schema(name = "纬度") + private String latitude; + + @Schema(name = "备注") + private String remark; + + @TableField(exist = false) + @Schema(name = "设备类型名称") + private String typeName; + + /** + * 租户ID + */ + @TableField(value = "tenant_id") + @Schema(hidden = true) + private String tenantId; + + /** + * 设备状态 + * 0 失效 + * 1 正常 + */ + @Schema(name = "设备状态") + private Integer deviceStatus; + + /** + * 绑定状态 + * 0 未绑定 + * 1 已绑定 + */ + @Schema(name = "绑定状态") + private Integer bindingStatus; + + /** + * 绑定类型 + * 0 APP + * 1 小程序 + */ + @Schema(name = "绑定类型") + private Integer bindingType; + + + public void copy(APPDevice1 source) { + BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); + } + + +} diff --git a/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/query/APPDeviceQueryCriteria1.java b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/query/APPDeviceQueryCriteria1.java new file mode 100644 index 0000000..a95085b --- /dev/null +++ b/fys-modules/fys-equipment/src/main/java/com/fuyuanshen/equipment/domain/query/APPDeviceQueryCriteria1.java @@ -0,0 +1,65 @@ +package com.fuyuanshen.equipment.domain.query; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; +import java.util.Set; + +/** + * @Description: + * @Author: WY + * @Date: 2025/5/16 + **/ +@Data +public class APPDeviceQueryCriteria1 { + + @Schema(name = "设备名称") + private String deviceName; + + @Schema(name = "设备类型") + private Long deviceType; + + @Schema(name = "设备MAC") + private String deviceMac; + + @Schema(name = "设备IMEI") + private String deviceImei; + + @Schema(name = "设备SN") + private String deviceSn; + + /** + * 设备状态 + * 0 失效 + * 1 正常 + */ + @Schema(name = "设备状态 0 失效 1 正常 ") + private Integer deviceStatus; + + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'") + @Schema(name = "创建时间") + private List createTime; + + @Schema(name = "页码", example = "1") + private Integer page = 1; + + @Schema(name = "每页数据量", example = "10") + private Integer size = 10; + + @Schema(name = "客户id") + private Long customerId; + private Set customerIds; + + @Schema(name = "当前所有者") + private Long currentOwnerId; + + @Schema(name = "租户ID") + private Long tenantId; + + @Schema(name = "通讯方式", example = "0:4G;1:蓝牙") + private Integer communicationMode; + +}