|
|
@@ -194,15 +194,22 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { |
|
|
return wxCreditHistoryMapper.selectByPrimaryKey(id); |
|
|
return wxCreditHistoryMapper.selectByPrimaryKey(id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void check(Long cUserId) { |
|
|
|
|
|
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectByPrimaryKey(cUserId); |
|
|
|
|
|
if (wxCUserBasicInfo == null) { |
|
|
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
public WxCreditHistory saveOrUpdate(WxCreditHistory record) { |
|
|
public WxCreditHistory saveOrUpdate(WxCreditHistory record) { |
|
|
WxCUser wxCUser = wxCUserMapper.selectByPrimaryKey(record.getCUserId()); |
|
|
WxCUser wxCUser = wxCUserMapper.selectByPrimaryKey(record.getCUserId()); |
|
|
if (wxCUser == null) { |
|
|
|
|
|
|
|
|
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectByPrimaryKey(record.getCUserId()); |
|
|
|
|
|
if (wxCUser == null && wxCUserBasicInfo == null) { |
|
|
//验证此用户是否存在 |
|
|
//验证此用户是否存在 |
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
} |
|
|
} |
|
|
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectByPrimaryKey(record.getCUserId()); |
|
|
|
|
|
if (StringUtils.isNotEmpty(record.getSpendStr())) { |
|
|
if (StringUtils.isNotEmpty(record.getSpendStr())) { |
|
|
record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue()); |
|
|
record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue()); |
|
|
} |
|
|
} |
|
|
|