|
@@ -5,12 +5,14 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
+import com.ims.eval.config.ImaConfig;
|
|
|
import com.ims.eval.dao.DeptAssessmentDeclarationMapper;
|
|
|
import com.ims.eval.entity.DeptAssessmentDeclaration;
|
|
|
import com.ims.eval.entity.DeptAssessmentDeclarationContent;
|
|
@@ -18,8 +20,15 @@ import com.ims.eval.entity.EvaluationDept;
|
|
|
import com.ims.eval.entity.EvaluationDeptRating;
|
|
|
import com.ims.eval.entity.dto.request.UserDTO;
|
|
|
import com.ims.eval.service.*;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpMethod;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.LinkedMultiValueMap;
|
|
|
+import org.springframework.util.MultiValueMap;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.ArrayList;
|
|
@@ -31,6 +40,7 @@ import java.util.List;
|
|
|
* 文件说明:
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssessmentDeclarationMapper, DeptAssessmentDeclaration> implements IDeptAssessmentDeclarationService {
|
|
|
|
|
|
@Autowired
|
|
@@ -48,6 +58,12 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
|
|
|
@Autowired
|
|
|
private IEvaluationDeptRatingService evaluationDeptRatingService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RestTemplate restTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ImaConfig imaConfig;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<DeptAssessmentDeclaration> listPage(Integer pageNum, Integer pageSize, String deptId, String orderNumber, String deptName, Integer annual, Integer declarationMonth) {
|
|
|
if ("23031009".equals(deptId)) {//组织人事部
|
|
@@ -189,6 +205,21 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public JSONObject processInformation(String instId, HttpServletRequest request) {
|
|
|
+ MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
|
|
|
+ headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
|
|
|
+ HttpEntity<LinkedMultiValueMap<String, Object>> param = new HttpEntity<>(null, headers);
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "bpm/instance/getOpinion?instId={1}",
|
|
|
+ HttpMethod.GET, param, String.class, instId);
|
|
|
+
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
+ return JSON.parseObject(responseEntity2.getBody());
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
private static void insertContent(DeptAssessmentDeclaration deptAssessmentDeclaration, EvaluationDeptRating evaluationDeptRating) {
|
|
|
if (1 == deptAssessmentDeclaration.getDeclarationMonth()) {
|
|
|
evaluationDeptRating.setJan(deptAssessmentDeclaration.getRatingGrade());
|