孙镇亮 5 سال پیش
والد
کامیت
a2fa06692e

+ 11 - 0
src/main/java/com/ym/mec/collectfee/entity/MecCourse.java

@@ -65,6 +65,17 @@ public class MecCourse {
 	
 	/**  */
 	private Integer buyCount;
+	
+	private Integer status;
+	
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
 
 	public Integer getClassType() {
 		return classType;

+ 25 - 9
src/main/java/com/ym/mec/collectfee/service/impl/ApplyInfoServiceImpl.java

@@ -141,8 +141,10 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 					body = xs.toXML(applyClass);
 					body = body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
 					//推送mec用户缴费
+					System.out.println(body);
 //					log.info("推送到用户数据到mec缴费 body: " + body);
-					getBody(body,125218);
+					String resultBody = getBody(body,125218);
+					System.out.println(resultBody);
 					applyInfoDao.update(applyInfo);
 					return true;
 				}catch (Exception e){
@@ -394,22 +396,36 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 			List<MecCourse> coursesMin = getCourses(body);
 			body = "<body><userId>" + userId + "</userId><classType>2</classType></body>";
 			List<MecCourse> coursesMax = getCourses(body);
+			List<MecCourse> coursesMinRes = new ArrayList<MecCourse>();
+			List<MecCourse> coursesMaxRes = new ArrayList<MecCourse>();
 			if(coursesMin != null && coursesMin.size() > 0){
-				coursesMin.forEach( e -> {
-					e.setClassType(1);
-				} );
+				for(MecCourse course : coursesMin){
+					if(course.getStatus()==10){
+						course.setClassType(1);
+						coursesMinRes.add(course);
+					}
+				}
+//				coursesMin.forEach( e -> {
+//					e.setClassType(1);
+//				} );
 			}else {
 				coursesMin = new ArrayList<>();
 			}
 			if(coursesMax != null && coursesMax.size() > 0){
-				coursesMax.forEach( e -> {
-					e.setClassType(2);
-				} );
+				for(MecCourse course : coursesMax){
+					if(course.getStatus()==10){
+						course.setClassType(2);
+						coursesMaxRes.add(course);
+					}
+				}
+//				coursesMax.forEach( e -> {
+//					e.setClassType(2);
+//				} );
 			}else {
 				coursesMax = new ArrayList<>();
 			}
-			coursesMin.addAll(coursesMax);
-			return coursesMin;
+			coursesMinRes.addAll(coursesMaxRes);
+			return coursesMinRes;
 		}catch (Exception e){
 			e.printStackTrace();
 		}