4个文件已删除
2 文件已重命名
1个文件已修改
4个文件已添加
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy; |
| | | |
| | | public interface InviteOrderSubsidyMapper extends BaseMapper<InviteOrderSubsidy> { |
| | | |
| | | /** |
| | | * 查询用户补贴 |
| | | * @param uid |
| | | * @param orderNo |
| | | * @param Type |
| | | * @return |
| | | */ |
| | | InviteOrderSubsidy getByOrderNoAndType(@Param("uid")Long uid, @Param("orderNo")String orderNo,@Param("type") Integer type); |
| | | } |
File was renamed from fanli/src/main/java/com/yeshi/fanli/entity/order/OrderSubsidy.java |
| | |
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 订单补贴
|
| | | * 邀请订单补贴
|
| | | *
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_order_subsidy")
|
| | | public class OrderSubsidy {
|
| | | @Table("yeshi_ec_invite_order_subsidy")
|
| | | public class InviteOrderSubsidy {
|
| | | // 未知
|
| | | public static final int STATE_UNKNOWN = 0;
|
| | | // 可补贴
|
| | |
| | | // 已补贴成功
|
| | | public static final int STATE_SUBSIDIZED = 3;
|
| | |
|
| | | public OrderSubsidy(Long id) {
|
| | | public InviteOrderSubsidy(Long id) {
|
| | | super();
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public OrderSubsidy() {
|
| | | public InviteOrderSubsidy() {
|
| | | }
|
| | |
|
| | | @Column(name = "os_id")
|
New file |
| | |
| | | package com.yeshi.fanli.exception.order;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class InviteOrderSubsidyException extends BaseException {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public InviteOrderSubsidyException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public InviteOrderSubsidyException() {
|
| | | super();
|
| | | }
|
| | | }
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderSubsidyMapper.xml |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.OrderSubsidyMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.OrderSubsidy"> |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.InviteOrderSubsidyMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.InviteOrderSubsidy"> |
| | | <id column="os_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="os_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="os_money" property="money" jdbcType="DECIMAL"/> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT} |
| | | <include refid="Base_Column_List"/>from yeshi_ec_invite_order_subsidy where os_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_invite_order_subsidy where os_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_invite_order_subsidy (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_invite_order_subsidy |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">os_id,</if> |
| | | <if test="uid != null">os_uid,</if> |
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy">update yeshi_ec_order_subsidy set os_uid = #{uid,jdbcType=BIGINT},os_money = #{money,jdbcType=DECIMAL},os_order_no = #{orderNo,jdbcType=VARCHAR},os_source_type = #{sourceType,jdbcType=INTEGER},os_state = #{state,jdbcType=INTEGER},os_create_time = #{createTime,jdbcType=TIMESTAMP},os_update_time = #{updateTime,jdbcType=TIMESTAMP} where os_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy">update yeshi_ec_order_subsidy |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy">update yeshi_ec_invite_order_subsidy set os_uid = #{uid,jdbcType=BIGINT},os_money = #{money,jdbcType=DECIMAL},os_order_no = #{orderNo,jdbcType=VARCHAR},os_source_type = #{sourceType,jdbcType=INTEGER},os_state = #{state,jdbcType=INTEGER},os_create_time = #{createTime,jdbcType=TIMESTAMP},os_update_time = #{updateTime,jdbcType=TIMESTAMP} where os_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy">update yeshi_ec_invite_order_subsidy |
| | | <set> |
| | | <if test="uid != null">os_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">os_money=#{money,jdbcType=DECIMAL},</if> |
| | |
| | | |
| | | |
| | | <select id="getByOrderNoAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_order_subsidy |
| | | SELECT * FROM yeshi_ec_invite_order_subsidy |
| | | WHERE os_uid = #{uid} AND os_order_no = #{orderNo} AND os_source_type = #{type} |
| | | LIMIT 1 |
| | | </select> |
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.OrderSubsidy;
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.OrderSubsidyService;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private OrderSubsidyService orderSubsidyService;
|
| | | private InviteOrderSubsidyService inviteOrderSubsidyService;
|
| | |
|
| | |
|
| | | // 奖励订单图片
|
| | |
| | |
|
| | | // 版本区分:2-0-2
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | OrderSubsidy orderSubsidy = orderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType2);
|
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType2);
|
| | | if (orderSubsidy != null) {
|
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
|
| | | if (orderSubsidy.getState() == OrderSubsidy.STATE_SUBSIDIZED) {
|
| | | if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) {
|
| | | subsidyInfo.setColor("#E5005C");
|
| | | subsidyInfo.setContent("已补贴¥" + orderSubsidy.getMoney());
|
| | | } else {
|
| | |
| | |
|
| | | // 版本区分:2-0-2
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | OrderSubsidy orderSubsidy = orderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType);
|
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType);
|
| | | if (orderSubsidy != null) {
|
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
|
| | | if (orderSubsidy.getState() == OrderSubsidy.STATE_SUBSIDIZED) {
|
| | | if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) {
|
| | | subsidyInfo.setColor("#E5005C");
|
| | | subsidyInfo.setContent("已补贴¥" + orderSubsidy.getMoney());
|
| | | } else {
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.InviteOrderSubsidyMapper;
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.exception.order.InviteOrderSubsidyException;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class InviteOrderSubsidyServiceImpl implements InviteOrderSubsidyService {
|
| | |
|
| | | @Resource
|
| | | private InviteOrderSubsidyMapper inviteOrderSubsidyMapper;
|
| | |
|
| | | @Override
|
| | | public InviteOrderSubsidy getByOrderNoAndType(Long uid, String orderNo, Integer type) {
|
| | | return inviteOrderSubsidyMapper.getByOrderNoAndType(uid, orderNo, type);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void addOrderSubsidy(InviteOrderSubsidy orderSubsidy) throws InviteOrderSubsidyException {
|
| | | if (orderSubsidy.getMoney() == null || StringUtil.isNullOrEmpty(orderSubsidy.getOrderNo())
|
| | | || orderSubsidy.getSourceType() == null || orderSubsidy.getUid() == null)
|
| | | throw new InviteOrderSubsidyException(1, "数据不完整");
|
| | | InviteOrderSubsidy old = getByOrderNoAndType(orderSubsidy.getUid(), orderSubsidy.getOrderNo(),
|
| | | orderSubsidy.getSourceType());
|
| | | if (old != null) {// 修改
|
| | | // 修改状态
|
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(old.getId());
|
| | | update.setMoney(orderSubsidy.getMoney());
|
| | | update.setState(orderSubsidy.getState());
|
| | | update.setUpdateTime(new Date());
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | | } else {// 添加
|
| | | if (orderSubsidy.getCreateTime() == null)
|
| | | orderSubsidy.setCreateTime(new Date());
|
| | | inviteOrderSubsidyMapper.insertSelective(orderSubsidy);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.exception.order.InviteOrderSubsidyException;
|
| | |
|
| | | public interface InviteOrderSubsidyService {
|
| | |
|
| | | /**
|
| | | * 查询补贴
|
| | | * |
| | | * @param uid
|
| | | * @param orderNo
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public InviteOrderSubsidy getByOrderNoAndType(Long uid, String orderNo, Integer type);
|
| | |
|
| | | /**
|
| | | * 添加订单补贴
|
| | | * |
| | | * @param orderSubsidy
|
| | | * @throws OrderSubsidyException
|
| | | */
|
| | | public void addOrderSubsidy(InviteOrderSubsidy orderSubsidy) throws InviteOrderSubsidyException;
|
| | |
|
| | | }
|