| @@ -153,50 +153,59 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { | |||||
| if(lastSignIn != null){ | if(lastSignIn != null){ | ||||
| long daysL = DateUtils.startToEnd(lastSignIn.getSigninDate(), new Date()); | long daysL = DateUtils.startToEnd(lastSignIn.getSigninDate(), new Date()); | ||||
| int daysI = new Long(daysL).intValue(); | int daysI = new Long(daysL).intValue(); | ||||
| if(daysI <= 1){ | |||||
| if(daysI == 0){ | |||||
| map.put("continueSign",lastSignIn.getContinueSign()%28); | map.put("continueSign",lastSignIn.getContinueSign()%28); | ||||
| map.put("signInDay",1);//今日已签到 | |||||
| }else if(daysI == 1){ | |||||
| map.put("continueSign",lastSignIn.getContinueSign()%28); | |||||
| map.put("signInDay",0); | |||||
| }else{ | }else{ | ||||
| map.put("continueSign",0); | map.put("continueSign",0); | ||||
| map.put("signInDay",0); | |||||
| } | } | ||||
| }else{ | |||||
| map.put("continueSign",0); | |||||
| map.put("signInDay",0); | |||||
| } | } | ||||
| // if(lastSignIn != null && DateUtils.isSameMonth(lastSignIn.getSigninDate(),new Date())){ | // if(lastSignIn != null && DateUtils.isSameMonth(lastSignIn.getSigninDate(),new Date())){ | ||||
| // //本月连续签到天数 | // //本月连续签到天数 | ||||
| // map.put("continueMonthSign",lastSignIn.getContinueMonthSign()); | // map.put("continueMonthSign",lastSignIn.getContinueMonthSign()); | ||||
| // }else{ | // }else{ | ||||
| // map.put("continueMonthSign",0); | // map.put("continueMonthSign",0); | ||||
| // } | // } | ||||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||||
| wxCreditHistory.setTenantId(record.getFinalTenantId()); | |||||
| wxCreditHistory.setCUserId(record.getUserId()); | |||||
| wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_DAY.getCode()); | |||||
| //每日签到 | |||||
| if(wxCreditHistoryMapper.loginCount(wxCreditHistory) > 0){ | |||||
| map.put("signInDay",1); | |||||
| }else{ | |||||
| map.put("signInDay",0); | |||||
| } | |||||
| //7日连续 | |||||
| wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_SEVENDAY.getCode()); | |||||
| if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| map.put("signInSevenDay",1); | |||||
| }else{ | |||||
| map.put("signInSevenDay",0); | |||||
| } | |||||
| //14日连续 | |||||
| wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_FTDAY.getCode()); | |||||
| if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| map.put("signInFTDay",1); | |||||
| }else{ | |||||
| map.put("signInFTDay",0); | |||||
| } | |||||
| //28日连续 | |||||
| wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_TEDAY.getCode()); | |||||
| if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| map.put("signInTEDay",1); | |||||
| }else{ | |||||
| map.put("signInTEDay",0); | |||||
| } | |||||
| // WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||||
| // wxCreditHistory.setTenantId(record.getFinalTenantId()); | |||||
| // wxCreditHistory.setCUserId(record.getUserId()); | |||||
| // wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_DAY.getCode()); | |||||
| // //每日签到 | |||||
| // if(wxCreditHistoryMapper.loginCount(wxCreditHistory) > 0){ | |||||
| // map.put("signInDay",1); | |||||
| // }else{ | |||||
| // map.put("signInDay",0); | |||||
| // } | |||||
| // //7日连续 | |||||
| // wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_SEVENDAY.getCode()); | |||||
| // if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| // map.put("signInSevenDay",1); | |||||
| // }else{ | |||||
| // map.put("signInSevenDay",0); | |||||
| // } | |||||
| // //14日连续 | |||||
| // wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_FTDAY.getCode()); | |||||
| // if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| // map.put("signInFTDay",1); | |||||
| // }else{ | |||||
| // map.put("signInFTDay",0); | |||||
| // } | |||||
| // //28日连续 | |||||
| // wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_TEDAY.getCode()); | |||||
| // if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ | |||||
| // map.put("signInTEDay",1); | |||||
| // }else{ | |||||
| // map.put("signInTEDay",0); | |||||
| // } | |||||
| return map; | return map; | ||||
| } | } | ||||