From 54f9289737e1a65e8c005ad602ae014b034da93f Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 10 May 2024 19:02:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?5-10=20=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=20=E6=9B=B4=E6=94=B9=20=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/common/util/ResultVOUtils.java | 39 ++ .../constant/BasicExportStatusTimeEnum.java | 14 + .../api/constant/BasicExportTypeEnum.java | 10 + .../com/glxp/api/constant/SocketMsgType.java | 2 + .../com/glxp/api/constant/SyncDelType.java | 2 + .../sync/SpsSyncDownloadController.java | 105 +++- .../api/controller/sync/SpsSyncWebSocket.java | 3 +- .../controller/sync/SyncDelController.java | 17 + .../glxp/api/dao/basic/BasicProductsDao.java | 3 + .../api/entity/basic/UdiProductEntity.java | 1 + .../api/entity/sync/SyncDataSetEntity.java | 5 + .../com/glxp/api/exception/JsonException.java | 5 + .../com/glxp/api/http/ErpBasicClient.java | 30 +- .../glxp/api/req/basic/BasicDataRequest.java | 4 +- .../res/sync/SpsSyncDeviceTaskResponse.java | 13 +- .../api/res/system/SyncDataSetResponse.java | 9 + .../service/sync/SpsSyncDownloadService.java | 354 ++++++++++++- src/main/resources/application-dev.yml | 4 +- src/main/resources/schemas/schema_v2.4.sql | 468 ++++++++++++++++++ 19 files changed, 1072 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/schemas/schema_v2.4.sql diff --git a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java index 106c5da6..16fb1682 100644 --- a/src/main/java/com/glxp/api/common/util/ResultVOUtils.java +++ b/src/main/java/com/glxp/api/common/util/ResultVOUtils.java @@ -37,6 +37,34 @@ public class ResultVOUtils { return success(data); } + /** + * 成功时返回 + * + * @param data 返回的data对象 + * @return {@link BaseResponse} + */ + public static BaseResponse success(String msg, Object data) { + BaseResponse baseResponse = new BaseResponse<>(); + baseResponse.setCode(ResultEnum.SUCCESS.getCode()); + baseResponse.setMessage(msg); + baseResponse.setData(data); + return baseResponse; + } + + /** + * 成功时返回 + * + * @return {@link BaseResponse} + */ + public static BaseResponse successMsg(String message) { + BaseResponse baseResponse = new BaseResponse<>(); + baseResponse.setCode(ResultEnum.SUCCESS.getCode()); + baseResponse.setMessage(message); + Map data = new HashMap(); + baseResponse.setData(data); + return baseResponse; + } + /** * 错误时返回 * @@ -74,6 +102,17 @@ public class ResultVOUtils { return error(resultEnum.getCode(), message); } + /** + * 错误时返回 + * + * @param message 错误的信息 + * @return {@link BaseResponse} + */ + public static BaseResponse error(String message) { + return error(ResultEnum.NOT_NETWORK.getCode(), message); + } + + /** * 根据PageHelper分页对象,直接返回分页结果 * diff --git a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java index 794d0d00..4fcfe99f 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java @@ -127,6 +127,20 @@ public enum BasicExportStatusTimeEnum { * 设备任务同步 */ DEVICE_TASK("device_task", "设备任务"), + + /** + * 设备任务主表 + */ + DEVICE_INFO_DATA("device_info", "设备信息数据"), + DEV_CHECK_DATA("device_check","巡检管理数据"), + DEV_CHECK_DETAIL("device_check_detail","巡检设备具体数据"), + + DEV_CHECK_DETAIL_ITEM("device_check_detail_item","巡检设备项目"), + //getDeviceRepairApply + DEV_REPAIR_APPLY("device_repair_apply","报修单数据"), + DEV_REPAIR_APPLY_DETAIL("device_repair_apply_detail","报修单明细数据"), + DEV_REPAIR("device_repair","设备维修单数据"), + PRODUCE_BUSINESS_DATA("thr_manufacturer", "生产企业数据"), ; @EnumValue private String key; diff --git a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java index 7f1a5195..1e82b46e 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java @@ -62,6 +62,16 @@ public enum BasicExportTypeEnum { * 设备任务同步 */ DEVICE_TASK("device_task", "设备任务"), + + DEVICE_INFO_DATA("device_info", "设备信息数据"), + + DEVICE_CHECK_DATA("device_check", "巡检管理数据"), + + DEVICE_REPAIR_DATA("device_repair_apply", "报修管理数据"), + + + PRODUCE_BUSINESS_DATA("thr_manufacturer", "生产企业数据"), + ; @EnumValue private String key; diff --git a/src/main/java/com/glxp/api/constant/SocketMsgType.java b/src/main/java/com/glxp/api/constant/SocketMsgType.java index 09f45dde..df133910 100644 --- a/src/main/java/com/glxp/api/constant/SocketMsgType.java +++ b/src/main/java/com/glxp/api/constant/SocketMsgType.java @@ -21,4 +21,6 @@ public interface SocketMsgType { String BASIC_BUSINESS_TYPE_DELETE = "BASIC_BUSINESS_TYPE_DELETE"; //单据类型 + + } diff --git a/src/main/java/com/glxp/api/constant/SyncDelType.java b/src/main/java/com/glxp/api/constant/SyncDelType.java index 1f927afa..80a20fc4 100644 --- a/src/main/java/com/glxp/api/constant/SyncDelType.java +++ b/src/main/java/com/glxp/api/constant/SyncDelType.java @@ -18,4 +18,6 @@ public interface SyncDelType { */ String DEV_TASK = "DEV_TASK"; + String DEVICE_INFO_DATA = "DEVICE_INFO_DATA"; + } diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index eac3d669..90d0e4ed 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -17,15 +17,16 @@ import com.glxp.api.constant.*; import com.glxp.api.constant.Constant; import com.glxp.api.dao.auth.*; import com.glxp.api.dao.basic.*; +import com.glxp.api.dao.dev.*; import com.glxp.api.dao.inout.*; -import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper; -import com.glxp.api.dao.inv.DeviceInspectTaskMapper; +import com.glxp.api.dao.inv.*; import com.glxp.api.dao.purchase.*; import com.glxp.api.dao.schedule.SystemParamConfigDao; import com.glxp.api.dao.system.*; import com.glxp.api.dao.thrsys.*; import com.glxp.api.entity.auth.*; import com.glxp.api.entity.basic.*; +import com.glxp.api.entity.dev.*; import com.glxp.api.entity.inout.*; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.entity.purchase.*; @@ -42,8 +43,6 @@ import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.IoAddInoutService; import com.glxp.api.service.inout.IoCheckInoutService; import com.glxp.api.service.inout.IoOrderService; -import com.glxp.api.service.inv.DeviceInspectTaskDetailService; -import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.service.purchase.PurOrderDetailService; import com.glxp.api.service.purchase.PurOrderService; import com.glxp.api.service.sync.BasicDownloadService; @@ -59,6 +58,7 @@ import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.TransactionIsolationLevel; +import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; @@ -72,8 +72,13 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -379,6 +384,18 @@ public class SpsSyncDownloadController { case DEVICE_TASK: saveUploadDevTask(JSONUtil.toBean(obj, SpsSyncDeviceTaskResponse.class)); break; + case DEVICE_INFO_DATA: + saveUploadDevTaskInfo(JSONUtil.toBean(obj, SpsSyncDeviceTaskResponse.class)); + break; + case DEVICE_CHECK_DATA: + saveUploadDevTaskInfo(JSONUtil.toBean(obj, SpsSyncDeviceTaskResponse.class)); + break; + case DEVICE_REPAIR_DATA: + saveUploadDevTaskInfo(JSONUtil.toBean(obj, SpsSyncDeviceTaskResponse.class)); + break; + case PRODUCE_BUSINESS_DATA: + saveUploadProBusinessData(JSONUtil.toBean(obj, SpsSyncProBusinessDataResponse.class)); + break; } String taskId = obj.getStr("taskId"); BasicDownloadStatusEntity downloadStatus = BasicDownloadStatusEntity.builder() @@ -635,6 +652,86 @@ public class SpsSyncDownloadController { } } + @Resource + DeviceInfoMapper deviceInfoMapper; + @Resource + DeviceCheckMapper deviceCheckMapper; + @Resource + DeviceCheckDetailMapper deviceCheckDetailMapper; + @Resource + DeviceCheckDetailItemMapper deviceCheckDetailItemMapper; + @Resource + DeviceRepairApplyMapper deviceRepairApplyMapper; + + @Resource + DeviceRepairApplyDetailMapper deviceRepairApplyDetailMapper; + + @Resource + DeviceRepairMapper deviceRepairMapper; + + + // 报修表 + private void saveUploadDevTaskInfo(SpsSyncDeviceTaskResponse bean) { + if (CollectionUtil.isNotEmpty(bean.getDeviceInfoEntities())) { + for (DeviceInfoEntity entity : bean.getDeviceInfoEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceInfoMapper.replaceBatchs(bean.getDeviceInfoEntities()); + } + + if (CollectionUtil.isNotEmpty(bean.getDeviceCheckEntities())) { + for (DeviceCheckEntity entity : bean.getDeviceCheckEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceCheckMapper.replaceBatchs(bean.getDeviceCheckEntities()); + } + if (CollectionUtil.isNotEmpty(bean.getDeviceCheckDetailEntities())) { + for (DeviceCheckDetailEntity entity : bean.getDeviceCheckDetailEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceCheckDetailMapper.replaceBatchs(bean.getDeviceCheckDetailEntities()); + } + + if (CollectionUtil.isNotEmpty(bean.getDeviceCheckDetailItemEntities())) { + for (DeviceCheckDetailItemEntity entity : bean.getDeviceCheckDetailItemEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceCheckDetailItemMapper.replaceBatchs(bean.getDeviceCheckDetailItemEntities()); + } + + if (CollectionUtil.isNotEmpty(bean.getDeviceRepairApplyEntities())) { + for (DeviceRepairApplyEntity entity : bean.getDeviceRepairApplyEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceRepairApplyMapper.replaceBatchs(bean.getDeviceRepairApplyEntities()); + } + + if (CollectionUtil.isNotEmpty(bean.getDeviceRepairApplyDetailEntities())) { + for (DeviceRepairApplyDetailEntity entity : bean.getDeviceRepairApplyDetailEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceRepairApplyDetailMapper.replaceBatchs(bean.getDeviceRepairApplyDetailEntities()); + } + + if (CollectionUtil.isNotEmpty(bean.getDeviceRepairEntities())) { + for (DeviceRepairEntity entity : bean.getDeviceRepairEntities()) { + entity.setUpdateTime(null); + } + boolean b = deviceRepairMapper.replaceBatchs(bean.getDeviceRepairEntities()); + } + } + + + @Resource + ThrManufacturerMapper thrManufacturerMapper; + private void saveUploadProBusinessData(SpsSyncProBusinessDataResponse bean) { + if (CollectionUtil.isNotEmpty(bean.getThrManufacturerEntities())) { + for (ThrManufacturerEntity entity : bean.getThrManufacturerEntities()) { + entity.setUpdateTime(null); + } + boolean b = thrManufacturerMapper.replaceBatchs(bean.getThrManufacturerEntities()); + } + } @Resource IoOrderDao orderDao; @Resource diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncWebSocket.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncWebSocket.java index 8be8e6ab..9f9c7ae1 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncWebSocket.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncWebSocket.java @@ -11,6 +11,7 @@ import com.glxp.api.service.sync.SyncEditLogService; import com.glxp.api.service.sync.SyncEditTypeService; import com.glxp.api.util.JsonUtils; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -121,7 +122,7 @@ public class SpsSyncWebSocket { } } - public BasicDataRequest insert(BasicDataRequest basicDataRequest, String userId) { + public BasicDataRequest insert(@NotNull BasicDataRequest basicDataRequest, String userId) { //日志参数类 DeleteBasicDataRequest deleteBasicDataRequest = new DeleteBasicDataRequest(); deleteBasicDataRequest.setRecordCode("DL" + new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(System.currentTimeMillis())); diff --git a/src/main/java/com/glxp/api/controller/sync/SyncDelController.java b/src/main/java/com/glxp/api/controller/sync/SyncDelController.java index cbc96479..414dccad 100644 --- a/src/main/java/com/glxp/api/controller/sync/SyncDelController.java +++ b/src/main/java/com/glxp/api/controller/sync/SyncDelController.java @@ -8,9 +8,11 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.SyncDelType; import com.glxp.api.controller.BaseController; +import com.glxp.api.dao.dev.DeviceInfoMapper; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.BasicCorpEntity; import com.glxp.api.entity.basic.UdiRelevanceEntity; +import com.glxp.api.entity.dev.DeviceInfoEntity; import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.entity.sync.SyncEditLogEntity; @@ -109,6 +111,14 @@ public class SyncDelController extends BaseController { //插入操作数据类型记录表 insertType(basicDataRequest.getDeleteBasicDataRequest()); break; + case SyncDelType.DEVICE_INFO_DATA: + + baseResponse = deleteDevInfoData(basicDataRequest.getDeleteDeviceInfoEntity()); + //插入日志 + insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); + //插入操作数据类型记录表 + insertType(basicDataRequest.getDeleteBasicDataRequest()); + break; default: break; } @@ -218,4 +228,11 @@ public class SyncDelController extends BaseController { return ResultVOUtils.success("删除成功"); } + @Resource + DeviceInfoMapper deviceInfoMapper; + public BaseResponse deleteDevInfoData(DeviceInfoEntity deviceInfoEntity) { + deviceInfoMapper.delete(new QueryWrapper().eq("deviceCode",deviceInfoEntity.getDeviceCode())); + return ResultVOUtils.success("删除成功"); + } + } diff --git a/src/main/java/com/glxp/api/dao/basic/BasicProductsDao.java b/src/main/java/com/glxp/api/dao/basic/BasicProductsDao.java index bd239e83..545b610b 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicProductsDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicProductsDao.java @@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.basic.BasicProductSetEntity; import com.glxp.api.entity.basic.BasicProductsEntity; +import com.glxp.api.entity.thrsys.ThrProductTypeEntity; import com.glxp.api.req.basic.FilterBasicProductSetrequest; +import com.glxp.api.req.thrsys.FilterBasicProducstRequest; +import com.glxp.api.req.thrsys.FilterThrProductTypeRequest; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java index 6cd92532..2c3f5999 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -41,6 +41,7 @@ public class UdiProductEntity { private String ybbm; private String sptm; private String manufactory; + private String manufactoryCode; private String measname; private Integer productType; private String scbssfbhph; diff --git a/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java b/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java index 8dd7161a..a0b72b66 100644 --- a/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java +++ b/src/main/java/com/glxp/api/entity/sync/SyncDataSetEntity.java @@ -69,6 +69,11 @@ public class SyncDataSetEntity { private int productCert; private int orderInvoice; //发票信息 + private int deviceInfo; //设备信息管理 + private int deviceCheck;//巡检管理 + private int deviceRepairApply;//报修管理 + private int produceBusiness;//生产企业 PRODUCE_BUSINESS_DATA + } diff --git a/src/main/java/com/glxp/api/exception/JsonException.java b/src/main/java/com/glxp/api/exception/JsonException.java index 7da45f74..4161b58d 100644 --- a/src/main/java/com/glxp/api/exception/JsonException.java +++ b/src/main/java/com/glxp/api/exception/JsonException.java @@ -25,4 +25,9 @@ public class JsonException extends RuntimeException{ super(message); this.code = code; } + public JsonException(String message) { + super(message); + this.code = ResultEnum.NOT_NETWORK.getCode(); + } + } diff --git a/src/main/java/com/glxp/api/http/ErpBasicClient.java b/src/main/java/com/glxp/api/http/ErpBasicClient.java index 69cb2705..7a8b8944 100644 --- a/src/main/java/com/glxp/api/http/ErpBasicClient.java +++ b/src/main/java/com/glxp/api/http/ErpBasicClient.java @@ -6,15 +6,13 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; import com.glxp.api.entity.thrsys.ThrSystemBusApiEntity; import com.glxp.api.entity.thrsys.ThrSystemEntity; import com.glxp.api.http.req.UdiwmsBusTypeRequest; import com.glxp.api.http.req.UdiwmsUnitRequest; import com.glxp.api.req.basic.YbHcflDetailFilterRequest; -import com.glxp.api.req.thrsys.FilterBasicThirdSysDetailRequest; -import com.glxp.api.req.thrsys.FilterThrProductsRequest; -import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest; -import com.glxp.api.req.thrsys.UdiwmsWarehouseRequest; +import com.glxp.api.req.thrsys.*; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.chs.YbHcflEntityResponse; import com.glxp.api.res.thrsys.ThrCorpsResponse; @@ -194,4 +192,28 @@ public class ErpBasicClient { } } + /** + * 获取往来单位 + */ + public BaseResponse> getThrManu(ThrManuFilterRequest thrManuFilterRequest) { + UdiwmsUnitRequest udiwmsUnitRequest = new UdiwmsUnitRequest(); + BeanUtils.copyProperties(thrManuFilterRequest, udiwmsUnitRequest); + udiwmsUnitRequest.setUnitId(thrManuFilterRequest.getErpId()); + ThrSystemEntity thrSystemEntity = basicThirdSysService.selectByThirdId(thrManuFilterRequest.getThirdSysFk()); + try { + String url = thrSystemEntity.getThridUrl() + "/udiwms/erp/getManus"; + String response = httpOkClient.uCloudPost(url, udiwmsUnitRequest, thrSystemEntity); + if (StrUtil.isBlank(response)) { + return ResultVOUtils.error(500, "连接第三方系统接口服务出错!"); + } + BaseResponse> baseResponse = + JSONObject.parseObject(response, new TypeReference>>() { + }); + return baseResponse; + } catch (Exception e) { + log.error("获取生产企业接口异常", e); + return ResultVOUtils.error(500, "连接第三方系统接口服务出错!"); + } + } + } diff --git a/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java b/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java index 9376bc13..6d774bff 100644 --- a/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java +++ b/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java @@ -1,10 +1,10 @@ package com.glxp.api.req.basic; +import com.glxp.api.entity.dev.DeviceInfoEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.req.system.DeleteCompanyFileRequest; import com.glxp.api.req.system.DeleteRequest; import lombok.Data; -import org.springframework.validation.BindingResult; @Data public class BasicDataRequest { @@ -28,6 +28,8 @@ public class BasicDataRequest { private DeviceInspectTaskEntity deviceInspectTaskEntity; + private DeviceInfoEntity deleteDeviceInfoEntity; + private String key; } diff --git a/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java b/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java index b87fa16e..2ec8f5bc 100644 --- a/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java +++ b/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java @@ -1,7 +1,8 @@ package com.glxp.api.res.sync; -import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; -import com.glxp.api.entity.inv.DeviceInspectTaskEntity; + +import com.glxp.api.entity.dev.*; +import com.glxp.api.entity.inv.*; import lombok.Data; import java.util.List; @@ -12,5 +13,11 @@ public class SpsSyncDeviceTaskResponse extends BaseSyncResponse { List deviceInspectTaskEntities; List deviceInspectTaskDetailEntities; - + List deviceInfoEntities; + List deviceCheckEntities; + List deviceCheckDetailEntities; + List deviceCheckDetailItemEntities; + List deviceRepairApplyDetailEntities;//报修单明细 + List deviceRepairApplyEntities;//报修单 + List deviceRepairEntities;//维修单 } diff --git a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java index 765e140d..4988aaab 100644 --- a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java +++ b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java @@ -64,4 +64,13 @@ public class SyncDataSetResponse { private int productCert; private int orderInvoice; //发票信息 + + + private int deviceInfo; //设备信息管理 + private int deviceCheck;//巡检管理 + private int deviceRepairApply;//报修管理 + private int produceBusiness;//生产企业 PRODUCE_BUSINESS_DATA + + + } diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index e8a73bb4..80bb00c7 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -14,6 +14,7 @@ import com.glxp.api.controller.sync.SpsSyncWebSocket; import com.glxp.api.constant.Constant; import com.glxp.api.dao.basic.BasicProductsDao; import com.glxp.api.entity.basic.*; +import com.glxp.api.entity.dev.*; import com.glxp.api.entity.inout.*; import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; @@ -23,6 +24,7 @@ import com.glxp.api.entity.sync.BasicExportStatusTimeEntity; import com.glxp.api.entity.sync.SocketMsgEntity; import com.glxp.api.entity.sync.SyncDataBustypeEntity; import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity; +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; import com.glxp.api.req.basic.ProductInfoFilterRequest; import com.glxp.api.req.basic.UdiCompanyRequest; import com.glxp.api.req.inout.FilterOrderRequest; @@ -32,6 +34,7 @@ import com.glxp.api.res.sync.SpsSyncDeviceTaskResponse; import com.glxp.api.res.sync.SpsSyncOrderResponse; import com.glxp.api.res.system.SyncDataSetResponse; import com.glxp.api.service.basic.*; +import com.glxp.api.service.dev.*; import com.glxp.api.service.inout.*; import com.glxp.api.service.inout.impl.IoCodeService; import com.glxp.api.service.inout.impl.IoOrderInvoiceService; @@ -39,6 +42,7 @@ import com.glxp.api.service.inv.DeviceInspectTaskDetailService; import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.service.purchase.*; import com.glxp.api.service.thrsys.IThrBusTypeOriginService; +import com.glxp.api.service.thrsys.ThrManufacturerService; import com.glxp.api.util.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -240,11 +244,31 @@ public class SpsSyncDownloadService { // , x -> x.generateDocumentTypeDataFile(info, now, true, syncTime)); // } break; - case DEVICE_TASK: basicExportInfoCreate(exportType, syncTime, now , x -> x.generateDevTaskDataFile(info, now, false, syncTime) , x -> x.generateDevTaskDataFile(info, now, true, syncTime)); + break; + case DEVICE_INFO_DATA: + basicExportInfoCreate(exportType,syncTime,now + , x -> x.generateDeviceInfoFile(info, now, false, syncTime) + ,x -> x.generateDeviceInfoFile(info, now, true, syncTime)); + break; + case DEVICE_CHECK_DATA: + basicExportInfoCreate(exportType,syncTime,now + , x -> x.generateDeviceCheckFile(info, now, false, syncTime) + ,x -> x.generateDeviceCheckFile(info, now, true, syncTime)); + break; + case DEVICE_REPAIR_DATA: + basicExportInfoCreate(exportType,syncTime,now + , x -> x.generateDeviceRepairFile(info, now, false, syncTime) + ,x -> x.generateDeviceRepairFile(info, now, true, syncTime)); + break; + case PRODUCE_BUSINESS_DATA: + basicExportInfoCreate(exportType,syncTime,now + , x -> x.generateProBusFile(info, now, false, syncTime) + ,x -> x.generateProBusFile(info, now, true, syncTime)); + break; } } @@ -311,6 +335,7 @@ public class SpsSyncDownloadService { } } + /** * 读取基础数据,创建文件 * @@ -811,6 +836,333 @@ public class SpsSyncDownloadService { } + + + @Resource + DeviceInfoService deviceInfoService; + + /** + * 设备信息同步 + * @param info + * @param now + * @param createFile + * @param syncTime + * @return + */ + protected boolean generateDeviceInfoFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) { + log.error("基础设备信息 info 的很多很好的活动和"); + BasicExportTypeEnum exportType = BasicExportTypeEnum.DEVICE_INFO_DATA; + //文件数据 + Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); + Map> totalTimeMap = new WeakHashMap<>(10); + StringBuffer remark = new StringBuffer(); + Map syncTimeMap = new WeakHashMap<>(3); + syncTimeMap.put("isNew", true); + boolean ge = false; + if (syncTime != null) { + ge = true; + } + try { + //确认有开启设备信息由外向内同步 + if (needExec(info.getDeviceInfo())) { + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEVICE_INFO_DATA, createFile); + totalTimeMap.put(BasicExportStatusTimeEnum.DEVICE_INFO_DATA, map); + List deviceInfoEntities = deviceInfoService.list(Wrappers.lambdaQuery(DeviceInfoEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceInfoEntity::getUpdateTime, now) + .between(ge, DeviceInfoEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceInfoEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceInfoEntities)) { + jsonMap.put(DeviceInfoEntity.class.getSimpleName(), deviceInfoEntities); + remark.append("基础设备信息:").append(deviceInfoEntities.size()).append("条\n"); + } + + } + if (jsonMap.size() > 0) { + jsonMap.put(SYNC_REMARK, remark.toString()); + if (!createFile) { + return true; + } + try { + String fileFullPath = writeFile(filePath, exportType.getRemark(), JsonUtils.toJsonString(jsonMap)); + try { + //修改任务数据 + boolean update = updateExportStatus(exportType, fileFullPath, remark.toString()); + } catch (Exception e) { + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, fileFullPath); + } + SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.DL_ALL_DATA).remark("下载设备信息").build(); + spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken); + + return true; + } catch (IOException e) { + logger.error(String.format("syncIdcSps----process------------生成[%s]文件及更改库操作异常,异常信息<%s>" + , exportType.getRemark(), e.getMessage())); + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, null); + } + } + return false; + } catch (Exception e) { + logger.error(e.getMessage()); + return false; + } + } + + + @Resource + DeviceCheckService deviceCheckService; + @Resource + DeviceCheckDetailService deviceCheckDetailService; + @Resource + DeviceCheckDetailItemService deviceCheckDetailItemService; + + //上传巡检设备信息 到中继服务 供给管理系统拉取 + protected boolean generateDeviceCheckFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) { + log.error("巡检设备信息任务"); + BasicExportTypeEnum exportType = BasicExportTypeEnum.DEVICE_CHECK_DATA; + //文件数据 + Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); + Map> totalTimeMap = new WeakHashMap<>(10); + StringBuffer remark = new StringBuffer(); + Map syncTimeMap = new WeakHashMap<>(3); + syncTimeMap.put("isNew", true); + boolean ge = false; + if (syncTime != null) { + ge = true; + } + try { + //确认有开启设备信息由外向内同步 + if (needExec(info.getDeviceCheck())) { + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DATA, createFile); + totalTimeMap.put(BasicExportStatusTimeEnum.DEV_CHECK_DATA, map); + List deviceCheckEntities = deviceCheckService.list(Wrappers.lambdaQuery(DeviceCheckEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceCheckEntity::getUpdateTime, now) + .between(ge, DeviceCheckEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceCheckEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceCheckEntities)) { + jsonMap.put(DeviceCheckEntity.class.getSimpleName(), deviceCheckEntities); + remark.append("巡检管理数据:").append(deviceCheckEntities.size()).append("条\n"); + } + List deviceCheckDetailEntities = deviceCheckDetailService.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime, now) + .between(ge, DeviceCheckDetailEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceCheckDetailEntities)) { + remark.append("巡检管理明细信息:").append(deviceCheckDetailEntities.size()).append("条\n"); + jsonMap.put(DeviceCheckDetailEntity.class.getSimpleName(), deviceCheckDetailEntities); + } + List deviceCheckDetailItemEntities = deviceCheckDetailItemService.list(Wrappers.lambdaQuery(DeviceCheckDetailItemEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailItemEntity::getUpdateTime, now) + .between(ge, DeviceCheckDetailItemEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailItemEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceCheckDetailItemEntities)) { + remark.append("设备巡检项目信息:").append(deviceCheckDetailItemEntities.size()).append("条\n"); + jsonMap.put(DeviceCheckDetailItemEntity.class.getSimpleName(), deviceCheckDetailItemEntities); + } + + } + if (jsonMap.size() > 0) { + jsonMap.put(SYNC_REMARK, remark.toString()); + if (!createFile) { + return true; + } + try { + String fileFullPath = writeFile(filePath, exportType.getRemark(), JsonUtils.toJsonString(jsonMap)); + try { + //修改任务数据 + boolean update = updateExportStatus(exportType, fileFullPath, remark.toString()); + } catch (Exception e) { + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, fileFullPath); + } + SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.DL_ALL_DATA).remark("下载巡检设备信息").build(); + spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken); + + return true; + } catch (IOException e) { + logger.error(String.format("syncIdcSps----process------------生成[%s]文件及更改库操作异常,异常信息<%s>" + , exportType.getRemark(), e.getMessage())); + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, null); + } + } + return false; + } catch (Exception e) { + logger.error(e.getMessage()); + return false; + } + } + + + @Resource + DeviceRepairApplyService deviceRepairApplyService; + + @Resource + DeviceRepairApplyDetailService deviceRepairApplyDetailService; + + @Resource + DeviceRepairService deviceRepairService; + + // generateDeviceRepairFile 报修管理 + protected boolean generateDeviceRepairFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) { + BasicExportTypeEnum exportType = BasicExportTypeEnum.DEVICE_REPAIR_DATA; + //文件数据 + Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); + Map> totalTimeMap = new WeakHashMap<>(10); + StringBuffer remark = new StringBuffer(); + Map syncTimeMap = new WeakHashMap<>(3); + syncTimeMap.put("isNew", true); + boolean ge = false; + if (syncTime != null) { + ge = true; + } + try { + //确认有开启报修设备管理信息由外向内同步 + if (needExec(info.getDeviceRepairApply())) { + log.error("shebei baoxiudan "); + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR_APPLY, createFile); + totalTimeMap.put(BasicExportStatusTimeEnum.DEV_REPAIR_APPLY, map); + List deviceRepairApplyEntities = deviceRepairApplyService.list(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceRepairApplyEntity::getUpdateTime, now) + .between(ge, DeviceRepairApplyEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceRepairApplyEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceRepairApplyEntities)) { + jsonMap.put(DeviceRepairApplyEntity.class.getSimpleName(), deviceRepairApplyEntities); + remark.append("设备报修单数据:").append(deviceRepairApplyEntities.size()).append("条\n"); + } + List deviceRepairApplyDetailEntities = deviceRepairApplyDetailService.list(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceRepairApplyDetailEntity::getUpdateTime, now) + .between(ge, DeviceRepairApplyDetailEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceRepairApplyDetailEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceRepairApplyDetailEntities)) { + remark.append("设备报修单明细信息:").append(deviceRepairApplyDetailEntities.size()).append("条\n"); + jsonMap.put(DeviceRepairApplyDetailEntity.class.getSimpleName(), deviceRepairApplyDetailEntities); + } + List deviceRepairEntities = deviceRepairService.list(Wrappers.lambdaQuery(DeviceRepairEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceRepairEntity::getUpdateTime, now) + .between(ge, DeviceRepairEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceRepairEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceRepairEntities)) { + remark.append("设备维修单信息:").append(deviceRepairEntities.size()).append("条\n"); + jsonMap.put(DeviceRepairEntity.class.getSimpleName(), deviceRepairEntities); + } + + } + if (jsonMap.size() > 0) { + jsonMap.put(SYNC_REMARK, remark.toString()); + if (!createFile) { + return true; + } + try { + String fileFullPath = writeFile(filePath, exportType.getRemark(), JsonUtils.toJsonString(jsonMap)); + try { + //修改任务数据 + boolean update = updateExportStatus(exportType, fileFullPath, remark.toString()); + } catch (Exception e) { + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, fileFullPath); + } + SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.DL_ALL_DATA).remark("下载报修设备信息").build(); + spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken); + + return true; + } catch (IOException e) { + logger.error(String.format("syncIdcSps----process------------生成[%s]文件及更改库操作异常,异常信息<%s>" + , exportType.getRemark(), e.getMessage())); + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, null); + } + } + return false; + } catch (Exception e) { + logger.error(e.getMessage()); + return false; + } + } + + + @Resource + ThrManufacturerService thrManufacturerService; + // 生产企业 generateProBusFile + protected boolean generateProBusFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) { + BasicExportTypeEnum exportType = BasicExportTypeEnum.PRODUCE_BUSINESS_DATA; + //文件数据 + Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); + Map> totalTimeMap = new WeakHashMap<>(10); + StringBuffer remark = new StringBuffer(); + Map syncTimeMap = new WeakHashMap<>(3); + syncTimeMap.put("isNew", true); + boolean ge = false; + if (syncTime != null) { + ge = true; + } + try { + //确认有开启报修设备管理信息由外向内同步 + if (needExec(info.getProduceBusiness())) { + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.PRODUCE_BUSINESS_DATA, createFile); + totalTimeMap.put(BasicExportStatusTimeEnum.PRODUCE_BUSINESS_DATA, map); + List thrManufacturerEntities = thrManufacturerService.list(Wrappers.lambdaQuery(ThrManufacturerEntity.class) + .le(!ge && (boolean) map.get("isNew"), ThrManufacturerEntity::getUpdateTime, now) + .between(ge, ThrManufacturerEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), ThrManufacturerEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(thrManufacturerEntities)) { + jsonMap.put(ThrManufacturerEntity.class.getSimpleName(), thrManufacturerEntities); + remark.append("生产企业数据:").append(thrManufacturerEntities.size()).append("条\n"); + } + + } + if (jsonMap.size() > 0) { + jsonMap.put(SYNC_REMARK, remark.toString()); + if (!createFile) { + return true; + } + try { + String fileFullPath = writeFile(filePath, exportType.getRemark(), JsonUtils.toJsonString(jsonMap)); + try { + //修改任务数据 + boolean update = updateExportStatus(exportType, fileFullPath, remark.toString()); + } catch (Exception e) { + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, fileFullPath); + } + SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.DL_ALL_DATA).remark("下载生产企业信息").build(); + spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken); + + return true; + } catch (IOException e) { + logger.error(String.format("syncIdcSps----process------------生成[%s]文件及更改库操作异常,异常信息<%s>" + , exportType.getRemark(), e.getMessage())); + // 异常回滚 + this.exportTimeRollback(totalTimeMap, exportType, null); + } + } + return false; + } catch (Exception e) { + logger.error(e.getMessage()); + return false; + } + } /** * 插入 basicExportStatusTime表 * diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index a2bd2805..2439b01f 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -5,7 +5,7 @@ spring: driver-class-name: com.p6spy.engine.spy.P6SpyDriver jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root - password: 123456 + password: root hikari: connection-timeout: 60000 maximum-pool-size: 60 @@ -59,6 +59,6 @@ UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs API_KEY: 1101 -API_SECRET: zBITspLNvuoEd4FaamlSoqxRHmNsmQ9L +API_SECRET: zBITspLNvuoEd4FaamlSoqxRHmNxmQ5L WEB_TITLE: 平潭协和医院 WEBSOCKET_TOKEN: 07rKFDFkQvBkbxgc7aUBlONo4gWNdx8b diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql new file mode 100644 index 00000000..ee88d7d4 --- /dev/null +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -0,0 +1,468 @@ +# # 字段新增 (表名,字段名,字段类型,修改方式(1:新增,2:修改,3:删除) +# +# + +CREATE TABLE IF NOT EXISTS "device_info" ( + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.正常,2变更归属中,3.维修申请中 4.维修中 6.销毁/报废', + "checkLock" bit(1) NOT NULL DEFAULT b'0' COMMENT '巡检锁定', + "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + "productId" bigint NOT NULL COMMENT '产品id', + "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + "changeCount" int NOT NULL DEFAULT '0' COMMENT '变更次数', + "repairApplyCount" int NOT NULL DEFAULT '0' COMMENT '报修次数', + "repairCount" int NOT NULL DEFAULT '0' COMMENT '维修次数', + "checkCount" int NOT NULL DEFAULT '0' COMMENT '巡检次数', + "lastChangeOrderId" bigint NOT NULL COMMENT '最后变更单号', + "lastRepairApplyId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后报修申请单号', + "lastRepairApplyTime" datetime DEFAULT NULL COMMENT '最后报修时间', + "lastRepairId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修单号', + "lastRepairUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修负责人名称', + "lastRepairUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修人联系电话', + "lastRepairTime" datetime DEFAULT NULL COMMENT '最后维修时间', + "lastCheckUserId" bigint DEFAULT NULL COMMENT '最后检查/巡检负责人', + "lastCheckUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检负责人名称', + "lastCheckPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检人联系电话', + "lastCheckTime" datetime DEFAULT NULL COMMENT '最后检查/巡检时间', + "lastCheckTaskId" bigint DEFAULT NULL COMMENT '最后检查/巡检任务id', + "createTime" datetime NOT NULL COMMENT '创建时间', + "createUserId" bigint NOT NULL COMMENT '创建人id', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + "assetType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产分类', + "sasacType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国资分类', + "assetMnemonicCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产助记码', + "number" int DEFAULT '1' COMMENT '数量', + "acquisitionMethod" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取得方式', + "purpose" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用途', + "depreciationYear" int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧年', + "depreciationMonth" int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧月', + "invCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '存储仓库', + "estimatedTotalHour" int(10) unsigned zerofill DEFAULT NULL COMMENT '预计总工时', + "dayHour" int(10) unsigned zerofill DEFAULT NULL COMMENT '单日工时', + "assetValue" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '单个资产价值', + "ownFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '自有资金', + "financialAppropriation" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '财政拨款', + "educationFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '科教基金', + "otherFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '其他资金', + "nonPeerFinancialAppropriation" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '非同级财政拨款', + "ybbm" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '医疗器械分类编码', + "catalogname1" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '一级分类名称(学科,品名)', + "catalogname2" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '二级分类名称(用途、品目)', + "catalogname3" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', + "catalogCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '编码', + "catalogCode1" bigint DEFAULT NULL COMMENT '一级分类名称(学科,品名)', + "catalogCode2" bigint DEFAULT NULL COMMENT '二级分类名称(用途、品目)', + "catalogCode3" bigint DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', + "managementCategory" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理类别', + "endUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '使用人', + "estimatedResidualValue" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '预计残值', + "currencyType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种', + "purType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '采购类型', + "purchaseDate" date DEFAULT NULL COMMENT '购置日期', + "addDate" date DEFAULT NULL COMMENT '添加日期', + "assetName" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产品名', + "isImperative" bigint DEFAULT NULL COMMENT '是否强检', + "isMaintain" bigint DEFAULT NULL COMMENT '是否保养', + "imperativeCycle" bigint DEFAULT NULL COMMENT '检定周期(月)', + "maintainCycle" bigint DEFAULT NULL COMMENT '保养周期(月)', + "startImperativeDate" date DEFAULT NULL COMMENT '开始检定日期', + "startMaintainDate" date DEFAULT NULL COMMENT '开始保养日期', + "serviceType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修组', + "maintainType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '保养组', + "managerUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理人', + "approveUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审核人', + "ledgerAccount" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '对应会计科目', + "impairmentProvision" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '减值准备', + "estimatedWorkload" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '预计工作量', + "completedWorkload" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '已完成工作量', + "maintenanceType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维保类型', + "maintenanceCycle" bigint DEFAULT NULL COMMENT '维保周期', + "startMaintenancDate" date DEFAULT NULL COMMENT '维保开始日期', + "endMaintenancDate" date DEFAULT NULL COMMENT '维保结束日期', + "networkType" bigint DEFAULT NULL COMMENT '内外网', + "UserRole" bigint DEFAULT NULL COMMENT '使用角色', + "isAddDomain" bigint DEFAULT NULL COMMENT '是否加域', + "isUDisc" bigint DEFAULT NULL COMMENT 'u盘是否禁用', + "ascriptionType" bigint DEFAULT NULL COMMENT '设备归类', + "assetReserveType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产备用类型', + "updateTime" datetime DEFAULT NULL COMMENT '更改日期', + PRIMARY KEY ("deviceCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备表' + ROW_FORMAT=Dynamic; + +CREATE TABLE if not exists "device_check" +( + "taskId" bigint NOT NULL COMMENT '巡检任务id', + "planId" bigint DEFAULT NULL COMMENT '计划id', + "planName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计划名称', + "chargeDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门编码', + "checkUserId" bigint DEFAULT NULL COMMENT '巡检人id', + "checkUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', + "checkUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人电话', + "deviceCount" int NOT NULL COMMENT '设备数量', + "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成设备数量', + "exceptionCount" int NOT NULL DEFAULT '0' COMMENT '异常数量', + "finishTime" datetime DEFAULT NULL COMMENT '完成时间', + "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '任务名称', + "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '任务备注', + "sysFlag" bit(1) NOT NULL COMMENT '是否系统创建 1/true 是 0/false 否', + "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成', + "createTime" datetime NOT NULL COMMENT '创建时间', + "createUserId" bigint DEFAULT NULL COMMENT '创建人id', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人姓名', + "updateTime" datetime DEFAULT NULL, + PRIMARY KEY ("taskId") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务表' + ROW_FORMAT=Dynamic; + + +CREATE TABLE IF NOT EXISTS "device_check_detail" +( + "taskId" bigint NOT NULL COMMENT '任务id', + "deviceCode" varbinary(255) NOT NULL COMMENT '设备编码', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '部门名称', + "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 1/true 0/false', + "productId" bigint NOT NULL COMMENT '产品id', + "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + "itemCount" int NOT NULL DEFAULT '0' COMMENT '项目数量', + "exceptionCount" int NOT NULL DEFAULT '0' COMMENT '异常数量', + "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成项目数量', + "finishTime" datetime DEFAULT NULL COMMENT '完成时间', + "repairId" bigint DEFAULT NULL COMMENT '维修单id', + "normalFlag" tinyint DEFAULT NULL COMMENT '巡检状态 :0:异常;1.正常', + "livePath" varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '现场照片', + "suggestion" varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检建议', + "updateTime" datetime DEFAULT NULL COMMENT '更改时间', + PRIMARY KEY ("taskId","deviceCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务明细' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_check_detail_item" +( + "taskId" bigint NOT NULL COMMENT '任务id', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + "itemCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + "itemName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + "itemContent" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + "normalFlag" bit(1) DEFAULT NULL COMMENT '正常标识', + "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '完成标识', + "finishTime" datetime DEFAULT NULL COMMENT '完成时间', + "suggestion" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '巡检建议', + "checkUserId" bigint DEFAULT NULL COMMENT '巡检人id', + "checkUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', + "checkDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门', + "checkDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门名称', + "updateTime" datetime DEFAULT NULL, + PRIMARY KEY ("taskId","deviceCode","itemCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检项目' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_repair" +( + "id" bigint NOT NULL COMMENT '维修id', + "applyId" bigint DEFAULT NULL COMMENT '维修申请id', + "checkTaskId" bigint DEFAULT NULL COMMENT '巡检任务单id', + "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 true/false', + "description" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', + "diagnosisInfo" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '诊断信息', + "innerFlag" bit(1) DEFAULT NULL COMMENT '是否内部维修', + "repairUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人姓名', + "repairUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人联系方式', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备码', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', + "productId" bigint NOT NULL COMMENT '产品id', + "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + "createUserId" bigint NOT NULL COMMENT '创建人id', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人姓名', + "createTime" datetime NOT NULL COMMENT '创建时间', + "createDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', + "createDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门名称', + "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', + "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', + "confirmRemark" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + "confirmPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', + "repairDeptCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修部门', + "updateTime" datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY ("id") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备维修单' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_repair_apply" +( + "id" bigint NOT NULL COMMENT '报修单id', + "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态 待受理,受理中,维修中,完成', + "applyDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门编码', + "applyDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门', + "applyUserId" bigint NOT NULL COMMENT '报修人id', + "applyUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人姓名', + "applyUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人联系方式', + "applyTime" datetime NOT NULL COMMENT '报修时间', + "deviceCount" int NOT NULL COMMENT '设备数量', + "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成数量', + "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', + "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + "confirmPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', + "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', + "finishTime" datetime DEFAULT NULL COMMENT '完成时间', + "updateTime" datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY ("id") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报修单' + ROW_FORMAT=Dynamic; + + +CREATE TABLE IF NOT EXISTS "device_repair_apply_detail" +( + "applyId" bigint NOT NULL COMMENT '报修单id', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', + "description" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', + "diagnosisInfo" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '诊断信息', + "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '\0' COMMENT '状态 待诊断、待维修、维修中、完成', + "repairFlag" bit(1) DEFAULT NULL COMMENT '是否需要维修 true/false', + "repairId" bigint DEFAULT NULL COMMENT '维修单id', + "productId" bigint NOT NULL COMMENT '产品id', + "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', + "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', + "confirmRemark" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + "finishTime" datetime DEFAULT NULL COMMENT '完成时间', + "updateTime" datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY ("applyId","deviceCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报修单明细' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_plan" +( + "planId" bigint NOT NULL COMMENT '计划id', + "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '计划名称', + "chargeDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门', + "startDate" date NOT NULL COMMENT '开始日期', + "endDate" date NOT NULL COMMENT '结束日期', + "frequency" int NOT NULL COMMENT '频率(天)', + "execCount" int NOT NULL DEFAULT '0' COMMENT '执行次数', + "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + "createUserId" bigint NOT NULL COMMENT '创建人id', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + "createTime" datetime NOT NULL COMMENT '创建时间', + "status" tinyint DEFAULT NULL COMMENT '设备巡检计划状态 :1:草稿;2.已提交', + PRIMARY KEY ("planId") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检计划' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_plan_detail" +( + "planId" bigint NOT NULL COMMENT '计划id', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', + "productId" bigint NOT NULL COMMENT '产品id', + PRIMARY KEY ("planId","deviceCode") USING BTREE, + UNIQUE KEY "uk_planId_productId" ("planId","deviceCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检计划明细' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_plan_detail_item" +( + "planId" bigint NOT NULL COMMENT '巡检计划明细id', + "productId" bigint NOT NULL COMMENT '巡检计划产品id', + "itemCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '', + "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + "content" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + PRIMARY KEY ("planId","productId","itemCode") USING BTREE, + UNIQUE KEY "uk_planId_deviceCode_itemCode" ("planId","itemCode","deviceCode") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检设备的项目' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_check_item_dict" +( + "code" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + "content" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + "createUserId" bigint NOT NULL COMMENT '创建人id', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + "createTime" datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY ("code") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检项目字典' + ROW_FORMAT=Dynamic; + +CREATE TABLE IF NOT EXISTS "device_change_log" +( + "id" bigint NOT NULL COMMENT '日志id', + "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + "type" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', + "changeOrderId" bigint NOT NULL COMMENT '变更单号', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', + "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', + "toDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + "toDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + "confirmUser" bigint NOT NULL COMMENT '确认人id', + "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '确认人姓名', + "confirmTime" datetime NOT NULL COMMENT '确认时间', + "confirmRemark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作人姓名', + "createUser" bigint NOT NULL COMMENT '操作人id', + "createTime" datetime NOT NULL COMMENT '操作时间', + PRIMARY KEY ("id") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更日志表' + ROW_FORMAT=Dynamic; + +CREATE TABLE "device_change_order" ( + "orderId" bigint NOT NULL COMMENT '编码', + "type" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', + "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 ,2.完成(目标确认接收) ,3.目标部门拒收,4.取消', + "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', + "toDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + "confirmUser" bigint DEFAULT NULL COMMENT '确认人id', + "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', + "confirmRemark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人', + "createUser" bigint DEFAULT NULL COMMENT '创建人id', + "createTime" datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY ("orderId") USING BTREE +) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更单' + ROW_FORMAT=Dynamic; + + +CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceInfo', + ' tinyint NULL DEFAULT NULL COMMENT ''设备管理数据''', + 1); + +CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceCheck', + ' tinyint NULL DEFAULT NULL COMMENT ''巡检管理数据''', + 1); + + +CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceRepairApply', + ' tinyint NULL DEFAULT NULL COMMENT ''报修单数据''', + 1); + + + + +CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription', + ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''', + 1); + +INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43'); +INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36'); +INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'processing', '1002', '手术室', 1, '超级用户', '18238132561', '2024-05-07 19:07:56', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:11:48', NULL, '2024-05-09 11:59:52'); +INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'processing', '1002', '手术室', 1, '超级用户', '15866936214', '2024-05-07 19:09:32', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:10:46', NULL, '2024-05-09 14:29:19'); +INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'S0185624335', '1002', '手术室', 'SUCCESS!!!!!!!!!!', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', 'zxzxz111', '11111111111111111', '2024-05-01', '2024-05-30', '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:07:56'); +INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32'); + + +CREATE TABLE IF NOT EXISTS "thr_manufacturer" +( + "id" bigint NOT NULL AUTO_INCREMENT, + "unitId" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "spell" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "addr" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "creditNo" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "contact" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "mobile" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "thirdSysFk" varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + "createUser" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建人', + "createTime" datetime DEFAULT NULL COMMENT '创建时间', + "updateUser" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新人', + "updateTime" datetime DEFAULT NULL COMMENT '更新时间', + "remark" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY ("id") USING BTREE, + UNIQUE KEY "unique" ("unitId","thirdSysFk") USING BTREE +) ENGINE=InnoDB + AUTO_INCREMENT=1001 + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='第三方往来单位类型' + ROW_FORMAT=Dynamic; + + +CALL Pro_Temp_ColumnWork('sync_data_set', 'produceBusiness', + ' tinyint NULL DEFAULT NULL COMMENT ''生产企业信息''', + 1); From fe0beef80dc3953418b700b29e540dd7f091e9eb Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 10 May 2024 19:07:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?5-10=20=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=201.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dev/DeviceCheckController.java | 92 +++ .../dev/DeviceCheckDetailController.java | 81 +++ .../dev/DeviceCheckDetailItemController.java | 67 ++ .../controller/dev/DeviceInfoController.java | 406 ++++++++++++ .../controller/dev/DevicePlanController.java | 103 +++ .../dev/DevicePlanDetailController.java | 133 ++++ .../dev/DevicePlanDetailItemController.java | 173 +++++ .../dev/DeviceRepairApplyController.java | 113 ++++ .../DeviceRepairApplyDetailController.java | 68 ++ .../dev/DeviceRepairController.java | 75 +++ .../controller/thrsys/ThrManusController.java | 147 +++++ .../api/dao/dev/DeviceChangeLogMapper.java | 15 + .../dao/dev/DeviceCheckDetailItemMapper.java | 15 + .../api/dao/dev/DeviceCheckDetailMapper.java | 14 + .../dao/dev/DeviceCheckItemDictMapper.java | 17 + .../glxp/api/dao/dev/DeviceCheckMapper.java | 23 + .../glxp/api/dao/dev/DeviceInfoMapper.java | 33 + .../dao/dev/DevicePlanDetailItemMapper.java | 15 + .../api/dao/dev/DevicePlanDetailMapper.java | 25 + .../glxp/api/dao/dev/DevicePlanMapper.java | 20 + .../dev/DeviceRepairApplyDetailMapper.java | 18 + .../api/dao/dev/DeviceRepairApplyMapper.java | 18 + .../glxp/api/dao/dev/DeviceRepairMapper.java | 18 + .../api/dao/thrsys/ThrManufacturerMapper.java | 22 + .../api/entity/dev/DeviceChangeLogEntity.java | 155 +++++ .../entity/dev/DeviceChangeOrderEntity.java | 109 ++++ .../entity/dev/DeviceCheckDetailEntity.java | 198 ++++++ .../dev/DeviceCheckDetailItemEntity.java | 115 ++++ .../api/entity/dev/DeviceCheckEntity.java | 140 +++++ .../entity/dev/DeviceCheckItemDictEntity.java | 59 ++ .../glxp/api/entity/dev/DeviceInfoEntity.java | 589 ++++++++++++++++++ .../entity/dev/DevicePlanDetailEntity.java | 41 ++ .../dev/DevicePlanDetailItemEntity.java | 58 ++ .../glxp/api/entity/dev/DevicePlanEntity.java | 99 +++ .../dev/DeviceRepairApplyDetailEntity.java | 210 +++++++ .../entity/dev/DeviceRepairApplyEntity.java | 132 ++++ .../api/entity/dev/DeviceRepairEntity.java | 258 ++++++++ .../entity/thrsys/ThrManufacturerEntity.java | 76 +++ .../api/enums/dev/DeviceChangeStatusEnum.java | 27 + .../api/enums/dev/DeviceChangeTypeEnum.java | 24 + .../DeviceRepairApplyDetailStatusEnum.java | 24 + .../dev/DeviceRepairApplyStatusEnum.java | 24 + .../glxp/api/enums/dev/DeviceStatusEnum.java | 34 + .../dev/DeviceCheckDetailItemFinishParam.java | 33 + .../req/dev/DeviceCheckDetailItemQuery.java | 23 + .../api/req/dev/DeviceCheckDetailParam.java | 35 ++ .../api/req/dev/DeviceCheckDetailQuery.java | 17 + .../req/dev/DeviceCheckDetailRepairParam.java | 32 + .../api/req/dev/DeviceCheckItemDictQuery.java | 19 + .../glxp/api/req/dev/DeviceCheckQuery.java | 13 + .../dev/DeviceInfoDetailByDeptCodeQuery.java | 61 ++ .../api/req/dev/DeviceInfoDetailQuery.java | 71 +++ .../com/glxp/api/req/dev/DeviceInfoQuery.java | 28 + .../req/dev/DevicePlanDetailGroupQuery.java | 18 + .../req/dev/DevicePlanDetailItemParam.java | 84 +++ .../req/dev/DevicePlanDetailItemQuery.java | 26 + .../api/req/dev/DevicePlanDetailParam.java | 56 ++ .../api/req/dev/DevicePlanDetailQuery.java | 25 + .../com/glxp/api/req/dev/DevicePlanParam.java | 98 +++ .../com/glxp/api/req/dev/DevicePlanQuery.java | 16 + .../req/dev/DeviceRepairApplyAddParam.java | 109 ++++ .../dev/DeviceRepairApplyConfirmParam.java | 21 + ...DeviceRepairApplyDetailDiagnosisParam.java | 55 ++ .../req/dev/DeviceRepairApplyDetailQuery.java | 15 + .../req/dev/DeviceRepairApplyHallQuery.java | 16 + .../api/req/dev/DeviceRepairApplyQuery.java | 36 ++ .../glxp/api/req/dev/DeviceRepairQuery.java | 25 + .../thrsys/FilterBasicProducstRequest.java | 31 + .../api/req/thrsys/ThrManuFilterRequest.java | 46 ++ .../sync/SpsSyncProBusinessDataResponse.java | 17 + .../service/dev/DeviceChangeLogService.java | 11 + .../dev/DeviceCheckDetailItemService.java | 31 + .../service/dev/DeviceCheckDetailService.java | 35 ++ .../dev/DeviceCheckItemDictService.java | 15 + .../api/service/dev/DeviceCheckService.java | 31 + .../api/service/dev/DeviceInfoService.java | 107 ++++ .../dev/DevicePlanDetailItemService.java | 16 + .../service/dev/DevicePlanDetailService.java | 27 + .../api/service/dev/DevicePlanService.java | 20 + .../dev/DeviceRepairApplyDetailService.java | 33 + .../service/dev/DeviceRepairApplyService.java | 39 ++ .../api/service/dev/DeviceRepairService.java | 33 + .../dev/impl/DeviceChangeLogServiceImpl.java | 20 + .../DeviceCheckDetailItemServiceImpl.java | 140 +++++ .../impl/DeviceCheckDetailServiceImpl.java | 147 +++++ .../impl/DeviceCheckItemDictServiceImpl.java | 36 ++ .../dev/impl/DeviceCheckServiceImpl.java | 216 +++++++ .../dev/impl/DeviceInfoServiceImpl.java | 236 +++++++ .../impl/DevicePlanDetailItemServiceImpl.java | 50 ++ .../dev/impl/DevicePlanDetailServiceImpl.java | 98 +++ .../dev/impl/DevicePlanServiceImpl.java | 61 ++ .../DeviceRepairApplyDetailServiceImpl.java | 141 +++++ .../impl/DeviceRepairApplyServiceImpl.java | 154 +++++ .../dev/impl/DeviceRepairServiceImpl.java | 94 +++ .../thrsys/ThrManufacturerService.java | 157 +++++ .../java/com/glxp/api/util/SnowflakeUtil.java | 18 + .../glxp/api/vo/dev/DeviceChangeLogVo.java | 18 + .../glxp/api/vo/dev/DeviceChangeOrderVo.java | 31 + .../glxp/api/vo/dev/DeviceCheckPrintVo.java | 33 + .../com/glxp/api/vo/dev/DeviceCheckVo.java | 11 + .../com/glxp/api/vo/dev/DeviceInfoVo.java | 21 + .../glxp/api/vo/dev/DevicePlanDetailVo.java | 82 +++ .../com/glxp/api/vo/dev/DevicePlanVo.java | 21 + .../api/vo/dev/DeviceRepairApplyDetailVo.java | 17 + .../glxp/api/vo/dev/DeviceRepairApplyVo.java | 17 + .../mapper/dev/DeviceChangeLogMapper.xml | 30 + .../dev/DeviceCheckDetailItemMapper.xml | 19 + .../mapper/dev/DeviceCheckDetailMapper.xml | 6 + .../mybatis/mapper/dev/DeviceCheckMapper.xml | 53 ++ .../mybatis/mapper/dev/DeviceInfoMapper.xml | 127 ++++ .../mapper/dev/DevicePlanDetailItemMapper.xml | 18 + .../mapper/dev/DevicePlanDetailMapper.xml | 54 ++ .../mybatis/mapper/dev/DevicePlanMapper.xml | 39 ++ .../dev/DeviceRepairApplyDetailMapper.xml | 48 ++ .../mapper/dev/DeviceRepairApplyMapper.xml | 32 + .../mybatis/mapper/dev/DeviceRepairMapper.xml | 7 + .../mapper/thrsys/ThrManufacturerMapper.xml | 62 ++ 117 files changed, 7821 insertions(+) create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceCheckController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailItemController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DevicePlanController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DevicePlanDetailController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DevicePlanDetailItemController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java create mode 100644 src/main/java/com/glxp/api/controller/thrsys/ThrManusController.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceChangeLogMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailItemMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceCheckItemDictMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceCheckMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceInfoMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DevicePlanDetailItemMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DevicePlanDetailMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DevicePlanMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceRepairMapper.java create mode 100644 src/main/java/com/glxp/api/dao/thrsys/ThrManufacturerMapper.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceChangeLogEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceChangeOrderEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailItemEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceCheckEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceInfoEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DevicePlanDetailEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java create mode 100644 src/main/java/com/glxp/api/entity/thrsys/ThrManufacturerEntity.java create mode 100644 src/main/java/com/glxp/api/enums/dev/DeviceChangeStatusEnum.java create mode 100644 src/main/java/com/glxp/api/enums/dev/DeviceChangeTypeEnum.java create mode 100644 src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyDetailStatusEnum.java create mode 100644 src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyStatusEnum.java create mode 100644 src/main/java/com/glxp/api/enums/dev/DeviceStatusEnum.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemFinishParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailRepairParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceInfoDetailByDeptCodeQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceInfoQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanDetailGroupQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanDetailParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanDetailQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DevicePlanQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyConfirmParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairQuery.java create mode 100644 src/main/java/com/glxp/api/req/thrsys/FilterBasicProducstRequest.java create mode 100644 src/main/java/com/glxp/api/req/thrsys/ThrManuFilterRequest.java create mode 100644 src/main/java/com/glxp/api/res/sync/SpsSyncProBusinessDataResponse.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceChangeLogService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceCheckDetailItemService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceCheckItemDictService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceCheckService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceInfoService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DevicePlanDetailItemService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DevicePlanDetailService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DevicePlanService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceRepairService.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceChangeLogServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailItemServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceCheckItemDictServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceCheckServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceInfoServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailItemServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DevicePlanServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceRepairServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/thrsys/ThrManufacturerService.java create mode 100644 src/main/java/com/glxp/api/util/SnowflakeUtil.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceChangeLogVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceChangeOrderVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceCheckPrintVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceCheckVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceInfoVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DevicePlanDetailVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DevicePlanVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyDetailVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyVo.java create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceChangeLogMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceCheckDetailItemMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceCheckDetailMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceCheckMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceInfoMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DevicePlanDetailItemMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DevicePlanDetailMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DevicePlanMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceRepairApplyMapper.xml create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceRepairMapper.xml create mode 100644 src/main/resources/mybatis/mapper/thrsys/ThrManufacturerMapper.xml diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceCheckController.java b/src/main/java/com/glxp/api/controller/dev/DeviceCheckController.java new file mode 100644 index 00000000..ea46dca3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceCheckController.java @@ -0,0 +1,92 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.req.dev.DeviceCheckQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceCheckService; +import com.glxp.api.vo.dev.DeviceCheckPrintVo; +import com.glxp.api.vo.dev.DeviceCheckVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceCheckController extends BaseController { + + private final DeviceCheckService deviceCheckService; + + /** + * 巡检任务单列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/page") + public BaseResponse page(@RequestBody DeviceCheckQuery query) { + List list = deviceCheckService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 本部门巡检任务单列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/pageByDept") + public BaseResponse pageByDept(@RequestBody DeviceCheckQuery query) { + AuthAdmin user = super.getUser(); + query.setChargeDeptCode(user.getLocDeptCode()); + List list = deviceCheckService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 根据计划id生成巡检任务单 + * + * @param planId 计划id + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/check/gen/{planId}") + public BaseResponse genDeviceCheck(@PathVariable Long planId) { + AuthAdmin user = super.getUser(); + deviceCheckService.genByPlanId(planId, false, user); + return ResultVOUtils.successMsg("操作成功"); + } + + @AuthRuleAnnotation("") + @GetMapping("/udi/device/check/info/print/{taskId}") + public BaseResponse checkInfoPrint(@PathVariable Long taskId) { + DeviceCheckPrintVo vo = deviceCheckService.checkInfoPrint(taskId, null); + return ResultVOUtils.success(vo); + } + + @AuthRuleAnnotation("") + @GetMapping("/udi/device/check/info/print/{taskId}/{deviceCode}") + public BaseResponse checkInfoPrint(@PathVariable Long taskId, @PathVariable String deviceCode) { + DeviceCheckPrintVo vo = deviceCheckService.checkInfoPrint(taskId, deviceCode); + return ResultVOUtils.success(vo); + } + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailController.java b/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailController.java new file mode 100644 index 00000000..bbe800d1 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailController.java @@ -0,0 +1,81 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.req.dev.DeviceCheckDetailParam; +import com.glxp.api.req.dev.DeviceCheckDetailQuery; +import com.glxp.api.req.dev.DeviceCheckDetailRepairParam; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceCheckDetailItemService; +import com.glxp.api.service.dev.DeviceCheckDetailService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceCheckDetailController extends BaseController { + + private final DeviceCheckDetailService deviceCheckDetailService; + private final DeviceCheckDetailItemService deviceCheckDetailItemService; + + /** + * 巡检任务单明细列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/page") + public BaseResponse page(@RequestBody @Valid DeviceCheckDetailQuery query) { + List list = deviceCheckDetailService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 巡检任务单明细--创建维修单 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/repair") + public BaseResponse repair(@RequestBody @Valid DeviceCheckDetailRepairParam param) { + AuthAdmin user = super.getUser(); + deviceCheckDetailService.repair(param, user); + return ResultVOUtils.successMsg("创建成功"); + } + + /** + * 完成巡检任务单明细项目 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/finish") + public BaseResponse finish(@RequestBody @Valid DeviceCheckDetailParam param) { + AuthAdmin user = super.getUser(); + deviceCheckDetailItemService.finishAll(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailItemController.java b/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailItemController.java new file mode 100644 index 00000000..b7b439d4 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceCheckDetailItemController.java @@ -0,0 +1,67 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; +import com.glxp.api.req.dev.DeviceCheckDetailItemFinishParam; +import com.glxp.api.req.dev.DeviceCheckDetailItemQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceCheckDetailItemService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 设备巡检单明细 + */ +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceCheckDetailItemController extends BaseController { + + private final DeviceCheckDetailItemService deviceCheckDetailItemService; + + /** + * 巡检任务单明细项目列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/item/page") + public BaseResponse page(@RequestBody @Valid DeviceCheckDetailItemQuery query) { + List list = deviceCheckDetailItemService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 完成巡检任务单明细项目 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/item/finish") + public BaseResponse page(@RequestBody @Valid DeviceCheckDetailItemFinishParam param) { + AuthAdmin user = super.getUser(); + deviceCheckDetailItemService.finish(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java new file mode 100644 index 00000000..44e23efc --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java @@ -0,0 +1,406 @@ +package com.glxp.api.controller.dev; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.RandomUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceChangeLogEntity; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery; +import com.glxp.api.req.dev.DeviceInfoDetailQuery; +import com.glxp.api.req.dev.DeviceInfoQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceChangeLogService; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.util.JasperUtils; +import com.glxp.api.vo.dev.DeviceChangeLogVo; +import com.glxp.api.vo.dev.DeviceInfoVo; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.WriterException; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RestController +@RequestMapping +@RequiredArgsConstructor +@Slf4j +public class DeviceInfoController extends BaseController { + + private final DeviceInfoService deviceInfoService; + private final DeviceChangeLogService deviceChangeLogService; + + + @Value("${file_path}") + private String filePath; + + /** + * 生成一个设备号 + * + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/code/gen") + public BaseResponse genDeviceCode() { + String deviceCode = ""; + DeviceInfoEntity deviceInfo = null; + do { + deviceCode = "S" + RandomUtil.randomNumbers(10); + deviceInfo = deviceInfoService.getById(deviceCode); + } while (deviceInfo != null); + return ResultVOUtils.success(deviceCode); + } + + /** + * 本科室设备 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/page") + public BaseResponse page(@RequestBody DeviceInfoQuery query) { + AuthAdmin user = super.getUser(); + List list = deviceInfoService.pageVo(query, user.getLocDeptCode()); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 所有科室设备 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/all/page") + public BaseResponse allPage(@RequestBody DeviceInfoQuery query) { + AuthAdmin user = super.getUser(); + List list = deviceInfoService.allPageVo(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 查看当前用户所在科室设备详情 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/detailByUser/page") + public BaseResponse detailByUser(@RequestBody @Valid DeviceInfoDetailQuery query) { + AuthAdmin user = super.getUser(); + query.setDeptCode(user.getLocDeptCode()); + List list = deviceInfoService.detail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 查看当前科室设备详情 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/detailByDeptCode/page") + public BaseResponse detailByDeptCode(@RequestBody @Valid DeviceInfoDetailByDeptCodeQuery query) { + List list = deviceInfoService.detail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 查看所有科室设备--设备码级别 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/detailInfo/page") + public BaseResponse detailInfoPage(@RequestBody DeviceInfoDetailQuery query) { + AuthAdmin user = super.getUser(); + query.setDeptCode(user.getLocDeptCode()); + List list = deviceInfoService.detail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备详情 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/detail/page") + public BaseResponse detail(@RequestBody @Valid DeviceInfoDetailQuery query) { +// AuthAdmin user = super.getUser(); + List list = deviceInfoService.detail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 获取设备变更日志 + * + * @param deviceCode 设备编码 + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/log/{deviceCode}") + public BaseResponse deviceLogs(@PathVariable String deviceCode) { + List logList = deviceChangeLogService.list(Wrappers.lambdaQuery(DeviceChangeLogEntity.class) + .eq(DeviceChangeLogEntity::getDeviceCode, deviceCode) + .orderByDesc(DeviceChangeLogEntity::getCreateTime) + ); + return ResultVOUtils.success(BeanUtil.copyToList(logList, DeviceChangeLogVo.class)); + } + + /** + * 生成设备二维码 + * + * @param deviceCode + * @throws WriterException + */ + @GetMapping("/udi/device/genQR/{deviceCode}") + public BaseResponse genQRImage(@PathVariable String deviceCode) throws WriterException { + DeviceInfoEntity deviceInfo = deviceInfoService.getById(deviceCode); + if (deviceInfo == null) { + throw new JsonException("未找到该设备,无法生成"); + } + String text = deviceInfo.getDeviceCode(); + // 二维码大小 + int width = 500, height = 500; + Map hints = new HashMap<>(); + //内容编码格式 + hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); + // 指定纠错等级 + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); + //设置二维码边的空度,非负数 + hints.put(EncodeHintType.MARGIN, 1); + + // 生成二维码图片 + QRCodeWriter writer = new QRCodeWriter(); + BitMatrix bm = writer.encode(text, BarcodeFormat.QR_CODE, width, height, hints); + + int margin = 10; + int tempM = margin * 2; + int[] rec = bm.getEnclosingRectangle(); //获取二维码图案的属性 + int resWidth = rec[2] + tempM; + int resHeight = rec[3] + tempM; + BitMatrix resMatrix = new BitMatrix(resWidth, resHeight); // 按照自定义边框生成新的BitMatrix + resMatrix.clear(); + for (int i = margin; i < resWidth - margin; i++) { //循环,将二维码图案绘制到新的bitMatrix中 + for (int j = margin; j < resHeight - margin; j++) { + if (bm.get(i - margin + rec[0], j - margin + rec[1])) { + resMatrix.set(i, j); + } + } + } + bm = resMatrix; + + int w = bm.getWidth(); + int h = bm.getHeight(); + BufferedImage qrcodeBuffImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + + // 开始利用二维码数据创建Bitmap图片 + for (int x = 0; x < w; x++) { + for (int y = 0; y < h; y++) { + qrcodeBuffImg.setRGB(x, y, bm.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); + } + } + // 新的图片,二维码下面加上文字 + String desc = String.format("设备编码:%s", deviceCode); + String desc1 = String.format("设备名称:%s", deviceInfo.getProductName()); + String desc2 = String.format("设备规格:%s", deviceInfo.getGgxh()); + String[] descArr = {desc, desc1, desc2}; + // 字体、字型、字号 + Font font = new Font("宋体", Font.BOLD, 26); + int textHeight = font.getSize(); + int textMargin = 10; + BufferedImage outImage = new BufferedImage(qrcodeBuffImg.getWidth(), qrcodeBuffImg.getHeight() + textHeight + (textMargin * 2), BufferedImage.TYPE_4BYTE_ABGR); + Graphics2D outg = outImage.createGraphics(); + outg.setFont(font); + FontMetrics fontMetrics = outg.getFontMetrics(); + int lineCount = 1; + int lineWidth = outImage.getWidth() - textMargin * 2; + int hasWidth = lineWidth; + HashMap hashMap = new HashMap<>(); + for (String item : descArr) { + for (String s : item.split("")) { + int strWidth = fontMetrics.stringWidth(s); + hasWidth -= strWidth; + if (hasWidth <= 0) { + hasWidth = lineWidth; + lineCount += 1; + hasWidth -= strWidth; + } + Integer i = hashMap.putIfAbsent(lineCount, 1); + if (i != null) { + hashMap.put(lineCount, i + 1); + } + } + hasWidth = lineWidth; + lineCount += 1; + } + lineCount -= 1; + desc = desc.concat(desc1).concat(desc2); + outImage = new BufferedImage(qrcodeBuffImg.getWidth(), qrcodeBuffImg.getHeight() + lineCount * textHeight + (textMargin * (lineCount + 1)), BufferedImage.TYPE_4BYTE_ABGR); + outg = outImage.createGraphics(); + outg.setFont(font); + for (int x = 0; x < outImage.getWidth(); x++) { + for (int y = 0; y < outImage.getHeight(); y++) { + outImage.setRGB(x, y, 0xFFFFFFFF); + } + } + // 画二维码到新的面板 + outg.drawImage(qrcodeBuffImg, 0, 0, qrcodeBuffImg.getWidth(), qrcodeBuffImg.getHeight(), null); + outg.setColor(Color.BLACK); + outg.setBackground(Color.WHITE); + int startIndex = 0; + for (int i = 0; i < lineCount; i++) { + Integer length = hashMap.get(i + 1); + String line = desc.substring(startIndex, startIndex + length); + if (length != null) { + startIndex += length.intValue(); + } +// outg.drawString(line, (outImage.getWidth() - fontMetrics.stringWidth(line) - textMargin) / 2, qrcodeBuffImg.getHeight() + textMargin + (i * textHeight) + (i + 2) * textMargin); + outg.drawString(line, textMargin, qrcodeBuffImg.getHeight() + textMargin + (i * textHeight) + (i + 2) * textMargin); + } + outg.dispose(); + try { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ImageIO.write(outImage, "png", byteArrayOutputStream); + byte[] imageBytes = byteArrayOutputStream.toByteArray(); + + // 使用Base64编码器将字节数组编码为Base64字符串 + String base64String = Base64.getEncoder().encodeToString(imageBytes); + return ResultVOUtils.success("data:image/png;base64," + base64String); + } catch (IOException e) { + log.error("e"); + throw new JsonException("系统异常"); + } + } + + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + + /** + * 设备标签打印 + * + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inv/deptDev/label/print") + public BaseResponse printLabel(@RequestBody DeviceInfoDetailQuery query, HttpServletRequest request, HttpServletResponse response) throws Exception { + + List list = deviceInfoService.detail(query); + if (CollUtil.isEmpty(list)) { + throw new JsonException("未找到该设备,无法生成"); + } + DeviceInfoVo obj = list.get(0); + SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(query.getLabelId() + ""); + if (null == sysPdfTemplateRelevanceLabelEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + + //打印单号标签 + Map data = new HashMap<>(1); + Map supData = new HashMap<>(); + supData.put("deviceCode", obj.getDeviceCode() == null ? ' ' : obj.getDeviceCode()); + supData.put("deptName", obj.getDeptName() == null ? ' ' : obj.getDeptName()); + supData.put("productName", obj.getProductName() == null ? ' ' : obj.getProductName()); + supData.put("ggxh", obj.getGgxh() == null ? ' ' : obj.getGgxh()); + supData.put("productionDate", obj.getProductionDate() == null ? ' ' : obj.getProductionDate()); + supData.put("expireDate", obj.getExpireDate() == null ? ' ' : obj.getExpireDate()); + supData.put("batchNo", obj.getBatchNo() == null ? ' ' : obj.getBatchNo()); + supData.put("serialNo", obj.getSerialNo() == null ? ' ' : obj.getSerialNo()); + supData.put("manufactory", obj.getManufactory() == null ? ' ' : obj.getManufactory()); + supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname()); + supData.put("zczbhhzbapzbh", obj.getZczbhhzbapzbh() == null ? ' ' : obj.getZczbhhzbapzbh()); + supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName()); + data.put("data", supData); + String param = JSON.toJSONString(data); + log.error(param); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + + /** + * 更新明细 + * + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/info/update") + public BaseResponse updateOrderItem(@RequestBody DeviceInfoEntity entity) { + entity.setUpdateTime(LocalDateTime.now()); + deviceInfoService.updateOrderItem(entity); + return ResultVOUtils.successMsg("保存成功!"); + } +} diff --git a/src/main/java/com/glxp/api/controller/dev/DevicePlanController.java b/src/main/java/com/glxp/api/controller/dev/DevicePlanController.java new file mode 100644 index 00000000..edc9ca16 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DevicePlanController.java @@ -0,0 +1,103 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.req.dev.DevicePlanParam; +import com.glxp.api.req.dev.DevicePlanQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.auth.DeptService; +import com.glxp.api.service.dev.DevicePlanService; +import com.glxp.api.vo.dev.DevicePlanVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@RestController +@RequestMapping +@RequiredArgsConstructor +@Slf4j +public class DevicePlanController extends BaseController { + + private final DevicePlanService devicePlanService; + private final DeptService deptService; + + + /** + * 设备巡检计划分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/page") + public BaseResponse page(@RequestBody @Valid DevicePlanQuery query) { + List list = devicePlanService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备巡检计划保存 + * + * @param param 参数 + * @return 计划id + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/save") + public BaseResponse save(@RequestBody @Valid DevicePlanParam param) { + AuthAdmin user = super.getUser(); + param.valid(deptService); + DevicePlanEntity entity = param.getEntity(user); + if (param.getPlanId() == null) { + devicePlanService.save(entity); + } else { + devicePlanService.updateById(entity); + } + return ResultVOUtils.success("保存成功", entity.getPlanId()); + } + + + /** + * 设备巡检计划详情 + * + * @param planId 计划id + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/plan/info/{planId}") + public BaseResponse info(@PathVariable Long planId) { + DevicePlanEntity entity = devicePlanService.getById(planId); + if (entity == null) { + return ResultVOUtils.error("计划不存在"); + } + return ResultVOUtils.success(entity); + } + + + /** + * 设备巡检计划删除 + * + * @param planId 计划id + * @return + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/plan/del/{planId}") + public BaseResponse del(@PathVariable Long planId) { + devicePlanService.deletePlan(planId); + return ResultVOUtils.successMsg("删除成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailController.java b/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailController.java new file mode 100644 index 00000000..094550a6 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailController.java @@ -0,0 +1,133 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.req.dev.DevicePlanDetailGroupQuery; +import com.glxp.api.req.dev.DevicePlanDetailParam; +import com.glxp.api.req.dev.DevicePlanDetailQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DevicePlanDetailService; +import com.glxp.api.service.dev.DevicePlanService; +import com.glxp.api.vo.dev.DevicePlanDetailVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 设备计划明细 + * data: 2023/11/12 + */ +@RestController +@RequestMapping +@RequiredArgsConstructor +@Slf4j +public class DevicePlanDetailController extends BaseController { + + private final DeviceInfoService deviceInfoService; + private final DevicePlanService devicePlanService; + private final DevicePlanDetailService devicePlanDetailService; + + + /** + * 设备巡检计划分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detailGroup/page") + public BaseResponse pageGroup(@RequestBody @Valid DevicePlanDetailGroupQuery query) { + List list = devicePlanDetailService.pageGroupVo(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备巡检计划明细分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/page") + public BaseResponse pageGroup(@RequestBody @Valid DevicePlanDetailQuery query) { + List list = devicePlanDetailService.pageVo(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备巡检计划明细新增 + * + * @param param 参数 + * @return 计划id + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/add") + public BaseResponse add(@RequestBody @Valid DevicePlanDetailParam param) { + + + DevicePlanEntity entity = null; + if (!param.valid(devicePlanService)) { + AuthAdmin user = super.getUser(); + entity = param.getDevicePlanParam().getEntity(user); + devicePlanService.save(entity); + param.getDevicePlanParam().setPlanId(entity.getPlanId()); + param.setPlanId(entity.getPlanId()); + } else { + entity = devicePlanService.getById(param.getPlanId()); + } + param.valid(devicePlanService); + List list = param.getEntity(deviceInfoService); + devicePlanDetailService.replaceBatch(list); + return ResultVOUtils.success(entity); + } + + + /** + * 设备巡检计划明细删除 + * + * @param planId 计划id + * @param productId 产品id + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/plan/detail/delByProductId/{planId}/{productId}") + public BaseResponse delByProductId(@PathVariable Long planId, @PathVariable Long productId) { + devicePlanDetailService.delByProductId(planId, productId); + return ResultVOUtils.successMsg("删除成功"); + } + + + /** + * 设备巡检计划明细删除 + * + * @param planId 计划id + * @param deviceCode 设备编码 + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/plan/detail/delByDeviceCode/{planId}/{deviceCode}") + public BaseResponse delByDeviceCode(@PathVariable Long planId, @PathVariable String deviceCode) { + devicePlanDetailService.delByDeviceCode(planId, deviceCode); + return ResultVOUtils.successMsg("删除成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailItemController.java b/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailItemController.java new file mode 100644 index 00000000..f5639f86 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DevicePlanDetailItemController.java @@ -0,0 +1,173 @@ +package com.glxp.api.controller.dev; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.dev.DeviceCheckItemDictEntity; +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; +import com.glxp.api.req.dev.DevicePlanDetailItemParam; +import com.glxp.api.req.dev.DevicePlanDetailItemQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceCheckItemDictService; +import com.glxp.api.service.dev.DevicePlanDetailItemService; +import com.glxp.api.service.dev.DevicePlanDetailService; +import com.glxp.api.vo.dev.DevicePlanDetailVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 设备管理 + * data: 2023/11/10 + */ +@RestController +@RequestMapping +@RequiredArgsConstructor +@Slf4j +public class DevicePlanDetailItemController extends BaseController { + + private final DevicePlanDetailService devicePlanDetailService; + private final DevicePlanDetailItemService devicePlanDetailItemService; + private final DeviceCheckItemDictService deviceCheckItemDictService; + + + /** + * 设备巡检计划明细项目分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/item/group/page") + public BaseResponse groupPage(@RequestBody @Valid DevicePlanDetailItemQuery query) { + List list = devicePlanDetailItemService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备巡检计划明细项目分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/item/page") + public BaseResponse page(@RequestBody @Valid DevicePlanDetailItemQuery query) { + List list = devicePlanDetailItemService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备巡检计划明细项目新增 + * + * @param param 参数 + * @return 计划id + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/item/add") + public BaseResponse add(@RequestBody @Valid DevicePlanDetailItemParam param) { + param.valid(devicePlanDetailService); + List entityList = param.getEntity(deviceCheckItemDictService); + if (StrUtil.isBlank(param.getDeviceCode())) { + devicePlanDetailItemService.replaceBatch(entityList); + } else { + devicePlanDetailItemService.insertIgnoreBatch(entityList); + } + return ResultVOUtils.successMsg("添加成功"); + } + + /** + * 设备巡检计划明细项目批量新增 + * + * @param param 参数 + * @return 计划id + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/plan/detail/item/batch/add") + public BaseResponse batchAdd(@RequestBody @Valid DevicePlanDetailItemParam param) { + List list = devicePlanDetailService.listByPlanId(param.getPlanId()); + if (CollUtil.isNotEmpty(list)) { + for (DevicePlanDetailVo item : list) { + List itemDictEntities = deviceCheckItemDictService.listByIds(param.getItemCodes()); + List entityList = new ArrayList<>(); + itemDictEntities.forEach(i -> { + DevicePlanDetailItemEntity build = DevicePlanDetailItemEntity.builder() + .planId(param.getPlanId()) + .productId(item.getProductId()) + .deviceCode(StrUtil.blankToDefault(item.getDeviceCode(), "")) + .itemCode(i.getCode()) + .name(i.getName()) + .content(i.getContent()) + .build(); + entityList.add(build); + }); + if (StrUtil.isBlank(param.getDeviceCode())) { + devicePlanDetailItemService.replaceBatch(entityList); + } else { + devicePlanDetailItemService.insertIgnoreBatch(entityList); + } + } + + } + return ResultVOUtils.successMsg("添加成功"); + } + + + /** + * 设备巡检计划明细项目删除 + * + * @param planId 计划id + * @param productId 产品id + * @param itemCode 项目编码 + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/plan/detail/item/delByProduct/{planId}/{productId}/{itemCode}") + public BaseResponse delByProduct(@PathVariable Long planId, @PathVariable Long productId, @PathVariable String itemCode) { + devicePlanDetailItemService.remove(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + .eq(DevicePlanDetailItemEntity::getProductId, productId) + .eq(DevicePlanDetailItemEntity::getItemCode, itemCode) + ); + return ResultVOUtils.successMsg("删除成功"); + } + + + /** + * 设备巡检计划明细项目删除 + * + * @param planId 计划id + * @param deviceCode 设备编码 + * @param itemCode 项目编码 + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/plan/detail/item/delByDevice/{planId}/{deviceCode}/{itemCode}") + public BaseResponse delByDevice(@PathVariable Long planId, @PathVariable String deviceCode, @PathVariable String itemCode) { + devicePlanDetailItemService.remove(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + .eq(DevicePlanDetailItemEntity::getDeviceCode, deviceCode) + .eq(DevicePlanDetailItemEntity::getItemCode, itemCode) + ); + return ResultVOUtils.successMsg("删除成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java new file mode 100644 index 00000000..cbc018e5 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java @@ -0,0 +1,113 @@ +package com.glxp.api.controller.dev; + +import cn.hutool.core.bean.BeanUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.req.dev.DeviceRepairApplyAddParam; +import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; +import com.glxp.api.req.dev.DeviceRepairApplyHallQuery; +import com.glxp.api.req.dev.DeviceRepairApplyQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceRepairApplyService; +import com.glxp.api.vo.dev.DeviceRepairApplyVo; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@RestController +@RequestMapping +@RequiredArgsConstructor +public class DeviceRepairApplyController extends BaseController { + + private final DeviceRepairApplyService deviceRepairApplyService; + + /** + * 本部门的报修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/page") + public BaseResponse page(@RequestBody DeviceRepairApplyQuery query) { + AuthAdmin user = super.getUser(); + query.setApplyDeptCode(user.getLocDeptCode()); + List list = deviceRepairApplyService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(BeanUtil.copyToList(pageInfo.getList(), DeviceRepairApplyVo.class)); + return ResultVOUtils.success(page); + } + + /** + * 报修单大厅 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/hall/page") + public BaseResponse adminPage(@RequestBody DeviceRepairApplyHallQuery query) { + DeviceRepairApplyQuery applyQuery = new DeviceRepairApplyQuery(); + applyQuery.setStatus(DeviceRepairApplyStatusEnum.WAIT_PROCESS); + applyQuery.setApplyId(query.getApplyId()); + applyQuery.setApplyDeptCode(query.getApplyDeptCode()); + List list = deviceRepairApplyService.pageList(applyQuery); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(BeanUtil.copyToList(pageInfo.getList(), DeviceRepairApplyVo.class)); + return ResultVOUtils.success(page); + } + + /** + * 我受理的报修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/confirmByUser/page") + public BaseResponse confirmByUserPage(@RequestBody DeviceRepairApplyQuery query) { + AuthAdmin user = super.getUser(); + query.setConfirmUserId(user.getId()); + List list = deviceRepairApplyService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(BeanUtil.copyToList(pageInfo.getList(), DeviceRepairApplyVo.class)); + return ResultVOUtils.success(page); + } + + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/add") + public BaseResponse addDeviceRepairApply(@RequestBody @Valid DeviceRepairApplyAddParam param) { + AuthAdmin user = super.getUser(); + deviceRepairApplyService.addDeviceRepairApply(param, user); + return ResultVOUtils.successMsg("创建成功"); + } + + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/confirm") + public BaseResponse confirmDeviceRepairApply(@RequestBody @Valid DeviceRepairApplyConfirmParam param) { + AuthAdmin user = super.getUser(); + deviceRepairApplyService.confirmDeviceRepairApply(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java new file mode 100644 index 00000000..5cc3f6ae --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java @@ -0,0 +1,68 @@ +package com.glxp.api.controller.dev; + +import cn.hutool.core.bean.BeanUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import com.glxp.api.vo.dev.DeviceRepairApplyDetailVo; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@RestController +@RequestMapping +@RequiredArgsConstructor +public class DeviceRepairApplyDetailController extends BaseController { + + private final DeviceRepairApplyDetailService deviceRepairApplyDetailService; + + /** + * 本部门的报修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/detail/page") + public BaseResponse page(@RequestBody @Valid DeviceRepairApplyDetailQuery query) { + + List list = deviceRepairApplyDetailService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(BeanUtil.copyToList(pageInfo.getList(), DeviceRepairApplyDetailVo.class)); + return ResultVOUtils.success(page); + } + + + /** + * 诊断设备 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/detail/diagnosis") + public BaseResponse diagnosis(@RequestBody @Valid DeviceRepairApplyDetailDiagnosisParam param) { + AuthAdmin user = super.getUser(); + deviceRepairApplyDetailService.diagnosis(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java new file mode 100644 index 00000000..fec31848 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java @@ -0,0 +1,75 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairEntity; +import com.glxp.api.req.dev.DeviceRepairQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceRepairService; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Slf4j +@RestController +@RequestMapping +@RequiredArgsConstructor +public class DeviceRepairController extends BaseController { + + private final DeviceRepairService deviceRepairService; + + /** + * 我的维修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/byUser/page") + public BaseResponse pageByUser(@RequestBody DeviceRepairQuery query) { + AuthAdmin user = super.getUser(); + query.setCreateUserId(user.getId()); + List list = deviceRepairService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 完成我的维修单 + * + * @param repairId 维修单id + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/repair/finishByUser/{repairId}") + public BaseResponse finishByUser(@PathVariable Long repairId) { + AuthAdmin user = super.getUser(); + deviceRepairService.finishByUser(repairId, user); + return ResultVOUtils.successMsg("操作成功"); + } + + + /** + * 维修单信息 + * + * @param repairId 维修单号 + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/repair/info/{repairId}") + public BaseResponse repairInfo(@PathVariable Long repairId) { + DeviceRepairEntity entity = deviceRepairService.getById(repairId); + return ResultVOUtils.success(entity); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrManusController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrManusController.java new file mode 100644 index 00000000..cd81a437 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrManusController.java @@ -0,0 +1,147 @@ +package com.glxp.api.controller.thrsys; + +import cn.hutool.core.thread.ThreadUtil; +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.entity.basic.BasicProductsEntity; +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; +import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; +import com.glxp.api.http.ErpBasicClient; +import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.req.thrsys.FilterBasicProducstRequest; +import com.glxp.api.req.thrsys.FilterThrCorpRequest; +import com.glxp.api.req.thrsys.ThrManuFilterRequest; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.thrsys.ThrManufacturerService; +import com.glxp.api.service.thrsys.ThrSystemDetailService; +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 ThrManusController { + + + @Resource + ThrManufacturerService thrManufacturerService; + @Resource + private ThrSystemDetailService thrSystemDetailService; + @Resource + private ErpBasicClient erpBasicClient; + + + @GetMapping("/udiwms/thrsys/getManus") + public BaseResponse getManus(FilterThrCorpRequest filterThrCorpRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List thrManufacturerEntities + = thrManufacturerService.filterThrManu(filterThrCorpRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(thrManufacturerEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(thrManufacturerEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/thrsys/delManus") + public BaseResponse delCorps(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String id = deleteRequest.getId(); + thrManufacturerService.removeById(id); + return ResultVOUtils.success("删除成功"); + } + + + //选中或者下载全部 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/thrsys/manu/corpsDlAll") + public BaseResponse corpsDlAll(@RequestBody ThrManuFilterRequest thrManuFilterRequest) { + if (null == thrManuFilterRequest) { + return ResultVOUtils.error(500, "参数不能为空"); + } + ThreadUtil.execAsync(() -> { + try { + thrManufacturerService.downloadByRequest(thrManuFilterRequest); + } catch (Exception e) { + log.error("下载异常", e); + e.printStackTrace(); + } + + }); + return ResultVOUtils.success("后台正在下载,请稍后刷新查看!"); + } + + + //查询ERP往来单位 + @AuthRuleAnnotation("") + @GetMapping("/udiwms/manu/filterErp") + public BaseResponse filterErp(ThrManuFilterRequest thrManuFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + ThrSystemDetailEntity thrSystemDetailEntity = thrSystemDetailService.selectByKey("manuUrl", thrManuFilterRequest.getThirdSys()); + if (thrSystemDetailEntity == null || thrSystemDetailEntity.getValue() == null) + return ResultVOUtils.error(500, "生产企业接口地址未定义"); + if (thrSystemDetailEntity.getEnabled()) { + BaseResponse> udiDlDeviceResponse = erpBasicClient.getThrManu(thrManuFilterRequest); + if (udiDlDeviceResponse.getCode() == 20000) { + for (ThrManufacturerEntity item : udiDlDeviceResponse.getData().getList()) { + ThrManufacturerEntity thrManufacturerEntity = thrManufacturerService.getOne(new QueryWrapper().eq("unitId", item.getUnitId()).eq("thirdSysFk", thrManuFilterRequest.getThirdSys()).last("limit 1")); + if (thrManufacturerEntity != null) { + item.setChecked(true); + } else { + item.setChecked(false); + } + } + return udiDlDeviceResponse; + } else { + return udiDlDeviceResponse; + } + + } else { + return ResultVOUtils.error(500, "第三方系统往来单位服务接口未启用"); + } + } + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/thrsys/getBasicProducts") + public BaseResponse getProductTypes(FilterBasicProducstRequest basicProducstRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List thrManufacturerEntities + = thrManufacturerService.getProductTypes(basicProducstRequest); + PageInfo pageInfo; + pageInfo = new PageInfo(thrManufacturerEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(thrManufacturerEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + +} diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceChangeLogMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceChangeLogMapper.java new file mode 100644 index 00000000..e1ba1fc8 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceChangeLogMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceChangeLogEntity; + +/** +* 针对表【device_change_log(设备变更日志表)】的数据库操作Mapper +*/ +public interface DeviceChangeLogMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailItemMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailItemMapper.java new file mode 100644 index 00000000..8125d697 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailItemMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; + +/** +* 针对表【device_check_detail_item(设备巡检项目)】的数据库操作Mapper +*/ +public interface DeviceCheckDetailItemMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailMapper.java new file mode 100644 index 00000000..1b6fe018 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceCheckDetailMapper.java @@ -0,0 +1,14 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; + +/** +* 针对表【device_check_detail(巡检任务明细)】的数据库操作Mapper +*/ +public interface DeviceCheckDetailMapper extends BaseMapperPlus { +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceCheckItemDictMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceCheckItemDictMapper.java new file mode 100644 index 00000000..30acd478 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceCheckItemDictMapper.java @@ -0,0 +1,17 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceCheckItemDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 针对表【device_check_item_dict(巡检项目字典)】的数据库操作Mapper + */ +@Mapper +public interface DeviceCheckItemDictMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceCheckMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceCheckMapper.java new file mode 100644 index 00000000..12aba880 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceCheckMapper.java @@ -0,0 +1,23 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceCheckEntity; +import com.glxp.api.req.dev.DeviceCheckQuery; +import com.glxp.api.vo.dev.DeviceCheckVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* 针对表【device_check(巡检任务表)】的数据库操作Mapper +*/ +public interface DeviceCheckMapper extends BaseMapperPlus { + + List pageVo(DeviceCheckQuery query); + + DeviceCheckVo getVoById(@Param("taskId") Long taskId); +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceInfoMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceInfoMapper.java new file mode 100644 index 00000000..f8c82622 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceInfoMapper.java @@ -0,0 +1,33 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery; +import com.glxp.api.req.dev.DeviceInfoDetailQuery; +import com.glxp.api.req.dev.DeviceInfoQuery; +import com.glxp.api.vo.dev.DeviceInfoVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Set; + +/** + * 针对表【device_info(设备表)】的数据库操作Mapper + */ +public interface DeviceInfoMapper extends BaseMapperPlus { + + List pageVo(@Param("param") DeviceInfoQuery query, @Param("deptCode") String locDeptCode); + + List allPageVo(@Param("param") DeviceInfoQuery query); + + List detail(@Param("param") DeviceInfoDetailQuery query); + + List detail(@Param("param") DeviceInfoDetailByDeptCodeQuery query); + + List listVoByProductIdAndStatus(@Param("productId")Long productId, @Param("status")DeviceStatusEnum status); + + List listVoByCodes(@Param("list") List deviceCodes,@Param("deptCode") String deptCode,@Param("status") DeviceStatusEnum status); +} + diff --git a/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailItemMapper.java b/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailItemMapper.java new file mode 100644 index 00000000..cf78aab8 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailItemMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; + +/** + * 针对表【device_plan_detail_item(巡检设备的项目)】的数据库操作Mapper + */ +public interface DevicePlanDetailItemMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailMapper.java b/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailMapper.java new file mode 100644 index 00000000..cd64d317 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DevicePlanDetailMapper.java @@ -0,0 +1,25 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.req.dev.DevicePlanDetailGroupQuery; +import com.glxp.api.req.dev.DevicePlanDetailQuery; +import com.glxp.api.vo.dev.DevicePlanDetailVo; + +import java.util.List; + +/** + * 针对表【device_plan_detail(巡检计划明细)】的数据库操作Mapper + */ +public interface DevicePlanDetailMapper extends BaseMapperPlus { + + List pageGroupVo(DevicePlanDetailGroupQuery query); + + List pageVo(DevicePlanDetailQuery query); + + List listByPlanId(Long planId); +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DevicePlanMapper.java b/src/main/java/com/glxp/api/dao/dev/DevicePlanMapper.java new file mode 100644 index 00000000..461d550d --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DevicePlanMapper.java @@ -0,0 +1,20 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.req.dev.DevicePlanQuery; +import com.glxp.api.vo.dev.DevicePlanVo; + +import java.util.List; + +/** +* 针对表【device_plan(设备巡检计划)】的数据库操作Mapper +*/ +public interface DevicePlanMapper extends BaseMapperPlus { + + List pageVo(DevicePlanQuery query); +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java new file mode 100644 index 00000000..ea5d89a7 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java @@ -0,0 +1,18 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; + +/** +* @author Administrator +* @description 针对表【device_repair_apply_detail(设备报修单明细)】的数据库操作Mapper +* @createDate 2023-12-07 17:15:49 +* @Entity com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity +*/ +public interface DeviceRepairApplyDetailMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyMapper.java new file mode 100644 index 00000000..ce0aa9e7 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyMapper.java @@ -0,0 +1,18 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; + +/** +* @author Administrator +* @description 针对表【device_repair_apply(设备报修单)】的数据库操作Mapper +* @createDate 2023-12-07 17:15:49 +* @Entity com.glxp.api.entity.dev.DeviceRepairApplyEntity +*/ +public interface DeviceRepairApplyMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceRepairMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceRepairMapper.java new file mode 100644 index 00000000..9b7cd318 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceRepairMapper.java @@ -0,0 +1,18 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceRepairEntity; + +/** +* @author Administrator +* @description 针对表【device_repair(设备维修单)】的数据库操作Mapper +* @createDate 2023-12-07 17:15:49 +* @Entity com.glxp.api.entity.dev.DeviceRepairEntity +*/ +public interface DeviceRepairMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrManufacturerMapper.java b/src/main/java/com/glxp/api/dao/thrsys/ThrManufacturerMapper.java new file mode 100644 index 00000000..e38264b5 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrManufacturerMapper.java @@ -0,0 +1,22 @@ +package com.glxp.api.dao.thrsys; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.basic.BasicProductsEntity; +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; +import com.glxp.api.req.thrsys.FilterBasicProducstRequest; +import com.glxp.api.req.thrsys.FilterThrCorpRequest; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ThrManufacturerMapper extends BaseMapperPlus { + + List filterThrManu(FilterThrCorpRequest filterThrCorpRequest); + + ThrManufacturerEntity selectByUnitIdAndThirdId(@Param("unitId") String unitId, @Param("thirdId") String thirdId); + + List getProductTypes(FilterBasicProducstRequest basicProducstRequest); + +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceChangeLogEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceChangeLogEntity.java new file mode 100644 index 00000000..fa5808f2 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceChangeLogEntity.java @@ -0,0 +1,155 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.glxp.api.enums.dev.DeviceChangeTypeEnum; +import com.glxp.api.util.SnowflakeUtil; +import com.glxp.api.vo.dev.DeviceChangeOrderVo; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 设备变更日志表 + * + * @TableName device_change_log + */ +@TableName(value = "device_change_log") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceChangeLogEntity implements Serializable { + /** + * 日志id + */ + @TableId(value = "id") + private Long id; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * add:新增入库,change:变更归属 + */ + @TableField(value = "type") + private DeviceChangeTypeEnum type; + + /** + * 变更单号 + */ + @TableField(value = "changeOrderId") + private Long changeOrderId; + + /** + * 操作部门 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 操作部门 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 目标部门 + */ + @TableField(value = "toDeptCode") + private String toDeptCode; + + /** + * 目标部门 + */ + @TableField(value = "toDeptName") + private String toDeptName; + + /** + * 确认人id + */ + @TableField(value = "confirmUser") + private Long confirmUser; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * 确认备注 + */ + @TableField(value = "confirmRemark") + private String confirmRemark; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 操作人姓名 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 操作人id + */ + @TableField(value = "createUser") + private Long createUser; + + /** + * 操作时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** + * 生成日志实体 + * + * @param deviceCode 设备编码 + * @param order 变更单据VO(需包含(to)deptCode对应的(to)deptName) + * @return 日志实体 + */ + public static DeviceChangeLogEntity genEntity(String deviceCode, DeviceChangeOrderVo order) { + + return DeviceChangeLogEntity.builder() + .id(SnowflakeUtil.getId()) + .type(order.getType()) + .deviceCode(deviceCode) + .changeOrderId(order.getOrderId()) + .remark(order.getRemark()) + .deptCode(order.getDeptCode()) + .deptName(order.getDeptName()) + .toDeptCode(order.getToDeptCode()) + .toDeptName(order.getToDeptName()) + .confirmUser(order.getConfirmUser()) + .confirmUserName(order.getConfirmUserName()) + .confirmTime(order.getConfirmTime()) + .confirmRemark(order.getConfirmRemark()) + .createTime(order.getCreateTime()) + .createUserName(order.getCreateUserName()) + .createUser(order.getCreateUser()) + .build(); + } +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceChangeOrderEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceChangeOrderEntity.java new file mode 100644 index 00000000..6414c806 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceChangeOrderEntity.java @@ -0,0 +1,109 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.glxp.api.enums.dev.DeviceChangeStatusEnum; +import com.glxp.api.enums.dev.DeviceChangeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 设备变更单 + * + * @TableName device_change_order + */ +@TableName(value = "device_change_order") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceChangeOrderEntity implements Serializable { + /** + * 编码 + */ + @TableId(value = "orderId") + private Long orderId; + + /** + * add:新增入库,change:变更归属 + */ + @TableField(value = "type") + private DeviceChangeTypeEnum type; + + /** + * 1.待目标部门接收 ,2.完成(目标确认接收) ,3.目标部门拒收,4.取消 + */ + @TableField(value = "status") + private DeviceChangeStatusEnum status; + + /** + * 创建部门 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 目标部门 + */ + @TableField(value = "toDeptCode") + private String toDeptCode; + + /** + * 确认人id + */ + @TableField(value = "confirmUser") + private Long confirmUser; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * + */ + @TableField(value = "confirmRemark") + private String confirmRemark; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 创建人 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 创建人id + */ + @TableField(value = "createUser") + private Long createUser; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailEntity.java new file mode 100644 index 00000000..7fc16e8e --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailEntity.java @@ -0,0 +1,198 @@ +package com.glxp.api.entity.dev; + + +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.time.LocalDateTime; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 巡检任务明细 + * + * @TableName device_check_detail + */ +@TableName(value = "device_check_detail") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceCheckDetailEntity { + /** + * 任务id + */ + @TableField(value = "taskId") + private Long taskId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 部门名称 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 是否完成 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 生产厂家 + */ + @TableField(value = "manufactory") + private String manufactory; + + /** + * 计量单位 + */ + @TableField(value = "measname") + private String measname; + + /** + * 注册/备案凭证号 + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 供应商名称 + */ + @TableField(value = "supName") + private String supName; + + /** + * 巡检项目数量 + */ + @TableField(value = "itemCount") + private Integer itemCount; + + /** + * 完成项目数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 异常项目数量 + */ + @TableField(value = "exceptionCount") + private Integer exceptionCount; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 维修单id + */ + @TableField(value = "repairId") + private Long repairId; + + /** + * 巡检建议 + */ + @TableField(value = "suggestion") + private String suggestion; + /** + * 现场照片 + */ + @TableField(value = "livePath") + private String livePath; + /** + * 正常标识 + */ + @TableField(value = "normalFlag") + private Boolean normalFlag; + + + /** + * 更改时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; + +} + diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailItemEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailItemEntity.java new file mode 100644 index 00000000..8f8d8a41 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceCheckDetailItemEntity.java @@ -0,0 +1,115 @@ +package com.glxp.api.entity.dev; + + +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.time.LocalDateTime; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 设备巡检项目 + * + * @TableName device_check_detail_item + */ +@TableName(value = "device_check_detail_item") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceCheckDetailItemEntity { + /** + * 任务id + */ + @TableField(value = "taskId") + private Long taskId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 项目编码 + */ + @TableField(value = "itemCode") + private String itemCode; + + /** + * 项目名称 + */ + @TableField(value = "itemName") + private String itemName; + + /** + * 项目内容 + */ + @TableField(value = "itemContent") + private String itemContent; + + /** + * 正常标识 + */ + @TableField(value = "normalFlag") + private Boolean normalFlag; + + + /** + * 项目完成标识 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + + /** + * 项目完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 巡检建议 + */ + @TableField(value = "suggestion") + private String suggestion; + + /** + * 巡检人id + */ + @TableField(value = "checkUserId") + private Long checkUserId; + + /** + * 巡检人姓名 + */ + @TableField(value = "checkUserName") + private String checkUserName; + + /** + * 巡检部门 + */ + @TableField(value = "checkDeptCode") + private String checkDeptCode; + + /** + * 巡检部门名称 + */ + @TableField(value = "checkDeptName") + private String checkDeptName; + + /** + * 更改时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceCheckEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceCheckEntity.java new file mode 100644 index 00000000..08a98cca --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceCheckEntity.java @@ -0,0 +1,140 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 巡检任务表 + * + * @TableName device_check + */ +@TableName(value = "device_check") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceCheckEntity { + /** + * 巡检任务id + */ + @TableId(value = "taskId") + private Long taskId; + + /** + * 计划id + */ + @TableField(value = "planId") + private Long planId; + + /** + * 计划名称 + */ + @TableField(value = "planName") + private String planName; + + /** + * 负责部门编码 + */ + @TableField(value = "chargeDeptCode") + private String chargeDeptCode; + + /** + * 巡检人id + */ + @TableField(value = "checkUserId") + private Long checkUserId; + + /** + * 巡检人姓名 + */ + @TableField(value = "checkUserName") + private String checkUserName; + + /** + * 巡检人电话 + */ + @TableField(value = "checkUserPhone") + private String checkUserPhone; + + /** + * 设备数量 + */ + @TableField(value = "deviceCount") + private Integer deviceCount; + + /** + * 完成设备数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 异常设备数量 + */ + @TableField(value = "exceptionCount") + private Integer exceptionCount; + + /** + * 任务名称 + */ + @TableField(value = "name") + private String name; + + /** + * 任务备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 是否系统创建 1/true 是 0/false 否 + */ + @TableField(value = "sysFlag") + private Boolean sysFlag; + + /** + * 是否已完成 1/true 是 0/false 否 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 创建时间 updateTime + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人姓名 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java new file mode 100644 index 00000000..06c8f0d0 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java @@ -0,0 +1,59 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 巡检项目字典 + * + * @TableName device_check_item_dict + */ +@TableName(value = "device_check_item_dict") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceCheckItemDictEntity { + /** + * 项目编码 + */ + @TableId(value = "code") + private String code; + + /** + * 项目名称 + */ + @TableField(value = "name") + private String name; + + /** + * 项目内容 + */ + @TableField(value = "content") + private String content; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人名称 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceInfoEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceInfoEntity.java new file mode 100644 index 00000000..c49e61f3 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceInfoEntity.java @@ -0,0 +1,589 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 设备表 + * + * @TableName device_info + */ +@TableName(value = "device_info") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceInfoEntity implements Serializable { + /** + * 设备编码 + */ + @TableId(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 1.正常,2.维修申请中 3.维修中 + */ + @TableField(value = "status") + private DeviceStatusEnum status; + + /** + * 巡检锁定 + */ + @TableField(value = "checkLock") + private Boolean checkLock; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 生产厂家 + */ + @TableField(value = "manufactory") + private String manufactory; + + /** + * 计量单位 + */ + @TableField(value = "measname") + private String measname; + + /** + * 注册/备案凭证号 + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 供应商名称 + */ + @TableField(value = "supName") + private String supName; + + /** + * 变更次数 + */ + @TableField(value = "changeCount") + private Integer changeCount; + + /** + * 报修次数 + */ + @TableField(value = "repairApplyCount") + private Integer repairApplyCount; + + /** + * 维修次数 + */ + @TableField(value = "repairCount") + private Integer repairCount; + + /** + * 巡检次数 + */ + @TableField(value = "checkCount") + private Integer checkCount; + + /** + * 最后变更单号 + */ + @TableField(value = "lastChangeOrderId") + private Long lastChangeOrderId; + + /** + * 最后报修申请单号 + */ + @TableField(value = "lastRepairApplyId") + private String lastRepairApplyId; + + /** + * 最后报修申请时间 + */ + @TableField(value = "lastRepairApplyTime") + private LocalDateTime lastRepairApplyTime; + + /** + * 最后维修单号 + */ + @TableField(value = "lastRepairId") + private String lastRepairId; + + /** + * 最后维修负责人名称 + */ + @TableField(value = "lastRepairUserName") + private String lastRepairUserName; + + /** + * 最后维修人联系电话 + */ + @TableField(value = "lastRepairUserPhone") + private String lastRepairUserPhone; + + /** + * 最后维修时间 + */ + @TableField(value = "lastRepairTime") + private LocalDateTime lastRepairTime; + + /** + * 最后检查/巡检负责人 + */ + @TableField(value = "lastCheckUserId") + private Long lastCheckUserId; + + /** + * 最后检查/巡检负责人名称 + */ + @TableField(value = "lastCheckUserName") + private String lastCheckUserName; + + /** + * 最后检查/巡检人联系电话 + */ + @TableField(value = "lastCheckPhone") + private String lastCheckPhone; + + /** + * 最后检查/巡检时间 + */ + @TableField(value = "lastCheckTime") + private LocalDateTime lastCheckTime; + + /** + * 最后检查/巡检任务id + */ + @TableField(value = "lastCheckTaskId") + private Long lastCheckTaskId; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人名称 + */ + @TableField(value = "createUserName") + private String createUserName; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** + * 资产分类 + */ + @TableField(value = "assetType") + private String assetType; + + /** + * 国资分类 + */ + @TableField(value = "sasacType") + private String sasacType; + + /** + * 资产助记码 + */ + @TableField(value = "assetMnemonicCode") + private String assetMnemonicCode; + + /** + * 数量 + */ + @TableField(value = "number") + private Integer number; + + /** + * 取得方式 + */ + @TableField(value = "acquisitionMethod") + private String acquisitionMethod; + + /** + * 用途 + */ + @TableField(value = "purpose") + private String purpose; + + /** + * 折旧年 + */ + @TableField(value = "depreciationYear") + private Integer depreciationYear; + + /** + * 折旧月 + */ + @TableField(value = "depreciationMonth") + private Integer depreciationMonth; + + /** + * 存储仓库 + */ + @TableField(value = "invCode") + private String invCode; + + /** + * 预计总工时 + */ + @TableField(value = "estimatedTotalHour") + private Integer estimatedTotalHour; + + /** + * 单日工时 + */ + @TableField(value = "dayHour") + private Integer dayHour; + + /** + * 单个资产价值 + */ + @TableField(value = "assetValue") + private BigDecimal assetValue; + + /** + * 自有资金 + */ + @TableField(value = "ownFund") + private BigDecimal ownFund; + + /** + * 财政拨款 + */ + @TableField(value = "financialAppropriation") + private BigDecimal financialAppropriation; + + /** + * 科教基金 + */ + @TableField(value = "educationFund") + private BigDecimal educationFund; + + /** + * 其他资金 + */ + @TableField(value = "otherFund") + private BigDecimal otherFund; + + /** + * 非同级财政拨款 + */ + @TableField(value = "nonPeerFinancialAppropriation") + private BigDecimal nonPeerFinancialAppropriation; + + /** + * 医疗器械分类编码 + */ + @TableField(value = "ybbm") + private String ybbm; + + /** + * 一级分类名称(学科,品名) + */ + @TableField(value = "catalogname1") + private String catalogname1; + + /** + * 二级分类名称(用途、品目) + */ + @TableField(value = "catalogname2") + private String catalogname2; + + /** + * 三级分类名称(部位、功能、品种) + */ + @TableField(value = "catalogname3") + private String catalogname3; + + /** + * 编码 + */ + @TableField(value = "catalogCode") + private String catalogCode; + + /** + * 编码 + */ + @TableField(value = "catalogCode1") + private Integer catalogCode1; + /** + * 编码 + */ + @TableField(value = "catalogCode2") + private Integer catalogCode2; + /** + * 编码 + */ + @TableField(value = "catalogCode3") + private Integer catalogCode3; + + /** + * 管理类别 + */ + @TableField(value = "managementCategory") + private String managementCategory; + /** + * 使用人 + */ + @TableField(value = "endUser") + private String endUser; + + /** + * 预计残值 + */ + @TableField(value = "estimatedResidualValue") + private BigDecimal estimatedResidualValue; + + /** + * 币种 + */ + @TableField(value = "currencyType") + private String currencyType; + /** + * 采购类型 + */ + @TableField(value = "purType") + private String purType; + + /** + * 购置日期 + */ + @TableField(value = "purchaseDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date purchaseDate; + /** + * 添加日期 + */ + @TableField(value = "addDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date addDate; + + /** + * 资产品名 + */ + @TableField(value = "assetName") + private String assetName; + /** + * 是否强检 + */ + @TableField(value = "isImperative") + private Boolean isImperative; + /** + * 是否保养 + */ + @TableField(value = "isMaintain") + private Boolean isMaintain; + + /** + * 检定周期(月) + */ + @TableField(value = "imperativeCycle") + private Integer imperativeCycle; + /** + * 保养周期(月) + */ + @TableField(value = "maintainCycle") + private Integer maintainCycle; + /** + * 开始检定日期 + */ + @TableField(value = "startImperativeDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date startImperativeDate; + /** + * 开始保养日期 + */ + @TableField(value = "startMaintainDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date startMaintainDate; + + /** + * 维修组 + */ + @TableField(value = "serviceType") + private String serviceType; + /** + * 保养组 + */ + @TableField(value = "maintainType") + private String maintainType; + /** + * 管理人 + */ + @TableField(value = "managerUser") + private String managerUser; + /** + * 审核人 + */ + @TableField(value = "approveUser") + private String approveUser; + + /** + * 对应会计科目 + */ + @TableField(value = "ledgerAccount") + private String ledgerAccount; + + /** + * 减值准备 + */ + @TableField(value = "impairmentProvision") + private String impairmentProvision; + + /** + * 预计工作量 + */ + @TableField(value = "estimatedWorkload") + private String estimatedWorkload; + + /** + * 已完成工作量 + */ + @TableField(value = "completedWorkload") + private String completedWorkload; + + /** + * 维保类型 + */ + @TableField(value = "maintenanceType") + private String maintenanceType; + + /** + * 维保周期 + */ + @TableField(value = "maintenanceCycle") + private Integer maintenanceCycle; + + /** + * 维保开始日期 + */ + @TableField(value = "startMaintenancDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date startMaintenancDate; + + /** + * 维保结束日期 + */ + @TableField(value = "endMaintenancDate") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date endMaintenancDate; + + /** + * 内外网 + */ + @TableField(value = "networkType") + private Integer networkType; + /** + * 使用角色 + */ + @TableField(value = "userRole") + private Integer userRole; + /** + * 是否加域 + */ + @TableField(value = "isAddDomain") + private Boolean isAddDomain; + /** + * u盘是否禁用 + */ + @TableField(value = "isUDisc") + private Boolean isUDisc; + /** + * 设备归类 + */ + @TableField(value = "ascriptionType") + private Integer ascriptionType; + /** + * 资产备用类型 + */ + @TableField(value = "assetReserveType") + private String assetReserveType; + + /** + * 更改日期 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailEntity.java new file mode 100644 index 00000000..9e8f6bb4 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailEntity.java @@ -0,0 +1,41 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 巡检计划明细 + * + * @TableName device_plan_detail + */ +@TableName(value = "device_plan_detail") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DevicePlanDetailEntity { + + /** + * 计划id + */ + @TableField(value = "planId") + private Long planId; + + /** + * 设备编号 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java new file mode 100644 index 00000000..f36668ac --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java @@ -0,0 +1,58 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 巡检设备的项目 + * + * @TableName device_plan_detail_item + */ +@TableName(value = "device_plan_detail_item") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DevicePlanDetailItemEntity { + + /** + * 计划id + */ + @TableField(value = "planId") + private Long planId; + + /** + * 设备编号 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 产品Id + */ + @TableField(value = "productId") + private Long productId; + + + /** + * 项目编码 + */ + @TableField(value = "itemCode") + private String itemCode; + + /** + * 项目名称 + */ + @TableField(value = "name") + private String name; + + /** + * 项目内容 + */ + @TableField(value = "content") + private String content; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java b/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java new file mode 100644 index 00000000..5fa03513 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java @@ -0,0 +1,99 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 设备巡检计划 + * + * @TableName device_plan + */ +@TableName(value = "device_plan") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DevicePlanEntity { + /** + * 计划id + */ + @TableId(value = "planId") + private Long planId; + + /** + * 计划名称 + */ + @TableField(value = "name") + private String name; + + /** + * 负责部门 + */ + @TableField(value = "chargeDeptCode") + private String chargeDeptCode; + + /** + * 开始日期 + */ + @TableField(value = "startDate") + private LocalDate startDate; + + /** + * 结束日期 + */ + @TableField(value = "endDate") + private LocalDate endDate; + + /** + * 频率(天) + */ + @TableField(value = "frequency") + private Integer frequency; + + /** + * 执行次数 + */ + @TableField(value = "execCount") + private Integer execCount; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人名称 + */ + @TableField(value = "createUserName") + private String createUserName; + + + /** + * 巡检计划状态 + */ + @TableField(value = "status") + private Integer status; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java new file mode 100644 index 00000000..af0d7304 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java @@ -0,0 +1,210 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 设备报修单明细 + * + * @TableName device_repair_apply_detail + */ +@TableName(value = "device_repair_apply_detail") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceRepairApplyDetailEntity { + /** + * 报修单id + */ + @TableField(value = "applyId") + private Long applyId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 部门名称 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 问题描述 + */ + @TableField(value = "description") + private String description; + + /** + * 诊断信息 + */ + @TableField(value = "diagnosisInfo") + private String diagnosisInfo; + + /** + * 状态 待诊断、待维修、维修中、完成 + */ + @TableField(value = "status") + private DeviceRepairApplyDetailStatusEnum status; + + /** + * 是否需要维修 true/false + */ + @TableField(value = "repairFlag") + private Boolean repairFlag; + + /** + * 维修单id + */ + @TableField(value = "repairId") + private Long repairId; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 生产厂家 + */ + @TableField(value = "manufactory") + private String manufactory; + + /** + * 计量单位 + */ + @TableField(value = "measname") + private String measname; + + /** + * 注册/备案凭证号 + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 供应商名称 + */ + @TableField(value = "supName") + private String supName; + + /** + * 确认人id + */ + @TableField(value = "confirmUserId") + private Long confirmUserId; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认部门 + */ + @TableField(value = "confirmDeptCode") + private String confirmDeptCode; + + /** + * 确认部门名称 + */ + @TableField(value = "confirmDeptName") + private String confirmDeptName; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * 确认备注 + */ + @TableField(value = "confirmRemark") + private String confirmRemark; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + + /** + * 完成时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyEntity.java new file mode 100644 index 00000000..32242278 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyEntity.java @@ -0,0 +1,132 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 设备报修单 + * + * @TableName device_repair_apply + */ +@TableName(value = "device_repair_apply") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceRepairApplyEntity { + /** + * 报修单id + */ + @TableId(value = "id") + private Long id; + + /** + * 状态 待受理,受理中,维修中,完成 + */ + @TableField(value = "status") + private DeviceRepairApplyStatusEnum status; + + /** + * 报修部门编码 + */ + @TableField(value = "applyDeptCode") + private String applyDeptCode; + + /** + * 报修部门 + */ + @TableField(value = "applyDeptName") + private String applyDeptName; + + /** + * 报修人id + */ + @TableField(value = "applyUserId") + private Long applyUserId; + + /** + * 报修人姓名 + */ + @TableField(value = "applyUserName") + private String applyUserName; + + /** + * 报修人联系方式 + */ + @TableField(value = "applyUserPhone") + private String applyUserPhone; + + /** + * 报修时间 + */ + @TableField(value = "applyTime") + private LocalDateTime applyTime; + + /** + * 设备数量 + */ + @TableField(value = "deviceCount") + private Integer deviceCount; + + /** + * 完成数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 确认部门 + */ + @TableField(value = "confirmDeptCode") + private String confirmDeptCode; + + /** + * 确认部门名称 + */ + @TableField(value = "confirmDeptName") + private String confirmDeptName; + + /** + * 确认人id + */ + @TableField(value = "confirmUserId") + private Long confirmUserId; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认人联系方式 + */ + @TableField(value = "confirmPhone") + private String confirmPhone; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java new file mode 100644 index 00000000..45748147 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java @@ -0,0 +1,258 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 设备维修单 + * + * @TableName device_repair + */ +@TableName(value = "device_repair") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceRepairEntity { + /** + * 维修id + */ + @TableId(value = "id") + private Long id; + + /** + * 维修申请id + */ + @TableField(value = "applyId") + private Long applyId; + + /** + * 巡检任务单id + */ + @TableField(value = "checkTaskId") + private Long checkTaskId; + + /** + * 是否已完成 true/false + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + /** + * 问题描述 + */ + @TableField(value = "description") + private String description; + + /** + * 诊断信息 + */ + @TableField(value = "diagnosisInfo") + private String diagnosisInfo; + + /** + * 是否内部维修 + */ + @TableField(value = "innerFlag") + private Boolean innerFlag; + + /** + * 维修人姓名 + */ + @TableField(value = "repairUserName") + private String repairUserName; + /** + * 维修部门 + */ + @TableField(value = "repairDeptCode") + private String repairDeptCode; + + /** + * 维修人联系方式 + */ + @TableField(value = "repairUserPhone") + private String repairUserPhone; + + /** + * 设备码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 部门名称 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 生产厂家 + */ + @TableField(value = "manufactory") + private String manufactory; + + /** + * 计量单位 + */ + @TableField(value = "measname") + private String measname; + + /** + * 注册/备案凭证号 + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 供应商名称 + */ + @TableField(value = "supName") + private String supName; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人姓名 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 创建部门 + */ + @TableField(value = "createDeptCode") + private String createDeptCode; + + /** + * 创建部门名称 + */ + @TableField(value = "createDeptName") + private String createDeptName; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + /** + * 确认人id + */ + @TableField(value = "confirmUserId") + private Long confirmUserId; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认部门 + */ + @TableField(value = "confirmDeptCode") + private String confirmDeptCode; + + /** + * 确认部门名称 + */ + @TableField(value = "confirmDeptName") + private String confirmDeptName; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * 确认备注 + */ + @TableField(value = "confirmRemark") + private String confirmRemark; + + /** + * 确认时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/thrsys/ThrManufacturerEntity.java b/src/main/java/com/glxp/api/entity/thrsys/ThrManufacturerEntity.java new file mode 100644 index 00000000..160aa498 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/thrsys/ThrManufacturerEntity.java @@ -0,0 +1,76 @@ +package com.glxp.api.entity.thrsys; + +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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 第三方往来单位类型 + */ +@Data +@TableName(value = "thr_manufacturer") +public class ThrManufacturerEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Long id; + + @TableField("unitId") + private String unitId; + + @TableField("spell") + private String spell; + + @TableField("addr") + private String addr; + + @TableField("creditNo") + private String creditNo; + + @TableField("contact") + private String contact; + + @TableField("mobile") + private String mobile; + + @TableField("thirdSysFk") + private String thirdSysFk; + + @TableField("name") + private String name; + + /** + * 创建人 + */ + @TableField("createUser") + private String createUser; + + /** + * 创建时间 + */ + @TableField("createTime") + private Date createTime; + + /** + * 更新人 + */ + @TableField("updateUser") + private String updateUser; + + /** + * 更新时间 + */ + @TableField("updateTime") + private Date updateTime; + + /** + * 备注 + */ + @TableField("remark") + private String remark; + @TableField(exist = false) + private Boolean checked; +} diff --git a/src/main/java/com/glxp/api/enums/dev/DeviceChangeStatusEnum.java b/src/main/java/com/glxp/api/enums/dev/DeviceChangeStatusEnum.java new file mode 100644 index 00000000..6c0375c9 --- /dev/null +++ b/src/main/java/com/glxp/api/enums/dev/DeviceChangeStatusEnum.java @@ -0,0 +1,27 @@ +package com.glxp.api.enums.dev; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备变更状态 + */ +@Getter +@AllArgsConstructor +public enum DeviceChangeStatusEnum { + TEMP("temp", "临时"), + DRAFT("draft", "草稿"), + WAIT_CONFIRM("wait_confirm", "待目标部门确认"), + REJECT_CONFIRM("reject_confirm", "目标部门拒绝"), + FINISH("finish", "已完成"), + // 只有type为change才可以取消 + CANCEL("cancel", "已取消"), + ; + + + @EnumValue + private final String key; + + private final String desc; +} diff --git a/src/main/java/com/glxp/api/enums/dev/DeviceChangeTypeEnum.java b/src/main/java/com/glxp/api/enums/dev/DeviceChangeTypeEnum.java new file mode 100644 index 00000000..c2770787 --- /dev/null +++ b/src/main/java/com/glxp/api/enums/dev/DeviceChangeTypeEnum.java @@ -0,0 +1,24 @@ +package com.glxp.api.enums.dev; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备变更类型 + */ +@Getter +@AllArgsConstructor +public enum DeviceChangeTypeEnum { + + ADD("add", "设备登记"), + CHANGE("change", "变更归属"), + DESTROY("destroy", "销毁/报废"), + ; + + + @EnumValue + private final String key; + + private final String desc; +} diff --git a/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyDetailStatusEnum.java b/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyDetailStatusEnum.java new file mode 100644 index 00000000..1b596ffa --- /dev/null +++ b/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyDetailStatusEnum.java @@ -0,0 +1,24 @@ +package com.glxp.api.enums.dev; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 报修单明细状态 + */ +@Getter +@AllArgsConstructor +public enum DeviceRepairApplyDetailStatusEnum { + + WAIT_DIAGNOSIS("wait_diagnosis", "待诊断"), +// WAIT_REPAIR("wait_repair", "待维修"), + REPAIRING("repairing", "维修中"), + FINISH("finish", "完成"); + + + @EnumValue + private final String key; + + private final String desc; +} diff --git a/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyStatusEnum.java b/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyStatusEnum.java new file mode 100644 index 00000000..95bbea11 --- /dev/null +++ b/src/main/java/com/glxp/api/enums/dev/DeviceRepairApplyStatusEnum.java @@ -0,0 +1,24 @@ +package com.glxp.api.enums.dev; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 报修单状态 + */ +@Getter +@AllArgsConstructor +public enum DeviceRepairApplyStatusEnum { + + WAIT_PROCESS("wait_process", "待受理"), + PROCESSING("processing", "受理中"), +// REPAIRING("repairing", "维修中"), + FINISH("finish", "完成"); + + + @EnumValue + private final String key; + + private final String desc; +} diff --git a/src/main/java/com/glxp/api/enums/dev/DeviceStatusEnum.java b/src/main/java/com/glxp/api/enums/dev/DeviceStatusEnum.java new file mode 100644 index 00000000..51f03afc --- /dev/null +++ b/src/main/java/com/glxp/api/enums/dev/DeviceStatusEnum.java @@ -0,0 +1,34 @@ +package com.glxp.api.enums.dev; + +/** + * @author : zhangsan + * @date : 2024/5/6 0:28 + * @modyified By : + */ + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备状态 + */ +@Getter +@AllArgsConstructor +public enum DeviceStatusEnum { + + NORMAL("normal", "正常"), + CHANGE("change", "变更归属中"), + REPAIR_APPLY("repair_apply", "维修申请中"), + REPAIR("repair", "维修中"), + // CHECK("check", "等待巡检"), + DESTROY("destroy", "销毁/报废"), + ; + + + @EnumValue + private final String key; + + private final String desc; +} + diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemFinishParam.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemFinishParam.java new file mode 100644 index 00000000..ba566cca --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemFinishParam.java @@ -0,0 +1,33 @@ +package com.glxp.api.req.dev; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Builder +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DeviceCheckDetailItemFinishParam { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + @NotBlank(message = "设备标识不能为空") + private String deviceCode; + + @NotNull(message = "项目标识不能为空") + private String itemCode; + + @NotNull(message = "请标记巡检状态") + private Boolean normalFlag; + + @NotBlank(message = "巡检意见不能为空") + private String suggestion; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemQuery.java new file mode 100644 index 00000000..907a8754 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailItemQuery.java @@ -0,0 +1,23 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class DeviceCheckDetailItemQuery extends ListPageRequest { + + /** + * 任务单标识 + */ + private Long taskId; + + /** + * 设备标识 + */ + @NotBlank(message = "设备标识不能为空") + private String deviceCode; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailParam.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailParam.java new file mode 100644 index 00000000..15882713 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailParam.java @@ -0,0 +1,35 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +@Data +public class DeviceCheckDetailParam { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + @NotBlank(message = "设备编码不能为空") + private String deviceCode; + + /** + * 巡检建议 + */ + private String suggestion; + + /** + * 现场照片 + */ + private String livePath; + /** + * 正常标识 + */ + private Boolean normalFlag; + + private List detailItemEntities; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailQuery.java new file mode 100644 index 00000000..8ba9a84d --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailQuery.java @@ -0,0 +1,17 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class DeviceCheckDetailQuery extends ListPageRequest { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + private String deviceCode; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailRepairParam.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailRepairParam.java new file mode 100644 index 00000000..80c6e16f --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailRepairParam.java @@ -0,0 +1,32 @@ +package com.glxp.api.req.dev; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +public class DeviceCheckDetailRepairParam { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + @NotBlank(message = "设备编码不能为空") + private String deviceCode; + + @NotBlank(message = "问题描述不能为空") + String description; + + @NotBlank(message = "诊断信息不能为空") + String diagnosisInfo; + + @NotNull(message = "请选择维修方式") + Boolean innerFlag; + + @NotBlank(message = "维修人姓名不能为空") + String repairUserName; + + @NotBlank(message = "维修人电话不能为空") + String repairUserPhone; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictQuery.java new file mode 100644 index 00000000..0bec15f8 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictQuery.java @@ -0,0 +1,19 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceCheckItemDictQuery extends ListPageRequest { + + /** + * 项目编码 + */ + private String code; + + /** + * 项目名称 + */ + private String name; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckQuery.java new file mode 100644 index 00000000..085a06ed --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckQuery.java @@ -0,0 +1,13 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceCheckQuery extends ListPageRequest { + + String taskId; + String chargeDeptCode; + Boolean finishFlag; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailByDeptCodeQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailByDeptCodeQuery.java new file mode 100644 index 00000000..852c180a --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailByDeptCodeQuery.java @@ -0,0 +1,61 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class DeviceInfoDetailByDeptCodeQuery extends ListPageRequest { + /** + * 部门编码 + */ + @NotBlank(message = "缺少部门编码") + private String deptCode; + + /** + * 设备状态 + */ + private DeviceStatusEnum status; + + /** + * 设备编码 + */ + private String deviceCode; + + /** + * 最小销售标识 + */ + private String nameCode; + + + /** + * 设备名称 + */ + private String productName; + + /** + * 生产企业 + */ + private String manufactory; + + /** + * 注册/备案号 + */ + private String zczbhhzbapzbh; + + private String productId; + + private Boolean checkLock; + /** + * 计划id + */ + private Long planId; + + /** + * 模版ID + */ + + private Integer labelId; +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java new file mode 100644 index 00000000..20261851 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java @@ -0,0 +1,71 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +public class DeviceInfoDetailQuery extends ListPageRequest { + + + @NotNull(message = "缺少必要参数") + private DeviceStatusEnum status; + +// @NotNull(message = "缺少必要参数") + private Boolean checkLock; + + /** + * 部门编码 + */ + @NotBlank(message = "缺少必要参数") + private String deptCode; + + /** + * 设备id + */ +// @NotNull(message = "缺少必要参数") + private Long productId; + + /** + * 设备名称 + */ + private String productName; + + /** + * 设备编码 + */ + private String deviceCode; + + /** + * 计划id + */ + private Long planId; + + /** + * 模版ID + */ + + private Integer labelId; + + + /** + * 最小销售标识 + */ + private String nameCode; + + + /** + * 生产企业 + */ + private String manufactory; + + /** + * 注册/备案号 + */ + private String zczbhhzbapzbh; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceInfoQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceInfoQuery.java new file mode 100644 index 00000000..31fd1971 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceInfoQuery.java @@ -0,0 +1,28 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceInfoQuery extends ListPageRequest { + + private DeviceStatusEnum status; + + /** + * 设备编码 + */ + private String deviceCode; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 设备名称 + */ + private String productName; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanDetailGroupQuery.java b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailGroupQuery.java new file mode 100644 index 00000000..1ced498f --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailGroupQuery.java @@ -0,0 +1,18 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DevicePlanDetailGroupQuery extends ListPageRequest { + + @NotNull(message = "计划标识不能为空") + Long planId; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemParam.java b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemParam.java new file mode 100644 index 00000000..f143ae9d --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemParam.java @@ -0,0 +1,84 @@ +package com.glxp.api.req.dev; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.glxp.api.entity.dev.DeviceCheckItemDictEntity; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.service.dev.DeviceCheckItemDictService; +import com.glxp.api.service.dev.DevicePlanDetailService; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +@Data +public class DevicePlanDetailItemParam { + + /** + * 计划id + */ + @NotNull(message = "计划标识不能为空") + Long planId; + + Long productId; + + /** + * 设备编码 + */ + String deviceCode; + + + @NotEmpty(message = "巡检项目不能为空") + Set itemCodes; + + + public void valid(DevicePlanDetailService devicePlanDetailService) { + DevicePlanDetailEntity one = devicePlanDetailService.getOne(Wrappers.lambdaQuery(DevicePlanDetailEntity.class) + .eq(DevicePlanDetailEntity::getPlanId, planId) + .eq(DevicePlanDetailEntity::getProductId, productId) + .eq(StrUtil.isNotBlank(deviceCode), DevicePlanDetailEntity::getDeviceCode, deviceCode) + .last("limit 1") + ); + if (one == null) { + throw new JsonException("未找到该计划中的设备,无法操作"); + } + } + + public List getEntity(DeviceCheckItemDictService deviceCheckItemDictService) { + List list = deviceCheckItemDictService.listByIds(itemCodes); + if (CollectionUtil.isEmpty(list)) { + throw new JsonException("所有项目编码都不存在,疑似非法操作"); + } + if (list.size() != itemCodes.size()) { + Map> collect = list.stream().collect(Collectors.groupingBy(DeviceCheckItemDictEntity::getCode)); + itemCodes.forEach(i -> { + boolean b = collect.containsKey(i); + if (!b) { + throw new JsonException(String.format("项目编码[%s]不存在", i)); + } + }); + } + List entityList = new ArrayList<>(); + list.forEach(i -> { + DevicePlanDetailItemEntity build = DevicePlanDetailItemEntity.builder() + .planId(planId) + .productId(productId) + .deviceCode(StrUtil.blankToDefault(deviceCode, "")) + .itemCode(i.getCode()) + .name(i.getName()) + .content(i.getContent()) + .build(); + entityList.add(build); + }); + return entityList; + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemQuery.java b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemQuery.java new file mode 100644 index 00000000..3189fefa --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailItemQuery.java @@ -0,0 +1,26 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +/** + * 巡检设备计划 + * data: 2023/11/15 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DevicePlanDetailItemQuery extends ListPageRequest { + + @NotNull(message = "计划标识不能为空") + Long planId; + + Long productId; + @NotNull(message = "设备标识不能为空") + String deviceCode; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanDetailParam.java b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailParam.java new file mode 100644 index 00000000..d75170cc --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailParam.java @@ -0,0 +1,56 @@ +package com.glxp.api.req.dev; + +import cn.hutool.core.collection.CollectionUtil; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DevicePlanService; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Data +public class DevicePlanDetailParam { + + /** + * 计划id + */ +// @NotNull(message = "计划标识不能为空") + Long planId; + + @NotEmpty(message = "请选择至少一个设备") + Set deviceCodes; + + DevicePlanParam devicePlanParam; + + public boolean valid(DevicePlanService devicePlanService) { + DevicePlanEntity entity = devicePlanService.getById(planId); + if (entity == null) { + return false; + } + return true; + } + + public List getEntity(DeviceInfoService deviceInfoService) { + List deviceList = deviceInfoService.listByIds(deviceCodes); + if (CollectionUtil.isEmpty(deviceList)) { + throw new JsonException("未找到设备,疑似非法操作"); + } + List list = deviceList.stream().map(d -> { + + DevicePlanDetailEntity build = DevicePlanDetailEntity.builder() + .planId(planId) + .deviceCode(d.getDeviceCode()) + .productId(d.getProductId()) + .build(); + return build; + }).collect(Collectors.toList()); + return list; + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailQuery.java new file mode 100644 index 00000000..8cb65c02 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanDetailQuery.java @@ -0,0 +1,25 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DevicePlanDetailQuery extends ListPageRequest { + + @NotNull(message = "计划标识不能为空") + Long planId; + + Long productId; + + /** + * 设备编码 + */ + String deviceCode; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanParam.java b/src/main/java/com/glxp/api/req/dev/DevicePlanParam.java new file mode 100644 index 00000000..ad5c042d --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanParam.java @@ -0,0 +1,98 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.auth.DeptEntity; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.service.auth.DeptService; +import com.glxp.api.util.SnowflakeUtil; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Data +public class DevicePlanParam { + + /** + * 计划id,修改时使用 + */ + Long planId; + + /** + * 计划名称 + */ + @NotBlank(message = "计划名称不能为空") + @Length(min = 1, max = 100, message = "计划名称应该在1~100字之间") + String name; + + /** + * 负责部门 + */ + @NotBlank(message = "负责部门不能为空") + String chargeDeptCode; + + /** + * 开始日期 + */ + @NotNull(message = "计划开始日期不能为空") + private LocalDate startDate; + + /** + * 结束日期 + */ + @NotNull(message = "计划结束日期不能为空") + private LocalDate endDate; + + /** + * 频率(天) + */ + @NotNull(message = "频率不能为空") + private Integer frequency; + + /** + * 计划单据状态 + */ + private Integer status; + + /** + * 备注 + */ + @Length(max = 500, message = "备注最多500字") + private String remark; + + public void valid(DeptService deptService) { + DeptEntity dept = deptService.selectByCode(chargeDeptCode); + if (dept == null) { + throw new JsonException("负责部门不存在,疑似非法操作"); + } + if (startDate.isAfter(endDate)) { + throw new JsonException("计划开始日期不能在计划结束日期之后"); + } + if (!endDate.isAfter(LocalDate.now())) { + throw new JsonException("计划结束日期要在今天之后"); + } + } + + public DevicePlanEntity getEntity(AuthAdmin user) { + boolean isUpdate = (planId != null); + DevicePlanEntity build = DevicePlanEntity.builder() + .planId(!isUpdate ? SnowflakeUtil.getId() : planId) + .name(name) + .chargeDeptCode(chargeDeptCode) + .startDate(startDate) + .endDate(endDate) + .frequency(frequency) + .status(status == null ? 1 : status) + .remark(remark) + .build(); + if (!isUpdate) { + build.setCreateUserId(user.getId()).setCreateUserName(user.getEmployeeName()).setCreateTime(LocalDateTime.now()); + } + return build; + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DevicePlanQuery.java b/src/main/java/com/glxp/api/req/dev/DevicePlanQuery.java new file mode 100644 index 00000000..ddf3dceb --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DevicePlanQuery.java @@ -0,0 +1,16 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DevicePlanQuery extends ListPageRequest { + + String name; + + /** + * 负责部门 + */ + String chargeDeptCode; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java new file mode 100644 index 00000000..7da4abd2 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java @@ -0,0 +1,109 @@ +package com.glxp.api.req.dev; + +import cn.hutool.core.bean.BeanUtil; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.util.SnowflakeUtil; +import com.glxp.api.vo.dev.DeviceInfoVo; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +@Data +public class DeviceRepairApplyAddParam { + + /** + * 报修人联系方式 + */ + @NotBlank(message = "报修人联系方式不能为空") + String applyUserPhone; + + @Valid + @NotEmpty(message = "请选择至少一个设备进行报修") + Set details; + + @Data + public static class ApplyDetail { + + /** + * 设备编码 + */ + @NotBlank(message = "设备编码不能为空") + String deviceCode; + + /** + * 问题描述 + */ + @NotBlank(message = "问题描述不能为空") + String description; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ApplyDetail that = (ApplyDetail) o; + return Objects.equals(deviceCode, that.deviceCode); + } + + @Override + public int hashCode() { + return Objects.hash(deviceCode); + } + } + + public void valid() { + } + + + public DeviceRepairApplyEntity getEntity(AuthAdmin user) { + return DeviceRepairApplyEntity + .builder() + .id(SnowflakeUtil.getId()) + .status(DeviceRepairApplyStatusEnum.WAIT_PROCESS) + .applyDeptCode(user.getLocDeptCode()) + .applyDeptName(user.getDeptName()) + .applyUserId(user.getId()) + .applyUserName(user.getEmployeeName()) + .applyUserPhone(this.applyUserPhone) + .applyTime(LocalDateTime.now()) + .deviceCount(details.size()) + .finishCount(0) + .updateTime(LocalDateTime.now()) + .build(); + } + + public List getDetailEntityList(Long applyId, DeviceInfoService deviceInfoService, AuthAdmin user) { + List list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), DeviceStatusEnum.NORMAL); + if (list.size() != details.size()) { + throw new JsonException("设备信息不匹配,疑似非法操作"); + } + Map> deviceMap = list.stream().collect(Collectors.groupingBy(DeviceInfoEntity::getDeviceCode)); + return details.stream().map(d -> { + DeviceInfoEntity info = deviceMap.get(d.getDeviceCode()).get(0); + DeviceRepairApplyDetailEntity build = DeviceRepairApplyDetailEntity.builder() + .applyId(applyId) + .description(d.getDescription()) + .status(DeviceRepairApplyDetailStatusEnum.WAIT_DIAGNOSIS) + .build(); + BeanUtil.copyProperties(info, build,"status"); + return build; + }).collect(Collectors.toList()); + + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyConfirmParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyConfirmParam.java new file mode 100644 index 00000000..dd554fe7 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyConfirmParam.java @@ -0,0 +1,21 @@ +package com.glxp.api.req.dev; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +public class DeviceRepairApplyConfirmParam { + + @NotNull(message = "报修单标识不能为空") + Long applyId; + + /** + * 报修人联系方式 + */ + @NotBlank(message = "受理人联系方式不能为空") + String confirmUserPhone; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java new file mode 100644 index 00000000..e7928a22 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java @@ -0,0 +1,55 @@ +package com.glxp.api.req.dev; + +import cn.hutool.core.util.StrUtil; +import com.glxp.api.exception.JsonException; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +public class DeviceRepairApplyDetailDiagnosisParam { + + @NotNull(message = "报修单标识不能为空") + Long applyId; + + @NotBlank(message = "设备标识不能为空") + String deviceCode; + + @NotNull(message = "请选择是否维修") + Boolean repairFlag; + + @NotBlank(message = "诊断信息不能为空") + String diagnosisInfo; + + Boolean innerFlag; + + String repairUserName; + + String repairDeptCode; + + String repairUserPhone; + + public void valid() { + if (repairFlag) { + if (innerFlag == null) { + throw new JsonException("请选择维修方式"); + } + if (StrUtil.isBlank(repairDeptCode)) { + throw new JsonException("维修部门不能为空"); + } + if (StrUtil.isBlank(repairUserName)) { + throw new JsonException("维修人姓名不能为空"); + } + if (StrUtil.isBlank(repairUserPhone)) { + throw new JsonException("维修人电话不能为空"); + } + } else { + innerFlag = null; + repairUserName = null; + repairUserPhone = null; + repairDeptCode = null; + } + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailQuery.java new file mode 100644 index 00000000..78c17d91 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailQuery.java @@ -0,0 +1,15 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class DeviceRepairApplyDetailQuery extends ListPageRequest { + + @NotNull(message = "保修单标识不能为空") + Long applyId; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java new file mode 100644 index 00000000..498fde5f --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java @@ -0,0 +1,16 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceRepairApplyHallQuery extends ListPageRequest { + + Long applyId; + + /** + * 申请部门 + */ + String applyDeptCode; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java new file mode 100644 index 00000000..9e3d81ae --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java @@ -0,0 +1,36 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceRepairApplyQuery extends ListPageRequest { + + Long applyId; + + /** + * 报修单状态 + */ + DeviceRepairApplyStatusEnum status; + + /** + * 申请部门 + */ + String applyDeptCode; + + /** + * 确认人 + */ + Long confirmUserId; + + /** + * 受理信息 + */ + String acceptInfo; + /** + * 报修信息 + */ + String repairInfo; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairQuery.java new file mode 100644 index 00000000..595a0ac8 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairQuery.java @@ -0,0 +1,25 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceRepairQuery extends ListPageRequest { + + /** + * 完成状态 + */ + Boolean isFinish; + + /** + * 设备编码 + */ + String deviceCode; + + + /** + * 创建人 + */ + Long createUserId; + +} diff --git a/src/main/java/com/glxp/api/req/thrsys/FilterBasicProducstRequest.java b/src/main/java/com/glxp/api/req/thrsys/FilterBasicProducstRequest.java new file mode 100644 index 00000000..31df1f74 --- /dev/null +++ b/src/main/java/com/glxp/api/req/thrsys/FilterBasicProducstRequest.java @@ -0,0 +1,31 @@ +package com.glxp.api.req.thrsys; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +/** + * @author : zhangsan + * @date : 2024/5/10 16:09 + * @modyified By : + */ + +@Data +public class FilterBasicProducstRequest extends ListPageRequest { + + /** + * 产品编码 + */ + private String code; + + /** + * 产品名称 + */ + private String name; + + /** + * 第三系统标识 + */ + private String thirdSys; + + private String key; +} diff --git a/src/main/java/com/glxp/api/req/thrsys/ThrManuFilterRequest.java b/src/main/java/com/glxp/api/req/thrsys/ThrManuFilterRequest.java new file mode 100644 index 00000000..48e197ba --- /dev/null +++ b/src/main/java/com/glxp/api/req/thrsys/ThrManuFilterRequest.java @@ -0,0 +1,46 @@ +package com.glxp.api.req.thrsys; + +import cn.hutool.core.util.StrUtil; +import com.glxp.api.res.thrsys.ThrCorpsResponse; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.util.List; + +@Data +public class ThrManuFilterRequest extends ListPageRequest { + + private Integer id; + private String key; + private String unitId; + private String name; + private String thirdSys; + private String thirdSysFk; + + private String thirdId; + private String thirdId1; + private String thirdId2; + private String thirdId3; + private String thirdId4; + private String erpId; + private Integer corpType; + private Integer outType; + private Boolean isDownThrSys; + private String lastUpdateTime; + List thrCorpEntities; + + + public String getThirdSys() { + if (StrUtil.isEmpty(thirdSys)) + return thirdSysFk; + return thirdSys; + } + + public String getThirdSysFk() { + + if (StrUtil.isEmpty(thirdSysFk)) + return thirdSys; + return thirdSysFk; + } + +} diff --git a/src/main/java/com/glxp/api/res/sync/SpsSyncProBusinessDataResponse.java b/src/main/java/com/glxp/api/res/sync/SpsSyncProBusinessDataResponse.java new file mode 100644 index 00000000..9b4b1943 --- /dev/null +++ b/src/main/java/com/glxp/api/res/sync/SpsSyncProBusinessDataResponse.java @@ -0,0 +1,17 @@ +package com.glxp.api.res.sync; + +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; +import lombok.Data; + +import java.util.List; + +/** + * @author : zhangsan + * @date : 2024/5/10 14:15 + * @modyified By : + */ + +@Data +public class SpsSyncProBusinessDataResponse extends BaseSyncResponse{ + List thrManufacturerEntities; +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceChangeLogService.java b/src/main/java/com/glxp/api/service/dev/DeviceChangeLogService.java new file mode 100644 index 00000000..6c6a6b49 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceChangeLogService.java @@ -0,0 +1,11 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.dev.DeviceChangeLogEntity; + +/** +* 针对表【device_change_log(设备变更日志表)】的数据库操作Service +*/ +public interface DeviceChangeLogService extends IService { + +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailItemService.java b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailItemService.java new file mode 100644 index 00000000..573d2794 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailItemService.java @@ -0,0 +1,31 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; +import com.glxp.api.req.dev.DeviceCheckDetailItemFinishParam; +import com.glxp.api.req.dev.DeviceCheckDetailItemQuery; +import com.glxp.api.req.dev.DeviceCheckDetailParam; + +import java.util.List; + +/** + * 针对表【device_check_detail_item(设备巡检项目)】的数据库操作Service + */ +public interface DeviceCheckDetailItemService extends IService { + + List pageList(DeviceCheckDetailItemQuery query); + + List listByTaskId(Long taskId, String deviceCode); + + /** + * 完成巡检项目 + * + * @param param + * @param user + */ + void finish(DeviceCheckDetailItemFinishParam param, AuthAdmin user); + + + public void finishAll(DeviceCheckDetailParam param, AuthAdmin user); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java new file mode 100644 index 00000000..f3135e86 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java @@ -0,0 +1,35 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.req.dev.DeviceCheckDetailParam; +import com.glxp.api.req.dev.DeviceCheckDetailQuery; +import com.glxp.api.req.dev.DeviceCheckDetailRepairParam; + +import java.util.List; + +/** + * 针对表【device_check_detail(巡检任务明细)】的数据库操作Service + */ +public interface DeviceCheckDetailService extends IService { + + List pageList(DeviceCheckDetailQuery query); + + List listByTaskId(Long taskId, String deviceCode); + + DeviceCheckDetailEntity getOne(Long taskId, String deviceCode); + + void finishItem(Long taskId, String deviceCode, String deptCode, boolean normalFlag, AuthAdmin user); + + /** + * 创建维修单 + * + * @param param 参数 + * @param user 当前用户 + */ + void repair(DeviceCheckDetailRepairParam param, AuthAdmin user); + + void finish(DeviceCheckDetailParam param, AuthAdmin user); + +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceCheckItemDictService.java b/src/main/java/com/glxp/api/service/dev/DeviceCheckItemDictService.java new file mode 100644 index 00000000..7df22215 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceCheckItemDictService.java @@ -0,0 +1,15 @@ +package com.glxp.api.service.dev; + +import com.glxp.api.entity.dev.DeviceCheckItemDictEntity; +import com.glxp.api.req.dev.DeviceCheckItemDictQuery; +import com.glxp.api.service.CustomService; + +import java.util.List; + +/** +* 针对表【device_check_item_dict(巡检项目字典)】的数据库操作Service +*/ +public interface DeviceCheckItemDictService extends CustomService { + + List pageList(DeviceCheckItemDictQuery query); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceCheckService.java b/src/main/java/com/glxp/api/service/dev/DeviceCheckService.java new file mode 100644 index 00000000..bf93f8f2 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceCheckService.java @@ -0,0 +1,31 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckEntity; +import com.glxp.api.req.dev.DeviceCheckQuery; +import com.glxp.api.vo.dev.DeviceCheckPrintVo; +import com.glxp.api.vo.dev.DeviceCheckVo; + +import java.util.List; + +/** + * 针对表【device_check(巡检任务表)】的数据库操作Service + */ +public interface DeviceCheckService extends IService { + + void genByPlanId(Long planId, boolean sysCreate, AuthAdmin user); + + List pageList(DeviceCheckQuery query); + + DeviceCheckPrintVo checkInfoPrint(Long taskId, String deviceCode); + + /** + * 完成一个巡检设备 + * + * @param taskId 任务id + * @param deviceCode 设备编码 + * @return + */ + void finishDevice(Long taskId, String deviceCode); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceInfoService.java b/src/main/java/com/glxp/api/service/dev/DeviceInfoService.java new file mode 100644 index 00000000..0ebc5598 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceInfoService.java @@ -0,0 +1,107 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery; +import com.glxp.api.req.dev.DeviceInfoDetailQuery; +import com.glxp.api.req.dev.DeviceInfoQuery; +import com.glxp.api.vo.dev.DeviceInfoVo; + +import java.util.List; + +/** + * 针对表【device_info(设备表)】的数据库操作Service + */ +public interface DeviceInfoService extends IService { + + /** + * 变更设备归属,同时将状态改为正常 + * + * @param deviceCode 设备码 + * @param oldDeptCode 原部门 + * @param toDeptCode 目标部门 + * @param orderId 变更单id + */ + void changeDept(String deviceCode, String oldDeptCode, String toDeptCode, Long orderId); + + /** + * 修改设备状态 + * + * @param deviceCode 设备码 + * @param deptCode 归属部门 + * @param oldStatus 源状态 + * @param toStatus 目标状态 + */ + void changeStatus(String deviceCode, String deptCode, DeviceStatusEnum oldStatus, DeviceStatusEnum toStatus); + + /** + * 开启巡检锁 + * + * @param deviceCode 设备编码 + * @param deptCode 部门编码 + */ + boolean openCheckLock(String deviceCode, String deptCode); + + /** + * 关闭巡检锁 + * + * @param deviceCode 设备编码 + * @param deptCode 部门编码 + * @param isCancel 是否为取消关闭 + */ + boolean closeCheckLock(String deviceCode, String deptCode, boolean isCancel); + + /** + * 设备完成巡检 + * + * @param deviceCode 设备编码 + * @param deptCode 设备所在部门 + * @param checkTaskId 任务id + * @param checkUser 巡检人信息 + * // * @param checkUserPhone 巡检人联系方式 + */ + void finishCheck(String deviceCode, String deptCode, Long checkTaskId, AuthAdmin checkUser); + + /** + * 设备完成维修 + * 同时修改设备状态 + * + * @param deviceCode 设备编码 + * @param deptCode 设备所在部门 + * @param repairId 维修单id + * @param repairUserName 维修人姓名 + * @param repairUserPhone 巡检人电话 + */ + void finishRepair(String deviceCode, String deptCode, Long repairId, String repairUserName, String repairUserPhone); + + /** + * 设备报修 + * 同时改变设备状态 + * + * @param deviceCode 设备编号 + * @param deptCode 设备部门编码 + * @param applyId 报修单id + */ + void repairApply(String deviceCode, String deptCode, Long applyId); + + List pageVo(DeviceInfoQuery query, String locDeptCode); + + List allPageVo(DeviceInfoQuery query); + + List detail(DeviceInfoDetailQuery query); + + List detail(DeviceInfoDetailByDeptCodeQuery query); + + List listVoByProductIdAndStatus(Long productId, DeviceStatusEnum status); + + List listVoByCodes(List deviceCodes, String deptCode, DeviceStatusEnum status); + + boolean exitOrder(Long orderId, String deviceCode); + + String genDeviceCode(); + + boolean updateOrderItem(DeviceInfoEntity entity); + +} diff --git a/src/main/java/com/glxp/api/service/dev/DevicePlanDetailItemService.java b/src/main/java/com/glxp/api/service/dev/DevicePlanDetailItemService.java new file mode 100644 index 00000000..9af4f2f6 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DevicePlanDetailItemService.java @@ -0,0 +1,16 @@ +package com.glxp.api.service.dev; + +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; +import com.glxp.api.req.dev.DevicePlanDetailItemQuery; +import com.glxp.api.service.CustomService; + +import java.util.List; + +/** + * 针对表【device_plan_detail_item(巡检设备的项目)】的数据库操作Service + */ +public interface DevicePlanDetailItemService extends CustomService { + + List listByPlanId(Long planId); + List pageList(DevicePlanDetailItemQuery query); +} diff --git a/src/main/java/com/glxp/api/service/dev/DevicePlanDetailService.java b/src/main/java/com/glxp/api/service/dev/DevicePlanDetailService.java new file mode 100644 index 00000000..9dd00121 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DevicePlanDetailService.java @@ -0,0 +1,27 @@ +package com.glxp.api.service.dev; + +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.req.dev.DevicePlanDetailGroupQuery; +import com.glxp.api.req.dev.DevicePlanDetailQuery; +import com.glxp.api.service.CustomService; +import com.glxp.api.vo.dev.DevicePlanDetailVo; + +import java.util.List; + +/** + * 针对表【device_plan_detail(巡检计划明细)】的数据库操作Service + */ +public interface DevicePlanDetailService extends CustomService { + + List listByPlanId(Long planId); + + List pageGroupVo(DevicePlanDetailGroupQuery query); + + List pageVo(DevicePlanDetailQuery query); + + void delByPlanId(Long planId); + + void delByProductId(Long planId, Long productId); + + void delByDeviceCode(Long planId, String deviceCode); +} diff --git a/src/main/java/com/glxp/api/service/dev/DevicePlanService.java b/src/main/java/com/glxp/api/service/dev/DevicePlanService.java new file mode 100644 index 00000000..7636eabd --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DevicePlanService.java @@ -0,0 +1,20 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.req.dev.DevicePlanQuery; +import com.glxp.api.vo.dev.DevicePlanVo; + +import java.util.List; + +/** + * 针对表【device_plan(设备巡检计划)】的数据库操作Service + */ +public interface DevicePlanService extends IService { + + List pageList(DevicePlanQuery query); + + void deletePlan(Long planId); + + void addExecCount(Long planId); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java new file mode 100644 index 00000000..da5a18d3 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java @@ -0,0 +1,33 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; + +import java.util.List; + +/** + * 针对表【device_repair_apply_detail(设备报修单明细)】的数据库操作Service + */ +public interface DeviceRepairApplyDetailService extends IService { + + List pageList(DeviceRepairApplyDetailQuery query); + + /** + * 诊断设备 + * + * @param param 参数 + * @param user 用户信息 + */ + void diagnosis(DeviceRepairApplyDetailDiagnosisParam param, AuthAdmin user); + + /** + * 完成报修单的设备维修 + * + * @param applyId 保修单id + * @param deviceCode 设备编码 + */ + void finishDeviceRepair(Long applyId, String deviceCode); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java new file mode 100644 index 00000000..c9e05b48 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java @@ -0,0 +1,39 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.req.dev.DeviceRepairApplyAddParam; +import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; +import com.glxp.api.req.dev.DeviceRepairApplyQuery; + +import java.util.List; + +/** + * 针对表【device_repair_apply(设备报修单)】的数据库操作Service + */ +public interface DeviceRepairApplyService extends IService { + + List pageList(DeviceRepairApplyQuery query); + + DeviceRepairApplyEntity getByIdAndStatus(Long applyId, DeviceRepairApplyStatusEnum status); + + void addDeviceRepairApply(DeviceRepairApplyAddParam param, AuthAdmin user); + + /** + * 受理报修单 + * + * @param param + * @param user + */ + void confirmDeviceRepairApply(DeviceRepairApplyConfirmParam param, AuthAdmin user); + + + /** + * 设备完成维修 + * + * @param applyId 报修单id + */ + void finishDeviceRepair(Long applyId); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceRepairService.java b/src/main/java/com/glxp/api/service/dev/DeviceRepairService.java new file mode 100644 index 00000000..c779aefb --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceRepairService.java @@ -0,0 +1,33 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairEntity; +import com.glxp.api.req.dev.DeviceRepairQuery; + +import java.util.List; + +/** + * 针对表【device_repair(设备维修单)】的数据库操作Service + */ +public interface DeviceRepairService extends IService { + + List pageList(DeviceRepairQuery query); + + /** + * 创建维修单 + * 同时改变设备状态 + * + * @param repair + */ + void createRepair(DeviceRepairEntity repair); + + /** + * 完成维修 + * 同时改变设备状态 + * + * @param repairId 维修单id + * @param user 用户信息 + */ + void finishByUser(Long repairId, AuthAdmin user); +} diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceChangeLogServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceChangeLogServiceImpl.java new file mode 100644 index 00000000..22176713 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceChangeLogServiceImpl.java @@ -0,0 +1,20 @@ +package com.glxp.api.service.dev.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.dev.DeviceChangeLogMapper; +import com.glxp.api.entity.dev.DeviceChangeLogEntity; +import com.glxp.api.service.dev.DeviceChangeLogService; +import org.springframework.stereotype.Service; + +/** +* 针对表【device_change_log(设备变更日志表)】的数据库操作Service实现 +*/ +@Service +public class DeviceChangeLogServiceImpl extends ServiceImpl + implements DeviceChangeLogService{ + +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailItemServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailItemServiceImpl.java new file mode 100644 index 00000000..676a1a4c --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailItemServiceImpl.java @@ -0,0 +1,140 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.dev.DeviceCheckDetailItemMapper; +import com.glxp.api.dao.dev.DeviceCheckDetailMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; +import com.glxp.api.entity.dev.DeviceCheckEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceCheckDetailItemFinishParam; +import com.glxp.api.req.dev.DeviceCheckDetailItemQuery; +import com.glxp.api.req.dev.DeviceCheckDetailParam; +import com.glxp.api.service.dev.DeviceCheckDetailItemService; +import com.glxp.api.service.dev.DeviceCheckDetailService; +import com.glxp.api.service.dev.DeviceCheckService; +import com.glxp.api.util.IntUtil; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_check_detail_item(设备巡检项目)】的数据库操作Service实现 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class DeviceCheckDetailItemServiceImpl extends ServiceImpl + implements DeviceCheckDetailItemService { + + final DeviceCheckService deviceCheckService; + + final DeviceCheckDetailService deviceCheckDetailService; + @Resource + DeviceCheckDetailMapper deviceCheckDetailMapper; + + @Override + public List pageList(DeviceCheckDetailItemQuery query) { + List list = super.list(Wrappers.lambdaQuery(DeviceCheckDetailItemEntity.class) + .eq(DeviceCheckDetailItemEntity::getTaskId, query.getTaskId()) + .eq(DeviceCheckDetailItemEntity::getDeviceCode, query.getDeviceCode()) + .orderByAsc(DeviceCheckDetailItemEntity::getFinishFlag, DeviceCheckDetailItemEntity::getNormalFlag, DeviceCheckDetailItemEntity::getDeviceCode, DeviceCheckDetailItemEntity::getItemCode) + ); + + return list; + } + + @Override + public List listByTaskId(Long taskId, String deviceCode) { + List list = super.list(Wrappers.lambdaQuery(DeviceCheckDetailItemEntity.class) + .eq(DeviceCheckDetailItemEntity::getTaskId, taskId) + .eq(deviceCode != null, DeviceCheckDetailItemEntity::getDeviceCode, deviceCode) + .orderByAsc(DeviceCheckDetailItemEntity::getDeviceCode, DeviceCheckDetailItemEntity::getItemCode) + ); + return list; + } + + @Override + @Transactional + public void finish(DeviceCheckDetailItemFinishParam param, AuthAdmin user) { + DeviceCheckEntity checkEntity = deviceCheckService.getById(param.getTaskId()); + if (checkEntity == null) { + return; + } + DeviceCheckDetailEntity detailEntity = deviceCheckDetailService.getOne(param.getTaskId(), param.getDeviceCode()); + if (detailEntity == null) { + return; + } + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceCheckDetailItemEntity.class) + .set(DeviceCheckDetailItemEntity::getFinishFlag, true) + .set(DeviceCheckDetailItemEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceCheckDetailItemEntity::getSuggestion, param.getSuggestion()) + .set(DeviceCheckDetailItemEntity::getNormalFlag, param.getNormalFlag()) + .set(DeviceCheckDetailItemEntity::getCheckUserId, user.getId()) + .set(DeviceCheckDetailItemEntity::getCheckUserName, user.getEmployeeName()) + .set(DeviceCheckDetailItemEntity::getCheckDeptCode, user.getLocDeptCode()) + .set(DeviceCheckDetailItemEntity::getCheckDeptName, user.getDeptName()) + .set(DeviceCheckDetailItemEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceCheckDetailItemEntity::getTaskId, param.getTaskId()) + .eq(DeviceCheckDetailItemEntity::getDeviceCode, param.getDeviceCode()) + .eq(DeviceCheckDetailItemEntity::getItemCode, param.getItemCode()) + .eq(DeviceCheckDetailItemEntity::getFinishFlag, false) + ); + if (updated) { + deviceCheckDetailService.finishItem(param.getTaskId(), param.getDeviceCode(), detailEntity.getDeptCode(), param.getNormalFlag(), user); + } else { + throw new JsonException("操作失败,该项目可能已经被其他人完成,请刷新重试"); + } + } + + @Override + public void finishAll(DeviceCheckDetailParam param, AuthAdmin user) { + int finishCount = 0; + int exceptionCount = 0; + int itemCount = 0; + if (CollUtil.isNotEmpty(param.getDetailItemEntities())) { + for (DeviceCheckDetailItemEntity itemEntity : param.getDetailItemEntities()) { + if (!IntUtil.value(itemEntity.getNormalFlag())) { + exceptionCount++; + } + finishCount++; + itemCount++; + finish(DeviceCheckDetailItemFinishParam.builder() + .taskId(param.getTaskId()) + .deviceCode(param.getDeviceCode()) + .itemCode(itemEntity.getItemCode()) + .normalFlag(itemEntity.getNormalFlag()) + .suggestion("") + .build(), user); + } + } + + + deviceCheckDetailMapper.update(DeviceCheckDetailEntity.builder() + .finishFlag(true) + .finishCount(finishCount) + .suggestion(param.getSuggestion()) + .livePath(param.getLivePath()) + .normalFlag(param.getNormalFlag()) + .finishTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .exceptionCount(exceptionCount).itemCount(itemCount).build(), + Wrappers.lambdaUpdate(DeviceCheckDetailEntity.class) + .eq(DeviceCheckDetailEntity::getTaskId, param.getTaskId()) + .eq(DeviceCheckDetailEntity::getDeviceCode, param.getDeviceCode()) + ); + + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java new file mode 100644 index 00000000..512385a8 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java @@ -0,0 +1,147 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceCheckDetailMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.entity.dev.DeviceRepairEntity; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceCheckDetailParam; +import com.glxp.api.req.dev.DeviceCheckDetailQuery; +import com.glxp.api.req.dev.DeviceCheckDetailRepairParam; +import com.glxp.api.service.dev.DeviceCheckDetailService; +import com.glxp.api.service.dev.DeviceCheckService; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DeviceRepairService; +import com.glxp.api.util.SnowflakeUtil; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_check_detail(巡检任务明细)】的数据库操作Service实现 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class DeviceCheckDetailServiceImpl extends ServiceImpl + implements DeviceCheckDetailService { + + final DeviceCheckService deviceCheckService; + final DeviceInfoService deviceInfoService; + final DeviceRepairService deviceRepairService; + + @Override + public List pageList(DeviceCheckDetailQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + List list = super.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class) + .eq(DeviceCheckDetailEntity::getTaskId, query.getTaskId()) + .eq(StrUtil.isNotBlank(query.getDeviceCode()), DeviceCheckDetailEntity::getDeviceCode, query.getDeviceCode()) + .orderBy(true, true, DeviceCheckDetailEntity::getFinishFlag) + .orderBy(true, false, DeviceCheckDetailEntity::getExceptionCount) + .orderBy(true, true, DeviceCheckDetailEntity::getDeptCode) + .orderBy(true, true, DeviceCheckDetailEntity::getFinishTime) + .orderBy(true, true, DeviceCheckDetailEntity::getDeptCode) +// .orderByAsc(DeviceCheckDetailEntity::getFinishFlag, DeviceCheckDetailEntity::getDeptCode, DeviceCheckDetailEntity::getDeptCode) + ); + + return list; + } + + @Override + public List listByTaskId(Long taskId, String deviceCode) { + List list = super.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class) + .eq(DeviceCheckDetailEntity::getTaskId, taskId) + .eq(deviceCode != null, DeviceCheckDetailEntity::getDeviceCode, deviceCode) + .orderByAsc(DeviceCheckDetailEntity::getDeptCode, DeviceCheckDetailEntity::getDeviceCode) + ); + return list; + + } + + @Override + public DeviceCheckDetailEntity getOne(Long taskId, String deviceCode) { + return super.getOne(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class) + .eq(DeviceCheckDetailEntity::getTaskId, taskId) + .eq(DeviceCheckDetailEntity::getDeviceCode, deviceCode) + ); + } + + @Override + @Transactional + public void finishItem(Long taskId, String deviceCode, String deptCode, boolean normalFlag, AuthAdmin user) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceCheckDetailEntity.class) + .setSql("finishCount = finishCount + 1") + .setSql(!normalFlag, "exceptionCount = exceptionCount + 1") + .eq(DeviceCheckDetailEntity::getTaskId, taskId) + .eq(DeviceCheckDetailEntity::getDeviceCode, deviceCode) + .last("and finishCount+1<=itemCount") + ); + if (updated) { + updated = super.update(Wrappers.lambdaUpdate(DeviceCheckDetailEntity.class) + .set(DeviceCheckDetailEntity::getFinishFlag, true) + .set(DeviceCheckDetailEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceCheckDetailEntity::getUpdateTime, LocalDateTime.now()) + .eq(DeviceCheckDetailEntity::getTaskId, taskId) + .eq(DeviceCheckDetailEntity::getDeviceCode, deviceCode) + .last("and finishCount = itemCount") + ); + if (updated) { + // 所有项目全部完成。。。修改任务单完成设备 and 关闭设备的巡检锁 + deviceCheckService.finishDevice(taskId, deviceCode); + deviceInfoService.finishCheck(deviceCode, deptCode, taskId, user); + } + + } + } + + @Override + @Transactional + public void repair(DeviceCheckDetailRepairParam param, AuthAdmin user) { + LocalDateTime now = LocalDateTime.now(); + DeviceCheckDetailEntity detailEntity = this.getOne(param.getTaskId(), param.getDeviceCode()); + if (detailEntity == null) { + throw new JsonException("未在任务单中找到设备"); + } + if (!detailEntity.getFinishFlag()) { + throw new JsonException("设备还未巡检完成,请等待设备巡检完成后再创建"); + } + if (detailEntity.getExceptionCount() == 0) { + throw new JsonException("设备没有异常项目,无法创建维修单"); + } + Long repairId = SnowflakeUtil.getId(); + //创建维修单 + DeviceRepairEntity repairEntity = BeanUtil.copyProperties(detailEntity, DeviceRepairEntity.class); + repairEntity.setId(repairId).setCheckTaskId(param.getTaskId()).setFinishFlag(false) + .setCreateUserId(user.getId()).setCreateUserName(user.getEmployeeName()) + .setCreateDeptCode(user.getLocDeptCode()).setCreateDeptName(user.getDeptName()) + .setCreateTime(now).setDescription(param.getDescription()).setDiagnosisInfo(param.getDiagnosisInfo()).setInnerFlag(param.getInnerFlag()) + .setRepairUserName(param.getRepairUserName()).setRepairUserPhone(param.getRepairUserPhone()) + ; + deviceRepairService.createRepair(repairEntity); + super.update(Wrappers.lambdaUpdate(DeviceCheckDetailEntity.class) + .set(DeviceCheckDetailEntity::getRepairId, repairId) + .set(DeviceCheckDetailEntity::getUpdateTime,now) + .eq(DeviceCheckDetailEntity::getTaskId, detailEntity.getTaskId()) + .eq(DeviceCheckDetailEntity::getDeviceCode, detailEntity.getDeviceCode()) + ); + } + + @Override + public void finish(DeviceCheckDetailParam param, AuthAdmin user) { + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckItemDictServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckItemDictServiceImpl.java new file mode 100644 index 00000000..9da382f9 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckItemDictServiceImpl.java @@ -0,0 +1,36 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceCheckItemDictMapper; +import com.glxp.api.entity.dev.DeviceCheckItemDictEntity; +import com.glxp.api.req.dev.DeviceCheckItemDictQuery; +import com.glxp.api.service.CustomServiceImpl; +import com.glxp.api.service.dev.DeviceCheckItemDictService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 针对表【device_check_item_dict(巡检项目字典)】的数据库操作Service实现 + */ +@Service +public class DeviceCheckItemDictServiceImpl extends CustomServiceImpl + implements DeviceCheckItemDictService { + + @Override + public List pageList(DeviceCheckItemDictQuery query) { + PageHelper.startPage(query.getPage(), query.getLimit()); + List list = super.list(Wrappers.lambdaQuery(DeviceCheckItemDictEntity.class) + .like(StrUtil.isNotBlank(query.getCode()), DeviceCheckItemDictEntity::getCode, query.getCode()) + .like(StrUtil.isNotBlank(query.getName()), DeviceCheckItemDictEntity::getName, query.getName()) + .orderByDesc(DeviceCheckItemDictEntity::getCreateTime) + ); + return list; + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckServiceImpl.java new file mode 100644 index 00000000..5244dd91 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckServiceImpl.java @@ -0,0 +1,216 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceCheckMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.*; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceCheckQuery; +import com.glxp.api.service.dev.*; +import com.glxp.api.util.SnowflakeUtil; +import com.glxp.api.vo.dev.DeviceCheckPrintVo; +import com.glxp.api.vo.dev.DeviceCheckPrintVo.DetailVo; +import com.glxp.api.vo.dev.DeviceCheckVo; +//import com.glxp.api.vo.dev.DevicePlanDetailVo; +import com.glxp.api.vo.dev.DevicePlanDetailVo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; + +/** + * 针对表【device_check(巡检任务表)】的数据库操作Service实现 + */ +@Service +@RequiredArgsConstructor +public class DeviceCheckServiceImpl extends ServiceImpl + implements DeviceCheckService { + + private final DevicePlanService devicePlanService; + private final DevicePlanDetailService devicePlanDetailService; + private final DevicePlanDetailItemService devicePlanDetailItemService; + + private final DeviceInfoService deviceInfoService; + @Lazy + @Autowired + private DeviceCheckDetailService deviceCheckDetailService; + @Lazy + @Autowired + private DeviceCheckDetailItemService deviceCheckDetailItemService; + + private final ThreadPoolTaskExecutor taskExecutor; + + @Override + @Transactional + public void genByPlanId(Long planId, boolean sysCreate, AuthAdmin user) throws JsonException { + DevicePlanEntity plan = devicePlanService.getById(planId); + if (plan == null) { + throw new JsonException("计划不存在"); + } + List planDetailList = devicePlanDetailService.listByPlanId(planId); + if (CollectionUtil.isEmpty(planDetailList)) { + throw new JsonException("计划巡检产品为空,不创建任务单"); + } + + List itemList = devicePlanDetailItemService.listByPlanId(planId); + Map> itemMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(itemList)) { + itemMap = itemList.stream().collect(Collectors.groupingBy(i -> i.getProductId() + "_" + i.getDeviceCode())); + } + + DeviceCheckEntity deviceCheckEntity = DeviceCheckEntity.builder() + .taskId(SnowflakeUtil.getId()) + .planId(plan.getPlanId()) + .planName(plan.getName()) + .chargeDeptCode(plan.getChargeDeptCode()) + .name(plan.getName()) + .finishCount(0) + .sysFlag(sysCreate) + .createTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .createUserId(sysCreate ? null : user.getId()) + .createUserName(sysCreate ? null : user.getEmployeeName()) + .build(); + List checkDetailList = new ArrayList<>(); + List checkDetailItemList = new ArrayList<>(); + Map> finalItemMap = itemMap; + planDetailList.forEach(d -> { + List items = finalItemMap.get(d.getProductId() + "_" + d.getDeviceCode()); + if (CollectionUtil.isEmpty(items)) { + items = new ArrayList<>(); + } + List productItems = finalItemMap.get(d.getProductId() + "_"); + if (CollectionUtil.isNotEmpty(productItems)) { + items.addAll(productItems); + } + if (CollectionUtil.isNotEmpty(items)) { + DeviceCheckDetailEntity detailEntity = DeviceCheckDetailEntity.builder() + .taskId(deviceCheckEntity.getTaskId()) + .updateTime(LocalDateTime.now()) + .finishFlag(false) + .build(); + BeanUtil.copyProperties(d, detailEntity); + boolean opened = deviceInfoService.openCheckLock(d.getDeviceCode(), d.getDeptCode()); + if (opened) { + items.forEach(item -> { + DeviceCheckDetailItemEntity deviceCheckDetailItem = DeviceCheckDetailItemEntity.builder() + .taskId(deviceCheckEntity.getTaskId()) + .deviceCode(d.getDeviceCode()) + .itemCode(item.getItemCode()) + .itemName(item.getName()) + .itemContent(item.getContent()) + .finishFlag(false) + .updateTime(LocalDateTime.now()) + .build(); +// deviceCheckDetailItem.setUpdateTime(LocalDateTime.now()); + checkDetailItemList.add(deviceCheckDetailItem); + }); + detailEntity.setItemCount(items.size()); + checkDetailList.add(detailEntity); + } + } + }); + + if (CollectionUtil.isNotEmpty(checkDetailList)) { + devicePlanService.addExecCount(planId); + deviceCheckEntity.setDeviceCount(checkDetailList.size()); + super.save(deviceCheckEntity); + deviceCheckDetailService.saveBatch(checkDetailList); + if (CollectionUtil.isNotEmpty(checkDetailItemList)) { + deviceCheckDetailItemService.saveBatch(checkDetailItemList); + } + } else { + throw new JsonException(String.format("没有配置巡检项目 或者 没有找到处于[%s]状态的设备,无法生成巡检单", DeviceStatusEnum.NORMAL.getDesc())); + } + } + + @Override + public List pageList(DeviceCheckQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + List list = super.baseMapper.pageVo(query); +// List list = super.list(Wrappers.lambdaQuery(DeviceCheckEntity.class) +// .orderByAsc(DeviceCheckEntity::getCreateTime) +// ); + return list; + } + + @Override + public DeviceCheckPrintVo checkInfoPrint(Long taskId, String deviceCode) { + CompletableFuture infoFuture = CompletableFuture.supplyAsync(() -> { + return super.baseMapper.getVoById(taskId); + }, taskExecutor); + CompletableFuture> detailFuture = CompletableFuture.supplyAsync(() -> { + return deviceCheckDetailService.listByTaskId(taskId, deviceCode); + }, taskExecutor); + CompletableFuture> detailItemFuture = CompletableFuture.supplyAsync(() -> { + return deviceCheckDetailItemService.listByTaskId(taskId, deviceCode); + }, taskExecutor); + + try { + CompletableFuture.allOf(detailItemFuture).get(); + DeviceCheckVo checkVo = infoFuture.get(); + List details = detailFuture.get(); + List items = detailItemFuture.get(); + if (checkVo == null || details == null || items == null) { + throw new JsonException("任务单不存在"); + } + List detailVos = BeanUtil.copyToList(details, DetailVo.class); + Map> itemsMap = items.stream().collect(Collectors.groupingBy(DeviceCheckDetailItemEntity::getDeviceCode)); + detailVos.forEach(i -> { + i.setDetailItems(itemsMap.get(i.getDeviceCode())); + }); + DeviceCheckPrintVo vo = DeviceCheckPrintVo.builder() + .printTime(LocalDateTime.now()) + .info(checkVo) + .details(detailVos) + .build(); + return vo; + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + + @Override + @Transactional + public void finishDevice(Long taskId, String deviceCode) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceCheckEntity.class) + .setSql("finishCount = finishCount + 1") + .setSql(String.format("exceptionCount = exceptionCount + (select exceptionCount>0 from device_check_detail where taskId = %s and deviceCode = '%s')", taskId, deviceCode)) + .eq(DeviceCheckEntity::getTaskId, taskId) + .last("and finishCount+1 <= deviceCount") + ); + if (updated) { + updated = super.update(Wrappers.lambdaUpdate(DeviceCheckEntity.class) + .set(DeviceCheckEntity::getFinishFlag, true) + .set(DeviceCheckEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceCheckEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceCheckEntity::getTaskId, taskId) + .eq(DeviceCheckEntity::getFinishFlag, false) + .last("and finishCount = deviceCount") + ); + } + } + +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceInfoServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceInfoServiceImpl.java new file mode 100644 index 00000000..f0720e65 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceInfoServiceImpl.java @@ -0,0 +1,236 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceInfoMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceInfoEntity; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery; +import com.glxp.api.req.dev.DeviceInfoDetailQuery; +import com.glxp.api.req.dev.DeviceInfoQuery; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.vo.dev.DeviceInfoVo; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_info(设备表)】的数据库操作Service实现 + */ +@Service +public class DeviceInfoServiceImpl extends ServiceImpl + implements DeviceInfoService { + + @Override + @Transactional + public void changeDept(String deviceCode, String oldDeptCode, String toDeptCode, Long orderId) throws JsonException { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .setSql("changeCount = changeCount +1") + .set(DeviceInfoEntity::getDeptCode, toDeptCode) + .set(DeviceInfoEntity::getLastChangeOrderId, orderId) + .set(DeviceInfoEntity::getStatus, DeviceStatusEnum.NORMAL) + .set(DeviceInfoEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeptCode, oldDeptCode) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getStatus, DeviceStatusEnum.CHANGE) + ); + if (!updated) { + throw new JsonException(String.format("设备[%s]变更归属失败,变更需要设备状态为[%s]且部门信息通过验证", deviceCode, DeviceStatusEnum.CHANGE.getDesc())); + } + } + + @Override + @Transactional + public void changeStatus(String deviceCode, String deptCode, DeviceStatusEnum oldStatus, DeviceStatusEnum toStatus) throws JsonException { + boolean isFinishRepair = oldStatus == DeviceStatusEnum.REPAIR && toStatus == DeviceStatusEnum.NORMAL; +// boolean isFinishCheck = oldStatus == DeviceStatusEnum.CHECK; + boolean isRepairApply = toStatus == DeviceStatusEnum.REPAIR_APPLY; + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .setSql(isFinishRepair, "repairCount = repairCount +1") +// .setSql(isFinishCheck, "checkCount = checkCount +1") + .setSql(isRepairApply, "repairApplyCount = repairApplyCount +1") + .set(DeviceInfoEntity::getStatus, toStatus) + .set(DeviceInfoEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getStatus, oldStatus) + .eq(toStatus == DeviceStatusEnum.CHANGE, DeviceInfoEntity::getCheckLock, false) + ); + if (!updated) { + throw new JsonException(String.format("设备[%s]状态变更失败,变更需要设备状态为[%s]、部门信息通过验证%s", deviceCode, oldStatus.getDesc(), toStatus == DeviceStatusEnum.CHANGE ? " 且 巡检未锁定" : "")); + } + } + + @Override + @Transactional + public boolean openCheckLock(String deviceCode, String deptCode) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) +// .setSql(isFinishCheck, "checkCount = checkCount +1") + .set(DeviceInfoEntity::getCheckLock, true) + .set(DeviceInfoEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getCheckLock, false) + ); + return updated; + } + + @Override + @Transactional + public boolean closeCheckLock(String deviceCode, String deptCode, boolean isCancel) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .setSql(!isCancel, "checkCount = checkCount +1") + .set(DeviceInfoEntity::getCheckLock, false) + .set(DeviceInfoEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getCheckLock, true) + ); + return updated; + } + + @Override + @Transactional + public void finishCheck(String deviceCode, String deptCode, Long checkTaskId, AuthAdmin checkUser) { + + boolean closed = this.closeCheckLock(deviceCode, deptCode, false); + if (closed) { + super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .set(DeviceInfoEntity::getLastCheckTaskId, checkTaskId) + .set(DeviceInfoEntity::getLastCheckUserId, checkUser.getId()) + .set(DeviceInfoEntity::getLastCheckUserName, checkUser.getEmployeeName()) + .set(DeviceInfoEntity::getUpdateTime,LocalDateTime.now()) +// .set(DeviceInfoEntity::getLastCheckPhone, checkUserPhone) + .set(DeviceInfoEntity::getLastCheckTime, LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + ); + } + + } + + @Override + @Transactional + public void finishRepair(String deviceCode, String deptCode, Long repairId, String repairUserName, String repairUserPhone) { + this.changeStatus(deviceCode, deptCode, DeviceStatusEnum.REPAIR, DeviceStatusEnum.NORMAL); + super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .set(DeviceInfoEntity::getLastRepairId, repairId) + .set(DeviceInfoEntity::getLastRepairUserName, repairUserName) + .set(DeviceInfoEntity::getLastRepairUserPhone, repairUserPhone) + .set(DeviceInfoEntity::getLastRepairTime, LocalDateTime.now()) + .set(DeviceInfoEntity::getUpdateTime, LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + ); + } + + @Override + public void repairApply(String deviceCode, String deptCode, Long applyId) { + this.changeStatus(deviceCode, deptCode, DeviceStatusEnum.NORMAL, DeviceStatusEnum.REPAIR_APPLY); + super.update(Wrappers.lambdaUpdate(DeviceInfoEntity.class) + .set(DeviceInfoEntity::getLastRepairApplyId, applyId) + .set(DeviceInfoEntity::getLastRepairApplyTime, LocalDateTime.now()) + .set(DeviceInfoEntity::getUpdateTime, LocalDateTime.now()) + .eq(DeviceInfoEntity::getDeviceCode, deviceCode) + .eq(DeviceInfoEntity::getDeptCode, deptCode) + ); + } + + @Override + public List pageVo(DeviceInfoQuery query, String locDeptCode) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.pageVo(query, locDeptCode); + } + + @Override + public List allPageVo(DeviceInfoQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.allPageVo(query); + } + + @Override + public List detail(DeviceInfoDetailQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.detail(query); + } + + @Override + public List detail(DeviceInfoDetailByDeptCodeQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.detail(query); + } + + @Override + public List listVoByProductIdAndStatus(Long productId, DeviceStatusEnum status) { + + List list = super.baseMapper.listVoByProductIdAndStatus(productId, status); +// List list = super.list(Wrappers.lambdaQuery(DeviceInfoEntity.class) +// .eq(DeviceInfoEntity::getProductId, productId) +// .eq(DeviceInfoEntity::getStatus, status) +// ); + return list; + } + + @Override + public List listVoByCodes(List deviceCodes, String deptCode, DeviceStatusEnum status) { + + List list = super.baseMapper.listVoByCodes(deviceCodes, deptCode, status); + return list; + } + + @Override + public boolean exitOrder(Long orderId, String deviceCode) { + return super.baseMapper.exists(new QueryWrapper().eq("deviceCode", deviceCode).ne("lastChangeOrderId", orderId)); + } + + @Override + public String genDeviceCode() { + String deviceCode = ""; + DeviceInfoEntity deviceInfo = null; + do { + deviceCode = "S" + RandomUtil.randomNumbers(10); + deviceInfo = super.getById(deviceCode); + } while (deviceInfo != null); + return deviceCode; + } + + @Override + public boolean updateOrderItem(DeviceInfoEntity entity) { + String ybbm = entity.getYbbm(); + if (StrUtil.isNotEmpty(ybbm) && ybbm.length() >= 7) { + String catalogCode = ybbm.substring(0, 7); + Integer catalogcode1 = Integer.valueOf(ybbm.substring(1, 3)); + Integer catalogcode2 = Integer.valueOf(catalogcode1 + ybbm.substring(3, 5)); + Integer catalogcode3 = Integer.valueOf(catalogcode2 + ybbm.substring(5, 7)); + entity.setCatalogCode1(catalogcode1); + entity.setCatalogCode2(catalogcode2); + entity.setCatalogCode3(catalogcode3); + entity.setCatalogCode(catalogCode); + } + entity.setUpdateTime(LocalDateTime.now()); + UpdateWrapper uw = new UpdateWrapper<>(); + uw.eq("deviceCode",entity.getDeviceCode()); + return super.update(entity,uw); + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailItemServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailItemServiceImpl.java new file mode 100644 index 00000000..9a865e7f --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailItemServiceImpl.java @@ -0,0 +1,50 @@ +package com.glxp.api.service.dev.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DevicePlanDetailItemMapper; +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; +import com.glxp.api.req.dev.DevicePlanDetailItemQuery; +import com.glxp.api.service.CustomServiceImpl; +import com.glxp.api.service.dev.DevicePlanDetailItemService; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 巡检设备的项目 + * data: 2023/11/10 + */ + +/** + * 针对表【device_plan_detail_item(巡检设备的项目)】的数据库操作Service实现 + */ +@Service +public class DevicePlanDetailItemServiceImpl extends CustomServiceImpl + implements DevicePlanDetailItemService { + + @Override + public List listByPlanId(Long planId) { + List list = super.list(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + ); + return list; + } + + @Override + public List pageList(DevicePlanDetailItemQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + + List list = super.list(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, query.getPlanId()) + .eq(DevicePlanDetailItemEntity::getDeviceCode, query.getDeviceCode()) + .orderByDesc(DevicePlanDetailItemEntity::getDeviceCode, DevicePlanDetailItemEntity::getItemCode) + ); + return list; + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailServiceImpl.java new file mode 100644 index 00000000..789931b8 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanDetailServiceImpl.java @@ -0,0 +1,98 @@ +package com.glxp.api.service.dev.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DevicePlanDetailMapper; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.entity.dev.DevicePlanDetailItemEntity; +import com.glxp.api.req.dev.DevicePlanDetailGroupQuery; +import com.glxp.api.req.dev.DevicePlanDetailQuery; +import com.glxp.api.service.CustomServiceImpl; +import com.glxp.api.service.dev.DevicePlanDetailItemService; +import com.glxp.api.service.dev.DevicePlanDetailService; +import com.glxp.api.vo.dev.DevicePlanDetailVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 针对表【device_plan_detail(巡检计划明细)】的数据库操作Service实现 + */ +@Service +@RequiredArgsConstructor +public class DevicePlanDetailServiceImpl extends CustomServiceImpl + implements DevicePlanDetailService { + + private final DevicePlanDetailItemService devicePlanDetailItemService; + + @Override + public List listByPlanId(Long planId) { + List list = super.baseMapper.listByPlanId(planId); + return list; + } + + @Override + public List pageGroupVo(DevicePlanDetailGroupQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.pageGroupVo(query); + } + + @Override + public List pageVo(DevicePlanDetailQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.pageVo(query); + } + + @Override + @Transactional + public void delByPlanId(Long planId) { + boolean b = super.remove(Wrappers.lambdaQuery(DevicePlanDetailEntity.class) + .eq(DevicePlanDetailEntity::getPlanId, planId) + ); + if (b) { + devicePlanDetailItemService.remove(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + ); + } + } + + @Override + @Transactional + public void delByProductId(Long planId, Long productId) { + boolean b = super.remove(Wrappers.lambdaQuery(DevicePlanDetailEntity.class) + .eq(DevicePlanDetailEntity::getPlanId, planId) + .eq(DevicePlanDetailEntity::getProductId, productId) + ); + if (b) { + devicePlanDetailItemService.remove(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + .eq(DevicePlanDetailItemEntity::getProductId, productId) + ); + } + } + + @Override + @Transactional + public void delByDeviceCode(Long planId, String deviceCode) { + boolean b = super.remove(Wrappers.lambdaQuery(DevicePlanDetailEntity.class) + .eq(DevicePlanDetailEntity::getPlanId, planId) + .eq(DevicePlanDetailEntity::getDeviceCode, deviceCode) + ); + if (b) { + devicePlanDetailItemService.remove(Wrappers.lambdaQuery(DevicePlanDetailItemEntity.class) + .eq(DevicePlanDetailItemEntity::getPlanId, planId) + .eq(DevicePlanDetailItemEntity::getDeviceCode, deviceCode) + ); + } + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DevicePlanServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanServiceImpl.java new file mode 100644 index 00000000..39a73f7f --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DevicePlanServiceImpl.java @@ -0,0 +1,61 @@ +package com.glxp.api.service.dev.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DevicePlanMapper; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.req.dev.DevicePlanQuery; +import com.glxp.api.service.dev.DevicePlanDetailService; +import com.glxp.api.service.dev.DevicePlanService; +import com.glxp.api.vo.dev.DevicePlanVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 针对表【device_plan(设备巡检计划)】的数据库操作Service实现 + */ +@Service +@RequiredArgsConstructor +public class DevicePlanServiceImpl extends ServiceImpl + implements DevicePlanService { + + private final DevicePlanDetailService devicePlanDetailService; + + + @Override + public List pageList(DevicePlanQuery query) { + PageHelper.startPage(query.getPage(), query.getLimit()); + List list =super.baseMapper.pageVo(query); +// List list = super.list(Wrappers.lambdaQuery(DevicePlanEntity.class) +// .like(StrUtil.isNotBlank(query.getName()), DevicePlanEntity::getName, query.getName()) +// .orderByDesc(DevicePlanEntity::getStartDate) +// ); + return list; + } + + @Override + @Transactional + public void deletePlan(Long planId) { + boolean b = super.removeById(planId); + if (b) { + devicePlanDetailService.delByPlanId(planId); + } + } + + @Override + @Transactional + public void addExecCount(Long planId) { + super.update(Wrappers.lambdaUpdate(DevicePlanEntity.class) + .setSql("execCount = execCount + 1") + .eq(DevicePlanEntity::getPlanId, planId) + ); + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java new file mode 100644 index 00000000..117e8780 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java @@ -0,0 +1,141 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceRepairApplyDetailMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.entity.dev.DeviceRepairEntity; +import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import com.glxp.api.service.dev.DeviceRepairApplyService; +import com.glxp.api.service.dev.DeviceRepairService; +import com.glxp.api.util.SnowflakeUtil; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_repair_apply_detail(设备报修单明细)】的数据库操作Service实现 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class DeviceRepairApplyDetailServiceImpl extends ServiceImpl + implements DeviceRepairApplyDetailService { + + final DeviceRepairApplyService deviceRepairApplyService; + + @Autowired + @Lazy + DeviceRepairService deviceRepairService; + final DeviceInfoService deviceInfoService; + + @Override + public List pageList(DeviceRepairApplyDetailQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + List list = super.list(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class) + .eq(DeviceRepairApplyDetailEntity::getApplyId, query.getApplyId()) + .orderByAsc(DeviceRepairApplyDetailEntity::getDeviceCode) + ); + return list; + } + + @Override + @Transactional + public void diagnosis(DeviceRepairApplyDetailDiagnosisParam param, AuthAdmin user) { + LocalDateTime now = LocalDateTime.now(); + param.valid(); + DeviceRepairApplyEntity repairApply = deviceRepairApplyService.getByIdAndStatus(param.getApplyId(), DeviceRepairApplyStatusEnum.PROCESSING); + if (repairApply == null) { + throw new JsonException(String.format("报修单不处于[%s]状态,无法诊断", DeviceRepairApplyStatusEnum.PROCESSING.getDesc())); + } + DeviceRepairApplyDetailEntity one = super.getOne(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class) + .eq(DeviceRepairApplyDetailEntity::getApplyId, param.getApplyId()) + .eq(DeviceRepairApplyDetailEntity::getDeviceCode, param.getDeviceCode()) + .eq(DeviceRepairApplyDetailEntity::getStatus, DeviceRepairApplyDetailStatusEnum.WAIT_DIAGNOSIS) + ); + if (one == null) { + throw new JsonException(String.format("该设备不处于[%s]状态,无法诊断", DeviceRepairApplyDetailStatusEnum.WAIT_DIAGNOSIS.getDesc())); + } + Long repairId = null; + if (!param.getRepairFlag()) { + deviceRepairApplyService.finishDeviceRepair(param.getApplyId()); + } else { + repairId = SnowflakeUtil.getId(); + //需要维修创建维修单 + DeviceRepairEntity repairEntity = BeanUtil.copyProperties(one, DeviceRepairEntity.class); + repairEntity.setId(repairId).setApplyId(param.getApplyId()).setFinishFlag(false) + .setCreateUserId(user.getId()).setCreateUserName(user.getEmployeeName()) + .setCreateDeptCode(user.getLocDeptCode()).setCreateDeptName(user.getDeptName()) + .setCreateTime(now).setDiagnosisInfo(param.getDiagnosisInfo()).setInnerFlag(param.getInnerFlag()) + .setRepairUserName(param.getRepairUserName()).setRepairUserPhone(param.getRepairUserPhone()).setRepairDeptCode(param.getRepairDeptCode()) + ; + deviceRepairService.createRepair(repairEntity); + } + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceRepairApplyDetailEntity.class) + .set(DeviceRepairApplyDetailEntity::getStatus, param.getRepairFlag() ? DeviceRepairApplyDetailStatusEnum.REPAIRING : DeviceRepairApplyDetailStatusEnum.FINISH) + .set(DeviceRepairApplyDetailEntity::getRepairId, repairId) + .set(DeviceRepairApplyDetailEntity::getRepairFlag, param.getRepairFlag()) + .set(DeviceRepairApplyDetailEntity::getDiagnosisInfo, param.getDiagnosisInfo()) + .set(DeviceRepairApplyDetailEntity::getConfirmUserId, user.getId()) + .set(DeviceRepairApplyDetailEntity::getConfirmUserName, user.getEmployeeName()) + .set(DeviceRepairApplyDetailEntity::getConfirmDeptCode, user.getLocDeptCode()) + .set(DeviceRepairApplyDetailEntity::getConfirmDeptName, user.getDeptName()) + .set(DeviceRepairApplyDetailEntity::getConfirmTime, now) + .set(!param.getRepairFlag(), DeviceRepairApplyDetailEntity::getFinishTime, now) + .eq(DeviceRepairApplyDetailEntity::getApplyId, param.getApplyId()) + .eq(DeviceRepairApplyDetailEntity::getDeviceCode, param.getDeviceCode()) + .eq(DeviceRepairApplyDetailEntity::getStatus, DeviceRepairApplyDetailStatusEnum.WAIT_DIAGNOSIS) + ); + if (!updated) { + throw new JsonException("设备诊断失败[未找到对应状态的设备],请稍后再试"); + } + + } + + @Override + @Transactional + public void finishDeviceRepair(Long applyId, String deviceCode) { + DeviceRepairApplyDetailEntity one = super.getOne(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class) + .eq(DeviceRepairApplyDetailEntity::getApplyId, applyId) + .eq(DeviceRepairApplyDetailEntity::getDeviceCode, deviceCode) + .eq(DeviceRepairApplyDetailEntity::getStatus, DeviceRepairApplyDetailStatusEnum.REPAIRING) + ); + if (one == null) { + throw new JsonException(String.format("该设备不处于[%s]状态,无法完成维修", DeviceRepairApplyDetailStatusEnum.REPAIRING.getDesc())); + } + //修改报修单中设备状态 + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceRepairApplyDetailEntity.class) + .set(DeviceRepairApplyDetailEntity::getStatus, DeviceRepairApplyDetailStatusEnum.FINISH) + .set(DeviceRepairApplyDetailEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceRepairApplyDetailEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceRepairApplyDetailEntity::getApplyId, applyId) + .eq(DeviceRepairApplyDetailEntity::getDeviceCode, deviceCode) + .eq(DeviceRepairApplyDetailEntity::getStatus, DeviceRepairApplyDetailStatusEnum.REPAIRING) + ); + if (updated) { + deviceRepairApplyService.finishDeviceRepair(applyId); + } + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java new file mode 100644 index 00000000..410ab0b4 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java @@ -0,0 +1,154 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceRepairApplyMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.req.dev.DeviceRepairApplyAddParam; +import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; +import com.glxp.api.req.dev.DeviceRepairApplyQuery; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import com.glxp.api.service.dev.DeviceRepairApplyService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_repair_apply(设备报修单)】的数据库操作Service实现 + */ +@Service +@RequiredArgsConstructor +public class DeviceRepairApplyServiceImpl extends ServiceImpl + implements DeviceRepairApplyService { + + + private final DeviceInfoService deviceInfoService; + + @Autowired + @Lazy + private DeviceRepairApplyDetailService repairApplyDetailService; + + @Override + public List pageList(DeviceRepairApplyQuery query) { + String acceptInfo = query.getAcceptInfo(); + String repairInfo = query.getRepairInfo(); + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(DeviceRepairApplyEntity.class); + wrapper.eq(query.getApplyId() != null, DeviceRepairApplyEntity::getId, query.getApplyId()) + .eq(query.getStatus() != null, DeviceRepairApplyEntity::getStatus, query.getStatus()) + .eq(query.getConfirmUserId() != null, DeviceRepairApplyEntity::getConfirmUserId, query.getConfirmUserId()) + .eq(StrUtil.isNotBlank(query.getApplyDeptCode()), DeviceRepairApplyEntity::getApplyDeptCode, query.getApplyDeptCode()) + .orderByDesc(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyEntity::getApplyTime); + if (StringUtils.isNotBlank(acceptInfo)){ + wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getConfirmDeptCode, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmDeptName, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmUserId, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmUserName, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmPhone, acceptInfo)); + } + if (StringUtils.isNotBlank(repairInfo)){ + wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getApplyDeptCode, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyDeptName, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserId, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserName, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserPhone, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getId, repairInfo)); + } + + List list = super.list(wrapper); + return list; + } + + @Override + public DeviceRepairApplyEntity getByIdAndStatus(Long applyId, DeviceRepairApplyStatusEnum status) { + return super.getOne(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class) + .eq(DeviceRepairApplyEntity::getId, applyId) + .eq(DeviceRepairApplyEntity::getStatus, status) + ); + } + + @Override + @Transactional + public void addDeviceRepairApply(DeviceRepairApplyAddParam param, AuthAdmin user) { + param.valid(); + DeviceRepairApplyEntity repairApply = param.getEntity(user); + List detailEntityList = param.getDetailEntityList(repairApply.getId(), deviceInfoService, user); + detailEntityList.forEach(d -> { + deviceInfoService.repairApply(d.getDeviceCode(), d.getDeptCode(), d.getApplyId()); + }); + repairApply.setUpdateTime(LocalDateTime.now()); + super.save(repairApply); + for (DeviceRepairApplyDetailEntity entity : detailEntityList) { + LocalDateTime now = LocalDateTime.now(); + entity.setUpdateTime(now); + } + repairApplyDetailService.saveBatch(detailEntityList); + + } + + @Override + @Transactional + public void confirmDeviceRepairApply(DeviceRepairApplyConfirmParam param, AuthAdmin user) { + super.update(Wrappers.lambdaUpdate(DeviceRepairApplyEntity.class) + .set(DeviceRepairApplyEntity::getConfirmUserId, user.getId()) + .set(DeviceRepairApplyEntity::getConfirmUserName, user.getEmployeeName()) + .set(DeviceRepairApplyEntity::getConfirmDeptCode, user.getLocDeptCode()) + .set(DeviceRepairApplyEntity::getConfirmDeptName, user.getDeptName()) + .set(DeviceRepairApplyEntity::getUpdateTime,LocalDateTime.now()) + .set(DeviceRepairApplyEntity::getConfirmPhone, param.getConfirmUserPhone()) + .set(DeviceRepairApplyEntity::getConfirmTime, LocalDateTime.now()) + .set(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyStatusEnum.PROCESSING) + .eq(DeviceRepairApplyEntity::getId, param.getApplyId()) + .eq(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyStatusEnum.WAIT_PROCESS) + ); + } + + @Override + @Transactional + public void finishDeviceRepair(Long applyId) { + //修改已完成数量 + super.update(Wrappers.lambdaUpdate(DeviceRepairApplyEntity.class) + .setSql("finishCount = finishCount + 1") + .eq(DeviceRepairApplyEntity::getId, applyId) + .eq(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyStatusEnum.PROCESSING) + .last("and finishCount + 1 <= deviceCount") + ); + //修改状态和完成时间 + super.update(Wrappers.lambdaUpdate(DeviceRepairApplyEntity.class) + .set(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyStatusEnum.FINISH) + .set(DeviceRepairApplyEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceRepairApplyEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceRepairApplyEntity::getId, applyId) + .eq(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyStatusEnum.PROCESSING) + .last("and deviceCount = finishCount") + ); + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairServiceImpl.java new file mode 100644 index 00000000..ae9aa816 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairServiceImpl.java @@ -0,0 +1,94 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceRepairMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairEntity; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceRepairQuery; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import com.glxp.api.service.dev.DeviceRepairService; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_repair(设备维修单)】的数据库操作Service实现 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class DeviceRepairServiceImpl extends ServiceImpl + implements DeviceRepairService { + + final DeviceRepairApplyDetailService deviceRepairApplyDetailService; + final DeviceInfoService deviceInfoService; + + @Override + public List pageList(DeviceRepairQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + List list = super.list(Wrappers.lambdaQuery(DeviceRepairEntity.class) + .eq(DeviceRepairEntity::getCreateUserId, query.getCreateUserId()) + .eq(query.getIsFinish() != null, DeviceRepairEntity::getFinishFlag, query.getIsFinish()) + .eq(StrUtil.isNotBlank(query.getDeviceCode()), DeviceRepairEntity::getDeviceCode, query.getDeviceCode()) + .orderByAsc(DeviceRepairEntity::getFinishFlag) + .orderByDesc(DeviceRepairEntity::getCreateTime) + ); + + return list; + } + + @Override + @Transactional + public void createRepair(DeviceRepairEntity repair) { + boolean saved = super.save(repair); + if (saved) { + //修改设备状态 + deviceInfoService.changeStatus(repair.getDeviceCode(), repair.getDeptCode(), repair.getApplyId() != null ? DeviceStatusEnum.REPAIR_APPLY : DeviceStatusEnum.NORMAL, DeviceStatusEnum.REPAIR); + } + } + + @Override + @Transactional + public void finishByUser(Long repairId, AuthAdmin user) { + // 获取维修单信息 + DeviceRepairEntity entity = super.getById(repairId); + if (entity == null) { + throw new JsonException("未找到维修单"); + } + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceRepairEntity.class) + .set(DeviceRepairEntity::getFinishFlag, true) + .set(DeviceRepairEntity::getConfirmUserId, user.getId()) + .set(DeviceRepairEntity::getConfirmUserName, user.getEmployeeName()) + .set(DeviceRepairEntity::getConfirmDeptCode, user.getLocDeptCode()) + .set(DeviceRepairEntity::getConfirmDeptName, user.getDeptName()) + .set(DeviceRepairEntity::getConfirmTime, LocalDateTime.now()) + .set(DeviceRepairEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceRepairEntity::getId, repairId) + .eq(DeviceRepairEntity::getCreateUserId, user.getId()) + .eq(DeviceRepairEntity::getFinishFlag, false) + ); + if (updated && entity.getApplyId() != null) { + //完成报修单的设备维修 + deviceRepairApplyDetailService.finishDeviceRepair(entity.getApplyId(), entity.getDeviceCode()); + } + //完成设备维修 + deviceInfoService.finishRepair(entity.getDeviceCode(), entity.getDeptCode(), repairId, entity.getRepairUserName(), entity.getRepairUserPhone()); + + } +} + + + + diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrManufacturerService.java b/src/main/java/com/glxp/api/service/thrsys/ThrManufacturerService.java new file mode 100644 index 00000000..e37a52a8 --- /dev/null +++ b/src/main/java/com/glxp/api/service/thrsys/ThrManufacturerService.java @@ -0,0 +1,157 @@ +package com.glxp.api.service.thrsys; + +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.dao.thrsys.ThrManufacturerMapper; +import com.glxp.api.entity.basic.BasicProductsEntity; +import com.glxp.api.entity.thrsys.ThrManufacturerEntity; +import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; +import com.glxp.api.http.ErpBasicClient; +import com.glxp.api.req.thrsys.FilterBasicProducstRequest; +import com.glxp.api.req.thrsys.FilterThrCorpRequest; +import com.glxp.api.req.thrsys.ThrManuFilterRequest; +import com.glxp.api.res.PageSimpleResponse; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +@Service +public class ThrManufacturerService extends ServiceImpl { + + @Resource + private ThrManufacturerMapper thrManufacturerMapper; + @Resource + private ErpBasicClient erpBasicClient; + + + public List filterThrManu(FilterThrCorpRequest filterThrCorpRequest) { + if (filterThrCorpRequest == null) { + return Collections.emptyList(); + } + if (filterThrCorpRequest.getPage() != null) { + int offset = (filterThrCorpRequest.getPage() - 1) * filterThrCorpRequest.getLimit(); + PageHelper.offsetPage(offset, filterThrCorpRequest.getLimit()); + } + List data = thrManufacturerMapper.filterThrManu(filterThrCorpRequest); + return data; + } + + public BaseResponse downloadThrManu(ThrSystemDetailEntity thrSystemDetailEntity) { + int page = 1; + int limit = 100; + + while (true) { + ThrManuFilterRequest request = new ThrManuFilterRequest(); + request.setPage(page); + request.setLimit(limit); + request.setThirdSysFk(thrSystemDetailEntity.getThirdSysFk()); + BaseResponse> baseResponse = erpBasicClient.getThrManu(request); + + if (baseResponse.getCode() == 20000) { + List list = baseResponse.getData().getList(); + list.forEach(thrCorpsResponse -> { + ThrManufacturerEntity thrCorpEntity = thrManufacturerMapper.selectByUnitIdAndThirdId(thrCorpsResponse.getUnitId(), thrSystemDetailEntity.getThirdSysFk()); + if (null == thrCorpEntity) { + thrCorpEntity = new ThrManufacturerEntity(); + BeanUtils.copyProperties(thrCorpsResponse, thrCorpEntity); + thrCorpEntity.setCreateTime(new Date()); + thrCorpEntity.setUpdateTime(new Date()); + thrCorpEntity.setId(IdUtil.getSnowflakeNextId()); + thrCorpEntity.setThirdSysFk(thrSystemDetailEntity.getThirdSysFk()); + thrManufacturerMapper.insert(thrCorpEntity); + } else { + boolean isChange = verifyDataChange(thrCorpEntity, thrCorpsResponse); + if (isChange) { + thrCorpEntity.setUpdateTime(new Date()); + thrManufacturerMapper.updateById(thrCorpEntity); + } + } + }); + if (list.size() >= limit) { + page++; + } else { + break; + } + } else { + return baseResponse; + } + } + + return ResultVOUtils.success("下载完成"); + } + + public BaseResponse downloadByRequest(ThrManuFilterRequest request) { + int page = 1; + int limit = 100; + while (true) { + request.setPage(page); + request.setLimit(limit); + request.setThirdSysFk(request.getThirdSys()); + BaseResponse> baseResponse = erpBasicClient.getThrManu(request); + if (baseResponse.getCode() == 20000) { + List list = baseResponse.getData().getList(); + list.forEach(thrCorpsResponse -> { + ThrManufacturerEntity thrCorpEntity = thrManufacturerMapper.selectByUnitIdAndThirdId(thrCorpsResponse.getUnitId(), request.getThirdSys()); + if (null == thrCorpEntity) { + thrCorpEntity = new ThrManufacturerEntity(); + BeanUtils.copyProperties(thrCorpsResponse, thrCorpEntity); + thrCorpEntity.setCreateTime(new Date()); + thrCorpEntity.setUpdateTime(new Date()); + thrCorpEntity.setThirdSysFk(request.getThirdSys()); + thrCorpEntity.setId(IdUtil.getSnowflakeNextId()); + thrManufacturerMapper.insert(thrCorpEntity); + } else { + boolean isChange = verifyDataChange(thrCorpEntity, thrCorpsResponse); + if (isChange) { + thrCorpEntity.setUpdateTime(new Date()); + thrManufacturerMapper.updateById(thrCorpEntity); + } + } + }); + if (list.size() >= limit) { + page++; + } else { + break; + } + } else { + return baseResponse; + } + } + + return ResultVOUtils.success("下载完成"); + } + + private boolean verifyDataChange(ThrManufacturerEntity thrCorpEntity, ThrManufacturerEntity thrCorpsResponse) { + ThrManufacturerEntity oldData = new ThrManufacturerEntity(); + BeanUtils.copyProperties(thrCorpEntity, oldData); + thrCorpEntity.setSpell(thrCorpsResponse.getSpell()); + thrCorpEntity.setAddr(thrCorpsResponse.getAddr()); + thrCorpEntity.setContact(thrCorpsResponse.getCreditNo()); + thrCorpEntity.setContact(thrCorpsResponse.getContact()); + thrCorpEntity.setMobile(thrCorpsResponse.getMobile()); + thrCorpEntity.setName(thrCorpsResponse.getName()); + thrCorpEntity.setRemark(thrCorpsResponse.getRemark()); + return !thrCorpEntity.equals(oldData); + } + + public List getProductTypes(FilterBasicProducstRequest basicProducstRequest) { + if (basicProducstRequest == null) { + return Collections.emptyList(); + } + if (basicProducstRequest.getPage() != null) { + int offset = (basicProducstRequest.getPage() - 1) * basicProducstRequest.getLimit(); + PageHelper.offsetPage(offset, basicProducstRequest.getLimit()); + } + List data = thrManufacturerMapper.getProductTypes(basicProducstRequest); + return data; + } + + +} diff --git a/src/main/java/com/glxp/api/util/SnowflakeUtil.java b/src/main/java/com/glxp/api/util/SnowflakeUtil.java new file mode 100644 index 00000000..393fab88 --- /dev/null +++ b/src/main/java/com/glxp/api/util/SnowflakeUtil.java @@ -0,0 +1,18 @@ +package com.glxp.api.util; + + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; + +public class SnowflakeUtil { + + /** + * 获取雪花id + */ + public static synchronized Long getId() { + int workId = RandomUtil.randomInt(0, 31); + int dataCenterId = RandomUtil.randomInt(0, 31); + return IdUtil.getSnowflake(workId, dataCenterId).nextId(); + } +} + diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceChangeLogVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceChangeLogVo.java new file mode 100644 index 00000000..60fd9875 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceChangeLogVo.java @@ -0,0 +1,18 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceChangeLogEntity; +import lombok.Data; + +@Data +public class DeviceChangeLogVo extends DeviceChangeLogEntity { + + String typeName; + + + public String getTypeName() { + if (super.getType() != null) { + return super.getType().getDesc(); + } + return typeName; + } +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceChangeOrderVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceChangeOrderVo.java new file mode 100644 index 00000000..ed3923bf --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceChangeOrderVo.java @@ -0,0 +1,31 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceChangeOrderEntity; +import lombok.Data; + +@Data +public class DeviceChangeOrderVo extends DeviceChangeOrderEntity { + + String deptName; + + String toDeptName; + + String typeName; + + String statusName; + + + public String getTypeName() { + if (super.getType() != null) { + return super.getType().getDesc(); + } + return typeName; + } + + public String getStatusName() { + if (super.getStatus() != null) { + return super.getStatus().getDesc(); + } + return statusName; + } +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceCheckPrintVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceCheckPrintVo.java new file mode 100644 index 00000000..530d718b --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceCheckPrintVo.java @@ -0,0 +1,33 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.entity.dev.DeviceCheckDetailItemEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceCheckPrintVo { + + LocalDateTime printTime; + + DeviceCheckVo info; + + List details; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public class DetailVo extends DeviceCheckDetailEntity { + public List detailItems; + } + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceCheckVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceCheckVo.java new file mode 100644 index 00000000..85e09b35 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceCheckVo.java @@ -0,0 +1,11 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceCheckEntity; +import lombok.Data; + +@Data +public class DeviceCheckVo extends DeviceCheckEntity { + + String chargeDeptName; + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceInfoVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceInfoVo.java new file mode 100644 index 00000000..71880ffb --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceInfoVo.java @@ -0,0 +1,21 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceInfoEntity; +import lombok.Data; + +@Data +public class DeviceInfoVo extends DeviceInfoEntity { + + Integer count; + + String deptName; + + String statusName; + + public String getStatusName() { + if (super.getStatus() != null) { + return super.getStatus().getDesc(); + } + return statusName; + } +} diff --git a/src/main/java/com/glxp/api/vo/dev/DevicePlanDetailVo.java b/src/main/java/com/glxp/api/vo/dev/DevicePlanDetailVo.java new file mode 100644 index 00000000..2180014e --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DevicePlanDetailVo.java @@ -0,0 +1,82 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import lombok.Data; + +@Data +public class DevicePlanDetailVo extends DevicePlanDetailEntity { + /** + * UDI码 + */ + private String udi; + + /** + * DI码 + */ + private String nameCode; + + /** + * 产品名称 + */ + private String productName; + + /** + * 规格型号 + */ + private String ggxh; + + /** + * 批次号 + */ + private String batchNo; + + /** + * 序列号 + */ + private String serialNo; + + /** + * 生产日期 + */ + private String productionDate; + + /** + * 失效日期 + */ + private String expireDate; + + /** + * 生产厂家 + */ + private String manufactory; + + /** + * 计量单位 + */ + private String measname; + + /** + * 注册/备案凭证号 + */ + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + private String supId; + + /** + * 供应商名称 + */ + private String supName; + + /** + * 数量 + */ + Integer count; + + String deptCode; + + String deptName; + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DevicePlanVo.java b/src/main/java/com/glxp/api/vo/dev/DevicePlanVo.java new file mode 100644 index 00000000..d7ae0bb9 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DevicePlanVo.java @@ -0,0 +1,21 @@ +package com.glxp.api.vo.dev; + +import cn.hutool.core.date.LocalDateTimeUtil; +import com.glxp.api.entity.dev.DevicePlanEntity; +import lombok.Data; + +import java.time.LocalDate; + +@Data +public class DevicePlanVo extends DevicePlanEntity { + + Integer deviceCount; + + String chargeDeptName; + + Boolean isActive; + + public Boolean getIsActive() { + return LocalDateTimeUtil.isIn(LocalDate.now().atStartOfDay(), super.getStartDate().atStartOfDay(), super.getEndDate().atStartOfDay()); + } +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyDetailVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyDetailVo.java new file mode 100644 index 00000000..2c3ebe92 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyDetailVo.java @@ -0,0 +1,17 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import lombok.Data; + +@Data +public class DeviceRepairApplyDetailVo extends DeviceRepairApplyDetailEntity { + + String statusName; + + public String getStatusName() { + if (super.getStatus() != null) { + return super.getStatus().getDesc(); + } + return statusName; + } +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyVo.java new file mode 100644 index 00000000..42aba4b8 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceRepairApplyVo.java @@ -0,0 +1,17 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import lombok.Data; + +@Data +public class DeviceRepairApplyVo extends DeviceRepairApplyEntity { + + String statusName; + + public String getStatusName() { + if (super.getStatus() != null) { + return super.getStatus().getDesc(); + } + return statusName; + } +} diff --git a/src/main/resources/mybatis/mapper/dev/DeviceChangeLogMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceChangeLogMapper.xml new file mode 100644 index 00000000..35a40e16 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceChangeLogMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + id,deviceCode,type, + deptCode,toDeptCode,confirmUser, + confirmUserName,confirmTime,confirmRemark, + remark,createUserName,createUser, + createTime + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailItemMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailItemMapper.xml new file mode 100644 index 00000000..93a97043 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailItemMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + taskId,deviceCode,itemCode, + itemName,itemContent + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailMapper.xml new file mode 100644 index 00000000..d207383e --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceCheckDetailMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceCheckMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceCheckMapper.xml new file mode 100644 index 00000000..dfeecf62 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceCheckMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + taskId,planId,planName, + checkUserId,checkUserName,checkUserPhone, + name,remark,sysFlag, + createTime,createUserId,createUserName + + + + + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceInfoMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceInfoMapper.xml new file mode 100644 index 00000000..513223ec --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceInfoMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/mapper/dev/DevicePlanDetailItemMapper.xml b/src/main/resources/mybatis/mapper/dev/DevicePlanDetailItemMapper.xml new file mode 100644 index 00000000..b0858004 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DevicePlanDetailItemMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + detailId,itemCode,name, + content + + diff --git a/src/main/resources/mybatis/mapper/dev/DevicePlanDetailMapper.xml b/src/main/resources/mybatis/mapper/dev/DevicePlanDetailMapper.xml new file mode 100644 index 00000000..a1921cf4 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DevicePlanDetailMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/mapper/dev/DevicePlanMapper.xml b/src/main/resources/mybatis/mapper/dev/DevicePlanMapper.xml new file mode 100644 index 00000000..7ca05d0f --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DevicePlanMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + planId,name,startDate, + endDate,frequency,remark, + createUserId,createUserName,createTime + + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml new file mode 100644 index 00000000..bd0cf536 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + applyId,deviceCode,deptCode, + deptName,description,status, + repairFlag,repairId,productId, + udi,nameCode,productName, + ggxh,batchNo,serialNo, + productionDate,expireDate,manufactory, + measname,zczbhhzbapzbh,supId, + supName,confirmUserId,confirmUserName, + confirmTime,confirmRemark,updateTime + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyMapper.xml new file mode 100644 index 00000000..8053bdd1 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + id,status,applyDeptCode, + applyDeptName,applyUserId,applyUserName, + applyUserPhone,applyTime,deviceCount, + finishCount,confirmUserId,confirmUserName, + confirmTime,finishTime,updateTime + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceRepairMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceRepairMapper.xml new file mode 100644 index 00000000..70a30682 --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceRepairMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrManufacturerMapper.xml b/src/main/resources/mybatis/mapper/thrsys/ThrManufacturerMapper.xml new file mode 100644 index 00000000..9b4922a5 --- /dev/null +++ b/src/main/resources/mybatis/mapper/thrsys/ThrManufacturerMapper.xml @@ -0,0 +1,62 @@ + + + + + + + + + + From b952f02c2b713689215159cba48dc83326d3c87f Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 20 May 2024 10:42:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?5-20=20=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=201.3=20=E4=BF=AE=E6=94=B9sql=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/res/system/SyncDataSetResponse.java | 2 +- src/main/resources/schemas/schema_v2.4.sql | 786 +++++++++--------- 2 files changed, 394 insertions(+), 394 deletions(-) diff --git a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java index 4988aaab..15ed2e9b 100644 --- a/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java +++ b/src/main/java/com/glxp/api/res/system/SyncDataSetResponse.java @@ -69,7 +69,7 @@ public class SyncDataSetResponse { private int deviceInfo; //设备信息管理 private int deviceCheck;//巡检管理 private int deviceRepairApply;//报修管理 - private int produceBusiness;//生产企业 PRODUCE_BUSINESS_DATA + private int produceBusiness;//生产企业 PRODUCE_BUSINESS_DATA produceBusiness diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index ee88d7d4..72c3ec62 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -2,433 +2,433 @@ # # -CREATE TABLE IF NOT EXISTS "device_info" ( - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', - "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.正常,2变更归属中,3.维修申请中 4.维修中 6.销毁/报废', - "checkLock" bit(1) NOT NULL DEFAULT b'0' COMMENT '巡检锁定', - "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', - "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', - "productId" bigint NOT NULL COMMENT '产品id', - "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', - "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', - "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', - "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', - "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', - "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', - "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', - "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', - "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', - "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', - "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', - "changeCount" int NOT NULL DEFAULT '0' COMMENT '变更次数', - "repairApplyCount" int NOT NULL DEFAULT '0' COMMENT '报修次数', - "repairCount" int NOT NULL DEFAULT '0' COMMENT '维修次数', - "checkCount" int NOT NULL DEFAULT '0' COMMENT '巡检次数', - "lastChangeOrderId" bigint NOT NULL COMMENT '最后变更单号', - "lastRepairApplyId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后报修申请单号', - "lastRepairApplyTime" datetime DEFAULT NULL COMMENT '最后报修时间', - "lastRepairId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修单号', - "lastRepairUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修负责人名称', - "lastRepairUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修人联系电话', - "lastRepairTime" datetime DEFAULT NULL COMMENT '最后维修时间', - "lastCheckUserId" bigint DEFAULT NULL COMMENT '最后检查/巡检负责人', - "lastCheckUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检负责人名称', - "lastCheckPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检人联系电话', - "lastCheckTime" datetime DEFAULT NULL COMMENT '最后检查/巡检时间', - "lastCheckTaskId" bigint DEFAULT NULL COMMENT '最后检查/巡检任务id', - "createTime" datetime NOT NULL COMMENT '创建时间', - "createUserId" bigint NOT NULL COMMENT '创建人id', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', - "assetType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产分类', - "sasacType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国资分类', - "assetMnemonicCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产助记码', - "number" int DEFAULT '1' COMMENT '数量', - "acquisitionMethod" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取得方式', - "purpose" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用途', - "depreciationYear" int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧年', - "depreciationMonth" int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧月', - "invCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '存储仓库', - "estimatedTotalHour" int(10) unsigned zerofill DEFAULT NULL COMMENT '预计总工时', - "dayHour" int(10) unsigned zerofill DEFAULT NULL COMMENT '单日工时', - "assetValue" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '单个资产价值', - "ownFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '自有资金', - "financialAppropriation" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '财政拨款', - "educationFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '科教基金', - "otherFund" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '其他资金', - "nonPeerFinancialAppropriation" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '非同级财政拨款', - "ybbm" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '医疗器械分类编码', - "catalogname1" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '一级分类名称(学科,品名)', - "catalogname2" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '二级分类名称(用途、品目)', - "catalogname3" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', - "catalogCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '编码', - "catalogCode1" bigint DEFAULT NULL COMMENT '一级分类名称(学科,品名)', - "catalogCode2" bigint DEFAULT NULL COMMENT '二级分类名称(用途、品目)', - "catalogCode3" bigint DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', - "managementCategory" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理类别', - "endUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '使用人', - "estimatedResidualValue" decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '预计残值', - "currencyType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种', - "purType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '采购类型', - "purchaseDate" date DEFAULT NULL COMMENT '购置日期', - "addDate" date DEFAULT NULL COMMENT '添加日期', - "assetName" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产品名', - "isImperative" bigint DEFAULT NULL COMMENT '是否强检', - "isMaintain" bigint DEFAULT NULL COMMENT '是否保养', - "imperativeCycle" bigint DEFAULT NULL COMMENT '检定周期(月)', - "maintainCycle" bigint DEFAULT NULL COMMENT '保养周期(月)', - "startImperativeDate" date DEFAULT NULL COMMENT '开始检定日期', - "startMaintainDate" date DEFAULT NULL COMMENT '开始保养日期', - "serviceType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修组', - "maintainType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '保养组', - "managerUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理人', - "approveUser" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审核人', - "ledgerAccount" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '对应会计科目', - "impairmentProvision" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '减值准备', - "estimatedWorkload" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '预计工作量', - "completedWorkload" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '已完成工作量', - "maintenanceType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维保类型', - "maintenanceCycle" bigint DEFAULT NULL COMMENT '维保周期', - "startMaintenancDate" date DEFAULT NULL COMMENT '维保开始日期', - "endMaintenancDate" date DEFAULT NULL COMMENT '维保结束日期', - "networkType" bigint DEFAULT NULL COMMENT '内外网', - "UserRole" bigint DEFAULT NULL COMMENT '使用角色', - "isAddDomain" bigint DEFAULT NULL COMMENT '是否加域', - "isUDisc" bigint DEFAULT NULL COMMENT 'u盘是否禁用', - "ascriptionType" bigint DEFAULT NULL COMMENT '设备归类', - "assetReserveType" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产备用类型', - "updateTime" datetime DEFAULT NULL COMMENT '更改日期', - PRIMARY KEY ("deviceCode") USING BTREE +CREATE TABLE IF NOT EXISTS `device_info` ( + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.正常,2变更归属中,3.维修申请中 4.维修中 6.销毁/报废', + `checkLock` bit(1) NOT NULL DEFAULT b'0' COMMENT '巡检锁定', + `udi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + `nameCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + `productId` bigint NOT NULL COMMENT '产品id', + `productName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + `ggxh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + `batchNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + `serialNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + `expireDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + `manufactory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + `measname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + `supId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + `supName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + `changeCount` int NOT NULL DEFAULT '0' COMMENT '变更次数', + `repairApplyCount` int NOT NULL DEFAULT '0' COMMENT '报修次数', + `repairCount` int NOT NULL DEFAULT '0' COMMENT '维修次数', + `checkCount` int NOT NULL DEFAULT '0' COMMENT '巡检次数', + `lastChangeOrderId` bigint NOT NULL COMMENT '最后变更单号', + `lastRepairApplyId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后报修申请单号', + `lastRepairApplyTime` datetime DEFAULT NULL COMMENT '最后报修时间', + `lastRepairId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修单号', + `lastRepairUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修负责人名称', + `lastRepairUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后维修人联系电话', + `lastRepairTime` datetime DEFAULT NULL COMMENT '最后维修时间', + `lastCheckUserId` bigint DEFAULT NULL COMMENT '最后检查/巡检负责人', + `lastCheckUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检负责人名称', + `lastCheckPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后检查/巡检人联系电话', + `lastCheckTime` datetime DEFAULT NULL COMMENT '最后检查/巡检时间', + `lastCheckTaskId` bigint DEFAULT NULL COMMENT '最后检查/巡检任务id', + `createTime` datetime NOT NULL COMMENT '创建时间', + `createUserId` bigint NOT NULL COMMENT '创建人id', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + `assetType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产分类', + `sasacType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国资分类', + `assetMnemonicCode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产助记码', + `number` int DEFAULT '1' COMMENT '数量', + `acquisitionMethod` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取得方式', + `purpose` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用途', + `depreciationYear` int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧年', + `depreciationMonth` int(10) unsigned zerofill DEFAULT NULL COMMENT '折旧月', + `invCode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '存储仓库', + `estimatedTotalHour` int(10) unsigned zerofill DEFAULT NULL COMMENT '预计总工时', + `dayHour` int(10) unsigned zerofill DEFAULT NULL COMMENT '单日工时', + `assetValue` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '单个资产价值', + `ownFund` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '自有资金', + `financialAppropriation` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '财政拨款', + `educationFund` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '科教基金', + `otherFund` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '其他资金', + `nonPeerFinancialAppropriation` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '非同级财政拨款', + `ybbm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '医疗器械分类编码', + `catalogname1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '一级分类名称(学科,品名)', + `catalogname2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '二级分类名称(用途、品目)', + `catalogname3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', + `catalogCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '编码', + `catalogCode1` bigint DEFAULT NULL COMMENT '一级分类名称(学科,品名)', + `catalogCode2` bigint DEFAULT NULL COMMENT '二级分类名称(用途、品目)', + `catalogCode3` bigint DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)', + `managementCategory` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理类别', + `endUser` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '使用人', + `estimatedResidualValue` decimal(10,2) unsigned zerofill DEFAULT NULL COMMENT '预计残值', + `currencyType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种', + `purType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '采购类型', + `purchaseDate` date DEFAULT NULL COMMENT '购置日期', + `addDate` date DEFAULT NULL COMMENT '添加日期', + `assetName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产品名', + `isImperative` bigint DEFAULT NULL COMMENT '是否强检', + `isMaintain` bigint DEFAULT NULL COMMENT '是否保养', + `imperativeCycle` bigint DEFAULT NULL COMMENT '检定周期(月)', + `maintainCycle` bigint DEFAULT NULL COMMENT '保养周期(月)', + `startImperativeDate` date DEFAULT NULL COMMENT '开始检定日期', + `startMaintainDate` date DEFAULT NULL COMMENT '开始保养日期', + `serviceType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修组', + `maintainType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '保养组', + `managerUser` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '管理人', + `approveUser` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审核人', + `ledgerAccount` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '对应会计科目', + `impairmentProvision` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '减值准备', + `estimatedWorkload` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '预计工作量', + `completedWorkload` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '已完成工作量', + `maintenanceType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维保类型', + `maintenanceCycle` bigint DEFAULT NULL COMMENT '维保周期', + `startMaintenancDate` date DEFAULT NULL COMMENT '维保开始日期', + `endMaintenancDate` date DEFAULT NULL COMMENT '维保结束日期', + `networkType` bigint DEFAULT NULL COMMENT '内外网', + `UserRole` bigint DEFAULT NULL COMMENT '使用角色', + `isAddDomain` bigint DEFAULT NULL COMMENT '是否加域', + `isUDisc` bigint DEFAULT NULL COMMENT 'u盘是否禁用', + `ascriptionType` bigint DEFAULT NULL COMMENT '设备归类', + `assetReserveType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资产备用类型', + `updateTime` datetime DEFAULT NULL COMMENT '更改日期', + PRIMARY KEY (`deviceCode`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备表' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备表' +ROW_FORMAT=Dynamic; -CREATE TABLE if not exists "device_check" +CREATE TABLE if not exists `device_check` ( - "taskId" bigint NOT NULL COMMENT '巡检任务id', - "planId" bigint DEFAULT NULL COMMENT '计划id', - "planName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计划名称', - "chargeDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门编码', - "checkUserId" bigint DEFAULT NULL COMMENT '巡检人id', - "checkUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', - "checkUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人电话', - "deviceCount" int NOT NULL COMMENT '设备数量', - "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成设备数量', - "exceptionCount" int NOT NULL DEFAULT '0' COMMENT '异常数量', - "finishTime" datetime DEFAULT NULL COMMENT '完成时间', - "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '任务名称', - "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '任务备注', - "sysFlag" bit(1) NOT NULL COMMENT '是否系统创建 1/true 是 0/false 否', - "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成', - "createTime" datetime NOT NULL COMMENT '创建时间', - "createUserId" bigint DEFAULT NULL COMMENT '创建人id', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人姓名', - "updateTime" datetime DEFAULT NULL, - PRIMARY KEY ("taskId") USING BTREE -) ENGINE=InnoDB + `taskId` bigint NOT NULL COMMENT '巡检任务id', + `planId` bigint DEFAULT NULL COMMENT '计划id', + `planName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计划名称', + `chargeDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门编码', + `checkUserId` bigint DEFAULT NULL COMMENT '巡检人id', + `checkUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', + `checkUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人电话', + `deviceCount` int NOT NULL COMMENT '设备数量', + `finishCount` int NOT NULL DEFAULT '0' COMMENT '完成设备数量', + `exceptionCount` int NOT NULL DEFAULT '0' COMMENT '异常数量', + `finishTime` datetime DEFAULT NULL COMMENT '完成时间', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '任务名称', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '任务备注', + `sysFlag` bit(1) NOT NULL COMMENT '是否系统创建 1/true 是 0/false 否', + `finishFlag` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成', + `createTime` datetime NOT NULL COMMENT '创建时间', + `createUserId` bigint DEFAULT NULL COMMENT '创建人id', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人姓名', + `updateTime` datetime DEFAULT NULL, + PRIMARY KEY (`taskId`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务表' ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_check_detail" -( - "taskId" bigint NOT NULL COMMENT '任务id', - "deviceCode" varbinary(255) NOT NULL COMMENT '设备编码', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', - "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '部门名称', - "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 1/true 0/false', - "productId" bigint NOT NULL COMMENT '产品id', - "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', - "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', - "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', - "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', - "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', - "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', - "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', - "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', - "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', - "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', - "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', - "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', - "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', - "itemCount" int NOT NULL DEFAULT '0' COMMENT '项目数量', - "exceptionCount" int NOT NULL DEFAULT '0' COMMENT '异常数量', - "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成项目数量', - "finishTime" datetime DEFAULT NULL COMMENT '完成时间', - "repairId" bigint DEFAULT NULL COMMENT '维修单id', - "normalFlag" tinyint DEFAULT NULL COMMENT '巡检状态 :0:异常;1.正常', - "livePath" varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '现场照片', - "suggestion" varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检建议', - "updateTime" datetime DEFAULT NULL COMMENT '更改时间', - PRIMARY KEY ("taskId","deviceCode") USING BTREE -) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务明细' - ROW_FORMAT=Dynamic; + CREATE TABLE IF NOT EXISTS `device_check_detail` + ( + `taskId` bigint NOT NULL COMMENT '任务id', + `deviceCode` varbinary(255) NOT NULL COMMENT '设备编码', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + `deptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '部门名称', + `finishFlag` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 1/true 0/false', + `productId` bigint NOT NULL COMMENT '产品id', + `udi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + `nameCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + `productName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + `ggxh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + `batchNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + `serialNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + `expireDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + `manufactory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + `measname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + `supId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + `supName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + `itemCount` int NOT NULL DEFAULT '0' COMMENT '项目数量', + `exceptionCount` int NOT NULL DEFAULT '0' COMMENT '异常数量', + `finishCount` int NOT NULL DEFAULT '0' COMMENT '完成项目数量', + `finishTime` datetime DEFAULT NULL COMMENT '完成时间', + `repairId` bigint DEFAULT NULL COMMENT '维修单id', + `normalFlag` tinyint DEFAULT NULL COMMENT '巡检状态 :0:异常;1.正常', + `livePath` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '现场照片', + `suggestion` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检建议', + `updateTime` datetime DEFAULT NULL COMMENT '更改时间', + PRIMARY KEY (`taskId`,`deviceCode`) USING BTREE + ) ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务明细' + ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_check_detail_item" + CREATE TABLE IF NOT EXISTS `device_check_detail_item` ( - "taskId" bigint NOT NULL COMMENT '任务id', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', - "itemCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', - "itemName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', - "itemContent" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', - "normalFlag" bit(1) DEFAULT NULL COMMENT '正常标识', - "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '完成标识', - "finishTime" datetime DEFAULT NULL COMMENT '完成时间', - "suggestion" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '巡检建议', - "checkUserId" bigint DEFAULT NULL COMMENT '巡检人id', - "checkUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', - "checkDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门', - "checkDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门名称', - "updateTime" datetime DEFAULT NULL, - PRIMARY KEY ("taskId","deviceCode","itemCode") USING BTREE + `taskId` bigint NOT NULL COMMENT '任务id', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + `itemCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + `itemName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + `itemContent` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + `normalFlag` bit(1) DEFAULT NULL COMMENT '正常标识', + `finishFlag` bit(1) NOT NULL DEFAULT b'0' COMMENT '完成标识', + `finishTime` datetime DEFAULT NULL COMMENT '完成时间', + `suggestion` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '巡检建议', + `checkUserId` bigint DEFAULT NULL COMMENT '巡检人id', + `checkUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检人姓名', + `checkDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门', + `checkDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '巡检部门名称', + `updateTime` datetime DEFAULT NULL, + PRIMARY KEY (`taskId`,`deviceCode`,`itemCode`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检项目' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检项目' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_repair" +CREATE TABLE IF NOT EXISTS `device_repair` ( - "id" bigint NOT NULL COMMENT '维修id', - "applyId" bigint DEFAULT NULL COMMENT '维修申请id', - "checkTaskId" bigint DEFAULT NULL COMMENT '巡检任务单id', - "finishFlag" bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 true/false', - "description" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', - "diagnosisInfo" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '诊断信息', - "innerFlag" bit(1) DEFAULT NULL COMMENT '是否内部维修', - "repairUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人姓名', - "repairUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人联系方式', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备码', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', - "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', - "productId" bigint NOT NULL COMMENT '产品id', - "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', - "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', - "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', - "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', - "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', - "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', - "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', - "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', - "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', - "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', - "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', - "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', - "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', - "createUserId" bigint NOT NULL COMMENT '创建人id', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人姓名', - "createTime" datetime NOT NULL COMMENT '创建时间', - "createDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', - "createDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门名称', - "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', - "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', - "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', - "confirmRemark" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', - "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', - "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', - "confirmPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', - "repairDeptCode" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修部门', - "updateTime" datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY ("id") USING BTREE + `id` bigint NOT NULL COMMENT '维修id', + `applyId` bigint DEFAULT NULL COMMENT '维修申请id', + `checkTaskId` bigint DEFAULT NULL COMMENT '巡检任务单id', + `finishFlag` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已完成 true/false', + `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', + `diagnosisInfo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '诊断信息', + `innerFlag` bit(1) DEFAULT NULL COMMENT '是否内部维修', + `repairUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人姓名', + `repairUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修人联系方式', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备码', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + `deptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', + `productId` bigint NOT NULL COMMENT '产品id', + `udi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + `nameCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + `productName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + `ggxh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + `batchNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + `serialNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + `expireDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + `manufactory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + `measname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + `supId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + `supName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + `createUserId` bigint NOT NULL COMMENT '创建人id', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人姓名', + `createTime` datetime NOT NULL COMMENT '创建时间', + `createDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', + `createDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门名称', + `confirmUserId` bigint DEFAULT NULL COMMENT '确认人id', + `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + `confirmTime` datetime DEFAULT NULL COMMENT '确认时间', + `confirmRemark` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + `confirmPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', + `repairDeptCode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '维修部门', + `updateTime` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备维修单' ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_repair_apply" +CREATE TABLE IF NOT EXISTS `device_repair_apply` ( - "id" bigint NOT NULL COMMENT '报修单id', - "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态 待受理,受理中,维修中,完成', - "applyDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门编码', - "applyDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门', - "applyUserId" bigint NOT NULL COMMENT '报修人id', - "applyUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人姓名', - "applyUserPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人联系方式', - "applyTime" datetime NOT NULL COMMENT '报修时间', - "deviceCount" int NOT NULL COMMENT '设备数量', - "finishCount" int NOT NULL DEFAULT '0' COMMENT '完成数量', - "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', - "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', - "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', - "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', - "confirmPhone" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', - "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', - "finishTime" datetime DEFAULT NULL COMMENT '完成时间', - "updateTime" datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY ("id") USING BTREE + `id` bigint NOT NULL COMMENT '报修单id', + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态 待受理,受理中,维修中,完成', + `applyDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门编码', + `applyDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门', + `applyUserId` bigint NOT NULL COMMENT '报修人id', + `applyUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人姓名', + `applyUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人联系方式', + `applyTime` datetime NOT NULL COMMENT '报修时间', + `deviceCount` int NOT NULL COMMENT '设备数量', + `finishCount` int NOT NULL DEFAULT '0' COMMENT '完成数量', + `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + `confirmUserId` bigint DEFAULT NULL COMMENT '确认人id', + `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + `confirmPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人联系方式', + `confirmTime` datetime DEFAULT NULL COMMENT '确认时间', + `finishTime` datetime DEFAULT NULL COMMENT '完成时间', + `updateTime` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报修单' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报修单' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_repair_apply_detail" +CREATE TABLE IF NOT EXISTS `device_repair_apply_detail` ( - "applyId" bigint NOT NULL COMMENT '报修单id', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', - "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', - "description" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', - "diagnosisInfo" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '诊断信息', - "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '\0' COMMENT '状态 待诊断、待维修、维修中、完成', - "repairFlag" bit(1) DEFAULT NULL COMMENT '是否需要维修 true/false', - "repairId" bigint DEFAULT NULL COMMENT '维修单id', - "productId" bigint NOT NULL COMMENT '产品id', - "udi" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', - "nameCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', - "productName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', - "ggxh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', - "batchNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', - "serialNo" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', - "productionDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', - "expireDate" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', - "manufactory" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', - "measname" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', - "zczbhhzbapzbh" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', - "supId" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', - "supName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', - "confirmUserId" bigint DEFAULT NULL COMMENT '确认人id', - "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', - "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', - "confirmRemark" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', - "confirmDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', - "confirmDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', - "finishTime" datetime DEFAULT NULL COMMENT '完成时间', - "updateTime" datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY ("applyId","deviceCode") USING BTREE + `applyId` bigint NOT NULL COMMENT '报修单id', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码', + `deptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称', + `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题描述', + `diagnosisInfo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '诊断信息', + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '\0' COMMENT '状态 待诊断、待维修、维修中、完成', + `repairFlag` bit(1) DEFAULT NULL COMMENT '是否需要维修 true/false', + `repairId` bigint DEFAULT NULL COMMENT '维修单id', + `productId` bigint NOT NULL COMMENT '产品id', + `udi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UDI码', + `nameCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'DI码', + `productName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品名称', + `ggxh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规格型号', + `batchNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号', + `serialNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '序列号', + `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产日期', + `expireDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '失效日期', + `manufactory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产厂家', + `measname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '计量单位', + `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '注册/备案凭证号', + `supId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID', + `supName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商名称', + `confirmUserId` bigint DEFAULT NULL COMMENT '确认人id', + `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + `confirmTime` datetime DEFAULT NULL COMMENT '确认时间', + `confirmRemark` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门', + `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认部门名称', + `finishTime` datetime DEFAULT NULL COMMENT '完成时间', + `updateTime` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`applyId`,`deviceCode`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报修单明细' ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_plan" +CREATE TABLE IF NOT EXISTS `device_plan` ( - "planId" bigint NOT NULL COMMENT '计划id', - "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '计划名称', - "chargeDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门', - "startDate" date NOT NULL COMMENT '开始日期', - "endDate" date NOT NULL COMMENT '结束日期', - "frequency" int NOT NULL COMMENT '频率(天)', - "execCount" int NOT NULL DEFAULT '0' COMMENT '执行次数', - "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', - "createUserId" bigint NOT NULL COMMENT '创建人id', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', - "createTime" datetime NOT NULL COMMENT '创建时间', - "status" tinyint DEFAULT NULL COMMENT '设备巡检计划状态 :1:草稿;2.已提交', - PRIMARY KEY ("planId") USING BTREE + `planId` bigint NOT NULL COMMENT '计划id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '计划名称', + `chargeDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门', + `startDate` date NOT NULL COMMENT '开始日期', + `endDate` date NOT NULL COMMENT '结束日期', + `frequency` int NOT NULL COMMENT '频率(天)', + `execCount` int NOT NULL DEFAULT '0' COMMENT '执行次数', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + `createUserId` bigint NOT NULL COMMENT '创建人id', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + `createTime` datetime NOT NULL COMMENT '创建时间', + `status` tinyint DEFAULT NULL COMMENT '设备巡检计划状态 :1:草稿;2.已提交', + PRIMARY KEY (`planId`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检计划' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备巡检计划' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_plan_detail" +CREATE TABLE IF NOT EXISTS `device_plan_detail` ( - "planId" bigint NOT NULL COMMENT '计划id', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', - "productId" bigint NOT NULL COMMENT '产品id', - PRIMARY KEY ("planId","deviceCode") USING BTREE, - UNIQUE KEY "uk_planId_productId" ("planId","deviceCode") USING BTREE + `planId` bigint NOT NULL COMMENT '计划id', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', + `productId` bigint NOT NULL COMMENT '产品id', + PRIMARY KEY (`planId`,`deviceCode`) USING BTREE, + UNIQUE KEY `uk_planId_productId` (`planId`,`deviceCode`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检计划明细' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检计划明细' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_plan_detail_item" +CREATE TABLE IF NOT EXISTS `device_plan_detail_item` ( - "planId" bigint NOT NULL COMMENT '巡检计划明细id', - "productId" bigint NOT NULL COMMENT '巡检计划产品id', - "itemCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '', - "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', - "content" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', - PRIMARY KEY ("planId","productId","itemCode") USING BTREE, - UNIQUE KEY "uk_planId_deviceCode_itemCode" ("planId","itemCode","deviceCode") USING BTREE + `planId` bigint NOT NULL COMMENT '巡检计划明细id', + `productId` bigint NOT NULL COMMENT '巡检计划产品id', + `itemCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + PRIMARY KEY ("planId","productId","itemCode") USING BTREE, + UNIQUE KEY "uk_planId_deviceCode_itemCode" ("planId","itemCode","deviceCode") USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检设备的项目' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检设备的项目' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_check_item_dict" +CREATE TABLE IF NOT EXISTS `device_check_item_dict` ( - "code" varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', - "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', - "content" longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', - "createUserId" bigint NOT NULL COMMENT '创建人id', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', - "createTime" datetime NOT NULL COMMENT '创建时间', - PRIMARY KEY ("code") USING BTREE + `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目内容', + `createUserId` bigint NOT NULL COMMENT '创建人id', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称', + `createTime` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`code`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检项目字典' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检项目字典' +ROW_FORMAT=Dynamic; -CREATE TABLE IF NOT EXISTS "device_change_log" +CREATE TABLE IF NOT EXISTS `device_change_log` ( - "id" bigint NOT NULL COMMENT '日志id', - "deviceCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', - "type" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', - "changeOrderId" bigint NOT NULL COMMENT '变更单号', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', - "deptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', - "toDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', - "toDeptName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', - "confirmUser" bigint NOT NULL COMMENT '确认人id', - "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '确认人姓名', - "confirmTime" datetime NOT NULL COMMENT '确认时间', - "confirmRemark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', - "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作人姓名', - "createUser" bigint NOT NULL COMMENT '操作人id', - "createTime" datetime NOT NULL COMMENT '操作时间', - PRIMARY KEY ("id") USING BTREE + `id` bigint NOT NULL COMMENT '日志id', + `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', + `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', + `changeOrderId` bigint NOT NULL COMMENT '变更单号', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', + `deptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门', + `toDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + `toDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + `confirmUser` bigint NOT NULL COMMENT '确认人id', + `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '确认人姓名', + `confirmTime` datetime NOT NULL COMMENT '确认时间', + `confirmRemark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作人姓名', + `createUser` bigint NOT NULL COMMENT '操作人id', + `createTime` datetime NOT NULL COMMENT '操作时间', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更日志表' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更日志表' +ROW_FORMAT=Dynamic; -CREATE TABLE "device_change_order" ( - "orderId" bigint NOT NULL COMMENT '编码', - "type" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', - "status" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 ,2.完成(目标确认接收) ,3.目标部门拒收,4.取消', - "deptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', - "toDeptCode" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', - "confirmUser" bigint DEFAULT NULL COMMENT '确认人id', - "confirmUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', - "confirmTime" datetime DEFAULT NULL COMMENT '确认时间', - "confirmRemark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', - "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', - "createUserName" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人', - "createUser" bigint DEFAULT NULL COMMENT '创建人id', - "createTime" datetime NOT NULL COMMENT '创建时间', - PRIMARY KEY ("orderId") USING BTREE +CREATE TABLE `device_change_order` ( + `orderId` bigint NOT NULL COMMENT '编码', + `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 ,2.完成(目标确认接收) ,3.目标部门拒收,4.取消', + `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门', + `toDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门', + `confirmUser` bigint DEFAULT NULL COMMENT '确认人id', + `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认人姓名', + `confirmTime` datetime DEFAULT NULL COMMENT '确认时间', + `confirmRemark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '确认备注', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', + `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人', + `createUser` bigint DEFAULT NULL COMMENT '创建人id', + `createTime` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`orderId`) USING BTREE ) ENGINE=InnoDB - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更单' - ROW_FORMAT=Dynamic; +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更单' +ROW_FORMAT=Dynamic; CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceInfo', - ' tinyint NULL DEFAULT NULL COMMENT ''设备管理数据''', - 1); +' tinyint NULL DEFAULT NULL COMMENT ''设备管理数据''', +1); CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceCheck', - ' tinyint NULL DEFAULT NULL COMMENT ''巡检管理数据''', - 1); +' tinyint NULL DEFAULT NULL COMMENT ''巡检管理数据''', +1); CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceRepairApply', - ' tinyint NULL DEFAULT NULL COMMENT ''报修单数据''', - 1); +' tinyint NULL DEFAULT NULL COMMENT ''报修单数据''', +1); CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription', - ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''', - 1); +' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''', +1); INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43'); INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36'); @@ -438,31 +438,31 @@ INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptC INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32'); -CREATE TABLE IF NOT EXISTS "thr_manufacturer" +CREATE TABLE IF NOT EXISTS `thr_manufacturer` ( - "id" bigint NOT NULL AUTO_INCREMENT, - "unitId" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "spell" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "addr" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "creditNo" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "contact" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "mobile" varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "thirdSysFk" varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "name" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - "createUser" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建人', - "createTime" datetime DEFAULT NULL COMMENT '创建时间', - "updateUser" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新人', - "updateTime" datetime DEFAULT NULL COMMENT '更新时间', - "remark" varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '备注', - PRIMARY KEY ("id") USING BTREE, - UNIQUE KEY "unique" ("unitId","thirdSysFk") USING BTREE + `id` bigint NOT NULL AUTO_INCREMENT, + `unitId` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `spell` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `creditNo` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `contact` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `mobile` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `thirdSysFk` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建人', + `createTime` datetime DEFAULT NULL COMMENT '创建时间', + `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新人', + `updateTime` datetime DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `unique` (`unitId`,`thirdSysFk`) USING BTREE ) ENGINE=InnoDB - AUTO_INCREMENT=1001 - DEFAULT CHARSET=utf8mb4 - COLLATE=utf8mb4_0900_ai_ci COMMENT='第三方往来单位类型' - ROW_FORMAT=Dynamic; +AUTO_INCREMENT=1001 +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_0900_ai_ci COMMENT='第三方往来单位类型' +ROW_FORMAT=Dynamic; CALL Pro_Temp_ColumnWork('sync_data_set', 'produceBusiness', - ' tinyint NULL DEFAULT NULL COMMENT ''生产企业信息''', - 1); +' tinyint NULL DEFAULT NULL COMMENT ''生产企业信息''', +1); From 629f9ca983066e315dc94f30d207c93e79a8000a Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 20 May 2024 14:19:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?5-20=20=20=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/config/HdSchemaExecutor.java | 2 +- .../dev/DeviceCheckItemDictController.java | 98 ++++++++ .../controller/dev/DeviceInfoController.java | 23 +- .../controller/dev/DeviceMiniController.java | 69 ++++++ .../dev/DeviceRepairApplyController.java | 23 +- .../DeviceRepairApplyDetailController.java | 20 +- .../dev/DeviceRepairController.java | 16 +- .../dev/DeviceUpkeepController.java | 113 +++++++++ .../dev/DeviceUpkeepDetailController.java | 102 ++++++++ .../dev/DeviceUpkeepDetailItemController.java | 73 ++++++ .../dev/DeviceRepairApplyDetailMapper.java | 7 + .../dao/dev/DeviceUpkeepDetailItemMapper.java | 15 ++ .../api/dao/dev/DeviceUpkeepDetailMapper.java | 15 ++ .../glxp/api/dao/dev/DeviceUpkeepMapper.java | 27 +++ .../entity/dev/DeviceCheckItemDictEntity.java | 13 +- .../dev/DevicePlanDetailItemEntity.java | 6 + .../glxp/api/entity/dev/DevicePlanEntity.java | 6 + .../dev/DeviceRepairApplyDetailEntity.java | 21 ++ .../api/entity/dev/DeviceRepairEntity.java | 33 +++ .../entity/dev/DeviceUpkeepDetailEntity.java | 192 +++++++++++++++ .../dev/DeviceUpkeepDetailItemEntity.java | 110 +++++++++ .../api/entity/dev/DeviceUpkeepEntity.java | 140 +++++++++++ .../req/dev/DeviceCheckDetailMiniQuery.java | 28 +++ .../api/req/dev/DeviceCheckItemDictParam.java | 56 +++++ .../dev/DeviceRepairApplyDetailMiniQuery.java | 28 +++ .../req/dev/DeviceRepairApplyHallQuery.java | 2 + ...DeviceRepairApplyListByIdAndCodeQuery.java | 21 ++ .../api/req/dev/DeviceRepairApplyQuery.java | 4 + .../DeviceUpkeepDetailItemFinishParam.java | 33 +++ .../req/dev/DeviceUpkeepDetailItemQuery.java | 21 ++ .../api/req/dev/DeviceUpkeepDetailParam.java | 35 +++ .../api/req/dev/DeviceUpkeepDetailQuery.java | 17 ++ .../glxp/api/req/dev/DeviceUpkeepQuery.java | 14 ++ .../DeviceRepairApplyDetailMiniResponse.java | 201 ++++++++++++++++ .../service/dev/DeviceCheckDetailService.java | 2 + .../dev/DeviceRepairApplyDetailService.java | 7 + .../service/dev/DeviceRepairApplyService.java | 3 + .../api/service/dev/DeviceRepairService.java | 4 +- .../dev/DeviceUpkeepDetailItemService.java | 25 ++ .../dev/DeviceUpkeepDetailService.java | 26 ++ .../api/service/dev/DeviceUpkeepService.java | 46 ++++ .../impl/DeviceCheckDetailServiceImpl.java | 22 ++ .../DeviceRepairApplyDetailServiceImpl.java | 29 +++ .../impl/DeviceRepairApplyServiceImpl.java | 3 + .../dev/impl/DeviceRepairServiceImpl.java | 11 +- .../DeviceUpkeepDetailItemServiceImpl.java | 148 ++++++++++++ .../impl/DeviceUpkeepDetailServiceImpl.java | 101 ++++++++ .../dev/impl/DeviceUpkeepServiceImpl.java | 227 ++++++++++++++++++ .../glxp/api/vo/dev/DeviceUpkeepDetailVo.java | 19 ++ .../glxp/api/vo/dev/DeviceUpkeepPrintVo.java | 33 +++ .../com/glxp/api/vo/dev/DeviceUpkeepVo.java | 11 + .../dev/DeviceRepairApplyDetailMapper.xml | 65 +++++ .../mybatis/mapper/dev/DeviceUpkeepMapper.xml | 60 +++++ src/main/resources/schemas/schema_v2.3.sql | 4 + src/main/resources/schemas/schema_v2.4.sql | 67 +++++- 55 files changed, 2449 insertions(+), 48 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceCheckItemDictController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceMiniController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceUpkeepController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailController.java create mode 100644 src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailItemController.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailItemMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailMapper.java create mode 100644 src/main/java/com/glxp/api/dao/dev/DeviceUpkeepMapper.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailItemEntity.java create mode 100644 src/main/java/com/glxp/api/entity/dev/DeviceUpkeepEntity.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckDetailMiniQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailMiniQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceRepairApplyListByIdAndCodeQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemFinishParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailParam.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailQuery.java create mode 100644 src/main/java/com/glxp/api/req/dev/DeviceUpkeepQuery.java create mode 100644 src/main/java/com/glxp/api/res/dev/DeviceRepairApplyDetailMiniResponse.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailItemService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailService.java create mode 100644 src/main/java/com/glxp/api/service/dev/DeviceUpkeepService.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepDetailItemServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepDetailServiceImpl.java create mode 100644 src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepServiceImpl.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceUpkeepDetailVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceUpkeepPrintVo.java create mode 100644 src/main/java/com/glxp/api/vo/dev/DeviceUpkeepVo.java create mode 100644 src/main/resources/mybatis/mapper/dev/DeviceUpkeepMapper.xml diff --git a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java index 020805ca..061da469 100644 --- a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java +++ b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java @@ -77,7 +77,7 @@ public class HdSchemaExecutor implements ApplicationRunner { // schema.add(new SchemaData("v2.1", "schema_v2.1.sql")); // schema.add(new SchemaData("v2.2", "schema_v2.2.sql")); schema.add(new SchemaData("v2.3", "schema_v2.3.sql")); -// schema.add(new SchemaData("v2.4", "schema_v2.4.sql")); + schema.add(new SchemaData("v2.4", "schema_v2.4.sql")); } } diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceCheckItemDictController.java b/src/main/java/com/glxp/api/controller/dev/DeviceCheckItemDictController.java new file mode 100644 index 00000000..16a499e3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceCheckItemDictController.java @@ -0,0 +1,98 @@ +package com.glxp.api.controller.dev; + +import cn.hutool.core.util.RandomUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.dev.DeviceCheckItemDictEntity; +import com.glxp.api.req.dev.DeviceCheckItemDictParam; +import com.glxp.api.req.dev.DeviceCheckItemDictQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceCheckItemDictService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@RequestMapping +@RestController +@RequiredArgsConstructor +public class DeviceCheckItemDictController extends BaseController { + + private final DeviceCheckItemDictService deviceCheckItemDictService; + + + /** + * 生成一个项目编码 + * + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/checkItemDict/code/gen") + public BaseResponse genItemCode() { + String code = ""; + DeviceCheckItemDictEntity info = null; + do { + code = "XJ" + RandomUtil.randomNumbers(10); + info = deviceCheckItemDictService.getById(code); + } while (info != null); + return ResultVOUtils.success(code); + } + + /** + * 设备巡检项目字典分页查询 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/checkItemDict/page") + public BaseResponse page(@RequestBody DeviceCheckItemDictQuery query) { + List list = deviceCheckItemDictService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 添加巡检项目字典 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/checkItemDict/save") + public BaseResponse save(@RequestBody @Valid DeviceCheckItemDictParam param) { + DeviceCheckItemDictEntity entity = param.getEntity(super.getUser()); + int i = deviceCheckItemDictService.insertIgnore(entity); + if (i == 0) { + return ResultVOUtils.error("项目编码已存在"); + } + return ResultVOUtils.successMsg("添加成功"); + } + + /** + * 删除巡检项目字典 + * + * @param itemCode 项目编码 + * @return + */ + @AuthRuleAnnotation("") + @DeleteMapping("/udi/device/checkItemDict/del/{itemCode}") + public BaseResponse del(@PathVariable String itemCode) { + + boolean b = deviceCheckItemDictService.removeById(itemCode); + if (!b) { + return ResultVOUtils.error("删除失败,请稍后再试"); + } + return ResultVOUtils.successMsg("删除成功"); + } + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java index 44e23efc..700909c8 100644 --- a/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java +++ b/src/main/java/com/glxp/api/controller/dev/DeviceInfoController.java @@ -17,9 +17,7 @@ import com.glxp.api.entity.dev.DeviceInfoEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.exception.JsonException; -import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery; -import com.glxp.api.req.dev.DeviceInfoDetailQuery; -import com.glxp.api.req.dev.DeviceInfoQuery; +import com.glxp.api.req.dev.*; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.dev.DeviceChangeLogService; import com.glxp.api.service.dev.DeviceInfoService; @@ -41,18 +39,19 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.imageio.ImageIO; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.awt.*; +import java.awt.font.LineMetrics; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.text.SimpleDateFormat; import java.time.LocalDateTime; -import java.util.Base64; -import java.util.HashMap; +import java.util.*; import java.util.List; -import java.util.Map; @RestController @@ -76,13 +75,7 @@ public class DeviceInfoController extends BaseController { @AuthRuleAnnotation("") @GetMapping("/udi/device/code/gen") public BaseResponse genDeviceCode() { - String deviceCode = ""; - DeviceInfoEntity deviceInfo = null; - do { - deviceCode = "S" + RandomUtil.randomNumbers(10); - deviceInfo = deviceInfoService.getById(deviceCode); - } while (deviceInfo != null); - return ResultVOUtils.success(deviceCode); + return ResultVOUtils.success(deviceInfoService.genDeviceCode()); } /** @@ -151,6 +144,8 @@ public class DeviceInfoController extends BaseController { @AuthRuleAnnotation("") @PostMapping("/udi/device/info/detailByDeptCode/page") public BaseResponse detailByDeptCode(@RequestBody @Valid DeviceInfoDetailByDeptCodeQuery query) { + AuthAdmin user = super.getUser(); + query.setDeptCode(user.getLocDeptCode()); List list = deviceInfoService.detail(query); PageInfo pageInfo = new PageInfo<>(list); PageSimpleResponse page = new PageSimpleResponse(); @@ -168,8 +163,6 @@ public class DeviceInfoController extends BaseController { @AuthRuleAnnotation("") @PostMapping("/udi/device/detailInfo/page") public BaseResponse detailInfoPage(@RequestBody DeviceInfoDetailQuery query) { - AuthAdmin user = super.getUser(); - query.setDeptCode(user.getLocDeptCode()); List list = deviceInfoService.detail(query); PageInfo pageInfo = new PageInfo<>(list); PageSimpleResponse page = new PageSimpleResponse(); diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceMiniController.java b/src/main/java/com/glxp/api/controller/dev/DeviceMiniController.java new file mode 100644 index 00000000..43920510 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceMiniController.java @@ -0,0 +1,69 @@ +package com.glxp.api.controller.dev; + + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.dev.DeviceCheckDetailEntity; +import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; +import com.glxp.api.service.dev.DeviceCheckDetailService; +import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@RestController +@RequestMapping +@RequiredArgsConstructor +public class DeviceMiniController extends BaseController { + + private final DeviceRepairApplyDetailService deviceRepairApplyDetailService; + private final DeviceCheckDetailService deviceCheckDetailService; + + /** + * 获取明细报修单列表分页 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/detail/mini/page") + public BaseResponse miniPage(@RequestBody @Valid DeviceRepairApplyDetailMiniQuery query) { + List list = deviceRepairApplyDetailService.miniPage(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 巡检任务单明细列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/check/detail/mini/page") + public BaseResponse miniPage(@RequestBody @Valid DeviceCheckDetailMiniQuery query) { + List list = deviceCheckDetailService.miniPage(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java index cbc018e5..f50702d3 100644 --- a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyController.java @@ -9,21 +9,16 @@ import com.glxp.api.controller.BaseController; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.dev.DeviceRepairApplyEntity; import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; -import com.glxp.api.req.dev.DeviceRepairApplyAddParam; -import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; -import com.glxp.api.req.dev.DeviceRepairApplyHallQuery; -import com.glxp.api.req.dev.DeviceRepairApplyQuery; +import com.glxp.api.req.dev.*; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.dev.DeviceRepairApplyService; import com.glxp.api.vo.dev.DeviceRepairApplyVo; import groovy.util.logging.Slf4j; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.ArrayList; import java.util.List; @Slf4j @@ -63,9 +58,15 @@ public class DeviceRepairApplyController extends BaseController { @PostMapping("/udi/device/repair/apply/hall/page") public BaseResponse adminPage(@RequestBody DeviceRepairApplyHallQuery query) { DeviceRepairApplyQuery applyQuery = new DeviceRepairApplyQuery(); - applyQuery.setStatus(DeviceRepairApplyStatusEnum.WAIT_PROCESS); - applyQuery.setApplyId(query.getApplyId()); - applyQuery.setApplyDeptCode(query.getApplyDeptCode()); + ArrayList statusEnums = new ArrayList<>(); + if (query.getIsFinish() == 1){ + statusEnums.add(DeviceRepairApplyStatusEnum.FINISH); + }else { + statusEnums.add(DeviceRepairApplyStatusEnum.WAIT_PROCESS); + statusEnums.add(DeviceRepairApplyStatusEnum.PROCESSING); + } + applyQuery.setStatuss(statusEnums); + BeanUtil.copyProperties(query,applyQuery); List list = deviceRepairApplyService.pageList(applyQuery); PageInfo pageInfo = new PageInfo<>(list); PageSimpleResponse page = new PageSimpleResponse(); diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java index 5cc3f6ae..0128fa63 100644 --- a/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairApplyDetailController.java @@ -8,11 +8,13 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; -import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; -import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; +import com.glxp.api.req.dev.*; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.dev.DeviceRepairApplyDetailService; +import com.glxp.api.service.dev.DeviceRepairApplyService; import com.glxp.api.vo.dev.DeviceRepairApplyDetailVo; +import com.glxp.api.vo.dev.DeviceRepairApplyVo; import groovy.util.logging.Slf4j; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; @@ -65,4 +67,18 @@ public class DeviceRepairApplyDetailController extends BaseController { } + /** + * 查出单条的设备保修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/repair/apply/listByIdAndCode") + public BaseResponse listByIdAndCode(@RequestBody @Valid DeviceRepairApplyListByIdAndCodeQuery query) { + DeviceRepairApplyDetailEntity entity = deviceRepairApplyDetailService.listByIdAndCode(query); + return ResultVOUtils.success(entity); + } + + } diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java b/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java index fec31848..72a95e59 100644 --- a/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java +++ b/src/main/java/com/glxp/api/controller/dev/DeviceRepairController.java @@ -1,19 +1,25 @@ package com.glxp.api.controller.dev; +import cn.hutool.core.bean.BeanUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; 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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceRepairApplyEntity; import com.glxp.api.entity.dev.DeviceRepairEntity; -import com.glxp.api.req.dev.DeviceRepairQuery; +import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; +import com.glxp.api.req.dev.*; import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceRepairApplyService; import com.glxp.api.service.dev.DeviceRepairService; +import com.glxp.api.vo.dev.DeviceRepairApplyVo; import groovy.util.logging.Slf4j; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; @Slf4j @@ -46,14 +52,14 @@ public class DeviceRepairController extends BaseController { /** * 完成我的维修单 * - * @param repairId 维修单id + * @param deviceRepairEntity * @return */ @AuthRuleAnnotation("") - @GetMapping("/udi/device/repair/finishByUser/{repairId}") - public BaseResponse finishByUser(@PathVariable Long repairId) { + @PostMapping("/udi/device/repair/finishByUser/repairId") + public BaseResponse finishByUser(@RequestBody DeviceRepairEntity deviceRepairEntity) { AuthAdmin user = super.getUser(); - deviceRepairService.finishByUser(repairId, user); + deviceRepairService.finishByUser(deviceRepairEntity, user); return ResultVOUtils.successMsg("操作成功"); } diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepController.java b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepController.java new file mode 100644 index 00000000..a436bb3b --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepController.java @@ -0,0 +1,113 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.req.dev.DeviceUpkeepQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceUpkeepService; +import com.glxp.api.vo.dev.DeviceUpkeepDetailVo; +import com.glxp.api.vo.dev.DeviceUpkeepPrintVo; +import com.glxp.api.vo.dev.DeviceUpkeepVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceUpkeepController extends BaseController { + + private final DeviceUpkeepService deviceUpkeepService; + + /** + * 保养任务单列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/page") + public BaseResponse page(@RequestBody DeviceUpkeepQuery query) { + List list = deviceUpkeepService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 本部门任务单列表 + * + * @param query + * @return +// */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/pageByDept") + public BaseResponse pageByDept(@RequestBody DeviceUpkeepQuery query) { + AuthAdmin user = super.getUser(); + query.setChargeDeptCode(user.getLocDeptCode()); + List list = deviceUpkeepService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 根据计划id生成巡检任务单 + * + * @param planId 计划id + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("/udi/device/upkeep/gen/{planId}") + public BaseResponse genDeviceUpkeep(@PathVariable Long planId) { + AuthAdmin user = super.getUser(); + deviceUpkeepService.genByPlanId(planId, false, user); + return ResultVOUtils.successMsg("操作成功"); + } + + @AuthRuleAnnotation("") + @GetMapping("/udi/device/upkeep/info/print/{taskId}") + public BaseResponse checkInfoPrint(@PathVariable Long taskId) { + DeviceUpkeepPrintVo vo = deviceUpkeepService.checkInfoPrint(taskId, null); + return ResultVOUtils.success(vo); + } + + @AuthRuleAnnotation("") + @GetMapping("/udi/device/upkeep/info/print/{taskId}/{deviceCode}") + public BaseResponse checkInfoPrint(@PathVariable Long taskId, @PathVariable String deviceCode) { + DeviceUpkeepPrintVo vo = deviceUpkeepService.checkInfoPrint(taskId, deviceCode); + return ResultVOUtils.success(vo); + } + + + /** + * 我的维修单 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/byUser/page") + public BaseResponse pageByUser(@RequestBody DeviceUpkeepQuery query) { + AuthAdmin user = super.getUser(); + query.setChargeDeptCode(user.getLocDeptCode()); + List list = deviceUpkeepService.pageListDetail(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailController.java b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailController.java new file mode 100644 index 00000000..af60c219 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailController.java @@ -0,0 +1,102 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DevicePlanDetailEntity; +import com.glxp.api.entity.dev.DevicePlanEntity; +import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity; +import com.glxp.api.req.dev.DevicePlanDetailParam; +import com.glxp.api.req.dev.DeviceUpkeepDetailParam; +import com.glxp.api.req.dev.DeviceUpkeepDetailQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceUpkeepDetailController extends BaseController { + + + private final DeviceUpkeepDetailService deviceUpkeepDetailService; + + private final DevicePlanService devicePlanService; + + private final DeviceInfoService deviceInfoService; + private final DevicePlanDetailService devicePlanDetailService; + private final DeviceUpkeepDetailItemService deviceUpkeepDetailItemService; + /** + * 保养任务单明细列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/detail/page") + public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailQuery query) { + List list = deviceUpkeepDetailService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + + /** + * 设备保养计划明细新增 + * + * @param param 参数 + * @return 计划id + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/detail/add") + public BaseResponse add(@RequestBody @Valid DevicePlanDetailParam param) { + + + DevicePlanEntity entity = null; + if (!param.valid(devicePlanService)) { + AuthAdmin user = super.getUser(); + entity = param.getDevicePlanParam().getEntity(user); + devicePlanService.save(entity); + param.getDevicePlanParam().setPlanId(entity.getPlanId()); + param.setPlanId(entity.getPlanId()); + } else { + entity = devicePlanService.getById(param.getPlanId()); + } + param.valid(devicePlanService); + List list = param.getEntity(deviceInfoService); + devicePlanDetailService.replaceBatch(list); + return ResultVOUtils.success(entity); + } + + /** + * 完成保养任务单明细项目 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/detail/finish") + public BaseResponse finish(@RequestBody @Valid DeviceUpkeepDetailParam param) { + AuthAdmin user = super.getUser(); + deviceUpkeepDetailItemService.finishAll(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + + +} diff --git a/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailItemController.java b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailItemController.java new file mode 100644 index 00000000..01244368 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/dev/DeviceUpkeepDetailItemController.java @@ -0,0 +1,73 @@ +package com.glxp.api.controller.dev; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity; +import com.glxp.api.req.dev.DeviceUpkeepDetailItemFinishParam; +import com.glxp.api.req.dev.DeviceUpkeepDetailItemQuery; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.dev.DeviceUpkeepDetailItemService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 设备巡检单明细 + */ +@RestController +@RequiredArgsConstructor +@Slf4j +@RequestMapping +public class DeviceUpkeepDetailItemController extends BaseController { + + private final DeviceUpkeepDetailItemService deviceUpkeepDetailItemService; + + /** + * 巡检任务单明细项目列表 + * + * @param query + * @return + */ + /** + * 保养任务单明细项目列表 + * + * @param query + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/detail/item/page") + public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailItemQuery query) { + List list = deviceUpkeepDetailItemService.pageList(query); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse page = new PageSimpleResponse(); + page.setTotal(pageInfo.getTotal()); + page.setList(pageInfo.getList()); + return ResultVOUtils.success(page); + } + + /** + * 完成巡检任务单明细项目 + * + * @param param + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udi/device/upkeep/detail/item/finish") + public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailItemFinishParam param) { + AuthAdmin user = super.getUser(); + deviceUpkeepDetailItemService.finish(param, user); + return ResultVOUtils.successMsg("操作成功"); + } + + +} diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java index ea5d89a7..47b4fc98 100644 --- a/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java +++ b/src/main/java/com/glxp/api/dao/dev/DeviceRepairApplyDetailMapper.java @@ -2,6 +2,12 @@ package com.glxp.api.dao.dev; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; +import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @author Administrator @@ -11,6 +17,7 @@ import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; */ public interface DeviceRepairApplyDetailMapper extends BaseMapperPlus { + List miniPage(@Param("param") DeviceRepairApplyDetailMiniQuery query); } diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailItemMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailItemMapper.java new file mode 100644 index 00000000..59cba6bc --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailItemMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity; + +/** +* 针对表【device_upkeep_detail_item(设备保养项目)】的数据库操作Mapper +*/ +public interface DeviceUpkeepDetailItemMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailMapper.java new file mode 100644 index 00000000..00eda3c7 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepDetailMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity; + +/** +* 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Mapper +*/ +public interface DeviceUpkeepDetailMapper extends BaseMapperPlus { + +} + + + + diff --git a/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepMapper.java b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepMapper.java new file mode 100644 index 00000000..f1e7732b --- /dev/null +++ b/src/main/java/com/glxp/api/dao/dev/DeviceUpkeepMapper.java @@ -0,0 +1,27 @@ +package com.glxp.api.dao.dev; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.dev.DeviceUpkeepEntity; +import com.glxp.api.req.dev.DeviceUpkeepQuery; +import com.glxp.api.vo.dev.DeviceUpkeepDetailVo; +import com.glxp.api.vo.dev.DeviceUpkeepVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* 针对表【device_upkeep(保养任务表)】的数据库操作Mapper +*/ +public interface DeviceUpkeepMapper extends BaseMapperPlus { + + List pageVo(DeviceUpkeepQuery query); + + + DeviceUpkeepVo getVoById(@Param("taskId") Long taskId); + + List pageListDetail(DeviceUpkeepQuery query); +} + + + + diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java index 06c8f0d0..e42f799a 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceCheckItemDictEntity.java @@ -43,7 +43,7 @@ public class DeviceCheckItemDictEntity { * 创建人id */ @TableField(value = "createUserId") - private Long createUserId; + private String createUserId; /** * 创建人名称 @@ -51,9 +51,18 @@ public class DeviceCheckItemDictEntity { @TableField(value = "createUserName") private String createUserName; + + /** + * 项目类型 1:巡检项目 2:保养项目 + */ + @TableField(value = "type") + private Integer type; + /** * 创建时间 */ @TableField(value = "createTime") private LocalDateTime createTime; -} \ No newline at end of file + + +} diff --git a/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java index f36668ac..ddfb199e 100644 --- a/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DevicePlanDetailItemEntity.java @@ -50,6 +50,12 @@ public class DevicePlanDetailItemEntity { @TableField(value = "name") private String name; + /** + * 项目类型 1巡检计划 2保养计划 + */ + @TableField(value = "type") + private String type; + /** * 项目内容 */ diff --git a/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java b/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java index 5fa03513..f9e906f1 100644 --- a/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DevicePlanEntity.java @@ -91,6 +91,12 @@ public class DevicePlanEntity { @TableField(value = "status") private Integer status; + /** + * 计划类型 1:巡检计划 2:保养计划 + */ + @TableField(value = "type") + private Integer type; + /** * 创建时间 */ diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java index af0d7304..e3443315 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java @@ -195,6 +195,20 @@ public class DeviceRepairApplyDetailEntity { @TableField(value = "confirmRemark") private String confirmRemark; + + /** + * 报修图片 + */ + @TableField(value = "livePath") + private String livePath; + + + /** + * 诊断图片 + */ + @TableField(value = "diagnosisLivePath") + private String diagnosisLivePath; + /** * 完成时间 */ @@ -207,4 +221,11 @@ public class DeviceRepairApplyDetailEntity { */ @TableField(value = "updateTime") private LocalDateTime updateTime; + + /** + * 报修人联系方式 + */ + @TableField(exist = false) + private String repairUserPhone; + } diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java index 45748147..3715c3d9 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java @@ -250,6 +250,39 @@ public class DeviceRepairEntity { @TableField(value = "confirmRemark") private String confirmRemark; + /** + * 维修内容 + */ + @TableField(value = "repairDescription") + private String repairDescription; + + + /** + * 报修图片 + */ + @TableField(value = "livePath") + private String livePath; + + + /** + * 维修后现场照片 + */ + @TableField(value = "serviceLivePath") + private String serviceLivePath; + + /** + * 诊断照片 + */ + @TableField(value = "diagnosisLivePath") + private String diagnosisLivePath; + + + /** + * 报修人id + */ + @TableField(value = "repairUserId") + private Long repairUserId; + /** * 确认时间 */ diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailEntity.java new file mode 100644 index 00000000..ed74cc01 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailEntity.java @@ -0,0 +1,192 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 巡检任务明细 + * + * @TableName device_upkeep_detail + */ +@TableName(value = "device_upkeep_detail") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceUpkeepDetailEntity { + /** + * 任务id + */ + @TableField(value = "taskId") + private Long taskId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 部门名称 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 是否完成 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 批次号 + */ + @TableField(value = "batchNo") + private String batchNo; + + /** + * 序列号 + */ + @TableField(value = "serialNo") + private String serialNo; + + /** + * 生产日期 + */ + @TableField(value = "productionDate") + private String productionDate; + + /** + * 失效日期 + */ + @TableField(value = "expireDate") + private String expireDate; + + /** + * 生产厂家 + */ + @TableField(value = "manufactory") + private String manufactory; + + /** + * 计量单位 + */ + @TableField(value = "measname") + private String measname; + + /** + * 注册/备案凭证号 + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + @TableField(value = "supId") + private String supId; + + /** + * 供应商名称 + */ + @TableField(value = "supName") + private String supName; + + /** + * 巡检项目数量 + */ + @TableField(value = "itemCount") + private Integer itemCount; + + /** + * 完成项目数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 异常项目数量 + */ + @TableField(value = "exceptionCount") + private Integer exceptionCount; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 维修单id + */ +// @TableField(value = "repairId") +// private Long repairId; + + /** + * 巡检建议 + */ + @TableField(value = "suggestion") + private String suggestion; + /** + * 现场照片 + */ + @TableField(value = "livePath") + private String livePath; + /** + * 正常标识 + */ + @TableField(value = "normalFlag") + private Boolean normalFlag; + + + /** + * 更改时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailItemEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailItemEntity.java new file mode 100644 index 00000000..f469673c --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepDetailItemEntity.java @@ -0,0 +1,110 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 设备保养项目 + * + * @TableName device_upkeep_detail_item + */ +@TableName(value = "device_upkeep_detail_item") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceUpkeepDetailItemEntity { + /** + * 任务id + */ + @TableField(value = "taskId") + private Long taskId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 项目编码 + */ + @TableField(value = "itemCode") + private String itemCode; + + /** + * 项目名称 + */ + @TableField(value = "itemName") + private String itemName; + + /** + * 项目内容 + */ + @TableField(value = "itemContent") + private String itemContent; + + /** + * 正常标识 + */ + @TableField(value = "normalFlag") + private Boolean normalFlag; + + + /** + * 项目完成标识 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + + /** + * 项目完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 保养建议 + */ + @TableField(value = "suggestion") + private String suggestion; + + /** + * 保养人id + */ + @TableField(value = "upkeepUserId") + private Long upkeepUserId; + + /** + * 保养人姓名 + */ + @TableField(value = "upkeepUserName") + private String upkeepUserName; + + /** + * 保养部门 + */ + @TableField(value = "upkeepDeptCode") + private String upkeepDeptCode; + + /** + * 保养部门名称 + */ + @TableField(value = "upkeepDeptName") + private String upkeepDeptName; + + /** + * 更改时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepEntity.java new file mode 100644 index 00000000..e42f6d70 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/dev/DeviceUpkeepEntity.java @@ -0,0 +1,140 @@ +package com.glxp.api.entity.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 保养任务表 + * + * @TableName device_upkeep + */ +@TableName(value = "device_upkeep") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class DeviceUpkeepEntity { + /** + * 保养任务id + */ + @TableId(value = "taskId") + private Long taskId; + + /** + * 计划id + */ + @TableField(value = "planId") + private Long planId; + + /** + * 计划名称 + */ + @TableField(value = "planName") + private String planName; + + /** + * 负责部门编码 + */ + @TableField(value = "chargeDeptCode") + private String chargeDeptCode; + + /** + * 保养人id + */ + @TableField(value = "upkeepUserId") + private Long upkeepUserId; + + /** + * 保养人姓名 + */ + @TableField(value = "upkeepUserName") + private String upkeepUserName; + + /** + * 保养人电话 + */ + @TableField(value = "upkeepUserPhone") + private String upkeepUserPhone; + + /** + * 设备数量 + */ + @TableField(value = "deviceCount") + private Integer deviceCount; + + /** + * 完成设备数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 异常设备数量 + */ + @TableField(value = "exceptionCount") + private Integer exceptionCount; + + /** + * 任务名称 + */ + @TableField(value = "name") + private String name; + + /** + * 任务备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 是否系统创建 1/true 是 0/false 否 + */ + @TableField(value = "sysFlag") + private Boolean sysFlag; + + /** + * 是否已完成 1/true 是 0/false 否 + */ + @TableField(value = "finishFlag") + private Boolean finishFlag; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + + /** + * 创建时间 updateTime + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + /** + * 创建人id + */ + @TableField(value = "createUserId") + private Long createUserId; + + /** + * 创建人姓名 + */ + @TableField(value = "createUserName") + private String createUserName; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailMiniQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailMiniQuery.java new file mode 100644 index 00000000..7251813f --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckDetailMiniQuery.java @@ -0,0 +1,28 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class DeviceCheckDetailMiniQuery extends ListPageRequest { + + /** + * 部门编码 + */ + @NotBlank(message = "缺少部门编码") + private String deptCode; + + /** + * 模糊设备码和UDI + */ + private String deviceCodeAndUdi; + + /** + * 是否完成 + */ + private Boolean finishFlag; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictParam.java b/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictParam.java new file mode 100644 index 00000000..7c1bf2e0 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceCheckItemDictParam.java @@ -0,0 +1,56 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceCheckItemDictEntity; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import java.time.LocalDateTime; + +@Data +public class DeviceCheckItemDictParam { + + /** + * 项目编码 + */ + @NotBlank(message = "项目编码不能为空") + @Pattern(regexp = "^[A-Za-z0-9]{1,20}$", message = "项目编码应该在1~20字之间且只能包含字母和数字") + private String code; + + /** + * 项目名称 + */ + @NotBlank(message = "项目名称不能为空") + @Length(min = 1, max = 100, message = "项目名称应该在1~100字之间") + private String name; + + /** + * 项目内容 + */ + @NotBlank(message = "项目内容不能为空") + private String content; + + /** + * 项目类型 + * @param user + * @return + */ + private Integer type; + + public DeviceCheckItemDictEntity getEntity(AuthAdmin user) { + + DeviceCheckItemDictEntity build = DeviceCheckItemDictEntity.builder() + .code(code) + .name(name) + .content(content) + .type(type) + .createUserId(user.getCustomerId()) + .createUserName(user.getEmployeeName()) + .createTime(LocalDateTime.now()) + .build(); + return build; + } + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailMiniQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailMiniQuery.java new file mode 100644 index 00000000..9f376a83 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailMiniQuery.java @@ -0,0 +1,28 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class DeviceRepairApplyDetailMiniQuery extends ListPageRequest { + + /** + * 部门编码 + */ + @NotBlank(message = "缺少部门编码") + private String deptCode; + + /** + * 模糊设备码和UDI + */ + private String deviceCodeAndUdi; + + /** + * 状态 待诊断、待维修、维修中、完成', + */ + private String status; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java index 498fde5f..a1acff24 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyHallQuery.java @@ -13,4 +13,6 @@ public class DeviceRepairApplyHallQuery extends ListPageRequest { */ String applyDeptCode; + Integer isFinish; + } diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyListByIdAndCodeQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyListByIdAndCodeQuery.java new file mode 100644 index 00000000..ae28b9a3 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyListByIdAndCodeQuery.java @@ -0,0 +1,21 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +public class DeviceRepairApplyListByIdAndCodeQuery extends ListPageRequest { + + @NotNull(message = "报修单标识不能为空") + Long applyId; + + /** + * 报修人联系方式 + */ + @NotBlank(message = "设备标识不可以为空") + String deviceCode; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java index 9e3d81ae..fe06f5ac 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java @@ -4,6 +4,8 @@ import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; +import java.util.List; + @Data public class DeviceRepairApplyQuery extends ListPageRequest { @@ -33,4 +35,6 @@ public class DeviceRepairApplyQuery extends ListPageRequest { */ String repairInfo; + List statuss; + } diff --git a/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemFinishParam.java b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemFinishParam.java new file mode 100644 index 00000000..5d590697 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemFinishParam.java @@ -0,0 +1,33 @@ +package com.glxp.api.req.dev; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Builder +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DeviceUpkeepDetailItemFinishParam { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + @NotBlank(message = "设备标识不能为空") + private String deviceCode; + + @NotNull(message = "项目标识不能为空") + private String itemCode; + + @NotNull(message = "请标记巡检状态") + private Boolean normalFlag; + + @NotBlank(message = "巡检意见不能为空") + private String suggestion; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemQuery.java new file mode 100644 index 00000000..a6c07716 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailItemQuery.java @@ -0,0 +1,21 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceUpkeepDetailItemQuery extends ListPageRequest { + + /** + * 任务单标识 + */ + private Long taskId; + + /** + * 设备标识 + */ +// @NotBlank(message = "设备标识不能为空") + private String deviceCode; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailParam.java b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailParam.java new file mode 100644 index 00000000..c338ebd8 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailParam.java @@ -0,0 +1,35 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +@Data +public class DeviceUpkeepDetailParam { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + @NotBlank(message = "设备编码不能为空") + private String deviceCode; + + /** + * 保养建议 + */ + private String suggestion; + + /** + * 现场照片 + */ + private String livePath; + /** + * 正常标识 + */ + private Boolean normalFlag; + + private List detailItemEntities; + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailQuery.java new file mode 100644 index 00000000..8e8a5799 --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepDetailQuery.java @@ -0,0 +1,17 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class DeviceUpkeepDetailQuery extends ListPageRequest { + + @NotNull(message = "任务单标识不能为空") + private Long taskId; + + private String deviceCode; + + +} diff --git a/src/main/java/com/glxp/api/req/dev/DeviceUpkeepQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepQuery.java new file mode 100644 index 00000000..eb609a6e --- /dev/null +++ b/src/main/java/com/glxp/api/req/dev/DeviceUpkeepQuery.java @@ -0,0 +1,14 @@ +package com.glxp.api.req.dev; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class DeviceUpkeepQuery extends ListPageRequest { + + String taskId; + String chargeDeptCode; + String deviceCode; + Boolean finishFlag; + +} diff --git a/src/main/java/com/glxp/api/res/dev/DeviceRepairApplyDetailMiniResponse.java b/src/main/java/com/glxp/api/res/dev/DeviceRepairApplyDetailMiniResponse.java new file mode 100644 index 00000000..f3567432 --- /dev/null +++ b/src/main/java/com/glxp/api/res/dev/DeviceRepairApplyDetailMiniResponse.java @@ -0,0 +1,201 @@ +package com.glxp.api.res.dev; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class DeviceRepairApplyDetailMiniResponse { + + /** + * 报修单id + */ + @TableField(value = "applyId") + private Long applyId; + + /** + * 设备编码 + */ + @TableField(value = "deviceCode") + private String deviceCode; + + /** + * 部门编码 + */ + @TableField(value = "deptCode") + private String deptCode; + + /** + * 部门名称 + */ + @TableField(value = "deptName") + private String deptName; + + /** + * 问题描述 + */ + @TableField(value = "description") + private String description; + + /** + * 诊断信息 + */ + @TableField(value = "diagnosisInfo") + private String diagnosisInfo; + + /** + * 状态 待诊断、待维修、维修中、完成 + */ + @TableField(value = "status") + private DeviceRepairApplyDetailStatusEnum status; + + /** + * 是否需要维修 true/false + */ + @TableField(value = "repairFlag") + private Boolean repairFlag; + + /** + * 维修单id + */ + @TableField(value = "repairId") + private Long repairId; + + /** + * 产品id + */ + @TableField(value = "productId") + private Long productId; + + /** + * UDI码 + */ + @TableField(value = "udi") + private String udi; + + /** + * DI码 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 产品名称 + */ + @TableField(value = "productName") + private String productName; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + + + /** + * 报修单id + */ + @TableId(value = "id") + private Long id; + +// /** +// * 状态 待受理,受理中,维修中,完成 +// */ +// @TableField(value = "status") +// private DeviceRepairApplyStatusEnum status; + + /** + * 报修部门编码 + */ + @TableField(value = "applyDeptCode") + private String applyDeptCode; + + /** + * 报修部门 + */ + @TableField(value = "applyDeptName") + private String applyDeptName; + + /** + * 报修人id + */ + @TableField(value = "applyUserId") + private Long applyUserId; + + /** + * 报修人姓名 + */ + @TableField(value = "applyUserName") + private String applyUserName; + + /** + * 报修人联系方式 + */ + @TableField(value = "applyUserPhone") + private String applyUserPhone; + + /** + * 报修时间 + */ + @TableField(value = "applyTime") + private LocalDateTime applyTime; + + /** + * 设备数量 + */ + @TableField(value = "deviceCount") + private Integer deviceCount; + + /** + * 完成数量 + */ + @TableField(value = "finishCount") + private Integer finishCount; + + /** + * 确认部门 + */ + @TableField(value = "confirmDeptCode") + private String confirmDeptCode; + + /** + * 确认部门名称 + */ + @TableField(value = "confirmDeptName") + private String confirmDeptName; + + /** + * 确认人id + */ + @TableField(value = "confirmUserId") + private Long confirmUserId; + + /** + * 确认人姓名 + */ + @TableField(value = "confirmUserName") + private String confirmUserName; + + /** + * 确认人联系方式 + */ + @TableField(value = "confirmPhone") + private String confirmPhone; + + /** + * 确认时间 + */ + @TableField(value = "confirmTime") + private LocalDateTime confirmTime; + + /** + * 完成时间 + */ + @TableField(value = "finishTime") + private LocalDateTime finishTime; + +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java index f3135e86..4073effe 100644 --- a/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java +++ b/src/main/java/com/glxp/api/service/dev/DeviceCheckDetailService.java @@ -3,6 +3,7 @@ package com.glxp.api.service.dev; import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery; import com.glxp.api.req.dev.DeviceCheckDetailParam; import com.glxp.api.req.dev.DeviceCheckDetailQuery; import com.glxp.api.req.dev.DeviceCheckDetailRepairParam; @@ -32,4 +33,5 @@ public interface DeviceCheckDetailService extends IService miniPage(DeviceCheckDetailMiniQuery query); } diff --git a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java index da5a18d3..e5f834b8 100644 --- a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java +++ b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyDetailService.java @@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity; import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; +import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; import java.util.List; @@ -30,4 +33,8 @@ public interface DeviceRepairApplyDetailService extends IService miniPage(DeviceRepairApplyDetailMiniQuery query); } diff --git a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java index c9e05b48..a4b2a711 100644 --- a/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java +++ b/src/main/java/com/glxp/api/service/dev/DeviceRepairApplyService.java @@ -6,7 +6,9 @@ import com.glxp.api.entity.dev.DeviceRepairApplyEntity; import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; import com.glxp.api.req.dev.DeviceRepairApplyAddParam; import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; import com.glxp.api.req.dev.DeviceRepairApplyQuery; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; import java.util.List; @@ -36,4 +38,5 @@ public interface DeviceRepairApplyService extends IService { * 完成维修 * 同时改变设备状态 * - * @param repairId 维修单id + * @param deviceRepairEntity 维修单id * @param user 用户信息 */ - void finishByUser(Long repairId, AuthAdmin user); + void finishByUser(DeviceRepairEntity deviceRepairEntity, AuthAdmin user); } diff --git a/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailItemService.java b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailItemService.java new file mode 100644 index 00000000..abd09311 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailItemService.java @@ -0,0 +1,25 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity; +import com.glxp.api.req.dev.DeviceUpkeepDetailItemFinishParam; +import com.glxp.api.req.dev.DeviceUpkeepDetailItemQuery; +import com.glxp.api.req.dev.DeviceUpkeepDetailParam; + +import java.util.List; + +/** + * 针对表【device_upkeep_detail_item(设备保养项目)】的数据库操作Service + */ +public interface DeviceUpkeepDetailItemService extends IService { + + + List listByTaskId(Long taskId, String deviceCode); + + List pageList(DeviceUpkeepDetailItemQuery query); + + void finish(DeviceUpkeepDetailItemFinishParam param, AuthAdmin user); + + void finishAll(DeviceUpkeepDetailParam param, AuthAdmin user); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailService.java b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailService.java new file mode 100644 index 00000000..38e121d4 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepDetailService.java @@ -0,0 +1,26 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity; +import com.glxp.api.req.dev.DeviceUpkeepDetailQuery; + +import java.util.List; + +/** + * 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Service + */ +public interface DeviceUpkeepDetailService extends IService { + + + List pageList(DeviceUpkeepDetailQuery query); + + + + + List listByTaskId(Long taskId, String deviceCode); + DeviceUpkeepDetailEntity getOne(Long taskId, String deviceCode); + + + void finishItem(Long taskId, String deviceCode, String deptCode, Boolean normalFlag, AuthAdmin user); +} diff --git a/src/main/java/com/glxp/api/service/dev/DeviceUpkeepService.java b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepService.java new file mode 100644 index 00000000..1d935c05 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/DeviceUpkeepService.java @@ -0,0 +1,46 @@ +package com.glxp.api.service.dev; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceUpkeepEntity; +import com.glxp.api.req.dev.DeviceUpkeepQuery; +import com.glxp.api.vo.dev.DeviceUpkeepDetailVo; +import com.glxp.api.vo.dev.DeviceUpkeepPrintVo; +import com.glxp.api.vo.dev.DeviceUpkeepVo; + +import java.util.List; + +/** + * @author : zhangsan + * @date : 2024/5/12 15:16 + * @modyified By : + */ + +/** + * 针对表【device_upkeep(保养任务表)】的数据库操作Service + */ +public interface DeviceUpkeepService extends IService { + + List pageList(DeviceUpkeepQuery query); + + void genByPlanId(Long planId, boolean b, AuthAdmin user); + + + + DeviceUpkeepPrintVo checkInfoPrint(Long taskId, String deviceCode); + + void finishUpkeep(Long taskId, String deviceCode); + + List pageListDetail(DeviceUpkeepQuery query); + + /** + * 完成一个保养设备 + * + * @param taskId 任务id + * @param deviceCode 设备编码 + * @return + */ +// void finishDevice(Long taskId, String deviceCode); + +// void finishUpkeep(String deviceCode, String deptCode, Long taskId, AuthAdmin user); +} diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java index 512385a8..33277f07 100644 --- a/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceCheckDetailServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.dev.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; @@ -10,6 +11,7 @@ import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.dev.DeviceCheckDetailEntity; import com.glxp.api.entity.dev.DeviceRepairEntity; import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery; import com.glxp.api.req.dev.DeviceCheckDetailParam; import com.glxp.api.req.dev.DeviceCheckDetailQuery; import com.glxp.api.req.dev.DeviceCheckDetailRepairParam; @@ -140,6 +142,26 @@ public class DeviceCheckDetailServiceImpl extends ServiceImpl miniPage(DeviceCheckDetailMiniQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(DeviceCheckDetailEntity.class) + .eq(DeviceCheckDetailEntity::getDeptCode, query.getDeptCode()); + if (StrUtil.isNotBlank(query.getDeviceCodeAndUdi())) { + queryWrapper.and(qW -> { + qW.like(DeviceCheckDetailEntity::getDeviceCode, query.getDeviceCodeAndUdi()) + .or().like(DeviceCheckDetailEntity::getUdi, query.getDeviceCodeAndUdi()); + }); + } + if (query.getFinishFlag() != null) { + queryWrapper.eq(DeviceCheckDetailEntity::getFinishFlag, query.getFinishFlag()); + } + List list = super.list(queryWrapper); + return list; + } } diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java index 117e8780..5ea8b347 100644 --- a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java @@ -13,7 +13,10 @@ import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum; import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; import com.glxp.api.exception.JsonException; import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery; +import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; import com.glxp.api.service.dev.DeviceInfoService; import com.glxp.api.service.dev.DeviceRepairApplyDetailService; import com.glxp.api.service.dev.DeviceRepairApplyService; @@ -134,6 +137,32 @@ public class DeviceRepairApplyDetailServiceImpl extends ServiceImpl miniPage(DeviceRepairApplyDetailMiniQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + return super.baseMapper.miniPage(query); + } } diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java index 410ab0b4..a2c3ae6e 100644 --- a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyServiceImpl.java @@ -13,7 +13,9 @@ import com.glxp.api.entity.dev.DeviceRepairApplyEntity; import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum; import com.glxp.api.req.dev.DeviceRepairApplyAddParam; import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam; +import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery; import com.glxp.api.req.dev.DeviceRepairApplyQuery; +import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse; import com.glxp.api.service.dev.DeviceInfoService; import com.glxp.api.service.dev.DeviceRepairApplyDetailService; import com.glxp.api.service.dev.DeviceRepairApplyService; @@ -147,6 +149,7 @@ public class DeviceRepairApplyServiceImpl extends ServiceImpl + implements DeviceUpkeepDetailItemService { + + @Resource + DeviceUpkeepService deviceUpkeepService; + @Resource + DeviceUpkeepDetailService deviceUpkeepDetailService; + @Resource + DeviceUpkeepDetailMapper deviceUpkeepDetailMapper; + + + @Override + public List listByTaskId(Long taskId, String deviceCode) { + List list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailItemEntity.class) + .eq(DeviceUpkeepDetailItemEntity::getTaskId, taskId) + .eq(deviceCode != null, DeviceUpkeepDetailItemEntity::getDeviceCode, deviceCode) + .orderByAsc(DeviceUpkeepDetailItemEntity::getDeviceCode, DeviceUpkeepDetailItemEntity::getItemCode) + ); + return list; + } + + @Override + public List pageList(DeviceUpkeepDetailItemQuery query) { + List list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailItemEntity.class) + .eq(DeviceUpkeepDetailItemEntity::getTaskId, query.getTaskId()) + .eq(query.getDeviceCode()!=null,DeviceUpkeepDetailItemEntity::getDeviceCode, query.getDeviceCode()) + .orderByAsc(DeviceUpkeepDetailItemEntity::getFinishFlag, DeviceUpkeepDetailItemEntity::getNormalFlag, DeviceUpkeepDetailItemEntity::getDeviceCode, DeviceUpkeepDetailItemEntity::getItemCode) + ); + + return list; + } + + @Override + public void finish(DeviceUpkeepDetailItemFinishParam param, AuthAdmin user) { + DeviceUpkeepEntity upkeepEntity = deviceUpkeepService.getById(param.getTaskId()); + if (upkeepEntity == null) { + return; + } +// DeviceUpkeepDetailEntity detailEntity = deviceUpkeepDetailService.getOne(param.getTaskId(), param.getDeviceCode()); +//// DeviceCheckDetailEntity detailEntity = deviceCheckDetailService.getOne(param.getTaskId(), param.getDeviceCode()); + + DeviceUpkeepDetailEntity detailEntity = deviceUpkeepDetailService.getOne(param.getTaskId(), param.getDeviceCode()); + if (detailEntity == null) { + return; + } + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailItemEntity.class) + .set(DeviceUpkeepDetailItemEntity::getFinishFlag, true) + .set(DeviceUpkeepDetailItemEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceUpkeepDetailItemEntity::getSuggestion, param.getSuggestion()) + .set(DeviceUpkeepDetailItemEntity::getNormalFlag, param.getNormalFlag()) + .set(DeviceUpkeepDetailItemEntity::getUpkeepUserId, user.getId()) + .set(DeviceUpkeepDetailItemEntity::getUpkeepUserName, user.getEmployeeName()) + .set(DeviceUpkeepDetailItemEntity::getUpkeepDeptCode, user.getLocDeptCode()) + .set(DeviceUpkeepDetailItemEntity::getUpkeepDeptName, user.getDeptName()) + .set(DeviceUpkeepDetailItemEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceUpkeepDetailItemEntity::getTaskId, param.getTaskId()) + .eq(DeviceUpkeepDetailItemEntity::getDeviceCode, param.getDeviceCode()) + .eq(DeviceUpkeepDetailItemEntity::getItemCode, param.getItemCode()) + .eq(DeviceUpkeepDetailItemEntity::getFinishFlag, false) + ); + if (updated) { + deviceUpkeepDetailService.finishItem(param.getTaskId(), param.getDeviceCode(), detailEntity.getDeptCode(), param.getNormalFlag(), user); + } else { + throw new JsonException("操作失败,该项目可能已经被其他人完成,请刷新重试"); + } + } + + @Override + public void finishAll(DeviceUpkeepDetailParam param, AuthAdmin user) { + int finishCount = 0; + int exceptionCount = 0; + int itemCount = 0; + if (CollUtil.isNotEmpty(param.getDetailItemEntities())) { + for (DeviceUpkeepDetailItemEntity itemEntity : param.getDetailItemEntities()) { + if (!IntUtil.value(itemEntity.getNormalFlag())) { + exceptionCount++; + } + finishCount++; + itemCount++; + finish(DeviceUpkeepDetailItemFinishParam.builder() + .taskId(param.getTaskId()) + .deviceCode(param.getDeviceCode()) + .itemCode(itemEntity.getItemCode()) + .normalFlag(itemEntity.getNormalFlag()) + .suggestion("") + .build(), user); + } + } +// log.error("修改语句"); + int update = deviceUpkeepDetailMapper.update(DeviceUpkeepDetailEntity.builder() + .finishFlag(true) + .finishCount(finishCount) + .suggestion(param.getSuggestion()) + .livePath(param.getLivePath()) + .normalFlag(param.getNormalFlag()) + .finishTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .exceptionCount(exceptionCount).itemCount(itemCount).build(), + Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class) + .eq(DeviceUpkeepDetailEntity::getTaskId, param.getTaskId()) + .eq(DeviceUpkeepDetailEntity::getDeviceCode, param.getDeviceCode()) + ); + if (update<1){ + + throw new JsonException(ResultEnum.NOT_NETWORK,"修改失败"); + } + + } + +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepDetailServiceImpl.java new file mode 100644 index 00000000..b55f3dd4 --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceUpkeepDetailMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity; +import com.glxp.api.req.dev.DeviceUpkeepDetailQuery; +import com.glxp.api.service.dev.DeviceInfoService; +import com.glxp.api.service.dev.DeviceUpkeepDetailService; +import com.glxp.api.service.dev.DeviceUpkeepService; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Service实现 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class DeviceUpkeepDetailServiceImpl extends ServiceImpl + implements DeviceUpkeepDetailService { + + final DeviceUpkeepService deviceUpkeepService; + final DeviceInfoService deviceInfoService; + + @Override + public List pageList(DeviceUpkeepDetailQuery query) { + if (query.getPage() != null) { + PageHelper.startPage(query.getPage(), query.getLimit()); + } + List list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class) + .eq(DeviceUpkeepDetailEntity::getTaskId, query.getTaskId()) + .eq(StrUtil.isNotBlank(query.getDeviceCode()), DeviceUpkeepDetailEntity::getDeviceCode, query.getDeviceCode()) + .orderBy(true, true, DeviceUpkeepDetailEntity::getFinishFlag) + .orderBy(true, false, DeviceUpkeepDetailEntity::getExceptionCount) + .orderBy(true, true, DeviceUpkeepDetailEntity::getDeptCode) + .orderBy(true, true, DeviceUpkeepDetailEntity::getFinishTime) + .orderBy(true, true, DeviceUpkeepDetailEntity::getDeptCode) + ); + return list; + } + + @Override + public List listByTaskId(Long taskId, String deviceCode) { + List list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class) + .eq(DeviceUpkeepDetailEntity::getTaskId, taskId) + .eq(deviceCode != null, DeviceUpkeepDetailEntity::getDeviceCode, deviceCode) + .orderByAsc(DeviceUpkeepDetailEntity::getDeptCode, DeviceUpkeepDetailEntity::getDeviceCode) + ); + return list; + } + + @Override + public DeviceUpkeepDetailEntity getOne(Long taskId, String deviceCode) { + return super.getOne(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class) + .eq(DeviceUpkeepDetailEntity::getTaskId, taskId) + .eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode) + ); + } + + @Override + public void finishItem(Long taskId, String deviceCode, String deptCode, Boolean normalFlag, AuthAdmin user) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class) + .setSql("finishCount = finishCount + 1") + .setSql(!normalFlag, "exceptionCount = exceptionCount + 1") + .eq(DeviceUpkeepDetailEntity::getTaskId, taskId) + .eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode) + .last("and finishCount+1<=itemCount") + ); + if (updated) { + updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class) + .set(DeviceUpkeepDetailEntity::getFinishFlag, true) + .set(DeviceUpkeepDetailEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceUpkeepDetailEntity::getUpdateTime, LocalDateTime.now()) + .eq(DeviceUpkeepDetailEntity::getTaskId, taskId) + .eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode) + .last("and finishCount = itemCount") + ); + if (updated) { + // 所有项目全部完成。。。修改任务单完成设备 and 关闭设备的巡检锁 + deviceUpkeepService.finishUpkeep(taskId, deviceCode); + deviceInfoService.finishCheck(deviceCode, deptCode, taskId, user); + + } + + } + } + + +} + + + + diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepServiceImpl.java new file mode 100644 index 00000000..5919ff6a --- /dev/null +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceUpkeepServiceImpl.java @@ -0,0 +1,227 @@ +package com.glxp.api.service.dev.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.dev.DeviceUpkeepMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.dev.*; +import com.glxp.api.enums.dev.DeviceStatusEnum; +import com.glxp.api.exception.JsonException; +import com.glxp.api.req.dev.DeviceUpkeepQuery; +import com.glxp.api.service.dev.*; +import com.glxp.api.util.SnowflakeUtil; +import com.glxp.api.vo.dev.DevicePlanDetailVo; +import com.glxp.api.vo.dev.DeviceUpkeepDetailVo; +import com.glxp.api.vo.dev.DeviceUpkeepPrintVo; +import com.glxp.api.vo.dev.DeviceUpkeepVo; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; + +/** + * @author : zhangsan + * @date : 2024/5/12 15:19 + * @modyified By : + */ + + +/** + * 针对表【device_upkeep(保养任务表)】的数据库操作Service + */ +@Service +@RequiredArgsConstructor +public class DeviceUpkeepServiceImpl extends ServiceImpl + implements DeviceUpkeepService { + + + @Resource + DevicePlanService devicePlanService; + @Resource + DeviceUpkeepDetailService deviceUpkeepDetailService; + @Resource + DevicePlanDetailItemService devicePlanDetailItemService; + @Resource + DeviceInfoService deviceInfoService; + @Resource + DeviceUpkeepDetailItemService deviceUpkeepDetailItemService; + @Resource + DevicePlanDetailService devicePlanDetailService; + + private final ThreadPoolTaskExecutor taskExecutor; + + @Override + public List pageList(DeviceUpkeepQuery query) { + if (query.getPage() != null){ + PageHelper.startPage(query.getPage(),query.getLimit()); + } + List list = super.baseMapper.pageVo(query); + return list; + } + + @Override + public void genByPlanId(Long planId, boolean b, AuthAdmin user) { + DevicePlanEntity plan = devicePlanService.getById(planId); + if (plan == null) { + throw new JsonException("保养计划不存在"); + } + List planDetailList = devicePlanDetailService.listByPlanId(planId); + if (CollectionUtil.isEmpty(planDetailList)) { + throw new JsonException("计划保养产品为空,不创建任务单"); + } + List itemList = devicePlanDetailItemService.listByPlanId(planId); + Map> itemMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(itemList)) { + itemMap = itemList.stream().collect(Collectors.groupingBy(i -> i.getProductId() + "_" + i.getDeviceCode())); + } + + DeviceUpkeepEntity deviceUpkeepEntity = DeviceUpkeepEntity.builder() + .taskId(SnowflakeUtil.getId()) + .planId(plan.getPlanId()) + .planName(plan.getName()) + .chargeDeptCode(plan.getChargeDeptCode()) + .name(plan.getName()) + .finishCount(0) + .sysFlag(b) + .createTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .createUserId(b ? null : user.getId()) + .createUserName(b ? null : user.getEmployeeName()) + .build(); + + List upkeepDetailList = new ArrayList<>(); + List upkeepDetailItemList = new ArrayList<>(); + Map> finalItemMap = itemMap; + planDetailList.forEach(d -> { + List items = finalItemMap.get(d.getProductId() + "_" + d.getDeviceCode()); + if (CollectionUtil.isEmpty(items)) { + items = new ArrayList<>(); + } + List productItems = finalItemMap.get(d.getProductId() + "_"); + if (CollectionUtil.isNotEmpty(productItems)) { + items.addAll(productItems); + } + if (CollectionUtil.isNotEmpty(items)) { + DeviceUpkeepDetailEntity detailEntity = DeviceUpkeepDetailEntity.builder() + .taskId(deviceUpkeepEntity.getTaskId()) + .updateTime(LocalDateTime.now()) + .finishFlag(false) + .build(); + BeanUtil.copyProperties(d, detailEntity); + boolean opened = deviceInfoService.openCheckLock(d.getDeviceCode(), d.getDeptCode()); + if (opened) { + items.forEach(item -> { + DeviceUpkeepDetailItemEntity deviceCheckDetailItem = DeviceUpkeepDetailItemEntity.builder() + .taskId(deviceUpkeepEntity.getTaskId()) + .deviceCode(d.getDeviceCode()) + .itemCode(item.getItemCode()) + .itemName(item.getName()) + .itemContent(item.getContent()) + .finishFlag(false) + .updateTime(LocalDateTime.now()) + .build(); +// deviceCheckDetailItem.setUpdateTime(LocalDateTime.now()); + upkeepDetailItemList.add(deviceCheckDetailItem); + }); + detailEntity.setItemCount(items.size()); + upkeepDetailList.add(detailEntity); + } + } + }); + + if (CollectionUtil.isNotEmpty(upkeepDetailList)) { + devicePlanService.addExecCount(planId); + deviceUpkeepEntity.setDeviceCount(upkeepDetailList.size()); + super.save(deviceUpkeepEntity); + deviceUpkeepDetailService.saveBatch(upkeepDetailList); + if (CollectionUtil.isNotEmpty(upkeepDetailItemList)) { + deviceUpkeepDetailItemService.saveBatch(upkeepDetailItemList); + }else { + throw new JsonException(String.format("没有配置巡检项目,无法生成巡检单")); + } + } else { + throw new JsonException(String.format("没有找到处于[%s]状态的设备,无法生成保养单", DeviceStatusEnum.NORMAL.getDesc())); + } + } + + @Override + public DeviceUpkeepPrintVo checkInfoPrint(Long taskId, String deviceCode) { + CompletableFuture infoFuture = CompletableFuture.supplyAsync(() -> { + return super.baseMapper.getVoById(taskId); + }, taskExecutor); + CompletableFuture> detailFuture = CompletableFuture.supplyAsync(() -> { + return deviceUpkeepDetailService.listByTaskId(taskId, deviceCode); + }, taskExecutor); + CompletableFuture> detailItemFuture = CompletableFuture.supplyAsync(() -> { + return deviceUpkeepDetailItemService.listByTaskId(taskId, deviceCode); + }, taskExecutor); + + try { + CompletableFuture.allOf(detailItemFuture).get(); + DeviceUpkeepVo upkeepVo = infoFuture.get(); + List details = detailFuture.get(); + List items = detailItemFuture.get(); + if (upkeepVo == null || details == null || items == null) { + throw new JsonException("任务单不存在"); + } + List detailVos = BeanUtil.copyToList(details, DeviceUpkeepPrintVo.DetailVo.class); + Map> itemsMap = items.stream().collect(Collectors.groupingBy(DeviceUpkeepDetailItemEntity::getDeviceCode)); + detailVos.forEach(i -> { + i.setDetailItems(itemsMap.get(i.getDeviceCode())); + }); + DeviceUpkeepPrintVo vo = DeviceUpkeepPrintVo.builder() + .printTime(LocalDateTime.now()) + .info(upkeepVo) + .details(detailVos) + .build(); + return vo; + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + + @Override + @Transactional + public void finishUpkeep(Long taskId, String deviceCode) { + boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepEntity.class) + .setSql("finishCount = finishCount + 1") + .setSql(String.format("exceptionCount = exceptionCount + (select exceptionCount>0 from device_upkeep_detail where taskId = %s and deviceCode = '%s')", taskId, deviceCode)) + .eq(DeviceUpkeepEntity::getTaskId, taskId) + .last("and finishCount+1 <= deviceCount") + ); + if (updated) { + updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepEntity.class) + .set(DeviceUpkeepEntity::getFinishFlag, true) + .set(DeviceUpkeepEntity::getFinishTime, LocalDateTime.now()) + .set(DeviceUpkeepEntity::getUpdateTime,LocalDateTime.now()) + .eq(DeviceUpkeepEntity::getTaskId, taskId) + .eq(DeviceUpkeepEntity::getFinishFlag, false) + .last("and finishCount = deviceCount") + ); + } + } + + @Override + public List pageListDetail(DeviceUpkeepQuery query) { + if (query.getPage() != null){ + PageHelper.startPage(query.getPage(),query.getLimit()); + } + List list = super.baseMapper.pageListDetail(query); + return list; + } + + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepDetailVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepDetailVo.java new file mode 100644 index 00000000..4280e8ed --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepDetailVo.java @@ -0,0 +1,19 @@ +package com.glxp.api.vo.dev; + +import lombok.Data; + +@Data +public class DeviceUpkeepDetailVo { + + String deviceCode; + String deptName; + Boolean finishFlag; + String manufactory; + Integer itemCount; + Integer exceptionCount; + Integer finishCount; + Integer deviceCount; + String createUserName; + + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepPrintVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepPrintVo.java new file mode 100644 index 00000000..e6e9579a --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepPrintVo.java @@ -0,0 +1,33 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceCheckDetailEntity; +import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeviceUpkeepPrintVo { + + LocalDateTime printTime; + + DeviceUpkeepVo info; + + List details; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public class DetailVo extends DeviceCheckDetailEntity { + public List detailItems; + } + +} diff --git a/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepVo.java b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepVo.java new file mode 100644 index 00000000..b7bf2802 --- /dev/null +++ b/src/main/java/com/glxp/api/vo/dev/DeviceUpkeepVo.java @@ -0,0 +1,11 @@ +package com.glxp.api.vo.dev; + +import com.glxp.api.entity.dev.DeviceUpkeepEntity; +import lombok.Data; + +@Data +public class DeviceUpkeepVo extends DeviceUpkeepEntity { + + String chargeDeptName; + +} diff --git a/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml index bd0cf536..d6ed4f93 100644 --- a/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml +++ b/src/main/resources/mybatis/mapper/dev/DeviceRepairApplyDetailMapper.xml @@ -45,4 +45,69 @@ supName,confirmUserId,confirmUserName, confirmTime,confirmRemark,updateTime + + + + diff --git a/src/main/resources/mybatis/mapper/dev/DeviceUpkeepMapper.xml b/src/main/resources/mybatis/mapper/dev/DeviceUpkeepMapper.xml new file mode 100644 index 00000000..2df51e8c --- /dev/null +++ b/src/main/resources/mybatis/mapper/dev/DeviceUpkeepMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + taskId,planId,planName, + upkeepUserId,upkeepUserName,upkeepUserPhone, + name,remark,sysFlag, + createTime,createUserId,createUserName + + + + + diff --git a/src/main/resources/schemas/schema_v2.3.sql b/src/main/resources/schemas/schema_v2.3.sql index d03b4164..1bc881af 100644 --- a/src/main/resources/schemas/schema_v2.3.sql +++ b/src/main/resources/schemas/schema_v2.3.sql @@ -817,3 +817,7 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailProductAttributes', 'tinyint NULL DEFAULT NULL COMMENT ''校验产品属性 :1:校验;2.无需校验''', 1); CALL Pro_Temp_ColumnWork('auth_user', 'lastUpdatePwdTime', 'datetime', 1); + + + + diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index 72c3ec62..01753bd7 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -132,7 +132,7 @@ CREATE TABLE if not exists `device_check` ROW_FORMAT=Dynamic; - CREATE TABLE IF NOT EXISTS `device_check_detail` +CREATE TABLE IF NOT EXISTS `device_check_detail` ( `taskId` bigint NOT NULL COMMENT '任务id', `deviceCode` varbinary(255) NOT NULL COMMENT '设备编码', @@ -168,7 +168,7 @@ CREATE TABLE if not exists `device_check` COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务明细' ROW_FORMAT=Dynamic; - CREATE TABLE IF NOT EXISTS `device_check_detail_item` +CREATE TABLE IF NOT EXISTS `device_check_detail_item` ( `taskId` bigint NOT NULL COMMENT '任务id', `deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码', @@ -389,7 +389,7 @@ DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更日志表' ROW_FORMAT=Dynamic; -CREATE TABLE `device_change_order` ( +CREATE TABLE IF NOT EXISTS `device_change_order` ( `orderId` bigint NOT NULL COMMENT '编码', `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库,change:变更归属', `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 ,2.完成(目标确认接收) ,3.目标部门拒收,4.取消', @@ -430,12 +430,23 @@ CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription', ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''', 1); -INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43'); -INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36'); -INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'processing', '1002', '手术室', 1, '超级用户', '18238132561', '2024-05-07 19:07:56', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:11:48', NULL, '2024-05-09 11:59:52'); -INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'processing', '1002', '手术室', 1, '超级用户', '15866936214', '2024-05-07 19:09:32', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:10:46', NULL, '2024-05-09 14:29:19'); -INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'S0185624335', '1002', '手术室', 'SUCCESS!!!!!!!!!!', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', 'zxzxz111', '11111111111111111', '2024-05-01', '2024-05-30', '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:07:56'); -INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32'); +INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) +VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43'); + +INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) +VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36'); + +INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) +VALUES (1787801533814042624, 'processing', '1002', '手术室', 1, '超级用户', '18238132561', '2024-05-07 19:07:56', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:11:48', NULL, '2024-05-09 11:59:52'); + +INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) +VALUES (1787801935535218688, 'processing', '1002', '手术室', 1, '超级用户', '15866936214', '2024-05-07 19:09:32', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:10:46', NULL, '2024-05-09 14:29:19'); + +INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) +VALUES (1787801533814042624, 'S0185624335', '1002', '手术室', 'SUCCESS!!!!!!!!!!', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', 'zxzxz111', '11111111111111111', '2024-05-01', '2024-05-30', '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:07:56'); + +INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) +VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '枚', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32'); CREATE TABLE IF NOT EXISTS `thr_manufacturer` @@ -463,6 +474,44 @@ COLLATE=utf8mb4_0900_ai_ci COMMENT='第三方往来单位类型' ROW_FORMAT=Dynamic; + + + +CALL Pro_Temp_ColumnWork('device_check_item_dict', 'type', + ' tinyint NULL DEFAULT NULL COMMENT ''项目字典类型 1:巡检项目;2:保养项目''', + 1); +CALL Pro_Temp_ColumnWork('device_plan', 'type', + ' tinyint NULL DEFAULT NULL COMMENT ''计划类型 1:巡检计划; 2:保养计划''', + 1); + +CALL Pro_Temp_ColumnWork('device_plan_detail_item', 'type', + ' tinyint NULL DEFAULT NULL COMMENT ''项目类型 1:巡检项目; 2:保养项目''', + 1); + CALL Pro_Temp_ColumnWork('sync_data_set', 'produceBusiness', ' tinyint NULL DEFAULT NULL COMMENT ''生产企业信息''', 1); +CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'livePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修现场照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair', 'livePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''报修现场照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair', 'serviceLivePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修后现场照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair', 'diagnosisLivePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'diagnosisLivePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair', 'repairUserId', 'bigint DEFAULT NULL COMMENT''报修人id''', 1); +CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription', + ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''', + 1); +ALTER TABLE device_repair + MODIFY COLUMN `diagnosisInfo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '诊断信息' AFTER `description`; +ALTER TABLE device_plan_detail_item + DROP PRIMARY KEY, + ADD PRIMARY KEY (`planId`, `productId`, `itemCode`, `deviceCode`) USING BTREE;