|
@@ -100,11 +100,15 @@ public class CollegeUserPointsService {
|
|
|
WXUser wxUser = wxUserService.getWXUser(openid);
|
|
|
tableData.put("stage", null);
|
|
|
tableData.put("stage_date", null);
|
|
|
- if (wxUser != null && wxUser.getXu_phone() != null) {
|
|
|
+ if (wxUser != null ) {
|
|
|
if(!wxUser.isCollege_enable()) {
|
|
|
tableData.put("errStatus", "9"); //没有开通超人学院
|
|
|
return tableData;
|
|
|
}
|
|
|
+ if ( wxUser.getXu_phone() == null) {
|
|
|
+ tableData.put("errStatus", "6"); //没有授权手机号
|
|
|
+ return tableData;
|
|
|
+ }
|
|
|
if (wxUser.getXu_content_type() != null && wxUser.getXu_content_date() != null) {
|
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -119,38 +123,52 @@ public class CollegeUserPointsService {
|
|
|
collegeCurriculumExperienceQuery.setOpenid(openid);
|
|
|
CollegePointsDetail collegePointsDetail = new CollegePointsDetail();
|
|
|
if (wxUser.getXu_content_type().equals("B01")) { //育儿
|
|
|
- if (dateNow.getTime() < getDate.getTime()) {
|
|
|
- //还没出生
|
|
|
- return tableData;
|
|
|
- } else {
|
|
|
- if (DateUtil.getMonthDiff(dateNow, getDate) + 1 > AGE) {
|
|
|
- return tableData;
|
|
|
- } else {
|
|
|
- tableData.put("stage_step", DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
- collegeCurriculumCoreQuery.setC_type("B01");
|
|
|
- collegeCurriculumCoreQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
- collegeCurriculumPracticeQuery.setC_type("B01");
|
|
|
- collegeCurriculumPracticeQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
- collegeCurriculumExperienceQuery.setC_type("B01");
|
|
|
- collegeCurriculumExperienceQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
- }
|
|
|
- }
|
|
|
+// if (dateNow.getTime() < getDate.getTime()) {
|
|
|
+// //还没出生
|
|
|
+// return tableData;
|
|
|
+// } else {
|
|
|
+// if (DateUtil.getMonthDiff(dateNow, getDate) + 1 > AGE) {
|
|
|
+// return tableData;
|
|
|
+// } else {
|
|
|
+// tableData.put("stage_step", DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+// collegeCurriculumCoreQuery.setC_type("B01");
|
|
|
+// collegeCurriculumCoreQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+// collegeCurriculumPracticeQuery.setC_type("B01");
|
|
|
+// collegeCurriculumPracticeQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+// collegeCurriculumExperienceQuery.setC_type("B01");
|
|
|
+// collegeCurriculumExperienceQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ tableData.put("stage_step", DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+ collegeCurriculumCoreQuery.setC_type("B01");
|
|
|
+ collegeCurriculumCoreQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+ collegeCurriculumPracticeQuery.setC_type("B01");
|
|
|
+ collegeCurriculumPracticeQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
+ collegeCurriculumExperienceQuery.setC_type("B01");
|
|
|
+ collegeCurriculumExperienceQuery.setC_step(DateUtil.getMonthDiff(dateNow, getDate) + 1);
|
|
|
} else if (wxUser.getXu_content_type().equals("P01")) { //孕周
|
|
|
- if (dateNow.getTime() < getDate.getTime()) {
|
|
|
- if (LMP - DateUtil.getWeekDiff(dateNow, getDate) < 0) {
|
|
|
- return tableData; //还没怀孕
|
|
|
- } else {
|
|
|
- tableData.put("stage_step", LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
- collegeCurriculumCoreQuery.setC_type("P01");
|
|
|
- collegeCurriculumCoreQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
- collegeCurriculumPracticeQuery.setC_type("P01");
|
|
|
- collegeCurriculumPracticeQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
- collegeCurriculumExperienceQuery.setC_type("P01");
|
|
|
- collegeCurriculumExperienceQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
- }
|
|
|
- } else {
|
|
|
- return tableData;
|
|
|
- }
|
|
|
+// if (dateNow.getTime() < getDate.getTime()) {
|
|
|
+// if (LMP - DateUtil.getWeekDiff(dateNow, getDate) < 0) {
|
|
|
+// return tableData; //还没怀孕
|
|
|
+// } else {
|
|
|
+// tableData.put("stage_step", LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+// collegeCurriculumCoreQuery.setC_type("P01");
|
|
|
+// collegeCurriculumCoreQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+// collegeCurriculumPracticeQuery.setC_type("P01");
|
|
|
+// collegeCurriculumPracticeQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+// collegeCurriculumExperienceQuery.setC_type("P01");
|
|
|
+// collegeCurriculumExperienceQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// return tableData;
|
|
|
+// }
|
|
|
+ tableData.put("stage_step", LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+ collegeCurriculumCoreQuery.setC_type("P01");
|
|
|
+ collegeCurriculumCoreQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+ collegeCurriculumPracticeQuery.setC_type("P01");
|
|
|
+ collegeCurriculumPracticeQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
+ collegeCurriculumExperienceQuery.setC_type("P01");
|
|
|
+ collegeCurriculumExperienceQuery.setC_step(LMP - DateUtil.getWeekDiff(dateNow, getDate));
|
|
|
} else {
|
|
|
return tableData;
|
|
|
}
|
|
@@ -182,7 +200,7 @@ public class CollegeUserPointsService {
|
|
|
tableData.put("surprise_type", collegePresentCredit.getType());
|
|
|
tableData.put("surprise_name", collegePresentCredit.getPresent_name());
|
|
|
//自动发放礼品
|
|
|
- if (collegePresentCredit.getType() == 1) {
|
|
|
+ if (collegePresentCredit.getType() == 2) {
|
|
|
// 实物生成一条预约信息并发送通知
|
|
|
CustomerBooking customerBooking = new CustomerBooking();
|
|
|
customerBooking.setBk_branches_id(Integer.valueOf(city));
|
|
@@ -214,6 +232,9 @@ public class CollegeUserPointsService {
|
|
|
tableData.put("present_received", collegePresentCredits);
|
|
|
//常规课
|
|
|
List<CollegeCurriculumCore> collegeCurriculumCores = collegeCurriculumCoreService.queryCoreByStep(collegeCurriculumCoreQuery);
|
|
|
+ if(collegeCurriculumCores.size() == 0){
|
|
|
+ collegeCurriculumCores.add(collegeCurriculumCoreService.queryCoreByLast(collegeCurriculumCoreQuery));
|
|
|
+ }
|
|
|
for (CollegeCurriculumCore collegeCurriculumCore : collegeCurriculumCores) {
|
|
|
if (collegeCurriculumCore.getStatus() != null && collegeCurriculumCore.getStatus().equals("9")) { //1-已预约,2-学习中,3-已过期, 9-已完成
|
|
|
collegeCurriculumCore.setStatus("已完成");
|
|
@@ -356,7 +377,7 @@ public class CollegeUserPointsService {
|
|
|
return tableData;
|
|
|
}
|
|
|
} else {
|
|
|
- tableData.put("errStatus", "6"); //没有授权手机号
|
|
|
+ tableData.put("errStatus", "系统异常"); //没有授权手机号
|
|
|
return tableData;
|
|
|
}
|
|
|
}
|