|
@@ -170,6 +170,8 @@ public class CollegeUserPointsService {
|
|
tableData.put("credit", collegeUserPoints.getCredit_total());
|
|
tableData.put("credit", collegeUserPoints.getCredit_total());
|
|
point_available = collegeUserPoints.getCredit_total();
|
|
point_available = collegeUserPoints.getCredit_total();
|
|
}
|
|
}
|
|
|
|
+ //查询奖学金
|
|
|
|
+ tableData.put("scholarships", collegeUserPoints.getScholarships_available());
|
|
//礼品领取情况
|
|
//礼品领取情况
|
|
List<CollegePresentCredit> collegePresentCredits = collegePresentCreditService.queryUserReceived(openid);
|
|
List<CollegePresentCredit> collegePresentCredits = collegePresentCreditService.queryUserReceived(openid);
|
|
for (CollegePresentCredit collegePresentCredit : collegePresentCredits) {
|
|
for (CollegePresentCredit collegePresentCredit : collegePresentCredits) {
|
|
@@ -429,7 +431,21 @@ public class CollegeUserPointsService {
|
|
List<Object> presentInfoTemp = new LinkedList<>();
|
|
List<Object> presentInfoTemp = new LinkedList<>();
|
|
WXUser wxUser = wxUserService.getWXUser(openid);
|
|
WXUser wxUser = wxUserService.getWXUser(openid);
|
|
CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
|
|
CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
|
|
- CollegeUserLevel collegeUserLevel = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
|
|
|
|
|
|
+ CollegeUserLevel collegeUserLevel = new CollegeUserLevel();
|
|
|
|
+ if(collegeUserPoints == null) {
|
|
|
|
+ //新增用户
|
|
|
|
+ CollegeUserPoints collegeUserPointsNew = new CollegeUserPoints();
|
|
|
|
+ collegeUserPointsNew.setOpenid(openid);
|
|
|
|
+ collegeUserPointsNew.setCredit_available(0);
|
|
|
|
+ collegeUserPointsNew.setCredit_total(0);
|
|
|
|
+ collegeUserPointsNew.setScholarships_available(0);
|
|
|
|
+ collegeUserPointsNew.setScholarships_total(0);
|
|
|
|
+ collegeUserPointsDao.insertSelective(collegeUserPointsNew);
|
|
|
|
+ collegeUserLevel = collegeUserLevelService.getUserLevel(0);
|
|
|
|
+ collegeUserPoints = collegeUserPointsNew;
|
|
|
|
+ } else {
|
|
|
|
+ collegeUserLevel = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
|
|
|
|
+ }
|
|
int level = 0;
|
|
int level = 0;
|
|
if (collegeUserLevel != null) {
|
|
if (collegeUserLevel != null) {
|
|
level = collegeUserLevel.getLevel();
|
|
level = collegeUserLevel.getLevel();
|
|
@@ -442,15 +458,16 @@ public class CollegeUserPointsService {
|
|
for (CollegePresentScholarships collegePresentScholarship : collegePresentScholarships) {
|
|
for (CollegePresentScholarships collegePresentScholarship : collegePresentScholarships) {
|
|
LinkedHashMap<String, Object> presents = new LinkedHashMap<>();
|
|
LinkedHashMap<String, Object> presents = new LinkedHashMap<>();
|
|
//通过等级判断是否适合商品
|
|
//通过等级判断是否适合商品
|
|
|
|
+ presents.put("id",collegePresentScholarship.getId());
|
|
presents.put("name", collegePresentScholarship.getName());
|
|
presents.put("name", collegePresentScholarship.getName());
|
|
presents.put("level", collegePresentScholarship.getLevel());
|
|
presents.put("level", collegePresentScholarship.getLevel());
|
|
presents.put("scholarships", collegePresentScholarship.getScholarships());
|
|
presents.put("scholarships", collegePresentScholarship.getScholarships());
|
|
presents.put("list_img_href", collegePresentScholarship.getList_img_href());
|
|
presents.put("list_img_href", collegePresentScholarship.getList_img_href());
|
|
presents.put("count", collegePresentScholarship.getCount());
|
|
presents.put("count", collegePresentScholarship.getCount());
|
|
if (collegePresentScholarship.getLevel() > level) {
|
|
if (collegePresentScholarship.getLevel() > level) {
|
|
- presents.put("redeem ", false);
|
|
|
|
|
|
+ presents.put("redeem", false);
|
|
} else {
|
|
} else {
|
|
- presents.put("redeem ", true);
|
|
|
|
|
|
+ presents.put("redeem", true);
|
|
}
|
|
}
|
|
presentInfoTemp.add(presents);
|
|
presentInfoTemp.add(presents);
|
|
}
|
|
}
|
|
@@ -471,15 +488,28 @@ public class CollegeUserPointsService {
|
|
LinkedHashMap<String, Object> returnInfo = new LinkedHashMap<>();
|
|
LinkedHashMap<String, Object> returnInfo = new LinkedHashMap<>();
|
|
CollegePresentScholarships collegePresentScholarships = collegePresentScholarshipsService.getCollegePresentScholarship(presentId);
|
|
CollegePresentScholarships collegePresentScholarships = collegePresentScholarshipsService.getCollegePresentScholarship(presentId);
|
|
CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
|
|
CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
|
|
|
|
+ CollegeUserLevel collegeUserLevelTemp = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
|
|
|
|
+ int level = 0;
|
|
|
|
+ if (collegeUserLevelTemp != null) {
|
|
|
|
+ level = collegeUserLevelTemp.getLevel();
|
|
|
|
+ }
|
|
if(collegeUserPoints == null || collegePresentScholarships == null) {
|
|
if(collegeUserPoints == null || collegePresentScholarships == null) {
|
|
returnInfo.put("error", "未找到信息");
|
|
returnInfo.put("error", "未找到信息");
|
|
} else {
|
|
} else {
|
|
|
|
+ CollegeUserLevel collegeUserLevel = collegeUserLevelService.getUserLevelDesc(collegePresentScholarships.getLevel());
|
|
returnInfo.put("level",collegePresentScholarships.getLevel());
|
|
returnInfo.put("level",collegePresentScholarships.getLevel());
|
|
|
|
+ returnInfo.put("levelDesc",collegeUserLevel.getDesc());
|
|
|
|
+ returnInfo.put("presentDesc",collegePresentScholarships.getDesc());
|
|
returnInfo.put("presentType",collegePresentScholarships.getType());
|
|
returnInfo.put("presentType",collegePresentScholarships.getType());
|
|
returnInfo.put("presentName",collegePresentScholarships.getName());
|
|
returnInfo.put("presentName",collegePresentScholarships.getName());
|
|
returnInfo.put("presentRedeemImg",collegePresentScholarships.getRedeem_img_href());
|
|
returnInfo.put("presentRedeemImg",collegePresentScholarships.getRedeem_img_href());
|
|
returnInfo.put("presentScholarships",collegePresentScholarships.getScholarships());
|
|
returnInfo.put("presentScholarships",collegePresentScholarships.getScholarships());
|
|
returnInfo.put("userScholarships",collegeUserPoints.getScholarships_available());
|
|
returnInfo.put("userScholarships",collegeUserPoints.getScholarships_available());
|
|
|
|
+ if (collegePresentScholarships.getLevel() > level) {
|
|
|
|
+ returnInfo.put("redeem", false);
|
|
|
|
+ } else {
|
|
|
|
+ returnInfo.put("redeem", true);
|
|
|
|
+ }
|
|
if(collegePresentScholarships.getType() == 2) {
|
|
if(collegePresentScholarships.getType() == 2) {
|
|
List<WXMktInfo> wxMktInfo = wxMktInfoService.getMktInfos(null);
|
|
List<WXMktInfo> wxMktInfo = wxMktInfoService.getMktInfos(null);
|
|
returnInfo.put("mktInfo",wxMktInfo);
|
|
returnInfo.put("mktInfo",wxMktInfo);
|