...
|
...
|
@@ -19,6 +19,7 @@ import java.util.stream.Collectors; |
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.yoho.service.model.union.bo.*;
|
|
|
import com.yoho.service.model.union.request.*;
|
|
|
import com.yoho.service.model.union.response.*;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
...
|
...
|
@@ -42,23 +43,6 @@ import com.yoho.core.rabbitmq.YhProducer; |
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.service.model.response.UserInfoRspBO;
|
|
|
import com.yoho.service.model.union.bo.IdOrIdsBo;
|
|
|
import com.yoho.service.model.union.bo.ShareOrderBo;
|
|
|
import com.yoho.service.model.union.bo.ShareOrdersProductBo;
|
|
|
import com.yoho.service.model.union.bo.ShareSettlementBo;
|
|
|
import com.yoho.service.model.union.bo.ShareUserSettlementInfoBo;
|
|
|
import com.yoho.service.model.union.bo.SocialMediaBo;
|
|
|
import com.yoho.service.model.union.bo.UninoShareIncomeBo;
|
|
|
import com.yoho.service.model.union.bo.UninoShareIncomeRankBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareBankBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareMessageBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareOrdersActivityBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareOrdersActivityLogsBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareOrdersBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareOrdersUidBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareUserBankBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareUserBo;
|
|
|
import com.yoho.service.model.union.bo.UnionShareVirtualAddBo;
|
|
|
import com.yoho.unions.common.enums.BankEnum;
|
|
|
import com.yoho.unions.common.enums.ShareOrdersKeyEnum;
|
|
|
import com.yoho.unions.common.enums.ShareOrdersStatusEnum;
|
...
|
...
|
@@ -704,7 +688,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
UnionShareUserBo bo = new UnionShareUserBo();
|
|
|
if (uid > 0) {
|
|
|
//获取数据库
|
|
|
UnionShareUser unionShareUser = unionShareUserMapper.selectByUid(uid);
|
|
|
UnionShareUser unionShareUser = getUnionShareUser(uid);
|
|
|
if (null != unionShareUser && unionShareUser.getStatus() == 1) {
|
|
|
BeanUtils.copyProperties(unionShareUser, bo);
|
|
|
} else {
|
...
|
...
|
@@ -725,6 +709,61 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return bo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public UnionShareBannerBo queryUnionShareBannerInfo(int uid) {
|
|
|
String key = "banner";
|
|
|
UnionShareBannerBo cacheResult = getFromRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, UnionShareBannerBo.class, key);
|
|
|
if (cacheResult != null) {
|
|
|
return cacheResult;
|
|
|
}
|
|
|
UnionShareBannerBo result = new UnionShareBannerBo();
|
|
|
if (uid <= 0) {
|
|
|
result.setContent("登录了解有货有赚详情");
|
|
|
return result;
|
|
|
}
|
|
|
UnionShareUser unionShareUser = getUnionShareUser(uid);
|
|
|
if (unionShareUser != null) {
|
|
|
//获取本月数据
|
|
|
result.setContent("本月订单数:100 预估佣金:¥200");
|
|
|
result.setAmount(new BigDecimal("200.01"));
|
|
|
result.setAmountStr("¥200.01");
|
|
|
result.setOrderNum(100);
|
|
|
} else {
|
|
|
//判断申请状态
|
|
|
UnionShareUserApply record = new UnionShareUserApply();
|
|
|
record.setUid(uid);
|
|
|
UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectOneByUid(record);
|
|
|
// 状态:1-申请中,2-通过,3-拒绝,4-拒绝已读
|
|
|
if (unionShareUserApply != null&&unionShareUserApply.getStatus()==1) {
|
|
|
result.setContent("审核中,请稍等");
|
|
|
}else {
|
|
|
result.setContent("分享赚现金,点击开通");
|
|
|
}
|
|
|
}
|
|
|
//设置缓存
|
|
|
addToRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, result, key);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
private UnionShareUser getUnionShareUser(int uid) {
|
|
|
if (uid < 0) {
|
|
|
return null;
|
|
|
}
|
|
|
String key = "info";
|
|
|
UnionShareUser cacheResult = getFromRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, UnionShareUser.class, key);
|
|
|
if (cacheResult != null) {
|
|
|
return cacheResult;
|
|
|
}
|
|
|
//获取数据库
|
|
|
UnionShareUser unionShareUser = unionShareUserMapper.selectByUid(uid);
|
|
|
if (unionShareUser == null) {
|
|
|
return null;
|
|
|
}
|
|
|
//设置缓存
|
|
|
addToRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, unionShareUser, key);
|
|
|
return unionShareUser;
|
|
|
}
|
|
|
/**
|
|
|
* 是否存在申请中的请求
|
|
|
* */
|
...
|
...
|
|