Browse Source

Merge branch 'dev' of http://120.79.166.78:19005/zhongzheng-edu/saas_entrepot into dev

he2802 3 years ago
parent
commit
b0da7ed59f

+ 0 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/http/HttpUtils.java

@@ -503,7 +503,6 @@ public class HttpUtils
         Arrays.stream(header).forEach(head->{
             httpPost.addHeader("Cookie", head.getValue());
         });
-        //Arrays.stream(header).forEach(httpPost::addHeader);
         return post(url, httpPost, encoding, new DataParse<String>() {
             @Override
             public String parseData(HttpEntity httpEntity, String encoding) throws IOException {

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/StudyAccountStatusQueryBo.java

@@ -57,4 +57,8 @@ public class StudyAccountStatusQueryBo extends BaseEntity {
 	@ApiModelProperty("手机号码")
 	private String telphone;
 
+	/** 岗位名称 */
+	@ApiModelProperty("岗位名称")
+	private String workTypeName;
+
 }

+ 10 - 11
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -3,14 +3,11 @@ package com.zhongzheng.modules.grade.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.exception.CustomException;
-import com.zhongzheng.common.exception.user.UserPasswordNotMatchException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -46,15 +43,12 @@ import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserUpdateService;
 import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserVo;
-import io.netty.handler.codec.http.cookie.Cookie;
 import org.apache.http.Header;
-import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
 import org.apache.http.util.EntityUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cloud.client.discovery.event.HeartbeatEvent;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -66,9 +60,7 @@ import com.zhongzheng.modules.grade.service.IClassGradeService;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
-import java.net.HttpCookie;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -589,13 +581,20 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                         if (ObjectUtils.isEmpty(personRoot)) {
                             throw new CustomException(studyAccountStatusQueryBo.getRealname() + "学员信息为空");
                         }
-                        CertInfoListItem certInfoListItem = personRoot.getCertInfoList().get(0);
+                        CertInfoListItem certInfoListItem = new CertInfoListItem();
+                        for (CertInfoListItem certInfo : personRoot.getCertInfoList()) {
+                            if (studyAccountStatusQueryBo.getWorkTypeName().equals(certInfo.getWorkTypeName())) {
+                                BeanUtils.copyProperties(certInfo, certInfoListItem);
+                            }
+                        }
                         //查询继教产品url
                         paramMap.clear();
                         String getProductUrl = "https://zjzyk.etledu.com/Student/GetProducts";
                         paramMap.put("workTypeCode", certInfoListItem.getWorkTypeCode());
                         paramMap.put("period", "0");
-                        paramMap.put("trainYear", bo.getTrainYear());
+                        //获取当前的年份
+                        Calendar cal = Calendar.getInstance();
+                        paramMap.put("trainYear", String.valueOf(cal.get(Calendar.YEAR)));
                         String getProductHttpResponse = "";
                         try {
                             hearders.put("Referer", "https://zjzyk.etledu.com/Student/TrainInfo");