From 5b15f6ff453ea253fa3ed2e4f9d521a6b816d0a3 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 28 Aug 2023 09:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=BF=A1=E6=81=AF=E5=AE=9A=E6=97=B6=E9=80=89?= =?UTF-8?q?=E5=85=A5=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=B0=E8=80=97=E6=9D=90=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thrsys/impl/ThrProductsServiceImpl.java | 26 +++++++++++++++++++ src/main/java/com/glxp/api/util/IntUtil.java | 6 ++--- src/main/resources/application-dev.yml | 2 +- src/main/resources/schemas/schema_v2.2.sql | 11 +++++--- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 967ea650..5dc589d7 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -6,11 +6,14 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.basic.UdiRelevanceDao; import com.glxp.api.dao.thrsys.ThrProductsDao; +import com.glxp.api.entity.basic.UdiRelevanceEntity; import com.glxp.api.entity.thrsys.ThrProductsEntity; import com.glxp.api.entity.thrsys.ThrSystemDetailEntity; import com.glxp.api.http.ErpBasicClient; @@ -19,7 +22,10 @@ import com.glxp.api.req.thrsys.PostThrProductsRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.thrsys.ThrProductsResponse; +import com.glxp.api.service.basic.UdiContrastService; +import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.service.thrsys.ThrProductsService; +import com.glxp.api.util.IntUtil; import com.glxp.api.util.RedisUtil; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.session.ExecutorType; @@ -53,6 +59,8 @@ public class ThrProductsServiceImpl extends ServiceImpl().eq("mainId", thrProductsEntity.getCode())); + if (!isExit) { + udiContrastService.createOnlyMainId(thrProductsEntity.getCode()); + } + } + } + + } else { boolean isChange = verifyDataChange(thrProductsEntity, item); if (isChange) { diff --git a/src/main/java/com/glxp/api/util/IntUtil.java b/src/main/java/com/glxp/api/util/IntUtil.java index 397b316c..6969ec1f 100644 --- a/src/main/java/com/glxp/api/util/IntUtil.java +++ b/src/main/java/com/glxp/api/util/IntUtil.java @@ -25,13 +25,11 @@ public class IntUtil { else return value; } - public static int value(String value) { if (StrUtil.isEmpty(value)) return 0; - else - return Integer.parseInt(value); - } + else return Integer.parseInt(value); + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index b2df4abe..458a4284 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,7 +4,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pzh?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 717ffe2c..ca48c794 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task` `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门', `invCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '仓库', `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资产编码', - `status` int NULL DEFAULT NULL COMMENT '状态', - `type` int NULL DEFAULT NULL COMMENT '类型', + `status` int NULL DEFAULT NULL COMMENT '状态', + `type` int NULL DEFAULT NULL COMMENT '类型', `inspectUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检人', `remindTime` datetime(0) NULL DEFAULT NULL COMMENT '提醒时间', `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检备注', @@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task_detail` `id` int NOT NULL AUTO_INCREMENT, `projectCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检项目编码', `projectContent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检内容', - `status` int NULL DEFAULT NULL COMMENT '状态(1:未开始;2:已检查;3:异常;4:不巡检', + `status` int NULL DEFAULT NULL COMMENT '状态(1:未开始;2:已检查;3:异常;4:不巡检', `result` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检结果备注', `inspectImage` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检图片', `inspectUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检人', @@ -265,3 +265,8 @@ CALL Pro_Temp_ColumnWork('dept_device_detail', 'nameCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1); + + +INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, + `paramType`, `paramExplain`, `updateTime`) +VALUES (2090, 0, '更新第三方产品信息是否选入耗材字典', 'update_third_in_rel', '0', 0, 0, '更新第三方产品信息是否选入耗材字典(0:否;1:是)', NULL);