| | |
| | | List<GoodsDetailVO> goodsDetailVOList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | int p = 0; |
| | | for (GoodsDetailVO vo : goodsDetailVOList) { |
| | | vo.setCreatetime(null); |
| | | if (type == CommonContentTypeEnum.mianDan)// 免单商品 |
| | | { |
| | | vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getCouponPrice(goodsList.get(p))); |
| | |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | |
| | | List<ImgInfo> listInfoNew = new ArrayList<ImgInfo>(); |
| | | |
| | | for (ImgInfo imgInfo : goodsEvaluate.getImgList()) { |
| | | |
| | | if (acceptData.getSystem() == SystemEnum.yhqjx) { |
| | | imgInfo.setGoods(null); |
| | | imgInfo.setGoodsVO(null); |
| | | } |
| | | |
| | | if (imgInfo.getType() != ImgEnum.activity) { |
| | | listInfoNew.add(imgInfo); |
| | | |
| | | |
| | | continue; |
| | | } |
| | | ImgInfo infoNew = new ImgInfo(); |
| | |
| | | |
| | | TaoBaoGoodsBrief tb = goods; |
| | | |
| | | //创建时间设置为空,防止前端用long解析 |
| | | tb.setCreatetime(null); |
| | | |
| | | |
| | | if (tb == null) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在")); |
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.LostOrder; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.order.LostOrderService; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.Utils; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.IPUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.NumberUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 动态 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/v2/lostOrder") |
| | | public class LostOrderControllerV2 { |
| | | |
| | | @Resource |
| | | private LostOrderService lostOrderService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | |
| | | @RequestMapping("findLostOrder") |
| | | public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, HttpServletRequest request, PrintWriter out) { |
| | | Integer type = lostOrder.getType(); |
| | | if (type == null) { |
| | | type = Constant.SOURCE_TYPE_TAOBAO; |
| | | } |
| | | |
| | | boolean orderNum = true; |
| | | String orderId = lostOrder.getOrderId(); |
| | | if (type == Constant.SOURCE_TYPE_TAOBAO) { |
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 12 || orderId.length() > 20)) { |
| | | orderNum = false; |
| | | } else { |
| | | orderNum = Utils.isOrderNum(orderId); |
| | | } |
| | | } else if (type == Constant.SOURCE_TYPE_JD) { |
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 6 || orderId.length() > 20)) { |
| | | orderNum = false; |
| | | } |
| | | } else if (type == Constant.SOURCE_TYPE_PDD) { |
| | | if (!orderId.contains("-")) { |
| | | orderNum = false; |
| | | } else { |
| | | String[] split = orderId.split("-"); |
| | | if (split == null || split.length != 2) { |
| | | orderNum = false; |
| | | } else { |
| | | if (!NumberUtil.isNumeric(split[0]) || !NumberUtil.isNumeric(split[1])) { |
| | | orderNum = false; |
| | | } |
| | | } |
| | | } |
| | | } else if (type == Constant.SOURCE_TYPE_VIP) { |
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 10 || orderId.length() > 18)) { |
| | | orderNum = false; |
| | | } |
| | | } else if (type == Constant.SOURCE_TYPE_SUNING) { |
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 10 || orderId.length() > 15)) { |
| | | orderNum = false; |
| | | } |
| | | } |
| | | |
| | | if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null |
| | | || lostOrder.getUserInfo().getId() <= 0) { |
| | | out.print(JsonUtil.loadFalseResult(1, |
| | | String.format("请登录%s账号", Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())))); |
| | | return; |
| | | } |
| | | lostOrder.setIpInfo(IPUtil.getRemotIP(request) + ":" + request.getRemotePort()); |
| | | int state; |
| | | String stateInfo = "提交成功,请等待审核结果"; |
| | | if (!orderNum) { |
| | | state = -4; |
| | | stateInfo = "请提交准确的订单号"; |
| | | } else { |
| | | lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING); |
| | | state = lostOrderService.addLostOrder(lostOrder); |
| | | if (state == -3) { |
| | | stateInfo = "该订单已被统计,无需申诉"; |
| | | } else if (state == -2) { |
| | | stateInfo = "请勿重复提交,该订单正在审核中"; |
| | | } else if (state == -1) { |
| | | stateInfo = "该订单申诉已通过,请在订单列表中查看"; |
| | | } else if (state == -5) { |
| | | stateInfo = "分享奖金订单无需申诉"; |
| | | } else if (state == -6) { |
| | | stateInfo = "该订单申诉已失败,请在订单列表中查看"; |
| | | } else if (state == -7) { |
| | | stateInfo = "今日申诉次数已达上限"; |
| | | } else if (state == -1001) { |
| | | stateInfo = "订单违规"; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("state", state); |
| | | data.put("info", stateInfo); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | } |
| | |
| | | dataObject.put("totalMoney", "¥" + goodsGroup.getTotalMoney()); |
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO); |
| | | detailVO.setCreatetime(null); |
| | | detailVO.setId(commonGoods.getId()); |
| | | dataObject.put("goods", gson.toJson(detailVO)); |
| | | array.add(dataObject); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param filter |
| | |
| | | |
| | | long count = 0L; |
| | | List<CommonOrderVO> list = null; |
| | | if (acceptData.getSystem() == SystemEnum.yhqjx) { |
| | | list = commonOrderService.getOrderList(acceptData, page, uid, state, orderType, orderState, orderNo, |
| | | startTime, endTime, dateType, listSource); |
| | | count = commonOrderService.countOrderList(uid, state, orderType, orderState, orderNo, startTime, |
| | | endTime, dateType, listSource); |
| | | } else { |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | list = commonOrderService.getOrderList(acceptData, page, uid, state, orderType, orderState, orderNo, |
| | | startTime, endTime, dateType, listSource); |
| | |
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, startTime, |
| | | endTime, dateType, listSource); |
| | | } |
| | | } |
| | | |
| | | // 判断是否需要显示订单找回提示 8秒内请求3次触发 |
| | | String orderFindUrl = null; |
| | |
| | | * 系统枚举 |
| | | */ |
| | | public enum SystemEnum { |
| | | blks("com.yeshi.ec.rebate", "com.xyj.ec.fanli-ios", new String[]{}, new SystemFunction[]{ |
| | | blks("com.yeshi.ec.rebate", "com.xyj.ec.fanli-ios", new String[]{}, new SystemFunction[]{SystemFunction.share, |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.vip,SystemFunction.inviteCode |
| | | }, 1, "板栗快省","板栗快省"), |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"), |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.lijinSub,SystemFunction.bindPhone}, 12, "优惠券精选","特价App"); |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.share,SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"), |
| | | yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.fanli,SystemFunction.lijinSub,SystemFunction.bindPhone}, 12, "特价","特价App"); |
| | | private String packageName; |
| | | private String bundleId; |
| | | private int systemId; |
| | |
| | | faQuan("发圈"), |
| | | vip("超级会员"), |
| | | fanli("是否需要返利"), |
| | | lijinSub("礼金立减"); |
| | | lijinSub("礼金立减"), |
| | | share("是否需要分享"); |
| | | |
| | | private SystemFunction(String desc) { |
| | | |
| | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.index.Indexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | import org.springframework.data.mongodb.core.mapping.Field; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | @Id |
| | | private String id; |
| | | @Indexed |
| | | @Field |
| | | private Long uid; |
| | | @Field |
| | | private MsgTypeEnum msgType; |
| | | @Field |
| | | private Long identityCode;//主键 |
| | | @Indexed |
| | | @Field |
| | | private Date createTime; |
| | | @Field |
| | | @Indexed |
| | | private Date updateTime; |
| | | |
| | |
| | | |
| | | private List<GoodsDetailVOWithKey> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, List<String> goodsKeyList, GoodsMoneyConfigParamsDTO paramsDTO) { |
| | | Map<String, MoneyInfo> lijinMap = null; |
| | | boolean hasCreateTime = false; |
| | | if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) { |
| | | loadMaterialLibsType(goodsBriefList); |
| | | lijinMap = getTBLijinList(uid, goodsBriefList); |
| | | hasCreateTime = true; |
| | | } |
| | | List<GoodsDetailVOWithKey> voList = new ArrayList<>(); |
| | | for (int i = 0; i < goodsBriefList.size(); i++) { |
| | |
| | | if (goodsList == null || goodsList.size() == 0) |
| | | return voList; |
| | | |
| | | boolean hasCreateTime = false; |
| | | BigDecimal fanliRate = null; |
| | | if (system == SystemEnum.yhqjx) { |
| | | fanliRate = getFanLiRate(uid); |
| | | hasCreateTime = true; |
| | | } |
| | | |
| | | BigDecimal couponPrice = null; |
| | |
| | | } |
| | | |
| | | for (GoodsDetailVO vo : otherVOList) { |
| | | int p = positionMap.get(vo.getGoodsId() + "#" + vo.getGoodsType() + "#" + vo.getId()); |
| | | String goodsId = vo.getGoodsId(); |
| | | if (goodsId.contains("-")) |
| | | goodsId = goodsId.split("-")[1]; |
| | | Integer p = positionMap.get(goodsId + "#" + vo.getGoodsType() + "#" + vo.getId()); |
| | | // if (p != null) |
| | | vos[p] = vo; |
| | | // else |
| | | // System.out.println(vo); |
| | | } |
| | | |
| | | List<GoodsDetailVO> finalList = new ArrayList<>(); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | |
| | | VIPEnum rank = null; |
| | | if (uid != null) |
| | | rank = vipCenterService.getVIPEnumByUid(getUid(uid)); |
| | | if (rank == null) |
| | | rank = vipGradeService.getDefaultGrade().getIdentity(); |
| | | return rank; |
| | | } |
| | | |
| | | |
| | | public VIPEnum getVIPRank(Long uid, Date date) { |
| | | VIPEnum rank = null; |
| | | if (uid != null) |
| | | rank = vipCenterService.getVIPEnumByUid(getUid(uid), date); |
| | | if (rank == null) |
| | | rank = vipGradeService.getDefaultGrade().getIdentity(); |
| | | return rank; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户的返利比例 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public BigDecimal getUserFanliRate(Long uid, Date date) { |
| | | VIPEnum vipRank = getVIPRank(uid, date); |
| | | VipGradePotence potence = vipGradePotenceService.getPotenceByVipEnum(vipRank, date); |
| | | return potence.getRebatePercent(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import javax.imageio.ImageIO; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.FileUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.yeshi.utils.DateUtil; |
| | | import org.yeshi.utils.ImageCropUtil; |
| | | import org.yeshi.utils.*; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import com.yeshi.fanli.dao.dynamic.GoodsEvaluateDao; |
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service; |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.FilePathEnum; |
| | | import com.yeshi.fanli.util.FileUtil; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil; |
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | |
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import sun.plugin2.util.SystemUtil; |
| | | |
| | | @Service |
| | | public class GoodsEvaluateServiceImpl implements GoodsEvaluateService { |
| | |
| | | } |
| | | } |
| | | } |
| | | if (oldGoodsVO != null) { |
| | | oldGoodsVO.setCreatetime(null); |
| | | } |
| | | |
| | | // 视频部分 |
| | | if (fileRequest != null) { |
| | |
| | | if (goodsDetailVO == null) { |
| | | throw new GoodsEvaluateException(1, "该商品信息不存在"); |
| | | } |
| | | |
| | | goodsDetailVO.setCreatetime(null); |
| | | |
| | | List<ImgInfo> tempList = new ArrayList<ImgInfo>(); |
| | | int totalImg = 0; |
| | |
| | | PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params); |
| | | } |
| | | if (goodsDetail != null) |
| | | goodsDetail.setCreatetime(null); |
| | | return goodsDetail; |
| | | } |
| | | |
| | |
| | | |
| | | if (typeEnum != null && typeEnum == EvaluateEnum.single) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | | goods.setCreatetime(null); |
| | | if (goods != null) { |
| | | String content = commentInfoNew.getContent(); |
| | | if (!StringUtil.isNullOrEmpty(content)) { |
| | |
| | | for (String st : activityIdList) |
| | | content = content.replace(st, ""); |
| | | content = content.replace("{relationId}", ""); |
| | | if (system == SystemEnum.yhqjx) { |
| | | content = content.replace("\n", "<br>"); |
| | | } |
| | | commentInfoNew.setContent(content); |
| | | } |
| | | } |
| | |
| | | CommentInfoEnum typeComment = commentInfoNew.getTypeEnum(); |
| | | if (typeComment != null && typeComment == CommentInfoEnum.goodsCoupon) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | | goods.setCreatetime(null); |
| | | if (goods != null && goods.isHasCoupon()) { |
| | | commentNew.add(commentInfoNew); |
| | | continue; |
| | |
| | | evaluateNew.setComments(commentNew); |
| | | |
| | | if (typeEnum != null && typeEnum == EvaluateEnum.single) { |
| | | |
| | | if (!SystemInfoUtil.hasFunctions(system, SystemFunction.share)) { |
| | | List<ImgInfo> imgList = evaluateNew.getImgList(); |
| | | if (imgList != null) { |
| | | for (ImgInfo imgInfo : imgList) { |
| | | imgInfo.setGoods(null); |
| | | if (imgInfo.getType() == ImgEnum.goods) |
| | | imgInfo.setType(ImgEnum.img); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!currencyCoupon && !singleCoupn) { // 所有券评论下架 |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | | if (goods != null) { |
| | | goods.setCreatetime(null); |
| | | goods.setState(1); // 评论不存在 下架 |
| | | evaluateNew.setRemarks("评论验证下架"); |
| | | } |
| | |
| | | if (simpleGoods != null) { |
| | | simpleGoods.setState(1); |
| | | simpleGoods.setRemarks("评论验证下架"); |
| | | } |
| | | if (system == SystemEnum.yhqjx) { |
| | | imgInfo.setGoods(null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | List<GoodsEvaluate> listOBJ = list; |
| | | // 更新商品信息 |
| | | executor.execute(new Runnable() { |
| | | executor.execute(new |
| | | |
| | | Runnable() { |
| | | @Override |
| | | public void run() { |
| | | updateGoodInfo(listOBJ); |
| | |
| | | CommonOrderGoodsVO commonGoodsVO = new CommonOrderGoodsVO(); |
| | | PropertyUtils.copyProperties(commonGoodsVO, goods); |
| | | commonGoodsVO.setGoodsType(sourceType); |
| | | commonGoodsVO.setPlaceOrderTime(TimeUtil.getGernalTime(order.getThirdCreateTime().getTime(),"yyyy.MM.dd HH:mm")); |
| | | |
| | | |
| | | // 淘宝商品图片处理 |
| | | String picture = commonGoodsVO.getPicture(); |
| | |
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) { |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | if (totalSettlement== null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) |
| | | commonGoodsVO.setPayState("未付款/已退款"); |
| | | else |
| | | commonGoodsVO.setPayState("已付款"); |
| | | |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | // 邀请订单信息保护 |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | commonGoodsVO.setPlaceOrderTime(TimeUtil.getGernalTime(commonOrder.getThirdCreateTime().getTime(),"yyyy.MM.dd HH:mm")); |
| | | |
| | | String picture = commonGoodsVO.getPicture(); |
| | | if (!StringUtil.isNullOrEmpty(picture) && !picture.contains("320x320")) { |
| | |
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) { |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | if (totalSettlement== null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) |
| | | commonGoodsVO.setPayState("未付款/已退款"); |
| | | else |
| | | commonGoodsVO.setPayState("已付款"); |
| | | // 实付款 |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | |
| | | if (commonGoodsVO.getGoodsType() == null) { |
| | | commonGoodsVO.setGoodsType(sourceType); |
| | | } |
| | | commonGoodsVO.setPlaceOrderTime(TimeUtil.getGernalTime(order.getThirdCreateTime().getTime(),"yyyy.MM.dd HH:mm")); |
| | | |
| | | // 淘宝商品图片处理 |
| | | String picture = commonGoodsVO.getPicture(); |
| | |
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) { |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | if (totalSettlement== null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) |
| | | commonGoodsVO.setPayState("未付款/已退款"); |
| | | else |
| | | commonGoodsVO.setPayState("已付款"); |
| | | |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | // 邀请订单信息保护 |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.lijin.manager.UserLijinMnager; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private UserLijinMnager userLijinMnager; |
| | | |
| | | @Override |
| | | public BigDecimal computeBaseFanliMoney(CommonOrder order) { |
| | |
| | | @Override |
| | | public BigDecimal computeFanliMoney(CommonOrder order, UserLevelEnum userLevel) { |
| | | SystemEnum system = userInfoService.getUserSystem(order.getUserInfo().getId()); |
| | | BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime(),system) |
| | | BigDecimal rate = null; |
| | | if (system == SystemEnum.yhqjx) { |
| | | rate = userLijinMnager.getUserFanliRate(order.getUserInfo().getId(), order.getThirdCreateTime()); |
| | | } else { |
| | | rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime(), system) |
| | | .add(getOfficialSubsidyRate(order.getThirdCreateTime(), |
| | | getCommonUserLevel(order.getThirdCreateTime(), userLevel), false,system)); |
| | | if (userLevel == UserLevelEnum.normalVIP) { |
| | | rate = new BigDecimal("61"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ) |
| | | return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100)); |
| | |
| | | @Override |
| | | public BigDecimal computeShareMoney(CommonOrder order, UserLevelEnum userLevel) { |
| | | SystemEnum system = userInfoService.getUserSystem(order.getUserInfo().getId()); |
| | | |
| | | if (system == SystemEnum.yhqjx) { |
| | | return new BigDecimal(0); |
| | | } |
| | | |
| | | BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime(),system) |
| | | .add(getOfficialSubsidyRate(order.getThirdCreateTime(), |
| | | getCommonUserLevel(order.getThirdCreateTime(), userLevel), true,system)); |
| | | |
| | | if (userLevel == UserLevelEnum.normalVIP) { |
| | | rate = new BigDecimal("61"); |
| | | } |
| | | |
| | | |
| | | if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ) |
| | | return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100)); |
| | |
| | | public BigDecimal computeFirstInviteMoney(CommonOrder order, UserLevelEnum buyer, |
| | | List<UserTeamLevel> bossLevelList) { |
| | | SystemEnum system = userInfoService.getUserSystem(order.getUserInfo().getId()); |
| | | if (system == SystemEnum.yhqjx) { |
| | | return new BigDecimal(0); |
| | | } |
| | | BigDecimal rate = null; |
| | | if (order.getThirdCreateTime().getTime() >= Constant.NEW_ORDER_FANLI_RULE_TIME) { |
| | | rate = getTeamRewardRate(buyer, bossLevelList, order.getThirdCreateTime(), 1,system).getRate(); |
| | |
| | | public BigDecimal computeSecondInviteMoney(CommonOrder order, UserLevelEnum buyer, |
| | | List<UserTeamLevel> bossLevelList) { |
| | | SystemEnum system = userInfoService.getUserSystem(order.getUserInfo().getId()); |
| | | if (system == SystemEnum.yhqjx) { |
| | | return new BigDecimal(0); |
| | | } |
| | | BigDecimal rate = null; |
| | | if (order.getThirdCreateTime().getTime() >= Constant.NEW_ORDER_FANLI_RULE_TIME) { |
| | | rate = getTeamRewardRate(buyer, bossLevelList, order.getThirdCreateTime(), 2,system).getRate(); |
| | |
| | | * @Description: |
| | | */ |
| | | private BigDecimal getOfficialSubsidyRate(Date date, UserLevelEnum userLevel, boolean share,SystemEnum system) { |
| | | if (system == SystemEnum.yhqjx) { |
| | | return new BigDecimal(0); |
| | | } |
| | | String key = null; |
| | | if (share) |
| | | key = String.format("official_subsidy_share_%s", userLevel.getLevel()); |
| | |
| | | } |
| | | |
| | | private BigDecimal getRateByLevel(UserLevelEnum level, Date date,SystemEnum system) { |
| | | if (system == SystemEnum.yhqjx) { |
| | | return new BigDecimal(0); |
| | | } |
| | | BigDecimal baseRate = hongBaoManageService.getBaseFanliRateCache( |
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(date.getTime(), "yyyy-MM-dd HH"), "yyyy-MM-dd HH"),system); |
| | | |
| | |
| | | @Override |
| | | public UserTeamRate getTeamRewardRate(UserLevelEnum buyerLevel, List<UserTeamLevel> bossLevelList, Date date, |
| | | int deep,SystemEnum system) { |
| | | if (system == SystemEnum.yhqjx) { |
| | | return null; |
| | | } |
| | | if (deep == 1) {// 直接邀请人奖金 |
| | | UserTeamLevel boss = bossLevelList.get(0); |
| | | BigDecimal rate = null; |
| | |
| | | @Override |
| | | public List<UserTeamRate> getTeamRewardMoreThan2LevelRates(UserLevelEnum buyerLevel, |
| | | List<UserTeamLevel> bossLevelList, Date date,SystemEnum system) { |
| | | if (system == SystemEnum.yhqjx) { |
| | | return null; |
| | | } |
| | | if (bossLevelList == null || bossLevelList.size() < 3) |
| | | return null; |
| | | |
| | |
| | | @Override |
| | | public List<UserTeamRate> getTeamDividentsRates(UserLevelEnum buyerLevel, List<UserTeamLevel> bossLevelList, |
| | | Date date,SystemEnum system) { |
| | | if (system == SystemEnum.yhqjx) { |
| | | return null; |
| | | } |
| | | List<UserTeamRate> rateList = new ArrayList<>(); |
| | | |
| | | List<UserTeamLevel> levelList = new ArrayList<>(); |
| | |
| | | |
| | | //获取推广位类型 |
| | | private SystemPIDInfo.PidType getPidType(int sourceType, String pid) { |
| | | List<SystemPIDInfo> pidInfoList = pidManager.listPidInfoByPidCache(pid, Constant.SOURCE_TYPE_TAOBAO); |
| | | if (pidInfoList == null || pidInfoList.size() == 0) { |
| | | List<SystemPIDInfo> pidInfoList = pidManager.listPidInfoByPidCache(pid, sourceType); |
| | | if ((pidInfoList == null || pidInfoList.size() == 0) && sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | pidInfoList = pidManager.listPidInfoByPidCache(pid, Constant.SOURCE_TYPE_ELME); |
| | | } |
| | | |
| | |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import redis.clients.jedis.Jedis; |
| | | import redis.clients.jedis.JedisPool; |
| | | |
| | |
| | | private MsgOverViewsService msgOverViewsService; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void addMsgOrderDetail(MsgOrderDetail detail, boolean needNotify) throws MsgOrderDetailException { |
| | | if (detail == null) |
| | |
| | | update.setBeiZhu(detail.getBeiZhu()); |
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update); |
| | | //更新消息索引时间 |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(detail).getId(), update.getUpdateTime()); |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(update).getId(), update.getUpdateTime()); |
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER); |
| | | } |
| | | if (needNotify) |
| | |
| | | * @param beiZhu 备注信息 - 非必填 |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void addOrderStatistics(Long uid, String orderId, int source, int type, int goodsCount, |
| | | BigDecimal payMoney, BigDecimal money, Date downTime, String beiZhu, boolean needNotify) { |
| | | try { |
| | |
| | | * @param sourceType |
| | | * @return |
| | | */ |
| | | public List<SystemPIDInfo> listPidInfoByPid(String pid, int sourceType) { |
| | | public List<SystemPIDInfo> listPidInfoByPid(String pid, Integer sourceType) { |
| | | SystemPIDInfoDao.DaoQuery daoQuery = new SystemPIDInfoDao.DaoQuery(); |
| | | daoQuery.sourceType = sourceType; |
| | | daoQuery.pid = pid; |
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgTypeEnum; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class MsgOverViewsFactory { |
| | | |
| | | public static MsgOverViews create(MsgOrderDetail msgOrderDetail) { |
| | |
| | | @Expose |
| | | private Map<String, String> goodsTitle; |
| | | |
| | | //下单时间 |
| | | @Expose |
| | | private String placeOrderTime; |
| | | |
| | | //订单状态 |
| | | @Expose |
| | | private String payState; |
| | | |
| | | public String getActualCount() { |
| | | return actualCount; |
| | |
| | | this.goodsType = goodsType; |
| | | } |
| | | |
| | | public String getPlaceOrderTime() { |
| | | return placeOrderTime; |
| | | } |
| | | |
| | | public void setPlaceOrderTime(String placeOrderTime) { |
| | | this.placeOrderTime = placeOrderTime; |
| | | } |
| | | |
| | | public static long getSerialVersionUID() { |
| | | return serialVersionUID; |
| | | } |
| | | |
| | | public String getPayState() { |
| | | return payState; |
| | | } |
| | | |
| | | public void setPayState(String payState) { |
| | | this.payState = payState; |
| | | } |
| | | } |
| | |
| | | timeToLiveSeconds="120" overflowToDisk="true" |
| | | memoryStoreEvictionPolicy="LRU" /> |
| | | |
| | | |
| | | <cache name="systemConfig" maxElementsInMemory="1000" |
| | | maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120" |
| | | timeToLiveSeconds="120" overflowToDisk="true" |
| | | memoryStoreEvictionPolicy="LRU" /> |
| | | |
| | | <cache name="homeBaoManage" maxElementsInMemory="1000" |
| | | maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="18000" |
| | | timeToLiveSeconds="18000" overflowToDisk="true" |