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',