Commit 75ce0f2b authored by shiyu's avatar shiyu

新增授权藏家直接发货的功能,藏家可以直接看到用户的收货信息,依然有中转单,但是中转单的地址直接为用户收货地址,不再是平台的收货地址

parent a6328afc
......@@ -11,7 +11,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/06/18
* @date 2024/07/22
*/
@Data
public class CollectorWhiteList implements Entity {
......@@ -37,6 +37,11 @@ public class CollectorWhiteList implements Entity {
*/
private Boolean isValid;
/**
* 直接发货权限1可以0不可以
*/
private Integer deliveryAuth;
private static final long serialVersionUID = 1L;
@Override
......@@ -50,6 +55,7 @@ public class CollectorWhiteList implements Entity {
sb.append(", channelCostRebate=").append(channelCostRebate);
sb.append(", createTime=").append(createTime);
sb.append(", isValid=").append(isValid);
sb.append(", deliveryAuth=").append(deliveryAuth);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......@@ -71,7 +77,8 @@ public class CollectorWhiteList implements Entity {
&& (this.getCollectorId() == null ? other.getCollectorId() == null : this.getCollectorId().equals(other.getCollectorId()))
&& (this.getChannelCostRebate() == null ? other.getChannelCostRebate() == null : this.getChannelCostRebate().equals(other.getChannelCostRebate()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()));
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()))
&& (this.getDeliveryAuth() == null ? other.getDeliveryAuth() == null : this.getDeliveryAuth().equals(other.getDeliveryAuth()));
}
@Override
......@@ -83,6 +90,7 @@ public class CollectorWhiteList implements Entity {
result = prime * result + ((getChannelCostRebate() == null) ? 0 : getChannelCostRebate().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
result = prime * result + ((getDeliveryAuth() == null) ? 0 : getDeliveryAuth().hashCode());
return result;
}
......@@ -98,7 +106,8 @@ public class CollectorWhiteList implements Entity {
collectorId("collector_id", "collectorId", "BIGINT", false),
channelCostRebate("channel_cost_rebate", "channelCostRebate", "DECIMAL", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
isValid("is_valid", "isValid", "BIT", false);
isValid("is_valid", "isValid", "BIT", false),
deliveryAuth("delivery_auth", "deliveryAuth", "INTEGER", false);
/**
* This field was generated by MyBatis Generator.
......
......@@ -808,6 +808,138 @@ public class CollectorWhiteListExample {
addCriterion("is_valid not between", value1, value2, "isValid");
return (Criteria) this;
}
public Criteria andDeliveryAuthIsNull() {
addCriterion("delivery_auth is null");
return (Criteria) this;
}
public Criteria andDeliveryAuthIsNotNull() {
addCriterion("delivery_auth is not null");
return (Criteria) this;
}
public Criteria andDeliveryAuthEqualTo(Integer value) {
addCriterion("delivery_auth =", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthNotEqualTo(Integer value) {
addCriterion("delivery_auth <>", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthNotEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthGreaterThan(Integer value) {
addCriterion("delivery_auth >", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthGreaterThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthGreaterThanOrEqualTo(Integer value) {
addCriterion("delivery_auth >=", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthGreaterThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthLessThan(Integer value) {
addCriterion("delivery_auth <", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthLessThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthLessThanOrEqualTo(Integer value) {
addCriterion("delivery_auth <=", value, "deliveryAuth");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeliveryAuthLessThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("delivery_auth <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeliveryAuthIn(List<Integer> values) {
addCriterion("delivery_auth in", values, "deliveryAuth");
return (Criteria) this;
}
public Criteria andDeliveryAuthNotIn(List<Integer> values) {
addCriterion("delivery_auth not in", values, "deliveryAuth");
return (Criteria) this;
}
public Criteria andDeliveryAuthBetween(Integer value1, Integer value2) {
addCriterion("delivery_auth between", value1, value2, "deliveryAuth");
return (Criteria) this;
}
public Criteria andDeliveryAuthNotBetween(Integer value1, Integer value2) {
addCriterion("delivery_auth not between", value1, value2, "deliveryAuth");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -7,6 +7,7 @@
<result column="channel_cost_rebate" jdbcType="DECIMAL" property="channelCostRebate" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="is_valid" jdbcType="BIT" property="isValid" />
<result column="delivery_auth" jdbcType="INTEGER" property="deliveryAuth" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -67,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, collector_id, channel_cost_rebate, create_time, is_valid
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap">
select
......@@ -102,7 +103,7 @@
</foreach>
</when>
<otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth
</otherwise>
</choose>
from collector_white_list
......@@ -133,7 +134,7 @@
</foreach>
</when>
<otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth
</otherwise>
</choose>
from collector_white_list
......@@ -154,9 +155,9 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into collector_white_list (collector_id, channel_cost_rebate, create_time,
is_valid)
is_valid, delivery_auth)
values (#{collectorId,jdbcType=BIGINT}, #{channelCostRebate,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
#{isValid,jdbcType=BIT})
#{isValid,jdbcType=BIT}, #{deliveryAuth,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
......@@ -176,6 +177,9 @@
<if test="isValid != null">
is_valid,
</if>
<if test="deliveryAuth != null">
delivery_auth,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="collectorId != null">
......@@ -190,6 +194,9 @@
<if test="isValid != null">
#{isValid,jdbcType=BIT},
</if>
<if test="deliveryAuth != null">
#{deliveryAuth,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultType="java.lang.Long">
......@@ -216,6 +223,9 @@
<if test="record.isValid != null">
is_valid = #{record.isValid,jdbcType=BIT},
</if>
<if test="record.deliveryAuth != null">
delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -227,7 +237,8 @@
collector_id = #{record.collectorId,jdbcType=BIGINT},
channel_cost_rebate = #{record.channelCostRebate,jdbcType=DECIMAL},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
is_valid = #{record.isValid,jdbcType=BIT}
is_valid = #{record.isValid,jdbcType=BIT},
delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -247,6 +258,9 @@
<if test="isValid != null">
is_valid = #{isValid,jdbcType=BIT},
</if>
<if test="deliveryAuth != null">
delivery_auth = #{deliveryAuth,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -255,7 +269,8 @@
set collector_id = #{collectorId,jdbcType=BIGINT},
channel_cost_rebate = #{channelCostRebate,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP},
is_valid = #{isValid,jdbcType=BIT}
is_valid = #{isValid,jdbcType=BIT},
delivery_auth = #{deliveryAuth,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap">
......@@ -291,7 +306,7 @@
</foreach>
</when>
<otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth
</otherwise>
</choose>
from collector_white_list
......
......@@ -1070,7 +1070,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributionOrderDetailVo.setIntroduceRebate(PriceUtil.convertPriceFromStr(String.valueOf(rebate)).toString());
distributionOrderDetailVo.setProfit(PriceUtil.convertPriceFenToYuan(distributorProfit.getProfit()));
}
//查询藏家是否具有直接发货给买家的权限
CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(distributionOrder.getSellerId());
if (collectorWhiteList != null && 1 == collectorWhiteList.getDeliveryAuth()) {
String addressInfo = distributionOrder.getReceiverName() + "," + distributionOrder.getReceiverPhone() + "," + distributionOrder.getReceiverAddress();
distributionOrderDetailVo.setChannelReceiveAddress(addressInfo);
} else {
distributionOrderDetailVo.setChannelReceiveAddress(CommConsts.SYSTEM_DEFAULT_ADDRESS);
}
//查询对应鉴定单状态
IdentifyOrder identifyOrder = identifyOrderDao.findByDistributionOrderId(dto.getDistributionOrderId());
if (identifyOrder != null) {
......
......@@ -25,8 +25,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
......
......@@ -5,8 +5,10 @@ import com.wwdz.ch.core.consts.CommonEnum;
import com.wwdz.ch.core.entity.LogisticsInfo;
import com.wwdz.ch.core.entity.LogisticsRequestDto;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import com.wwdz.ch.db.dao.distribution.IdentifyOrderDao;
import com.wwdz.ch.db.domain.CollectorWhiteList;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.IdentifyOrder;
import com.wwdz.ch.core.api.LogisticsApi;
......@@ -31,6 +33,9 @@ public class LogisticsServiceImpl implements LogisticsService {
@Autowired
IdentifyOrderDao identifyOrderDao;
@Autowired
CollectorWhiteListDao collectorWhiteListDao;
@Override
public Result findLogisticsInfo(String orderId) {
try {
......@@ -73,7 +78,14 @@ public class LogisticsServiceImpl implements LogisticsService {
IdentifyOrder identifyOrder = identifyOrderDao.findByDistributionOrderId(dto.getDistributionOrderId());
logisticsCode = identifyOrder.getFromLogisticsCode();
waybill = identifyOrder.getFromWaybill();
DistributionOrder distributionOrder = distributionOrderDao.findById(dto.getDistributionOrderId());
//查询藏家是否具有直接发货给买家的权限
CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(distributionOrder.getSellerId());
if (collectorWhiteList != null && 1 == collectorWhiteList.getDeliveryAuth()) {
receiverInfo = distributionOrder.getReceiverName() + "," + distributionOrder.getReceiverPhone() + "," + distributionOrder.getReceiverAddress();
} else {
receiverInfo = CommConsts.SYSTEM_DEFAULT_ADDRESS;
}
} else if (type == CommonEnum.LogisticsTypeEnum.DELIVERY.getCode()) {
DistributionOrder distributionOrder = distributionOrderDao.findById(dto.getDistributionOrderId());
logisticsCode = distributionOrder.getLogisticsCode();
......
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