Commit b8eb0102 authored by shiyu's avatar shiyu

预支付下单新增地址

parent 968c2866
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
public interface DistributorProfitDao {
/**
* 插入新记录
*
* @param distributorProfit
* @return
*/
int insert(DistributorProfit distributorProfit);
/**
* 更新记录
*
* @param distributorProfit
* @return
*/
int update(DistributorProfit distributorProfit);
}
package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/01/30
* @date 2024/01/31
*/
@Data
public class DistributionOrder implements Entity {
private Integer id;
/**
......@@ -66,14 +67,24 @@ public class DistributionOrder implements Entity {
private Long amount;
/**
* 买家收货地址id
* 收件人收货地址id
*/
private Long addressId;
/**
* 买家收货地址
* 收件人名称
*/
private String receiverName;
/**
* 收件人电话
*/
private String receiverPhone;
/**
* 收件人收货地址
*/
private String address;
private String receiverAddress;
/**
* 快递公司编码
......@@ -140,7 +151,9 @@ public class DistributionOrder implements Entity {
sb.append(", sellerId=").append(sellerId);
sb.append(", amount=").append(amount);
sb.append(", addressId=").append(addressId);
sb.append(", address=").append(address);
sb.append(", receiverName=").append(receiverName);
sb.append(", receiverPhone=").append(receiverPhone);
sb.append(", receiverAddress=").append(receiverAddress);
sb.append(", logisticsCode=").append(logisticsCode);
sb.append(", waybill=").append(waybill);
sb.append(", createTime=").append(createTime);
......@@ -179,7 +192,9 @@ public class DistributionOrder implements Entity {
&& (this.getSellerId() == null ? other.getSellerId() == null : this.getSellerId().equals(other.getSellerId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getAddressId() == null ? other.getAddressId() == null : this.getAddressId().equals(other.getAddressId()))
&& (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName()))
&& (this.getReceiverPhone() == null ? other.getReceiverPhone() == null : this.getReceiverPhone().equals(other.getReceiverPhone()))
&& (this.getReceiverAddress() == null ? other.getReceiverAddress() == null : this.getReceiverAddress().equals(other.getReceiverAddress()))
&& (this.getLogisticsCode() == null ? other.getLogisticsCode() == null : this.getLogisticsCode().equals(other.getLogisticsCode()))
&& (this.getWaybill() == null ? other.getWaybill() == null : this.getWaybill().equals(other.getWaybill()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
......@@ -207,7 +222,9 @@ public class DistributionOrder implements Entity {
result = prime * result + ((getSellerId() == null) ? 0 : getSellerId().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getAddressId() == null) ? 0 : getAddressId().hashCode());
result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode());
result = prime * result + ((getReceiverPhone() == null) ? 0 : getReceiverPhone().hashCode());
result = prime * result + ((getReceiverAddress() == null) ? 0 : getReceiverAddress().hashCode());
result = prime * result + ((getLogisticsCode() == null) ? 0 : getLogisticsCode().hashCode());
result = prime * result + ((getWaybill() == null) ? 0 : getWaybill().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
......@@ -240,7 +257,9 @@ public class DistributionOrder implements Entity {
sellerId("seller_id", "sellerId", "BIGINT", false),
amount("amount", "amount", "BIGINT", false),
addressId("address_id", "addressId", "BIGINT", false),
address("address", "address", "VARCHAR", false),
receiverName("receiver_name", "receiverName", "VARCHAR", false),
receiverPhone("receiver_phone", "receiverPhone", "VARCHAR", false),
receiverAddress("receiver_address", "receiverAddress", "VARCHAR", false),
logisticsCode("logistics_code", "logisticsCode", "VARCHAR", false),
waybill("waybill", "waybill", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
......
......@@ -60,14 +60,24 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
private Long sellerId;
/**
* 买家收货地址
* 收件人收货地址
*/
private Long addressId;
/**
* 买家收货地址
* 收件人名称
*/
private String address;
private String receiverName;
/**
* 收件人电话
*/
private String receiverPhone;
/**
* 收件人收货地址
*/
private String receiverAddress;
/**
* 快递公司编码
......
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.DistributorProfitDao;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.mapper.distribution.DistributorProfitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class DistributorProfitDaoImpl implements DistributorProfitDao {
@Autowired
DistributorProfitMapper distributorProfitMapper;
@Override
public int insert(DistributorProfit distributorProfit) {
return 0;
}
@Override
public int update(DistributorProfit distributorProfit) {
return 0;
}
}
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.DistributorProfitExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface DistributorProfitMapper {
long countByExample(DistributorProfitExample example);
int deleteByExample(DistributorProfitExample example);
int deleteByPrimaryKey(Long id);
int insert(DistributorProfit record);
int insertSelective(DistributorProfit record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DistributorProfit selectOneByExample(DistributorProfitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DistributorProfit selectOneByExampleSelective(@Param("example") DistributorProfitExample example, @Param("selective") DistributorProfit.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<DistributorProfit> selectByExampleSelective(@Param("example") DistributorProfitExample example, @Param("selective") DistributorProfit.Column ... selective);
List<DistributorProfit> selectByExample(DistributorProfitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DistributorProfit selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") DistributorProfit.Column ... selective);
DistributorProfit selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") DistributorProfit record, @Param("example") DistributorProfitExample example);
int updateByExample(@Param("record") DistributorProfit record, @Param("example") DistributorProfitExample example);
int updateByPrimaryKeySelective(DistributorProfit record);
int updateByPrimaryKey(DistributorProfit record);
}
\ No newline at end of file
......@@ -14,7 +14,9 @@
<result column="seller_id" jdbcType="BIGINT" property="sellerId" />
<result column="amount" jdbcType="BIGINT" property="amount" />
<result column="address_id" jdbcType="BIGINT" property="addressId" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="receiver_name" jdbcType="VARCHAR" property="receiverName" />
<result column="receiver_phone" jdbcType="VARCHAR" property="receiverPhone" />
<result column="receiver_address" jdbcType="VARCHAR" property="receiverAddress" />
<result column="logistics_code" jdbcType="VARCHAR" property="logisticsCode" />
<result column="waybill" jdbcType="VARCHAR" property="waybill" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -85,9 +87,9 @@
</sql>
<sql id="Base_Column_List">
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, address, logistics_code, waybill,
create_time, pay_time, delivery_time, finish_time, update_time, share_record_id,
`state`
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.DistributionOrderExample" resultMap="BaseResultMap">
select
......@@ -123,9 +125,9 @@
</when>
<otherwise>
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, address, logistics_code,
waybill, create_time, pay_time, delivery_time, finish_time, update_time, share_record_id,
`state`
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`
</otherwise>
</choose>
from distribution_order
......@@ -157,9 +159,9 @@
</when>
<otherwise>
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, address, logistics_code,
waybill, create_time, pay_time, delivery_time, finish_time, update_time, share_record_id,
`state`
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`
</otherwise>
</choose>
from distribution_order
......@@ -182,19 +184,19 @@
insert into distribution_order (distribution_order_id, prepay_id, transaction_id,
item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id,
amount, address_id, address,
logistics_code, waybill, create_time,
pay_time, delivery_time, finish_time,
update_time, share_record_id, `state`
)
amount, address_id, receiver_name,
receiver_phone, receiver_address, logistics_code,
waybill, create_time, pay_time,
delivery_time, finish_time, update_time,
share_record_id, `state`)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{prepayId,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR},
#{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER}, #{buyerId,jdbcType=BIGINT},
#{buyerOpenid,jdbcType=VARCHAR}, #{shopId,jdbcType=BIGINT}, #{sellerId,jdbcType=BIGINT},
#{amount,jdbcType=BIGINT}, #{addressId,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{logisticsCode,jdbcType=VARCHAR}, #{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{payTime,jdbcType=TIMESTAMP}, #{deliveryTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}
)
#{amount,jdbcType=BIGINT}, #{addressId,jdbcType=BIGINT}, #{receiverName,jdbcType=VARCHAR},
#{receiverPhone,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR}, #{logisticsCode,jdbcType=VARCHAR},
#{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
#{deliveryTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.DistributionOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
......@@ -235,8 +237,14 @@
<if test="addressId != null">
address_id,
</if>
<if test="address != null">
address,
<if test="receiverName != null">
receiver_name,
</if>
<if test="receiverPhone != null">
receiver_phone,
</if>
<if test="receiverAddress != null">
receiver_address,
</if>
<if test="logisticsCode != null">
logistics_code,
......@@ -300,8 +308,14 @@
<if test="addressId != null">
#{addressId,jdbcType=BIGINT},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
<if test="receiverName != null">
#{receiverName,jdbcType=VARCHAR},
</if>
<if test="receiverPhone != null">
#{receiverPhone,jdbcType=VARCHAR},
</if>
<if test="receiverAddress != null">
#{receiverAddress,jdbcType=VARCHAR},
</if>
<if test="logisticsCode != null">
#{logisticsCode,jdbcType=VARCHAR},
......@@ -377,8 +391,14 @@
<if test="record.addressId != null">
address_id = #{record.addressId,jdbcType=BIGINT},
</if>
<if test="record.address != null">
address = #{record.address,jdbcType=VARCHAR},
<if test="record.receiverName != null">
receiver_name = #{record.receiverName,jdbcType=VARCHAR},
</if>
<if test="record.receiverPhone != null">
receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
</if>
<if test="record.receiverAddress != null">
receiver_address = #{record.receiverAddress,jdbcType=VARCHAR},
</if>
<if test="record.logisticsCode != null">
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
......@@ -426,7 +446,9 @@
seller_id = #{record.sellerId,jdbcType=BIGINT},
amount = #{record.amount,jdbcType=BIGINT},
address_id = #{record.addressId,jdbcType=BIGINT},
address = #{record.address,jdbcType=VARCHAR},
receiver_name = #{record.receiverName,jdbcType=VARCHAR},
receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
receiver_address = #{record.receiverAddress,jdbcType=VARCHAR},
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
waybill = #{record.waybill,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -476,8 +498,14 @@
<if test="addressId != null">
address_id = #{addressId,jdbcType=BIGINT},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
<if test="receiverName != null">
receiver_name = #{receiverName,jdbcType=VARCHAR},
</if>
<if test="receiverPhone != null">
receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
</if>
<if test="receiverAddress != null">
receiver_address = #{receiverAddress,jdbcType=VARCHAR},
</if>
<if test="logisticsCode != null">
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
......@@ -522,7 +550,9 @@
seller_id = #{sellerId,jdbcType=BIGINT},
amount = #{amount,jdbcType=BIGINT},
address_id = #{addressId,jdbcType=BIGINT},
address = #{address,jdbcType=VARCHAR},
receiver_name = #{receiverName,jdbcType=VARCHAR},
receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
receiver_address = #{receiverAddress,jdbcType=VARCHAR},
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
waybill = #{waybill,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -568,9 +598,9 @@
</when>
<otherwise>
id, distribution_order_id, prepay_id, transaction_id, item_id, item_num, buyer_id,
buyer_openid, shop_id, seller_id, amount, address_id, address, logistics_code,
waybill, create_time, pay_time, delivery_time, finish_time, update_time, share_record_id,
`state`
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
finish_time, update_time, share_record_id, `state`
</otherwise>
</choose>
from distribution_order
......
......@@ -39,7 +39,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
// 放行路径
.excludePathPatterns("/*.html", "/**/*.html", "/**/*.css", "/**/*.js"
, "/wx/user/loginByWx", "/wx/user/finishLogin", "/wx/user/loginByMobile", "/wx/user/loginRegCaptcha", "/wx/user/updateRegCaptcha", "/wx/user/login", "/wx/user/fillCode",
"/officialAccountCallback/**",
"/officialAccountCallback/**","/wxPayCallback/**",
"/imCallback/**", "/wx/category/**",
"/wx/consignSale/**", "/wx/item/**",
"/wx/returnOrder/**", "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**"
......
......@@ -86,7 +86,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributionOrder.setSellerId(distributorShareRecord.getDistributorId());
distributionOrder.setAmount(distributorShareRecord.getPrice() * dto.getItemNum());
distributionOrder.setAddressId(dto.getAddressId());
distributionOrder.setAddress(dto.getAddress());
distributionOrder.setReceiverAddress(dto.getReceiverAddress());
distributionOrder.setReceiverName(dto.getReceiverName());
distributionOrder.setReceiverPhone(dto.getReceiverPhone());
distributionOrder.setCreateTime(new Date());
distributionOrder.setUpdateTime(new Date());
distributionOrder.setState(DistributionEnum.DistributionOrderStateEnum.PRE_PAY.getCode());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment