From dec79c047da4ed0e5ea61fb1d0039d7ff8013eba Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 25 Aug 2023 16:44:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=B2=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=AC=A1=E6=95=B0=E5=AD=97=E6=AE=B5=EF=BC=9B=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=89=8D=E7=AB=AF=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9B=B8=E5=85=B3=E6=93=8D=E4=BD=9C=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dao/system/SysTableHeadMapper.java | 10 ++ .../entity/inv/DeviceInspectPlanEntity.java | 5 + .../api/entity/system/SysTableHeadEntity.java | 90 +++++++++++++ .../service/system/SysTableHeadService.java | 13 ++ .../mapper/system/SysTableHeadMapper.xml | 26 ++++ src/main/resources/schemas/schema_v2.2.sql | 121 ++++++++++-------- 6 files changed, 215 insertions(+), 50 deletions(-) create mode 100644 src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java create mode 100644 src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java create mode 100644 src/main/java/com/glxp/api/service/system/SysTableHeadService.java create mode 100644 src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml diff --git a/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java b/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java new file mode 100644 index 00000000..c1209ab3 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java @@ -0,0 +1,10 @@ +package com.glxp.api.dao.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.system.SysTableHeadEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SysTableHeadMapper extends BaseMapperPlus { +} diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanEntity.java index 93fd2d4c..8301f9de 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanEntity.java @@ -131,4 +131,9 @@ public class DeviceInspectPlanEntity { */ private Integer useFrequency; + /** + * 已执行次数 + */ + private Integer executeCount; + } diff --git a/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java b/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java new file mode 100644 index 00000000..c9932366 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java @@ -0,0 +1,90 @@ +package com.glxp.api.entity.system; + +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 java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "sys_table_head") +public class SysTableHeadEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + + /** + * 前端页面 + */ + @TableField(value = "page") + private String page; + + /** + * 所属后端返回类 + */ + @TableField(value = "response") + private String response; + + /** + * 显示的标题 + */ + @TableField(value = "`label`") + private String label; + + /** + * 字段名 + */ + @TableField(value = "prop") + private String prop; + + /** + * 对应列的宽度 + */ + @TableField(value = "width") + private Double width; + + /** + * 是否显示 + */ + @TableField(value = "isShow") + private String isShow; + + /** + * 自适应宽度 + */ + @TableField(value = "isAuto") + private String isAuto; + + /** + * 当内容过长被隐藏时显示 tooltip + */ + @TableField(value = "overflow") + private Byte overflow; + + /** + * 排序顺序 + */ + @TableField(value = "sort") + private Integer sort; + + /** + * 是否启用自定义排序 + */ + @TableField(value = "customSort") + private Byte customSort; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + private static final long serialVersionUID = 1L; +} diff --git a/src/main/java/com/glxp/api/service/system/SysTableHeadService.java b/src/main/java/com/glxp/api/service/system/SysTableHeadService.java new file mode 100644 index 00000000..4ed95258 --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/SysTableHeadService.java @@ -0,0 +1,13 @@ +package com.glxp.api.service.system; + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.entity.system.SysTableHeadEntity; +import com.glxp.api.dao.system.SysTableHeadMapper; + +@Service +public class SysTableHeadService extends ServiceImpl { + +} + + diff --git a/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml b/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml new file mode 100644 index 00000000..c0b4b814 --- /dev/null +++ b/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + id, page, response, `label`, prop, width, isShow, isAuto, overflow, sort, customSort, + remark, updateTime + + diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index fd6742c0..fb8434d3 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -180,28 +180,37 @@ CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceTask', 'tinyint', 1); # INSERT ignore INTO `udi_wms_wmd`.`auth_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2001, '我的领用单', 1685, 1, 'inout/receive/receiveMySearch', 'inout/receive/receiveMySearch', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-08-14 10:35:30', NULL, NULL, NULL); # -INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`, `paramExplain`, `updateTime`) VALUES (20068, 0, '设备领用是否选取耗材字段', 'device_product', '0', 1, 0, '0:否;1:是', NULL); -INSERT ignore INTO `sys_pdf_template_relevance_label` (`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`, `updateTime`) VALUES (5, 3, 110, 0, 9, '设备打印', NULL, NULL, NULL, NULL, 'lable', '2023-06-25 15:18:37'); - - - -CREATE TABLE IF NOT EXISTS `device_asset_cert` ( - `id` bigint NOT NULL, - `devCodeFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备资产编码外键', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证书名称', - `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证书编码', - `filePath` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '文件路径', - `vailDate` datetime(0) NULL DEFAULT NULL COMMENT '生效期', - `expireDate` datetime(0) NULL DEFAULT NULL COMMENT '失效期', - `status` tinyint NULL DEFAULT NULL COMMENT '证书状态', - `type` tinyint NULL DEFAULT NULL COMMENT '证书类型(1:资质证书;2:技术材料)', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注说明', - `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', - `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `updateUser` datetime(0) NULL DEFAULT NULL COMMENT '更新人', - `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; +INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, + `paramType`, `paramExplain`, `updateTime`) +VALUES (20068, 0, '设备领用是否选取耗材字段', 'device_product', '0', 1, 0, '0:否;1:是', NULL); +INSERT ignore INTO `sys_pdf_template_relevance_label` (`id`, `templateId`, `customerId`, `adminId`, `moduleId`, + `localAction`, `remark1`, `remark2`, `remark3`, `printType`, + `modelKey`, `updateTime`) +VALUES (5, 3, 110, 0, 9, '设备打印', NULL, NULL, NULL, NULL, 'lable', '2023-06-25 15:18:37'); + + + +CREATE TABLE IF NOT EXISTS `device_asset_cert` +( + `id` bigint NOT NULL, + `devCodeFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备资产编码外键', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证书名称', + `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '证书编码', + `filePath` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '文件路径', + `vailDate` datetime(0) NULL DEFAULT NULL COMMENT '生效期', + `expireDate` datetime(0) NULL DEFAULT NULL COMMENT '失效期', + `status` tinyint NULL DEFAULT NULL COMMENT '证书状态', + `type` tinyint NULL DEFAULT NULL COMMENT '证书类型(1:资质证书;2:技术材料)', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注说明', + `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', + `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `updateUser` datetime(0) NULL DEFAULT NULL COMMENT '更新人', + `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_0900_ai_ci + ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of device_asset_cert @@ -210,36 +219,48 @@ CREATE TABLE IF NOT EXISTS `device_asset_cert` ( SET FOREIGN_KEY_CHECKS = 1; -CREATE TABLE IF NOT EXISTS `device_asset_user` ( - `id` bigint NOT NULL COMMENT '雪花ID', - `devCodeFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备资产编码', - `userName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '相关人员名称', - `contact1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系方式1', - `contact2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系方式2', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注说明', - `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', - `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `updateUser` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人', - `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; - - -CREATE TABLE IF NOT EXISTS `device_asset_usage` ( - `id` bigint NOT NULL COMMENT '雪花ID', - `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用记录号', - `user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用人', - `startTime` datetime(0) NULL DEFAULT NULL COMMENT '开始时间', - `endTime` datetime(0) NULL DEFAULT NULL COMMENT '结束时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', - `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', - `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人', - `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; +CREATE TABLE IF NOT EXISTS `device_asset_user` +( + `id` bigint NOT NULL COMMENT '雪花ID', + `devCodeFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备资产编码', + `userName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '相关人员名称', + `contact1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系方式1', + `contact2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系方式2', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注说明', + `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', + `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `updateUser` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人', + `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_0900_ai_ci + ROW_FORMAT = Dynamic; + + +CREATE TABLE IF NOT EXISTS `device_asset_usage` +( + `id` bigint NOT NULL COMMENT '雪花ID', + `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用记录号', + `user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用人', + `startTime` datetime(0) NULL DEFAULT NULL COMMENT '开始时间', + `endTime` datetime(0) NULL DEFAULT NULL COMMENT '结束时间', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人', + `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人', + `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_0900_ai_ci + ROW_FORMAT = Dynamic; CALL Pro_Temp_ColumnWork('dept_device_detail', 'curUser', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('dept_device_detail', 'location', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('dept_device_detail', 'detailLocation', 'varchar(255)', 1); + +CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1); +CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1); + From 70483edee8594f4a04ec67117ddf9bd0042f504b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 25 Aug 2023 17:32:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/constant/DeviceStatus.java | 18 +++++++++- .../inv/DeptDeviceDetailController.java | 34 ++++++++++++++++++- .../entity/inv/DeptDeviceDetailEntity.java | 3 ++ .../api/req/inv/FilterDeptDeviceRequest.java | 22 ++++++++++++ .../api/res/inv/DeptDeviceDetailResponse.java | 2 ++ .../inv/impl/DeptDeviceDetailServiceImpl.java | 4 ++- .../mapper/inv/DeptDeviceDetailDao.xml | 22 ++++++++++++ src/main/resources/schemas/schema_v2.2.sql | 1 + 8 files changed, 103 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/constant/DeviceStatus.java b/src/main/java/com/glxp/api/constant/DeviceStatus.java index 18f09ca4..46cac657 100644 --- a/src/main/java/com/glxp/api/constant/DeviceStatus.java +++ b/src/main/java/com/glxp/api/constant/DeviceStatus.java @@ -1,8 +1,9 @@ package com.glxp.api.constant; -//设备任务状态 + public class DeviceStatus { + //设备任务状态 public static final int DEVICE_STATUS_TEMP_SAVE = 0; //草稿 public static final int DEVICE_STATUS_TEMP_UNDISTRIBUTTED = 1; //未分配 @@ -14,5 +15,20 @@ public class DeviceStatus { public static final int DEVICE_STATUS_TEMP_INSPECTED = 4; //已巡检 + //设备状态 + public static final int DEVICE_STATUS_NORMAL = 1; //正常 + + public static final int DEVICE_STATUS_REPAIRS = 2; //报修 + + public static final int DEVICE_STATUS_INSPECTION = 3; //巡检中 + + public static final int DEVICE_STATUS_MAINTAIN = 4; //维修中 + + public static final int DEVICE_STATUS_SCRAP = 5; //报废 + + public static final int DEVICE_STATUS_USE = 6; //使用中 + + public static final int DEVICE_STATUS_LEISURE = 7; //空闲 + } diff --git a/src/main/java/com/glxp/api/controller/inv/DeptDeviceDetailController.java b/src/main/java/com/glxp/api/controller/inv/DeptDeviceDetailController.java index 1bbc14d4..0e7d67b1 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeptDeviceDetailController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeptDeviceDetailController.java @@ -1,15 +1,19 @@ package com.glxp.api.controller.inv; import com.github.pagehelper.PageInfo; +import com.github.xiaoymin.knife4j.core.util.StrUtil; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.basic.UdiEntity; import com.glxp.api.entity.inv.DeptDeviceDetailEntity; import com.glxp.api.req.inv.AddDeptDeviceRequest; import com.glxp.api.req.inv.FilterDeptDeviceRequest; import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.res.inv.DeptDeviceDetailResponse; import com.glxp.api.service.inv.DeptDeviceDetailService; +import com.glxp.api.util.CustomUtil; +import com.glxp.api.util.udi.FilterUdiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -37,7 +42,34 @@ public class DeptDeviceDetailController { */ @GetMapping("/udiwms/inv/deptDevice/filter") public BaseResponse filterList(FilterDeptDeviceRequest filterDeptDeviceRequest) { - List list = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + + + List list = new ArrayList<>(); + if (StrUtil.isNotBlank(filterDeptDeviceRequest.getUdiCode())) { + filterDeptDeviceRequest =new FilterDeptDeviceRequest(); + //用唯一编码查询 + filterDeptDeviceRequest.setCode(filterDeptDeviceRequest.getUdiCode()); + list = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + if (CustomUtil.isEmpty(list)) { + //用设备udi码查询 + filterDeptDeviceRequest.setCode(null); + filterDeptDeviceRequest.setOriginCode(filterDeptDeviceRequest.getUdiCode()); + list = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + if (CustomUtil.isEmpty(list)) { + //用DI/物资编码查询 + filterDeptDeviceRequest.setOriginCode(null); + UdiEntity udiEntity = FilterUdiUtils.getUdi(filterDeptDeviceRequest.getUdiCode()); + filterDeptDeviceRequest.setNameCode(udiEntity.getUdi()); + filterDeptDeviceRequest.setBatchNo(udiEntity.getBatchNo()); + filterDeptDeviceRequest.setProductionDate(udiEntity.getProduceDate()); + filterDeptDeviceRequest.setExpireDate(udiEntity.getExpireDate()); + filterDeptDeviceRequest.setSerialNo(udiEntity.getSerialNo()); + list = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + } + } + } else { + list = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + } PageInfo pageInfo = new PageInfo<>(list); return ResultVOUtils.page(pageInfo); } diff --git a/src/main/java/com/glxp/api/entity/inv/DeptDeviceDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/DeptDeviceDetailEntity.java index 98049293..73ed84b9 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeptDeviceDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeptDeviceDetailEntity.java @@ -184,4 +184,7 @@ public class DeptDeviceDetailEntity { @TableField(value = "detailLocation") private String detailLocation; + @TableField(value = "nameCode") + private String nameCode; + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java index 870e214b..59fe3536 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java @@ -1,5 +1,6 @@ package com.glxp.api.req.inv; +import com.baomidou.mybatisplus.annotation.TableField; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; @@ -56,4 +57,25 @@ public class FilterDeptDeviceRequest extends ListPageRequest { private Integer id; + private String udiCode; + + private String nameCode; + + private String manufactory; + + private String zczbhhzbapzbh; + + private String supName; + + private String productionDate; + + private String expireDate; + + private String serialNo; + + private String manager; + + + + } diff --git a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java index f9a1e354..73af99a2 100644 --- a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java @@ -153,4 +153,6 @@ public class DeptDeviceDetailResponse { private String invName; private String orderIdFk; + + private String nameCode; } diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java index 1af7c99b..f249373c 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java @@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.DeviceStatus; import com.glxp.api.dao.inv.DeptDeviceDetailDao; import com.glxp.api.dao.inv.DeviceReceiveOrderDao; import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao; @@ -70,6 +71,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService { deviceDetail.setRelId(receiveOrderDetailResponse.getRelId()); deviceDetail.setDeviceName(receiveOrderDetailResponse.getProductName()); deviceDetail.setGgxh(receiveOrderDetailResponse.getGgxh()); + deviceDetail.setNameCode(receiveOrderDetailResponse.getNameCode()); deviceDetail.setBatchNo(receiveOrderDetailResponse.getBatchNo()); deviceDetail.setSerialNo(receiveOrderDetailResponse.getSerialNo()); deviceDetail.setProductionDate(receiveOrderDetailResponse.getProductionDate()); @@ -80,7 +82,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService { deviceDetail.setSupId(receiveOrderDetailResponse.getSupId()); deviceDetail.setSupName(receiveOrderDetailResponse.getSupName()); deviceDetail.setManager(receiveOrderEntity.getReceiveUser()); - deviceDetail.setStatus(1); + deviceDetail.setStatus(DeviceStatus.DEVICE_STATUS_NORMAL); deviceDetail.setAddType(1); deviceDetail.setCreateUser(receiveOrderEntity.getAuditUser()); // deviceDetail.setCreateTime(date); diff --git a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml index 12ad5925..9b88b3ee 100644 --- a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml @@ -16,6 +16,7 @@ t.deviceName, t.ggxh, t.batchNo, + t.nameCode, t.serialNo, t.productionDate, t.expireDate, @@ -58,6 +59,27 @@ AND t.batchNo like concat('%', #{batchNo}, '%') + + AND t.manager like concat('%', #{manager}, '%') + + + AND t.nameCode like concat('%', #{nameCode}, '%') + + + AND t.manufactory like concat('%', #{manufactory}, '%') + + + AND t.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') + + + AND t.serialNo = #{serialNo} + + + AND t.productionDate = #{productionDate} + + + AND t.expireDate = #{expireDate} + AND t.status = #{status} diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index fb8434d3..717ffe2c 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -260,6 +260,7 @@ CREATE TABLE IF NOT EXISTS `device_asset_usage` CALL Pro_Temp_ColumnWork('dept_device_detail', 'curUser', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('dept_device_detail', 'location', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('dept_device_detail', 'detailLocation', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('dept_device_detail', 'nameCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1); From c62383ff51f0c0813f1c386db2c7118c3519b947 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 28 Aug 2023 09:10:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E5=8F=82=E6=95=B0=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysTableHeadController.java | 95 +++++++++++++++++++ .../api/dao/system/SysTableHeadMapper.java | 5 + .../api/entity/system/SysTableHeadEntity.java | 18 +++- .../api/req/system/SysTableHeadRequest.java | 76 +++++++++++++++ .../service/system/SysTableHeadService.java | 24 +++++ src/main/resources/application-dev.yml | 2 +- .../mapper/system/SysTableHeadMapper.xml | 72 +++++++++----- 7 files changed, 264 insertions(+), 28 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/system/SysTableHeadController.java create mode 100644 src/main/java/com/glxp/api/req/system/SysTableHeadRequest.java diff --git a/src/main/java/com/glxp/api/controller/system/SysTableHeadController.java b/src/main/java/com/glxp/api/controller/system/SysTableHeadController.java new file mode 100644 index 00000000..caa793d3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/system/SysTableHeadController.java @@ -0,0 +1,95 @@ +package com.glxp.api.controller.system; + + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.system.SysTableHeadEntity; +import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.req.system.SysTableHeadRequest; +import com.glxp.api.service.system.SysTableHeadService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 设备表头字段 + */ +@Slf4j +@RestController +public class SysTableHeadController extends BaseController { + + @Resource + SysTableHeadService sysTableHeadService; + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/sys/table/head/filter") + public BaseResponse filterPreInorder(SysTableHeadRequest sysTableHeadRequest) { + List list = sysTableHeadService.filterList(sysTableHeadRequest); + PageInfo pageInfo = new PageInfo(list); + return ResultVOUtils.page(pageInfo); + } + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/sys/table/head/find") + public BaseResponse findByPage(SysTableHeadRequest sysTableHeadRequest) { + if (StrUtil.isEmpty(sysTableHeadRequest.getPageCode())) { + return ResultVOUtils.error(500, "页面标识不能为空!"); + } + List list = sysTableHeadService.list(new QueryWrapper().eq("pageCode", sysTableHeadRequest.getPageCode())); + return ResultVOUtils.success(list); + } + + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/sys/table/head/save") + public BaseResponse save(@RequestBody SysTableHeadEntity sysTableHeadEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + boolean b = sysTableHeadService.save(sysTableHeadEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success("添加成功!"); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/sys/table/head/update") + public BaseResponse update(@RequestBody SysTableHeadEntity sysTableHeadEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + boolean b = sysTableHeadService.updateById(sysTableHeadEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success("修改成功!"); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/sys/table/head/delete") + public BaseResponse deleteById(@RequestBody DeleteRequest deleteRequest) { + boolean b = sysTableHeadService.removeById(deleteRequest.getId()); + if (b) + return ResultVOUtils.success("删除成功"); + else { + return ResultVOUtils.error(500, "删除失败"); + } + } +} diff --git a/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java b/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java index c1209ab3..145d9b46 100644 --- a/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java +++ b/src/main/java/com/glxp/api/dao/system/SysTableHeadMapper.java @@ -3,8 +3,13 @@ package com.glxp.api.dao.system; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.system.SysTableHeadEntity; +import com.glxp.api.req.system.SysTableHeadRequest; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface SysTableHeadMapper extends BaseMapperPlus { + + List filterList(SysTableHeadRequest sysTableHeadRequest); } diff --git a/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java b/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java index c9932366..7b0190b8 100644 --- a/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java +++ b/src/main/java/com/glxp/api/entity/system/SysTableHeadEntity.java @@ -4,8 +4,10 @@ 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 java.io.Serializable; import java.util.Date; + import lombok.Data; @Data @@ -15,10 +17,16 @@ public class SysTableHeadEntity implements Serializable { private Integer id; /** - * 前端页面 + * 前端页面名称 + */ + @TableField(value = "pageName") + private String pageName; + + /** + * 前端页面标识 */ - @TableField(value = "page") - private String page; + @TableField(value = "pageCode") + private String pageCode; /** * 所属后端返回类 @@ -60,7 +68,7 @@ public class SysTableHeadEntity implements Serializable { * 当内容过长被隐藏时显示 tooltip */ @TableField(value = "overflow") - private Byte overflow; + private Boolean overflow; /** * 排序顺序 @@ -72,7 +80,7 @@ public class SysTableHeadEntity implements Serializable { * 是否启用自定义排序 */ @TableField(value = "customSort") - private Byte customSort; + private Boolean customSort; /** * 备注 diff --git a/src/main/java/com/glxp/api/req/system/SysTableHeadRequest.java b/src/main/java/com/glxp/api/req/system/SysTableHeadRequest.java new file mode 100644 index 00000000..db9ad0b8 --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SysTableHeadRequest.java @@ -0,0 +1,76 @@ +package com.glxp.api.req.system; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.util.Date; + +@Data +public class SysTableHeadRequest extends ListPageRequest { + + private Integer id; + + /** + * 前端页面名称 + */ + private String pageName; + + /** + * 前端页面标识 + */ + private String pageCode; + + /** + * 所属后端返回类 + */ + private String response; + + /** + * 显示的标题 + */ + private String label; + + /** + * 字段名 + */ + private String prop; + + /** + * 对应列的宽度 + */ + private Double width; + + /** + * 是否显示 + */ + private String isShow; + + /** + * 自适应宽度 + */ + private String isAuto; + + /** + * 当内容过长被隐藏时显示 tooltip + */ + private Boolean overflow; + + + /** + * 是否启用自定义排序 + */ + private Boolean customSort; + + /** + * 备注 + */ + private String remark; + + /** + * 更新时间 + */ + private Date updateTime; +} diff --git a/src/main/java/com/glxp/api/service/system/SysTableHeadService.java b/src/main/java/com/glxp/api/service/system/SysTableHeadService.java index 4ed95258..b85f2854 100644 --- a/src/main/java/com/glxp/api/service/system/SysTableHeadService.java +++ b/src/main/java/com/glxp/api/service/system/SysTableHeadService.java @@ -1,13 +1,37 @@ package com.glxp.api.service.system; +import cn.hutool.core.util.StrUtil; +import com.github.pagehelper.PageHelper; +import com.glxp.api.req.system.SysTableHeadRequest; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.api.entity.system.SysTableHeadEntity; import com.glxp.api.dao.system.SysTableHeadMapper; +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + @Service public class SysTableHeadService extends ServiceImpl { + @Resource + SysTableHeadMapper sysTableHeadMapper; + + public List filterList(SysTableHeadRequest sysTableHeadRequest) { + if (sysTableHeadRequest == null) { + return Collections.emptyList(); + } + if (sysTableHeadRequest.getPage() != null) { + int offset = (sysTableHeadRequest.getPage() - 1) * sysTableHeadRequest.getLimit(); + PageHelper.offsetPage(offset, sysTableHeadRequest.getLimit()); + } + + return sysTableHeadMapper.filterList(sysTableHeadRequest); + + } + } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 873706a3..b2df4abe 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,7 +4,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_wmd?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml b/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml index c0b4b814..25af366d 100644 --- a/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml +++ b/src/main/resources/mybatis/mapper/system/SysTableHeadMapper.xml @@ -1,26 +1,54 @@ - - - - - - - - - - - - - - - - - - - - id, page, response, `label`, prop, width, isShow, isAuto, overflow, sort, customSort, - remark, updateTime - + + + + + + + + + + + + + + + + + + + + + id,pageName, pageCode, response, `label`, prop, width, isShow, isAuto, overflow, sort, customSort, + remark, updateTime + + + +