| | |
| | | taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl());
|
| | | if (uid != null && !"".equals(uid.trim())) {
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
|
| | | Long.parseLong(id));
|
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("collection", collectionGoods != null ? true : false);
|
| | | }
|
| | |
|
| | |
| | | // 判断收藏
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
|
| | | Long.parseLong(id));
|
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("collected", collectionGoods != null ? true : false);
|
| | | } else
|
| | | data.put("collected", false);
|
| | |
| | |
|
| | | // 获取浏览记录
|
| | | @RequestMapping(value = "getscanhistory", method = RequestMethod.POST)
|
| | | public void getScanHistory(AcceptData acceptData, String uid, int page, Integer source, PrintWriter out) {
|
| | | public void getScanHistory(AcceptData acceptData, String uid, int page, Integer goodsType, PrintWriter out) {
|
| | | if (page < 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "page不小于0"));
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | List<ScanHistoryV2> list = scanHistoryV2Service.getScanHistoryByDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20, source);
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20, goodsType);
|
| | |
|
| | | long count = scanHistoryV2Service.getCountByDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), source);
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), goodsType);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "deletescanhistory", method = RequestMethod.POST)
|
| | | public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, PrintWriter out) {
|
| | | public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, |
| | | Integer goodsType, PrintWriter out) {
|
| | | BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
|
| | | if (sys == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | |
| | | for (String auctionIdStr : idStr) {
|
| | | scanHistoryV2Service.deleteByAuctionIdAndDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(),
|
| | | Long.parseLong(auctionIdStr));
|
| | | Long.parseLong(auctionIdStr), goodsType);
|
| | | }
|
| | | } else {
|
| | | scanHistoryV2Service.deleteByDeviceOrUid(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid),
|
| | | acceptData.getDevice());
|
| | | acceptData.getDevice(), goodsType);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | |
|
| | |
| | | if (uid == null) {
|
| | | data.put("collected", false);
|
| | | } else {
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id);
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("collected", collectionGoods != null ? true : false);
|
| | | }
|
| | |
|
| | |
| | | // 是否加入选品库: 0未加入 1 已加入
|
| | | boolean storageState = false;
|
| | | if (uid != null) {
|
| | | storageState = userGoodsStorageService.isExistStorage(uid, id);
|
| | | storageState = userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_TAOBAO);
|
| | | }
|
| | |
|
| | | data.put("storageState", storageState);
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | @RequestMapping(value = "sharedetail", method = RequestMethod.POST)
|
| | | public void shareDetail(AcceptData acceptData, Long uid, Long auctionId, String type, PrintWriter out) {
|
| | | try {
|
| | | userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId);
|
| | | userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | out.print(JsonUtil.loadTrueResult("分享成功"));
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
|
| | | import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
|
| | |
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getShareGoodsV2", method = RequestMethod.POST)
|
| | | public void getShareGoodsV2(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | List<ShareHotGoods> listHot = shareHotGoodsService.listByDay(day);
|
| | | if (listHot == null) {
|
| | | listHot = new ArrayList<ShareHotGoods>(); |
| | | }
|
| | | |
| | | |
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | |
| | | boolean isNewUser = userInfoExtraService.isNewUser(uid);
|
| | | if (isNewUser) {
|
| | | // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
|
| | | long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
|
| | | if (countRecord > 0) {
|
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value");
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
|
| | | |
| | | // 推广红包 不能小于1
|
| | | if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | // 去掉标签
|
| | | detailVO.setLabels(null);
|
| | | |
| | | MoneyInfoVO moneyInfo = detailVO.getMoneyInfo();
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | SpreadHongBao spreadHongBao = new SpreadHongBao();
|
| | | |
| | | // 显示类型
|
| | | if (isNewUser) {
|
| | | moneyInfo.setMoneyType(1);
|
| | | spreadHongBao.setName("推广红包");
|
| | | spreadHongBao.setMoney(" ¥1");
|
| | | } else {
|
| | | moneyInfo.setMoneyType(2);
|
| | | spreadHongBao.setName("推广红包");
|
| | | spreadHongBao.setMoney(" ¥" + spreadMoney);
|
| | | }
|
| | | detailVO.setMoneyInfo(moneyInfo);
|
| | | otherInfo.setSpreadHongBao(spreadHongBao);
|
| | | detailVO.setOtherInfo(otherInfo);
|
| | | |
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | | |
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 过期
|
| | | userTaoLiJinOriginService.overdueHongBao(uid);
|
| | | }
|
| | | });
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | List<CommonOrderVO> listUserOrder(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState, |
| | | @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("day") Integer day); |
| | | @Param("day") Integer day, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 统计用户订单 并订单号分组 |
| | |
| | | */ |
| | | long countUserOrder(@Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type, |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 判断部分失效状态 |
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day); |
| | | Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 昨日总订单-根据红包类型 自购 邀请 分享 |
| | |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, |
| | | @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 奖金订单数量 |
| | |
| | | * @return |
| | | */ |
| | | long countBonusOrderNumber(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 奖金统计 |
| | |
| | | * @return |
| | | */ |
| | | BigDecimal countBonusOrderMoney(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 奖金统计 |
| | |
| | | MAX(co_settle_time) AS co_settle_time, co_order_by, co_create_time, |
| | | co_update_time |
| | | </sql> |
| | | |
| | | <select id="listUserOrder" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS |
| | |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countUserOrder" resultType="java.lang.Long"> |
| | | <!-- 统计用户订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | <select id="listOrderGoodsInfo" resultMap="ResultMap" |
| | |
| | | </foreach> |
| | | GROUP BY tc.`co_order_no`,tc.`co_order_goods_id` |
| | | </select> |
| | | |
| | | |
| | | <select id="countHistoryOrder" resultType="java.util.HashMap"> |
| | | <!-- 统计历史订单数量 --> |
| | | SELECT SUM(A.self)AS totalSelf,SUM(A.shared)AS |
| | |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | | UNION ALL |
| | | |
| | | <!-- 分享订单 --> |
| | | SELECT 0 AS self,IFNULL(COUNT(ho_id),0) AS shared,0 AS invite FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | | UNION ALL |
| | | |
| | | <!-- 邀请订单 --> |
| | | SELECT 0 AS self,0 AS shared,IFNULL(COUNT(ho_id),0) AS invite FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUidAndOrderState" resultType="java.util.HashMap"> |
| | | SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS |
| | | totalProces,SUM(A.Invalid)AS totalInvite FROM ( |
| | |
| | | WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]> |
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2) |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | | UNION ALL |
| | | |
| | | <!-- 维权订单 --> |
| | | SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | | UNION ALL |
| | | |
| | | <!-- 失效订单 --> |
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state_whole_order` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A |
| | | </select> |
| | | <select id="countBonusOrderNumber" resultType="java.lang.Long"> |
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | <select id="countBonusOrderMoney" resultType="java.math.BigDecimal"> |
| | |
| | | AND co.`co_state` = 2 |
| | | <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | </select> |
| | | <select id="countBonusOrderMoneyAndNumber" resultType="java.util.HashMap"> |
| | | SELECT COUNT(*) AS totalNum, CAST(SUM(moneys) AS DECIMAL(19,2)) AS |
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
|
| | | throws CommonOrderException {
|
| | | return commonOrderMapper.listUserOrder(start, count, uid, state, type, orderState, orderNo, startTime, endTime,
|
| | | dateType);
|
| | | dateType, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
|
| | | String startTime, String endTime, Integer dateType) throws CommonOrderException {
|
| | | return commonOrderMapper.countUserOrder(uid, state, type, orderState, orderNo, startTime, endTime, dateType);
|
| | | String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException {
|
| | | return commonOrderMapper.countUserOrder(uid, state, type, orderState, orderNo, startTime, endTime, dateType, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException {
|
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData,Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException {
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<CommonOrderVO> listOrder = listGroupOrderNoByUid((page - 1) * pageSize, pageSize, uid, state, type,
|
| | | orderState, orderNo, startTime, endTime, dateType);
|
| | | orderState, orderNo, startTime, endTime, dateType, source);
|
| | |
|
| | | // 订单信息为空
|
| | | if (listOrder == null || listOrder.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | // 数据加工重新组织
|
| | | listDataFactory(listOrder, listGoods, uid);
|
| | | listDataFactory(acceptData, listOrder, listGoods, uid);
|
| | |
|
| | | return listOrder;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day) {
|
| | | return commonOrderMapper.countHistoryOrder(uid, day);
|
| | | public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source) {
|
| | | return commonOrderMapper.countHistoryOrder(uid, day, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer day, String startTime, String endTime) {
|
| | | return commonOrderMapper.countBonusOrderNumber(uid, type, day, startTime, endTime);
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer day, String startTime, String endTime, Integer source) {
|
| | | return commonOrderMapper.countBonusOrderNumber(uid, type, day, startTime, endTime, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer day, String startTime, String endTime) {
|
| | | return commonOrderMapper.countBonusOrderMoney(uid, type, day, startTime, endTime);
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer day, String startTime, String endTime, Integer source) {
|
| | | return commonOrderMapper.countBonusOrderMoney(uid, type, day, startTime, endTime, source);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Override
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day) {
|
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day);
|
| | | Integer day, Integer source) {
|
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day, source);
|
| | | }
|
| | |
|
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | | public void listDataFactory(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | |
|
| | | List<String> listNo = new ArrayList<String>();
|
| | | for (CommonOrderVO commonOrderVO : listOrder) {
|
| | |
| | |
|
| | | listOrderGoods.add(commonGoodsVO);
|
| | |
|
| | | Integer orderType = commonOrder.getOrderType();
|
| | | Integer orderType = order.getOrderType();
|
| | | if (orderType == null) {
|
| | | String shopType = commonGoodsVO.getShopType();
|
| | | if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) {
|
| | | commonOrder.setOrderType(1);
|
| | | order.setOrderType(1);
|
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
|
| | | commonOrder.setOrderType(2);
|
| | | order.setOrderType(2);
|
| | | } |
| | | |
| | | if (Constant.SOURCE_TYPE_JD == sourceType2) {
|
| | | order.setOrderType(3);
|
| | | } else if (Constant.SOURCE_TYPE_PDD == sourceType2) {
|
| | | order.setOrderType(4);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException {
|
| | | List<CommonOrderVO> list = getOrderByUid(1, uid, null, null, null, orderNo, null, null, null);
|
| | | if (list == null || list.size() == 0) {
|
| | | return null;
|
| | | } else {
|
| | | return list.get(0);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState)
|
| | |
| | | return commonOrderVO;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer hongBaoState, String orderNo)
|
| | | throws CommonOrderException {
|
| | |
|
| | | List<CommonOrderVO> listOrder = commonOrderMapper.getCouponHongbaoByOrderNo(uid, hongBaoState, orderNo);
|
| | |
|
| | | // 订单信息为空
|
| | | if (listOrder == null || listOrder.size() == 0) {
|
| | | listOrder = new ArrayList<CommonOrderVO>();
|
| | | return listOrder;
|
| | | }
|
| | |
|
| | | // 商品信息
|
| | | List<CommonOrderVO> listGoods = commonOrderMapper.listOrderGoodsInfo(listOrder);
|
| | | // 订单商品为空
|
| | | if (listGoods == null || listGoods.size() == 0) {
|
| | | return listOrder;
|
| | | }
|
| | |
|
| | | // 数据加工重新组织
|
| | | listDataFactory(listOrder, listGoods, uid);
|
| | |
|
| | | return listOrder;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public JSONObject getRewardJumpInfo(String orderNo) {
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | List<CommonGoods> listGoods = commonGoodsService.getByListGoodsId(listGoodsId);
|
| | | List<CommonGoods> listGoods = commonGoodsService.getByListGoodsId(listGoodsId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (listGoods == null || listGoods.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | |
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
|
| | | throws CommonOrderException;
|
| | |
|
| | | /**
|
| | |
| | | * @throws CommonOrderException
|
| | | */
|
| | | long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
|
| | | String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | | String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 移动段订单列表
|
| | |
| | | * 到账状态
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
|
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 统计订单-根据红包类型 自购 邀请 分享
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day);
|
| | | public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source);
|
| | |
|
| | | /**
|
| | | * 统计订单
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime);
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
|
| | |
|
| | | /**
|
| | | * 统计订单
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime);
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
|
| | |
|
| | | /**
|
| | | * 统计奖金订单数量、金额
|
| | |
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
|
| | | Integer day);
|
| | | Integer day, Integer source);
|
| | |
|
| | | /**
|
| | | * 根据订单号与订单类型查询订单
|
| | |
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 根据订单号获取信息
|
| | | * |
| | | * @param orderNo
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 查询券奖励金额以及订单信息
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @param orderNo
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer state, String orderNo)
|
| | | throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 查询订单
|
New file |
| | |
| | | package com.yeshi.fanli.util.pinduoduo;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
|
| | | public class PinDuoDuoUtil {
|
| | |
|
| | | |
| | | /**
|
| | | * 商品佣金计算
|
| | | * @param goods
|
| | | * @param rate
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getGoodsFanLiMoney(PDDGoodsDetail goods, BigDecimal rate) {
|
| | | BigDecimal money = null;
|
| | | BigDecimal price = new BigDecimal(goods.getMinNormalPrice());
|
| | | BigDecimal promotionRate = new BigDecimal(goods.getPromotionRate());
|
| | | |
| | | Boolean hasCoupon = goods.getHasCoupon();
|
| | | if (hasCoupon == null || !hasCoupon) {
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(price, promotionRate),new BigDecimal("0.001")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | } else {
|
| | | BigDecimal amount = new BigDecimal(goods.getCouponDiscount());
|
| | | BigDecimal startFree = new BigDecimal(goods.getCouponMinOrderAmount()); |
| | | if (startFree.compareTo(price) <= 0 && price.compareTo(amount) > 0) {
|
| | | BigDecimal finalPrice = price.subtract(amount);
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil
|
| | | .mul(MoneyBigDecimalUtil.mul(finalPrice, promotionRate), new BigDecimal("0.001")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | |
|
| | | } else {// 不能用券
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(price,promotionRate), new BigDecimal("0.001")), |
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | }
|
| | | }
|
| | | return BigDecimalUtil.getWithNoZera(money);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 计算商品券后价,没有券则返回原价
|
| | | * |
| | | * @param goodsBrief
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getQuanPrice(PDDGoodsDetail goods) {
|
| | | BigDecimal price = new BigDecimal(goods.getMinNormalPrice());
|
| | | Boolean hasCoupon = goods.getHasCoupon();
|
| | | if (hasCoupon == null || !hasCoupon) {
|
| | | return price;
|
| | | }
|
| | | |
| | | BigDecimal amount = new BigDecimal(goods.getCouponDiscount());
|
| | | BigDecimal startFree = new BigDecimal(goods.getCouponMinOrderAmount());
|
| | | if (startFree.compareTo(price) <= 0) {
|
| | | BigDecimal quanPrice = MoneyBigDecimalUtil.sub(price, amount);
|
| | | return quanPrice;
|
| | | } else {
|
| | | return price;
|
| | | }
|
| | | }
|
| | | |
| | | public static String getSaleCount(long count) {
|
| | | String salesCountMidea = null;
|
| | | if (count < 10000) {
|
| | | salesCountMidea = count + "";
|
| | | } else {
|
| | | double sales = count;
|
| | | salesCountMidea = String.format("%.1f", sales / 10000);
|
| | | salesCountMidea = salesCountMidea + "万";
|
| | | }
|
| | | return salesCountMidea;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | tg.setReservePrice(tb.getReservePrice());
|
| | | tg.setUserType(tb.getUserType());
|
| | | tg.setShopTitle(tb.getShopTitle());
|
| | | tg.setTkRate(tb.getTkRate());
|
| | | tg.setSellerId(tb.getSellerId());
|
| | | tg.setState(tb.getState()); // 状态:2018-12-03
|
| | | if (tb.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
|
| | |
|