Browse Source

修正

master
董书康 1 year ago
parent
commit
dd27ca0326
3 changed files with 27 additions and 22 deletions
  1. +6
    -6
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java
  2. +15
    -10
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java
  3. +6
    -6
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java

+ 6
- 6
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java View File

@ -41,11 +41,11 @@ public class CpsQuestionInfo extends BaseMgrEntity<CpsQuestionInfo> {
private String controlArea;
private String knowledgeAccumulation;
private Integer status = 0;
private Integer status1 = 0;
private Integer status2 = 0;
private Integer status3 = 0;
private Integer status4 = 0;
private Integer status5 = 0;
private Integer status6 = 0;
private Integer status1 = 1;
private Integer status2 = 1;
private Integer status3 = 1;
private Integer status4 = 1;
private Integer status5 = 1;
private Integer status6 = 1;
private String timestamp;
}

+ 15
- 10
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java View File

@ -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;
}


+ 6
- 6
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java View File

@ -50,23 +50,23 @@ public class CpsQuestionUpdateService extends AbsEAIService {
switch (option) {
case "1":
o.setStatus1(1);
o.setStatus1(2);
break;
case "2":
o.setStatus2(1);
o.setStatus2(2);
break;
case "3":
o.setStatus3(1);
o.setStatus3(2);
o.setCompletionTime(DateUtils.getDateTimeNow());
break;
case "4":
o.setStatus4(1);
o.setStatus4(2);
break;
case "5":
o.setStatus5(1);
o.setStatus5(2);
break;
case "6":
o.setStatus6(1);
o.setStatus6(2);
break;
}


Loading…
Cancel
Save