|
|
@ -7,18 +7,22 @@ |
|
|
|
*/ |
|
|
|
package com.digiwin.athena.app.service.cps; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
|
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
|
import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; |
|
|
|
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.persistence.domain.BaseMgrEntity; |
|
|
|
import org.apache.commons.collections.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
@ -60,32 +64,33 @@ public class CpsQuestionGetService extends AbsEAIService { |
|
|
|
} |
|
|
|
|
|
|
|
// 任务卡查询 |
|
|
|
List<CpsQuestionInfo> questionInfo = eaiRequest.getObject("question_info", new TypeReference<List<CpsQuestionInfo>>() { |
|
|
|
}); |
|
|
|
List<Map<String, Object>> questionInfo = eaiRequest.getObject("question_info", EAIUtil.TYPE_LIST_MAP_V_OBJ); |
|
|
|
|
|
|
|
List<Long> collectIds = questionInfo.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); |
|
|
|
if (questionInfo.isEmpty()) { |
|
|
|
return buildOK("question_info", new ArrayList<>()); |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); |
|
|
|
LambdaQueryChainWrapper<CpsQuestionInfo> lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); |
|
|
|
|
|
|
|
String status = eaiRequest.getString("status"); |
|
|
|
switch (option) { |
|
|
|
case "1": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus1, MapUtils.getInteger(questionInfo.get(0), "status1")); |
|
|
|
break; |
|
|
|
case "2": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus2, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus2, MapUtils.getInteger(questionInfo.get(0), "status2")); |
|
|
|
break; |
|
|
|
case "3": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus3, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus3, MapUtils.getInteger(questionInfo.get(0), "status3")); |
|
|
|
break; |
|
|
|
case "4": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus4, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus4, MapUtils.getInteger(questionInfo.get(0), "status4")); |
|
|
|
break; |
|
|
|
case "5": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus5, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus5, MapUtils.getInteger(questionInfo.get(0), "status5")); |
|
|
|
break; |
|
|
|
case "6": |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus6, status); |
|
|
|
lambdaQuery.eq(CpsQuestionInfo::getStatus6, MapUtils.getInteger(questionInfo.get(0), "status6")); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|