|
@@ -25,7 +25,6 @@ import com.ims.eval.service.custom.PostUserService;
|
|
import com.ims.eval.util.ExcelUtil;
|
|
import com.ims.eval.util.ExcelUtil;
|
|
import com.ims.eval.util.ExcelUtils;
|
|
import com.ims.eval.util.ExcelUtils;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.*;
|
|
import org.springframework.http.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -416,24 +415,25 @@ public class DeptAssessmentDeclarationController {
|
|
@RequestParam(value = "stage") String stage) throws IOException {
|
|
@RequestParam(value = "stage") String stage) throws IOException {
|
|
try {
|
|
try {
|
|
DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
|
|
DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
|
- headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
|
|
|
- headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
|
|
- headers.add("code", request.getHeader("code"));
|
|
|
|
-
|
|
|
|
- HttpEntity<Map> param = new HttpEntity<>(null, headers);
|
|
|
|
- ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/instance/getOpinion?instId={1}", HttpMethod.POST, param, String.class, deptAssessmentDeclaration.getInstId());
|
|
|
|
- log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
|
- if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
|
- JSONObject jsonObject = JSON.parseObject(responseEntity2.getBody());
|
|
|
|
- if ("200".equals(jsonObject.getString("code"))) {
|
|
|
|
- String data = jsonObject.getString("data");
|
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
- Object[] jsonArray = objectMapper.readValue(data, Object[].class);
|
|
|
|
- if (jsonArray.length > 1){
|
|
|
|
- String lastItemJson = objectMapper.writeValueAsString(jsonArray[jsonArray.length - 1]);
|
|
|
|
- //processState = JSON.parseObject(lastItemJson).getString("taskName");
|
|
|
|
- stage = JSON.parseObject(lastItemJson).getString("taskName");
|
|
|
|
|
|
+ if (!"驳回".equals(stage)){
|
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
|
+ headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
|
|
|
+ headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
|
|
+ headers.add("code", request.getHeader("code"));
|
|
|
|
+
|
|
|
|
+ HttpEntity<Map> param = new HttpEntity<>(null, headers);
|
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/instance/getOpinion?instId={1}", HttpMethod.POST, param, String.class, deptAssessmentDeclaration.getInstId());
|
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(responseEntity2.getBody());
|
|
|
|
+ if ("200".equals(jsonObject.getString("code"))) {
|
|
|
|
+ String data = jsonObject.getString("data");
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ Object[] jsonArray = objectMapper.readValue(data, Object[].class);
|
|
|
|
+ if (jsonArray.length > 1){
|
|
|
|
+ String lastItemJson = objectMapper.writeValueAsString(jsonArray[jsonArray.length - 1]);
|
|
|
|
+ stage = JSON.parseObject(lastItemJson).getString("taskName");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|