|
|
@@ -6,6 +6,7 @@ import com.iformall.common.IdWorker; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.domain.po.WxCUserBasicSign; |
|
|
import com.iformall.domain.po.WxCUserBasicSign; |
|
|
import com.iformall.domain.po.WxCreditHistory; |
|
|
import com.iformall.domain.po.WxCreditHistory; |
|
|
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
import com.iformall.enums.EnumScoreType; |
|
|
import com.iformall.enums.EnumScoreType; |
|
|
import com.iformall.enums.EnumUserType; |
|
|
import com.iformall.enums.EnumUserType; |
|
|
import com.iformall.mapper.WxCUserBasicSignMapper; |
|
|
import com.iformall.mapper.WxCUserBasicSignMapper; |
|
|
@@ -49,7 +50,7 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) |
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) |
|
|
@Override |
|
|
@Override |
|
|
public WxCUserBasicSign signIn(WxCUserBasicSign record) { |
|
|
|
|
|
|
|
|
public WxCUserBasicSign signIn(TenantEntity tenantEntity,WxCUserBasicSign record) { |
|
|
if(record.getType() == null){ |
|
|
if(record.getType() == null){ |
|
|
record.setType(WxCUserBasicSign.SIGNIN_TYPE); |
|
|
record.setType(WxCUserBasicSign.SIGNIN_TYPE); |
|
|
} |
|
|
} |
|
|
@@ -113,8 +114,8 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
} |
|
|
} |
|
|
wxCUserBasicSignMapper.insert(record); |
|
|
wxCUserBasicSignMapper.insert(record); |
|
|
} |
|
|
} |
|
|
int inCredit = signInCreditHistory(record, EnumScoreType.SIGN_IN_DAY); |
|
|
|
|
|
int continueIn = continueSignInAddCredit(record); |
|
|
|
|
|
|
|
|
int inCredit = signInCreditHistory(tenantEntity,record, EnumScoreType.SIGN_IN_DAY); |
|
|
|
|
|
int continueIn = continueSignInAddCredit(tenantEntity,record); |
|
|
record.setCredit(inCredit + continueIn); |
|
|
record.setCredit(inCredit + continueIn); |
|
|
return record; |
|
|
return record; |
|
|
}else{ |
|
|
}else{ |
|
|
@@ -218,7 +219,7 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public int signInCreditHistory(WxCUserBasicSign record, EnumScoreType enumScoreType){ |
|
|
|
|
|
|
|
|
public int signInCreditHistory(TenantEntity tenantEntity, WxCUserBasicSign record, EnumScoreType enumScoreType){ |
|
|
WxCreditHistory wxCreditHistory = new WxCreditHistory(); |
|
|
WxCreditHistory wxCreditHistory = new WxCreditHistory(); |
|
|
wxCreditHistory.setCUserId(record.getUserId()); |
|
|
wxCreditHistory.setCUserId(record.getUserId()); |
|
|
wxCreditHistory.setTenantId(record.getFinalTenantId()); |
|
|
wxCreditHistory.setTenantId(record.getFinalTenantId()); |
|
|
@@ -227,7 +228,7 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
wxCreditHistory.setChangePurpose(enumScoreType.getMessage()); |
|
|
wxCreditHistory.setChangePurpose(enumScoreType.getMessage()); |
|
|
wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); |
|
|
wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); |
|
|
wxCreditHistory.setOperatorId(record.getUserId()); |
|
|
wxCreditHistory.setOperatorId(record.getUserId()); |
|
|
WxCreditHistory wxCreditHistory1 = wxCreditHistoryService.saveOrUpdate(wxCreditHistory, null); |
|
|
|
|
|
|
|
|
WxCreditHistory wxCreditHistory1 = wxCreditHistoryService.saveOrUpdate(wxCreditHistory, tenantEntity.getTenantId()); |
|
|
if(wxCreditHistory1.getCreditNum() == null){ |
|
|
if(wxCreditHistory1.getCreditNum() == null){ |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
@@ -250,14 +251,14 @@ public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { |
|
|
return new ResultData(list); |
|
|
return new ResultData(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private int continueSignInAddCredit(WxCUserBasicSign record){ |
|
|
|
|
|
|
|
|
private int continueSignInAddCredit(TenantEntity tenantEntity, WxCUserBasicSign record){ |
|
|
int i = record.getContinueSign() % 28; |
|
|
int i = record.getContinueSign() % 28; |
|
|
if(record.getContinueSign() > 0 && i == 0){ |
|
|
if(record.getContinueSign() > 0 && i == 0){ |
|
|
return signInCreditHistory(record, EnumScoreType.SIGN_IN_TEDAY); |
|
|
|
|
|
|
|
|
return signInCreditHistory(tenantEntity,record, EnumScoreType.SIGN_IN_TEDAY); |
|
|
}else if(i == 7){ |
|
|
}else if(i == 7){ |
|
|
return signInCreditHistory(record,EnumScoreType.SIGN_IN_SEVENDAY); |
|
|
|
|
|
|
|
|
return signInCreditHistory(tenantEntity,record,EnumScoreType.SIGN_IN_SEVENDAY); |
|
|
}else if(i == 14){ |
|
|
}else if(i == 14){ |
|
|
return signInCreditHistory(record,EnumScoreType.SIGN_IN_FTDAY); |
|
|
|
|
|
|
|
|
return signInCreditHistory(tenantEntity,record,EnumScoreType.SIGN_IN_FTDAY); |
|
|
} |
|
|
} |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|