| | |
| | | * @param uid
|
| | | */
|
| | | void setMsgReadByUid(Long uid);
|
| | | |
| | | /**
|
| | | * 根据唯一索引查询
|
| | | * |
| | | * @param uniqueKey
|
| | | * @return
|
| | | */
|
| | | MsgOrderDetail getByUniqueKey(@Param("uniqueKey") String uniqueKey);
|
| | |
|
| | | } |
| | |
| | | foundSucceed("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | foundFail("订单找回", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | orderStatistics("订单统计", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | businessRunning("订单失效", "http://img.flqapp.com/resource/msg/icon_msg_order.png"),
|
| | | elme("饿了么订单", "http://img.flqapp.com/resource/msg/icon_msg_order.png");
|
| | |
|
| | | private final String desc;
|
| | |
| | | private Date createTime;
|
| | | @Column(name = "mo_update_time")
|
| | | private Date updateTime;
|
| | | // 唯一索引
|
| | | @Column(name = "mo_unique_key")
|
| | | private String uniquekey;
|
| | |
|
| | | private String extraInfo;// 新版消息内容
|
| | |
|
| | |
| | | public void setExtraInfo(String extraInfo) {
|
| | | this.extraInfo = extraInfo;
|
| | | }
|
| | | |
| | |
|
| | | public String getUniquekey() {
|
| | | return uniquekey;
|
| | | }
|
| | |
|
| | | public void setUniquekey(String uniquekey) {
|
| | | this.uniquekey = uniquekey;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | <result column="mo_happen_date" property="happendDate"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="mo_order_type" property="orderType" jdbcType="INTEGER" />
|
| | | <result column="mo_unique_key" property="uniquekey" jdbcType="VARCHAR"/>
|
| | | <result column="extraInfo" property="extraInfo" jdbcType="VARCHAR"/>
|
| | | <association property="user" column="mo_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | |
| | | </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,mo_happen_date,mo_order_type
|
| | | <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,mo_order_type,mo_unique_key
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
| | | parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_order where mo_uid
|
| | | = #{uid,jdbcType=BIGINT}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="getByUniqueKey" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_msg_order
|
| | | where unique_key = #{uniqueKey}
|
| | | </select>
|
| | | |
| | | |
| | | <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_happen_date,mo_order_type)
|
| | | (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,mo_order_type,mo_unique_key)
|
| | | 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},#{happendDate,jdbcType=TIMESTAMP},#{orderType,jdbcType=INTEGER})
|
| | | (#{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},#{orderType,jdbcType=INTEGER},#{uniquekey,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | |
| | | <if test="updateTime != null">mo_update_time,</if>
|
| | | <if test="happendDate != null">mo_happen_date,</if>
|
| | | <if test="orderType != null">mo_order_type,</if>
|
| | | <if test="uniquekey != null">mo_unique_key,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="happendDate != null">#{happendDate,jdbcType=TIMESTAMP},</if>
|
| | | <if test="orderType != null">#{orderType,jdbcType=INTEGER},</if>
|
| | | <if test="uniquekey != null">#{uniquekey,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOrderDetail">update
|
| | |
| | | #{read,jdbcType=BOOLEAN},mo_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},mo_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP},mo_happen_date=#{happendDate,jdbcType=TIMESTAMP}
|
| | | ,mo_order_type =#{orderType,jdbcType=INTEGER} where mo_id =
|
| | | #{id,jdbcType=BIGINT}
|
| | | ,mo_order_type =#{orderType,jdbcType=INTEGER},mo_unique_key = #{uniquekey,jdbcType=VARCHAR} |
| | | 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="updateTime != null">mo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="happendDate != null">mo_happen_date=#{happendDate,jdbcType=TIMESTAMP},</if>
|
| | | <if test="orderType !=null">mo_order_type =#{orderType,jdbcType=INTEGER},</if>
|
| | | <if test="uniquekey != null">mo_unique_key=#{uniquekey,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where mo_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | import com.yeshi.fanli.service.inter.order.OrderMoneySettleService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.order.jd.JDOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.pdd.PDDOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private UserOrderMsgNotificationService userOrderMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | |
| | | update.setUpdateTime(new Date());
|
| | | hongBaoV2Service.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | // TODO 商家关店跑路需要赠送金币
|
| | | // userSystemCouponService.rewardCouponWin(uid,
|
| | | // UserSystemCoupon.SOURCE_SYSTEM_PUSH, 1, true, new BigDecimal("31"));
|
| | | |
| | | |
| | | if (hongBao.getType() == HongBaoV2.TYPE_ZIGOU || hongBao.getType() == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | | userOrderMsgNotificationService.orderInvalidToBusinessRunning(uid, orderId, sourceType, hongBao.getType());
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgOrderDetailMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | |
| | | if (detail.getOrderId() == null || detail.getType() == null || detail.getUser() == null
|
| | | || StringUtil.isNullOrEmpty(detail.getExtraInfo()))
|
| | | throw new MsgOrderDetailException(2, "消息不完整");
|
| | | |
| | | if (detail.getType() == MsgTypeOrderTypeEnum.businessRunning) {
|
| | | MsgOrderDetail msgOrderDetail = msgOrderDetailMapper.getByUniqueKey(detail.getUniquekey());
|
| | | if (msgOrderDetail != null) {
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | // 锁住订单号
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | try {
|
| | |
| | | return msgOrderDetailMapper.listByOrderId(orderId);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void orderInvalidToBusinessRunning(Long uid, String orderId, int orderSource, int type) {
|
| | | try {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.orderInvalidToBusinessRunning(uid, orderId, orderSource, type);
|
| | | // 消息
|
| | | msgOrderDetailService.addMsgOrderDetail(detail, true);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public void orderFoundFail(Long uid, String orderId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 商品跑路订单失效消息
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param orderSource
|
| | | * @param type
|
| | | */
|
| | | public void orderInvalidToBusinessRunning(Long uid, String orderId, int orderSource, int type);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 商家跑路
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param orderSource
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public static MsgOrderDetail orderInvalidToBusinessRunning(Long uid, String orderId, int orderSource, int type) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderId))
|
| | | return null;
|
| | | |
| | | String fanliName = "";
|
| | | String sourceName = Constant.getSourceName(orderSource);
|
| | | if (Constant.TYPE_REBATE == type) {
|
| | | fanliName = "返利订单";
|
| | | } else {
|
| | | fanliName = "分享订单";
|
| | | }
|
| | | |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单状态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("商家店铺已被"+sourceName+"封禁,商品佣金已被冻结,无法结算佣金,订单已失效", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单详情", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(fanliName, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("订单号", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | |
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setOrderId(orderId);
|
| | | detail.setOrderType(orderSource);
|
| | | detail.setType(MsgTypeOrderTypeEnum.businessRunning);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setRead(false);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUniquekey(StringUtil.Md5(uid+"&"+ orderId + "&" +orderSource + "&" + MsgTypeOrderTypeEnum.businessRunning.name()));
|
| | | detail.setExtraInfo(new Gson().toJson(listMsg));
|
| | | return detail;
|
| | | }
|
| | | }
|