Authored by mingdan.ge

个人中心cps的楼层数据

... ... @@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.yoho.service.model.union.bo.*;
import com.yoho.service.model.union.request.*;
import com.yoho.service.model.union.response.*;
import com.yoho.unions.dal.model.*;
... ... @@ -27,17 +28,6 @@ import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.core.rest.annotation.ServiceDesc;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.union.bo.IdOrIdsBo;
import com.yoho.service.model.union.bo.ShareOrderBo;
import com.yoho.service.model.union.bo.ShareSettlementBo;
import com.yoho.service.model.union.bo.ShareUserSettlementInfoBo;
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.UnionShareOrdersActivityLogsBo;
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.ApiResponse;
import com.yoho.unions.server.service.IUnionShareService;
import com.yoho.unions.server.task.CpsOrderExtraActivityTask;
... ... @@ -104,6 +94,18 @@ public class UnionShareRest {
UnionShareUserBo unionShareUser = unionShareService.queryUnionTypeByUid(uid);
return new UnionResponse(200, "queryUnionTypeByUid success",unionShareUser);
}
/**
* 获取app个人中心有赚用户的banner数据
* */
@RequestMapping("/queryBannerInfoByUid")
@ResponseBody
public UnionResponse queryBannerInfoByUid(@RequestBody int uid){
log.info("UnionShareRest.queryBannerInfoByUid uid is {}", uid);
UnionShareBannerBo unionShareBannerBo = unionShareService.queryUnionShareBannerInfo(uid);
return new UnionResponse(200, "queryUnionTypeByUid success",unionShareBannerBo);
}
/**
* 申请
* @return
... ...
... ... @@ -7,17 +7,7 @@ import java.util.Set;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yoho.service.model.union.bo.IdOrIdsBo;
import com.yoho.service.model.union.bo.ShareOrderBo;
import com.yoho.service.model.union.bo.ShareSettlementBo;
import com.yoho.service.model.union.bo.ShareUserSettlementInfoBo;
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.UnionShareOrdersActivityLogsBo;
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.service.model.union.bo.*;
import com.yoho.service.model.union.request.*;
import com.yoho.service.model.union.response.*;
import com.yoho.unions.dal.model.*;
... ... @@ -66,6 +56,8 @@ public interface IUnionShareService {
*/
UnionShareUserBo queryUnionTypeByUid(int uid);
UnionShareBannerBo queryUnionShareBannerInfo(int uid);
/**
* 申请
* @param req
... ...
... ... @@ -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;
}
/**
* 是否存在申请中的请求
* */
... ...