| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "gettaobaolink")
|
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, HttpServletRequest request,
|
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId,String from, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
|
| | |
| | | */ |
| | | List<LostOrder> listByStateAndResultCode(@Param("state") Integer state, @Param("resultCode") Integer resultCode, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | |
| | | /** |
| | | * 统计今日申诉次数 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countTodayAppeal(@Param("uid")Long uid); |
| | | long countTodayAppeal(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据处理的最大时间和状态,处理结果查询 |
| | | * |
| | | * @param maxTime |
| | | * @param state |
| | | * @param resultCode |
| | | * @return |
| | | */ |
| | | List<LostOrder> listByMaxHandleTimeAndStateAndResultCode(@Param("maxTime") long maxTime, |
| | | @Param("state") Integer state, @Param("resultCode") Integer resultCode); |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 通过最小更新时间做删除 |
| | | * |
| | | * @return |
| | | */ |
| | | int deleteByMinUpdateTime(Long minTime); |
| | | |
| | | /** |
| | | * 根据商品ID列表查询 |
| | | * |
| | | * @param goodsIdList |
| | | * @return |
| | | */ |
| | | List<DaTaoKeDetail> listByGoodsIds(@Param("goodsIdList") List<Long> goodsIdList); |
| | | |
| | | /** |
| | | * 根据主键ID查询 |
| | | * |
| | | * @param idList |
| | | * @return |
| | | */ |
| | | List<DaTaoKeDetail> listByIds(@Param("idList") List<Long> idList); |
| | | |
| | | } |
| | |
| | | public final static int STATE_SX = 4;// 未付款/已退款
|
| | |
|
| | | public enum MsgTypeOrderTypeEnum {
|
| | | fanli("返利订单"), share("分享订单"), invite("邀请订单");
|
| | | fanli("返利订单"), share("分享订单"), invite("邀请订单"), found("订单找回");
|
| | | private final String desc;
|
| | |
|
| | | private MsgTypeOrderTypeEnum(String desc) {
|
| | |
| | | private BigDecimal payMoney;// 付款金额
|
| | | @Column(name = "mo_hongbao_money")
|
| | | private BigDecimal hongBaoMoney;// 佣金
|
| | | @Column(name = "mo_happen_date")
|
| | | private Date happendDate;// 发生时间
|
| | | @Column(name = "mo_beizhu")
|
| | | private String beiZhu;
|
| | | @Column(name = "mo_read")
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Date getHappendDate() {
|
| | | return happendDate;
|
| | | }
|
| | |
|
| | | public void setHappendDate(Date happendDate) {
|
| | | this.happendDate = happendDate;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
|
| | |
| | | private QualityFactoryService qualityFactoryService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsService;
|
| | |
|
| | | // 两小时执行一次 对商品信息进行更新
|
| | | @Scheduled(cron = "0 0 0/2 * * ?")
|
| | |
| | | <result column="mo_read" property="read" jdbcType="BOOLEAN" /> |
| | | <result column="mo_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="mo_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="mo_happen_date" property="happendDate" jdbcType="TIMESTAMP" /> |
| | | <association property="user" column="mo_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="mo_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_order_id,mo_state,mo_goods_count,mo_pay_money,mo_hongbao_money,mo_beizhu,mo_read,mo_create_time,mo_update_time |
| | | <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_order_id,mo_state,mo_goods_count,mo_pay_money,mo_hongbao_money,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_happen_date |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_msg_order where mo_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_order |
| | | (mo_id,mo_uid,mo_type,mo_order_id,mo_state,mo_goods_count,mo_pay_money,mo_hongbao_money,mo_beizhu,mo_read,mo_create_time,mo_update_time) |
| | | (mo_id,mo_uid,mo_type,mo_order_id,mo_state,mo_goods_count,mo_pay_money,mo_hongbao_money,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_happen_date) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{payMoney,jdbcType=DECIMAL},#{hongBaoMoney,jdbcType=DECIMAL},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{payMoney,jdbcType=DECIMAL},#{hongBaoMoney,jdbcType=DECIMAL},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{happendDate,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="read != null">mo_read,</if> |
| | | <if test="createTime != null">mo_create_time,</if> |
| | | <if test="updateTime != null">mo_update_time,</if> |
| | | <if test="happendDate != null">mo_happen_date,</if> |
| | | |
| | | |
| | | |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="read != null">#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="happendDate != null">#{happendDate,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail">update |
| | |
| | | #{beiZhu,jdbcType=VARCHAR},mo_read = |
| | | #{read,jdbcType=BOOLEAN},mo_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},mo_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where mo_id = #{id,jdbcType=BIGINT} |
| | | #{updateTime,jdbcType=TIMESTAMP},mo_happen_date=#{happendDate,jdbcType=TIMESTAMP} where mo_id = #{id,jdbcType=BIGINT} |
| | | |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail"> |
| | | update yeshi_ec_msg_order |
| | |
| | | <if test="read != null">mo_read=#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">mo_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">mo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="happendDate != null">mo_happen_date=#{happendDate,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where mo_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey" /> |
| | | </resultMap> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT}</delete> |
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <select id="selectByOrderId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String">select * from yeshi_ec_lost_order where orderId=#{0} |
| | | </select> |
| | |
| | | <select id="countByUid" resultType="java.util.HashMap">SELECT IFNULL(COUNT(id), 0) |
| | | AS total,IFNULL(SUM(CASE WHEN state = 1 THEN 1 ELSE 0 END),0) AS |
| | | totalPass, IFNULL(SUM(CASE WHEN state = 2 THEN 1 ELSE 0 END),0) AS |
| | | totalReject FROM yeshi_ec_lost_order WHERE uid = #{uid};</select> |
| | | totalReject FROM yeshi_ec_lost_order WHERE uid = #{uid}; |
| | | </select> |
| | | <select id="listQuery" resultMap="AllResultMap"> |
| | | SELECT d.* FROM yeshi_ec_lost_order d left join yeshi_ec_user u on |
| | | d.uid = u.id WHERE 1=1 |
| | |
| | | <select id="countLostNum" resultType="java.util.HashMap"> |
| | | SELECT COUNT(t.`id`) AS showValue, |
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS |
| | | 'showDate'</if> |
| | | 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if> |
| | | FROM `yeshi_ec_lost_order` t WHERE t.`createTime`IS NOT NULL |
| | |
| | | <select id="countAppealMoney" resultType="java.util.HashMap"> |
| | | SELECT CAST(SUM(v.`hb_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS |
| | | 'showDate'</if> |
| | | 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if> |
| | | FROM `yeshi_ec_lost_order` t LEFT JOIN `yeshi_ec_common_order` tc ON |
| | |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if> |
| | | ORDER BY t.`createTime` |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByMaxHandleTimeAndStateAndResultCode" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_lost_order lo where #{maxTime} > |
| | | lo.`handleTime` |
| | | <if test="state!=null"> and lo.`state`=#{state} and result_code=#{resultCode} |
| | | </if> |
| | | |
| | | <if test="resultCode!=null"> and lo.`result_code`=#{resultCode} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_lost_order |
| | | (id,orderId,type,state,createTime,handleTime,uid,oid,remake,judge,result_code,id,ip_info) |
| | |
| | | ,ip_info =#{ipInfo,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteByUid" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_lost_order where uid = #{0}</delete> |
| | | yeshi_ec_lost_order where uid = #{0} |
| | | </delete> |
| | | <select id="listByUidOrderByCreateTimeDesc" resultMap="BaseResultMap">select * |
| | | from yeshi_ec_lost_order where uid=#{uid} order by id desc limit |
| | | #{start},#{count}</select> |
| | | #{start},#{count} |
| | | </select> |
| | | <select id="countAllByUid" resultType="java.lang.Long">select count(id) from |
| | | yeshi_ec_lost_order where uid=#{0}</select> |
| | | yeshi_ec_lost_order where uid=#{0} |
| | | </select> |
| | | <select id="listByOrderIdAndTypeAndState" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_lost_order where orderId=#{orderId} |
| | | <if test="type!=null">and type=#{type}</if> |
| | |
| | | lo.`result_code`=3 WHERE lo.`state`=1 AND lo.`result_code`=1 AND |
| | | UNIX_TIMESTAMP()*1000- lo.`handleTime`>1000* 60 * 60 * 24 * 3 |
| | | </update> |
| | | |
| | | |
| | | <select id="countTodayAppeal" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(t.`id`),0) FROM yeshi_ec_lost_order t |
| | | WHERE t.`uid` = #{uid} |
| | | AND FROM_UNIXTIME(t.`createTime`/1000, '%Y-%m-%d') =DATE_FORMAT(NOW(),'%Y-%m-%d') |
| | | SELECT |
| | | IFNULL(COUNT(t.`id`),0) FROM yeshi_ec_lost_order t |
| | | WHERE t.`uid` = |
| | | #{uid} |
| | | AND FROM_UNIXTIME(t.`createTime`/1000, '%Y-%m-%d') |
| | | =DATE_FORMAT(NOW(),'%Y-%m-%d') |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_goods_dataoke where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByGoodsIds" resultMap="BaseResultMap" |
| | | parameterType="java.util.List"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_goods_dataoke where |
| | | |
| | | <foreach collection="goodsIdList" item="goodsId" separator=" or "> |
| | | goods_id=#{goodsId} |
| | | </foreach> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="listByIds" resultMap="BaseResultMap" parameterType="java.util.List"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_goods_dataoke where |
| | | <foreach collection="idList" item="id" separator=" or "> |
| | | id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByIdList"> |
| | | delete from |
| | | yeshi_ec_goods_dataoke where |
| | |
| | | #{jiHuaLink,jdbcType=VARCHAR},price = |
| | | #{price,jdbcType=DECIMAL},jihua_shenhe = |
| | | #{jiHuaShenHe,jdbcType=INTEGER},introduce = |
| | | #{introduce,jdbcType=VARCHAR},cid = #{cid,jdbcType=INTEGER},sales_num |
| | | = #{salesNum,jdbcType=INTEGER},quan_link = |
| | | #{introduce,jdbcType=VARCHAR},cid = |
| | | #{cid,jdbcType=INTEGER},sales_num |
| | | = |
| | | #{salesNum,jdbcType=INTEGER},quan_link = |
| | | #{quanLink,jdbcType=VARCHAR},is_tmall = |
| | | #{isTmall,jdbcType=INTEGER},goods_id = |
| | | #{goodsId,jdbcType=BIGINT},commission_jihua = |
| | |
| | | public void addMsgOrderDetail(MsgOrderDetail detail) throws MsgOrderDetailException {
|
| | | if (detail == null)
|
| | | throw new MsgOrderDetailException(1, "消息为空");
|
| | | if (detail.getOrderId() == null || detail.getGoodsCount() == null || detail.getType() == null
|
| | | || detail.getState() == null || detail.getPayMoney() == null || detail.getUser() == null)
|
| | | if (detail.getOrderId() == null || detail.getType() == null
|
| | | || detail.getState() == null || detail.getUser() == null)
|
| | | throw new MsgOrderDetailException(2, "消息不完整");
|
| | | MsgOrderDetail old = msgOrderDetailMapper.selectByUidAndOrderId(detail.getUser().getId(), detail.getOrderId());
|
| | | if (old == null) {
|
| | |
| | | package com.yeshi.fanli.service.impl.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOrderDetailFactory;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderFoundSuccess(Long uid, String orderId, BigDecimal payMoney, int orderType,
|
| | | Date happendDate) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFoundOrder(uid, orderId, true, payMoney, orderType,
|
| | | happendDate, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderFoundFail(Long uid, String orderId, BigDecimal payMoney, int orderType,
|
| | | Date happendDate) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFoundOrder(uid, orderId, false, payMoney, orderType,
|
| | | happendDate, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgOrderDetailService.addMsgOrderDetail(detail);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | |
| | |
|
| | | @Resource
|
| | | private LostOrderMapper lostOrderMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private UserOrderMsgNotificationService userOrderMsgNotificationService;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | |
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0)
|
| | | return -5;
|
| | |
|
| | | |
| | | // 次数限制
|
| | | long count = lostOrderMapper.countTodayAppeal(lostOrder.getUserInfo().getId());
|
| | | String countMax = configService.get("order_appeal_count_day");
|
| | | if (countMax != null && countMax.trim().length() > 0 && count >= Long.parseLong(countMax)) {
|
| | | return -7;
|
| | | }
|
| | | |
| | |
|
| | | WriteLock lostOrderwriteLock = lostOrderLock.writeLock();
|
| | | ReadLock lostOrderReadLock = lostOrderLock.readLock();
|
| | | try {
|
| | |
| | | lostOrderReadLock.lock();
|
| | | lostOrderwriteLock.unlock();
|
| | | }
|
| | | |
| | |
|
| | | Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId());
|
| | | if (or != null) {
|
| | | boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId());
|
| | |
| | | lostOrder.setJudge("不匹配");
|
| | | }
|
| | |
|
| | | |
| | | try {
|
| | | Order addorder = new Order();
|
| | | addorder.setBeizhu("补单");
|
| | |
| | | addorder.setOrderType(lostOrder.getType());
|
| | | addorder.setState(1);
|
| | | addorder.setUserInfo(lostOrder.getUserInfo());
|
| | | |
| | |
|
| | | boolean b = orderService.addOrder(addorder);
|
| | | if (b) {
|
| | | lostOrder.setRemake("处理成功");
|
| | |
| | | lostOrder.setRemake(e.getMessage());
|
| | | lostOrder.setState(LostOrder.STATE_REJECT);
|
| | | }
|
| | | |
| | |
|
| | | lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING);
|
| | | lostOrder.setHandleTime(System.currentTimeMillis());
|
| | | lostOrder.setCreateTime(System.currentTimeMillis());
|
| | | lostOrderMapper.insertSelective(lostOrder);
|
| | | |
| | |
|
| | | } finally {
|
| | | lostOrderReadLock.unlock();
|
| | | }
|
| | |
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | for (LostOrder lo : list) {
|
| | | if (lo.getState() == 1 && lo.getResultCode() != null
|
| | | if (lo.getState() == LostOrder.STATE_PASS && lo.getResultCode() != null
|
| | | && lo.getResultCode() == LostOrder.RESULT_CODE_VERFING) {
|
| | | LostOrder update = new LostOrder();
|
| | | update.setId(lo.getId());
|
| | | update.setResultCode(LostOrder.RESULT_CODE_SUCCESS);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | Order order = orderService.findOrderByOrderIdAndType(orderId, Order.ORDER_TYPE_TAOBAO);
|
| | | if (order != null)
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundSuccess(lo.getUserInfo().getId(), lo.getOrderId(),
|
| | | order.getMoney(), 1, new Date(lo.getHandleTime()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | update.setId(order.getId());
|
| | | update.setResultCode(LostOrder.RESULT_CODE_FAIL);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
|
| | | new Date(order.getHandleTime()));
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void processFail() {
|
| | | // 订单申诉人工通过后,但是隔了3天还未处理成功就视为该订单申诉失败
|
| | | lostOrderMapper.processFail();
|
| | | List<LostOrder> list = lostOrderMapper.listByMaxHandleTimeAndStateAndResultCode(
|
| | | System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 3L, LostOrder.STATE_PASS,
|
| | | LostOrder.RESULT_CODE_VERFING);
|
| | | if (list != null)
|
| | | for (LostOrder order : list) {
|
| | | LostOrder update = new LostOrder();
|
| | | update.setId(order.getId());
|
| | | update.setResultCode(LostOrder.RESULT_CODE_FAIL);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
|
| | | new Date(order.getHandleTime()));
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao.dataoke;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.dataoke.DaTaoKeDetailMapper;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeApiResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | |
|
| | | @Service
|
| | | public class DaTaoKeGoodsDetailServiceImpl implements DaTaoKeGoodsDetailService {
|
| | | @Resource
|
| | | private DaTaoKeDetailMapper daTaoKeDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Override
|
| | | public void startSyncGoods() {
|
| | | // 判断是否有正在进行的更新
|
| | | String key1 = "dataoke-updating";
|
| | | // if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key1)))
|
| | | // return;
|
| | |
|
| | | // 开始更新
|
| | | redisManager.cacheCommonString(key1, "1", 60 * 20);
|
| | | long firstTime = System.currentTimeMillis() - 1000 * 60 * 5L;
|
| | | int totalCount = 0;
|
| | | for (int p = 1; p <= 2000; p++) {// 10W数据
|
| | | DaTaoKeApiResult result = DaTaoKeApiUtil.goodsList(p);
|
| | | if (result.getDetailList().size() < 50)// 更新完成
|
| | | {
|
| | | redisManager.removeCommonString(key1);
|
| | | break;
|
| | | }
|
| | | addGoodsList(result.getDetailList());
|
| | | totalCount += result.getDetailList().size();
|
| | | }
|
| | |
|
| | | LogHelper.test("大淘客总共更新数据数量:" + totalCount);
|
| | | // 清除过期数据
|
| | | if (totalCount > 50000)// 保证有5w数据再清除过期
|
| | | {
|
| | | daTaoKeDetailMapper.deleteByMinUpdateTime(firstTime);
|
| | | LogHelper.test("删除大淘客过期数据:" + totalCount);
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void addGoodsList(List<DaTaoKeDetail> goodsList) {
|
| | | List<Long> idList = new ArrayList<>();
|
| | | for (DaTaoKeDetail goods : goodsList) {
|
| | | goods.setUpdateTime(new Date());
|
| | | idList.add(goods.getId());
|
| | | }
|
| | | // 批量删除
|
| | | daTaoKeDetailMapper.deleteByIdList(idList);
|
| | | // 批量插入
|
| | | daTaoKeDetailMapper.insertByBatch(goodsList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> listByGoodsIds(List<Long> goodsIdList) {
|
| | | if (goodsIdList == null || goodsIdList.size() == 0)
|
| | | return null;
|
| | | List<DaTaoKeDetail> goodsList = daTaoKeDetailMapper.listByGoodsIds(goodsIdList);
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) {
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | goodsIdList.add(goods.getAuctionId());
|
| | |
|
| | | List<DaTaoKeDetail> dtList = listByGoodsIds(goodsIdList);
|
| | |
|
| | | Map<Long, DaTaoKeDetail> map = new HashMap<>();
|
| | | for (DaTaoKeDetail goods : dtList)
|
| | | map.put(goods.getGoodsId(), goods);
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | DaTaoKeDetail detail = map.get(goods.getAuctionId());
|
| | | goods = filterTaoBaoGoods(goods, detail);
|
| | | }
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods) {
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | goodsIdList.add(goods.getAuctionId());
|
| | |
|
| | | List<DaTaoKeDetail> daTaoKeList = daTaoKeDetailMapper.listByGoodsIds(goodsIdList);
|
| | | if (daTaoKeList == null || daTaoKeList.size() == 0)
|
| | | return goods;
|
| | |
|
| | | // 重新设置标题与券价格
|
| | | goods = filterTaoBaoGoods(goods, daTaoKeList.get(0));
|
| | |
|
| | | return goods;
|
| | | }
|
| | |
|
| | | private TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
|
| | | if (detail != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | goods.setCouponAmount(detail.getQuanPrice());
|
| | | if (new BigDecimal(detail.getQuanCondition()).compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", detail.getQuanCondition(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", detail.getQuanPrice()));
|
| | | }
|
| | | return goods;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> listByIds(List<Long> idList) {
|
| | | return daTaoKeDetailMapper.listByIds(idList);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.taobao.dataoke;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.dataoke.DaTaoKeDetailMapper;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeApiResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
|
| | | @Service
|
| | | public class DaTaoKeGoodsServiceImpl implements DaTaoKeGoodsService {
|
| | | @Resource
|
| | | private DaTaoKeDetailMapper daTaoKeDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Override
|
| | | public void startSyncGoods() {
|
| | | // 判断是否有正在进行的更新
|
| | | String key1 = "dataoke-updating";
|
| | | // if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key1)))
|
| | | // return;
|
| | |
|
| | | // 开始更新
|
| | | redisManager.cacheCommonString(key1, "1", 60 * 20);
|
| | | long firstTime = System.currentTimeMillis() - 1000 * 60 * 5L;
|
| | | int totalCount = 0;
|
| | | for (int p = 1; p <= 2000; p++) {// 10W数据
|
| | | DaTaoKeApiResult result = DaTaoKeApiUtil.goodsList(p);
|
| | | if (result.getDetailList().size() < 50)// 更新完成
|
| | | {
|
| | | redisManager.removeCommonString(key1);
|
| | | break;
|
| | | private List<DaTaoKeDetail> reSearchDetails(List<DaTaoKeDetail> list) {
|
| | | List<Long> idList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (DaTaoKeDetail detail : list) {
|
| | | idList.add(detail.getId());
|
| | | }
|
| | | addGoodsList(result.getDetailList());
|
| | | totalCount += result.getDetailList().size();
|
| | | }
|
| | |
|
| | | LogHelper.test("大淘客总共更新数据数量:" + totalCount);
|
| | | // 清除过期数据
|
| | | if (totalCount > 50000)// 保证有5w数据再清除过期
|
| | | {
|
| | | daTaoKeDetailMapper.deleteByMinUpdateTime(firstTime);
|
| | | LogHelper.test("删除大淘客过期数据:" + totalCount);
|
| | | }
|
| | | List<DaTaoKeDetail> detailList = daTaoKeGoodsDetailService.listByIds(idList);
|
| | | return detailList;
|
| | | } else
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void addGoodsList(List<DaTaoKeDetail> goodsList) {
|
| | | List<Long> idList = new ArrayList<>();
|
| | | for (DaTaoKeDetail goods : goodsList) {
|
| | | goods.setUpdateTime(new Date());
|
| | | idList.add(goods.getId());
|
| | | }
|
| | | // 批量删除
|
| | | daTaoKeDetailMapper.deleteByIdList(idList);
|
| | | // 批量插入
|
| | | daTaoKeDetailMapper.insertByBatch(goodsList);
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentSalesRankGoodsList(Long cid) {
|
| | | List<DaTaoKeDetail> list = DaTaoKeUtil.getCurrentSalesRank(cid);
|
| | | return reSearchDetails(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentDaySalesRankGoodsList(Long cid) {
|
| | | List<DaTaoKeDetail> list = DaTaoKeUtil.getCurrentDaySalesRank(cid);
|
| | | return reSearchDetails(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentHotSalesRankGoodsList() {
|
| | | List<DaTaoKeDetail> list = DaTaoKeUtil.getCurrentHotSalesRank();
|
| | | return reSearchDetails(list);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | /**
|
| | | * 用户订单消息通知
|
| | |
| | | int orderState);
|
| | |
|
| | | public void orderShareFirstLevelStatistic(Long uid, String orderId, BigDecimal payMoney, BigDecimal money,
|
| | | int goodsCount, int orderState,String sourceUserName);
|
| | | int goodsCount, int orderState, String sourceUserName);
|
| | |
|
| | | /**
|
| | | * 分享订单状态改变
|
| | |
| | | public void orderShareFirstLevelStateChanged(Long uid, String orderId, BigDecimal payMoney, BigDecimal money,
|
| | | int orderState);
|
| | |
|
| | | /**
|
| | | * 订单找回成功
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param payMoney
|
| | | * @param money
|
| | | * @param orderType
|
| | | */
|
| | | public void orderFoundSuccess(Long uid, String orderId, BigDecimal payMoney, int orderType,Date happendDate);
|
| | |
|
| | | /**
|
| | | * 订单找回失败
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param payMoney
|
| | | * @param goodsCount
|
| | | * @param orderType 1-淘宝
|
| | | */
|
| | | public void orderFoundFail(Long uid, String orderId, BigDecimal payMoney, int orderType,Date happendDate);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao.dataoke;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | |
|
| | | /**
|
| | | * 大淘客商品详情服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface DaTaoKeGoodsDetailService {
|
| | | /**
|
| | | * 启动商品同步服务
|
| | | */
|
| | | public void startSyncGoods();
|
| | |
|
| | | /**
|
| | | * 根据商品ID查询
|
| | | * |
| | | * @param goodsIdList
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> listByGoodsIds(List<Long> goodsIdList);
|
| | |
|
| | | /**
|
| | | * 过滤淘宝商品信息
|
| | | * |
| | | * @param goodsList
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> filterTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList);
|
| | |
|
| | | /**
|
| | | * 过滤淘宝商品信息
|
| | | * |
| | | * @param goods
|
| | | * @return
|
| | | */
|
| | | public TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods);
|
| | |
|
| | | /**
|
| | | * 根据主键查询
|
| | | * |
| | | * @param idList
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> listByIds(List<Long> idList);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.taobao.dataoke;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | |
|
| | | /**
|
| | | * 大淘客商品服务
|
| | | *
|
| | |
| | | *
|
| | | */
|
| | | public interface DaTaoKeGoodsService {
|
| | |
|
| | | public List<DaTaoKeDetail> getCurrentSalesRankGoodsList(Long cid);
|
| | |
|
| | | /**
|
| | | * 启动商品同步服务
|
| | | * 全天销量榜
|
| | | * |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public void startSyncGoods();
|
| | | public List<DaTaoKeDetail> getCurrentDaySalesRankGoodsList(Long cid);
|
| | |
|
| | | /**
|
| | | * 获取热推榜
|
| | | * |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> getCurrentHotSalesRankGoodsList();
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.poi.ss.formula.functions.T;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import redis.clients.jedis.Jedis;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void expire(String key,int seconds) {
|
| | | public void expire(String key, int seconds) {
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | try {
|
| | | jedis.expire(key, seconds);
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 保存对象
|
| | | * |
| | | * @param T
|
| | | * @param key
|
| | | * @param seconds
|
| | | */
|
| | | public void save(Class<?> clazz, String key, Integer seconds) {
|
| | | if (clazz == null)
|
| | | return;
|
| | | String value = new Gson().toJson(clazz);
|
| | | if (seconds != null)
|
| | | cacheCommonString(key, value, seconds);
|
| | | else
|
| | | cacheCommonString(key, value);
|
| | | }
|
| | |
|
| | | public void saveList(List<Class<?>> clazzList, String key, Integer seconds) {
|
| | | if (clazzList == null)
|
| | | return;
|
| | | String value = new Gson().toJson(clazzList);
|
| | | if (seconds != null)
|
| | | cacheCommonString(key, value, seconds);
|
| | | else
|
| | | cacheCommonString(key, value);
|
| | | }
|
| | |
|
| | | public Class<?> getObj(Class<?> clazz, String key) {
|
| | | String value = getCommonString(key);
|
| | | return new Gson().fromJson(value, clazz);
|
| | | }
|
| | |
|
| | | public List<T> getObjList(Class<T> clazz, String key) {
|
| | | List<T> list = new ArrayList<>();
|
| | | String value = getCommonString(key);
|
| | | JSONArray array = JSONArray.fromObject(value);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | list.add(new Gson().fromJson(array.optJSONObject(i).toString(), clazz));
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.cache;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | public class ObjectCacheUtil<T> {
|
| | |
|
| | | // public T getObj( String value) {
|
| | | // return new Gson().fromJson(value, Class<T>);
|
| | | // }
|
| | | //
|
| | | // public List<T> getObjList(String value) {
|
| | | // List<T> list = new ArrayList<>();
|
| | | // JSONArray array = JSONArray.fromObject(value);
|
| | | // for (int i = 0; i < array.size(); i++) {
|
| | | // list.add(new Gson().fromJson(array.optJSONObject(i).toString(), T));
|
| | | // }
|
| | | // return list;
|
| | | // }
|
| | |
|
| | | }
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单找回
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * -订单号
|
| | | * @param isSuccess-是否找回成功
|
| | | * @param payMoney
|
| | | * @param orderType
|
| | | * 1-淘宝订单 3-拼多多订单 4-京东订单
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOrderDetail createFoundOrder(Long uid, String orderId, boolean isSuccess, BigDecimal payMoney,
|
| | | int orderType, Date happendDate, String beiZhu) {
|
| | | if (orderId == null || uid == null)
|
| | | return null;
|
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setOrderId((orderType == 1 ? "【淘宝订单】" : "") + orderId);
|
| | | detail.setPayMoney(payMoney);
|
| | | detail.setRead(false);
|
| | | detail.setState(isSuccess ? 1 : 0);
|
| | | detail.setType(MsgTypeOrderTypeEnum.found);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setHappendDate(happendDate);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public static UserMsgVO create(MsgOrderDetail msg) {
|
| | |
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList));
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.found) {
|
| | | contentList.add(new ClientTextStyleVO("订单找回", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("共", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(msg.getGoodsCount() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("商品数量", COLOR_TITLE), contentList));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getType().getDesc(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单类型", COLOR_TITLE), contentList));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(TimeUtil.getGernalTime(msg.getHappendDate().getTime(),"yyyy.MM.dd HH:mm"), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("提交时间", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | if (msg.getState() == MsgOrderDetail.STATE_FK)
|
| | | contentList.add(new ClientTextStyleVO("已付款", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_JS)
|
| | | contentList.add(new ClientTextStyleVO("已收货", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_SX)
|
| | | contentList.add(new ClientTextStyleVO("未付款/已退款", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_WQ)
|
| | | contentList.add(new ClientTextStyleVO("已维权", COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getState() == 1 ? "订单找回成功" : "订单找回失败", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("找回状态", COLOR_TITLE), contentList));
|
| | |
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单状态", COLOR_TITLE), contentList));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getState() == 1 ? "¥" + msg.getPayMoney() : "无", COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("找回金额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(msg.getPayMoney()),
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("付款金额", COLOR_TITLE), contentList));
|
| | | } else {
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(msg.getHongBaoMoney()),
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("共", COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(msg.getGoodsCount() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("件商品", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("商品数量", COLOR_TITLE), contentList));
|
| | |
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.fanli)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利金额", COLOR_TITLE), contentList));
|
| | | else if (msg.getType() == MsgTypeOrderTypeEnum.share)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("分享奖金", COLOR_TITLE), contentList));
|
| | | else if (msg.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请奖金", COLOR_TITLE), contentList));
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getType().getDesc(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单类型", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | if (msg.getState() == MsgOrderDetail.STATE_FK)
|
| | | contentList.add(new ClientTextStyleVO("已付款", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_JS)
|
| | | contentList.add(new ClientTextStyleVO("已收货", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_SX)
|
| | | contentList.add(new ClientTextStyleVO("未付款/已退款", COLOR_HIGHLIGHT_CONTENT));
|
| | | else if (msg.getState() == MsgOrderDetail.STATE_WQ)
|
| | | contentList.add(new ClientTextStyleVO("已维权", COLOR_HIGHLIGHT_CONTENT));
|
| | |
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单状态", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(msg.getPayMoney()),
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("付款金额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(msg.getHongBaoMoney()),
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | |
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.fanli)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("返利金额", COLOR_TITLE), contentList));
|
| | | else if (msg.getType() == MsgTypeOrderTypeEnum.share)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("分享奖金", COLOR_TITLE), contentList));
|
| | | else if (msg.getType() == MsgTypeOrderTypeEnum.invite)
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请奖金", COLOR_TITLE), contentList));
|
| | | }
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("预估返利", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | |
|
| | | if (dto.getOrderFanLiMoney() != null) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(dto.getOrderFanLiMoney()),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单返利", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | |
|
| | | if (dto.getRewardMoney() != null) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + MoneyBigDecimalUtil.getWithNoZera(dto.getRewardMoney()),
|
| | |
| | | */
|
| | | public class DaTaoKeUtil {
|
| | |
|
| | | static final String[] commonEmojis = new String[] { "😀", // 笑嘻嘻
|
| | | "😁", // 笑嘻嘻的脸,含笑的眼睛
|
| | | "😃", // 开口笑脸
|
| | | "😄", // 开口笑脸和微笑的眼睛
|
| | | "😆", // 开口笑紧闭的眼睛
|
| | | "😉", // 眨眼表情
|
| | | "😊", // 面带微笑的眼睛
|
| | | "😋", // 品尝美味食物表情
|
| | | "😎", // 太阳镜笑脸
|
| | | "😍", // 面带心形眼睛
|
| | | "😘", // 飞吻表情
|
| | | "😗", // 亲吻表情
|
| | | "😙", // 含笑亲吻表情
|
| | | "😚", // 闭眼亲吻表情
|
| | | "☺", // 笑脸
|
| | | "😇", // 光环笑脸
|
| | | "😐", // 中性面
|
| | | "😏", // 傻笑
|
| | | "😮", // 张着嘴
|
| | | "😛", // 吐舌头
|
| | | "😜", // 吐舌头,眨眼眼
|
| | | "😝", // 闭眼吐舌头
|
| | | "👅", // 舌头
|
| | | "👄", // 口
|
| | | "👀", // 眼睛
|
| | | "❤", // 心
|
| | | "💓", // 跳动的心
|
| | | "💕", // 两颗心
|
| | | "💗", // 成长的心
|
| | | "💝", // 扎丝带的心形礼盒
|
| | | "💞", // 旋转心
|
| | | "💐", // 花束
|
| | | "🌸", // 樱花
|
| | | "🌹", // 玫瑰
|
| | | "🌺", // 槿
|
| | | "🌻", // 向日葵
|
| | | "🌼", // 开花
|
| | | "🌷", // 郁金香
|
| | | "🍇", // 葡萄
|
| | | "🍈", // 瓜
|
| | | "🍉", // 西瓜
|
| | | "🍊", // 柑橘
|
| | | "🍋", // 柠檬
|
| | | "🍌", // 香蕉
|
| | | "🍍", // 菠萝
|
| | | "🍎", // 红苹果
|
| | | "🍏", // 青苹果
|
| | | "🍐", // 梨
|
| | | "🍑", // 桃子
|
| | | "🍒", // 樱桃
|
| | | "🍓", // 草莓
|
| | | "🌿", // 枝叶
|
| | | "🍀", // 四叶草
|
| | | "🍁", // 枫叶
|
| | | "🍂", // 落叶
|
| | | "🍃", // 叶子在风中飘落
|
| | | "☘", // 三叶草(酢浆草)
|
| | | "☀", // 太阳光芒四射
|
| | | "🌞", // 太阳人脸
|
| | | "⭐", // 星星,五角星
|
| | | "🌟",// 发光的星星
|
| | | };
|
| | |
|
| | | static final String[] timeEmojis = new String[] { |
| | | "🕛",// 十二点
|
| | | "🕧",// 十二点半
|
| | | "🕐",// 一点钟
|
| | | "🕜",// 一点半
|
| | | "🕑",// 两点
|
| | | "🕝",// 两点半
|
| | | "🕒",// 三点钟
|
| | | "🕞",// 三点半
|
| | | "🕓",// 四点钟
|
| | | "🕟",// 四点半
|
| | | "🕔",// 五时
|
| | | "🕠",// 五点半
|
| | | "🕕",// 六点
|
| | | "🕡",// 六点半
|
| | | "🕖",// 七点
|
| | | "🕢",// 七点半
|
| | | "🕗",// 八点
|
| | | "🕣",// 八点半
|
| | | "🕘",// 九点钟
|
| | | "🕤",// 九点半
|
| | | "🕙",// 的十点
|
| | | "🕥",// 十点半
|
| | | "🕚",// 十一点
|
| | | "🕦",// 十一点半
|
| | | };
|
| | |
|
| | | public static List<GoodsClass> goodsClasses;
|
| | | static {
|
| | | goodsClasses = new ArrayList<>();
|
| | |
| | | }
|
| | |
|
| | | public static String getDesc(DaTaoKeDetail detail) {
|
| | |
|
| | | // 标题+券后价+包邮+描述
|
| | | String desc = "😛" + detail.getdTitle() + "😛";
|
| | | desc += "\n";
|
| | | desc += "😛" + String.format("券后【%s元】包邮秒杀 ", MoneyBigDecimalUtil.getWithNoZera(detail.getPrice()).toString())
|
| | | desc += "😛" + String.format("券后💰【%s元】包邮秒杀 ", MoneyBigDecimalUtil.getWithNoZera(detail.getPrice()).toString())
|
| | | + "😛";
|
| | | desc += "\n";
|
| | | desc += detail.getIntroduce();
|