From 4273060f9e52a697e57f503b95948f928fbe6d09 Mon Sep 17 00:00:00 2001 From: dongsk Date: Sun, 2 Jul 2023 13:00:24 +0800 Subject: [PATCH 1/2] no message --- .../digiwin/athena/app/service/cps/CpsQuestionGetService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index ad318ca..d8a475d 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -96,6 +96,10 @@ public class CpsQuestionGetService extends AbsEAIService { break; }*/ + if (StringUtils.isBlank(status)) { + status = "1"; + } + switch (option) { case "1": lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); From 88ba67c4e329e47a330e5573de840c403913812f Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 3 Jul 2023 10:27:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/infra/entity/CpsQuestionInfo.java | 6 +++++- .../athena/app/service/cps/CpsQuestionGetService.java | 7 +++++-- doc/sql/app-20230630-ddl.sql | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index ee3d108..18e3d0b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -73,5 +73,9 @@ public class CpsQuestionInfo extends BaseMgrEntity { private Integer status5 = 1; @SerializedName(value = "status6") private Integer status6 = 1; + @SerializedName(value = "measures_from") + private String measuresFrom; + @SerializedName(value = "accumulation_from") + private String accumulationFrom; private String timestamp; -} \ No newline at end of file +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index d8a475d..5236f07 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -16,6 +16,7 @@ import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.EAIUtil; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -52,10 +53,12 @@ public class CpsQuestionGetService extends AbsEAIService { String option = eaiRequest.getString("option"); + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + // 侦测 if (StringUtils.isBlank(option)) { - List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).list(); + List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).eq(CpsQuestionInfo::getTenantSid,tenantSid).list(); list.forEach(o -> { o.setStatus(1); }); @@ -71,7 +74,7 @@ public class CpsQuestionGetService extends AbsEAIService { } List collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); - LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); + LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getTenantSid,tenantSid).in(CpsQuestionInfo::getId, collectIds); String status = eaiRequest.getString("status"); diff --git a/doc/sql/app-20230630-ddl.sql b/doc/sql/app-20230630-ddl.sql index cde5566..0fa5b25 100644 --- a/doc/sql/app-20230630-ddl.sql +++ b/doc/sql/app-20230630-ddl.sql @@ -19,6 +19,8 @@ CREATE TABLE `cps_question_info` `completion_time` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `control_area` DATETIME NULL DEFAULT NULL, `knowledge_accumulation` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `measures_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `accumulation_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `status` INT(2) NULL DEFAULT '0' COMMENT '状态', `status1` INT(2) NULL DEFAULT '0' COMMENT '状态1', `status2` INT(2) NULL DEFAULT '0' COMMENT '状态2',