|
|
|
@@ -112,6 +112,7 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
|
wxCUserBasicSignMapper.insert(record); |
|
|
|
} |
|
|
|
signInCreditHistory(record,EnumScoreType.SIGN_IN_DAY); |
|
|
|
continueSignInAddCredit(record); |
|
|
|
return record; |
|
|
|
}else{ |
|
|
|
//补签 |
|
|
|
@@ -148,12 +149,22 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
|
public Map<String,Integer> getLastSignIn(WxCUserBasicSign record) { |
|
|
|
Map<String,Integer> map = new HashMap<>(); |
|
|
|
WxCUserBasicSign lastSignIn = wxCUserBasicSignMapper.getLastSignIn(record); |
|
|
|
if(lastSignIn != null && DateUtils.isSameMonth(lastSignIn.getSigninDate(),new Date())){ |
|
|
|
//本月连续签到天数 |
|
|
|
map.put("continueMonthSign",lastSignIn.getContinueMonthSign()); |
|
|
|
}else{ |
|
|
|
map.put("continueMonthSign",0); |
|
|
|
if(lastSignIn != null){ |
|
|
|
long daysL = DateUtils.startToEnd(lastSignIn.getSigninDate(), new Date()); |
|
|
|
int daysI = new Long(daysL).intValue(); |
|
|
|
if(daysI <= 1){ |
|
|
|
map.put("continueSign",lastSignIn.getContinueSign()%28); |
|
|
|
}else{ |
|
|
|
map.put("continueSign",0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// if(lastSignIn != null && DateUtils.isSameMonth(lastSignIn.getSigninDate(),new Date())){ |
|
|
|
// //本月连续签到天数 |
|
|
|
// map.put("continueMonthSign",lastSignIn.getContinueMonthSign()); |
|
|
|
// }else{ |
|
|
|
// map.put("continueMonthSign",0); |
|
|
|
// } |
|
|
|
WxCreditHistory wxCreditHistory = new WxCreditHistory(); |
|
|
|
wxCreditHistory.setTenantId(record.getFinalTenantId()); |
|
|
|
wxCreditHistory.setCUserId(record.getUserId()); |
|
|
|
@@ -201,4 +212,15 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
|
wxCreditHistoryService.saveOrUpdate(wxCreditHistory,null); |
|
|
|
} |
|
|
|
|
|
|
|
private void continueSignInAddCredit(WxCUserBasicSign record){ |
|
|
|
int i = record.getContinueSign() % 28; |
|
|
|
if(record.getContinueSign() > 0 && i == 0){ |
|
|
|
signInCreditHistory(record,EnumScoreType.SIGN_IN_TEDAY); |
|
|
|
}else if(i == 7){ |
|
|
|
signInCreditHistory(record,EnumScoreType.SIGN_IN_SEVENDAY); |
|
|
|
}else if(i == 14){ |
|
|
|
signInCreditHistory(record,EnumScoreType.SIGN_IN_FTDAY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |