Commit 887d1e55 authored by shiyu's avatar shiyu

平台服务费可配置

parent 9d04736e
...@@ -40,6 +40,11 @@ public class PriceUtil { ...@@ -40,6 +40,11 @@ public class PriceUtil {
} }
public static BigDecimal convertToDivide(BigDecimal number){
return number.divide(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_DOWN);
}
public static Long convertPriceUnit(Long price){ public static Long convertPriceUnit(Long price){
BigDecimal bigDecimal = new BigDecimal(price); BigDecimal bigDecimal = new BigDecimal(price);
bigDecimal = bigDecimal.multiply(new BigDecimal(100)); bigDecimal = bigDecimal.multiply(new BigDecimal(100));
......
...@@ -9,4 +9,6 @@ public interface CollectorWhiteListDao { ...@@ -9,4 +9,6 @@ public interface CollectorWhiteListDao {
void upsert(CollectorWhiteList collectorWhiteList); void upsert(CollectorWhiteList collectorWhiteList);
CollectorWhiteList findById(long collectorId);
} }
package com.wwdz.ch.db.domain; package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/04/09 * @date 2024/06/18
*/ */
@Data @Data
public class CollectorWhiteList implements Entity { public class CollectorWhiteList implements Entity {
...@@ -19,6 +22,11 @@ public class CollectorWhiteList implements Entity { ...@@ -19,6 +22,11 @@ public class CollectorWhiteList implements Entity {
*/ */
private Long collectorId; private Long collectorId;
/**
* 平台服务费比例
*/
private BigDecimal channelCostRebate;
/** /**
* 创建时间 * 创建时间
*/ */
...@@ -39,6 +47,7 @@ public class CollectorWhiteList implements Entity { ...@@ -39,6 +47,7 @@ public class CollectorWhiteList implements Entity {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", collectorId=").append(collectorId); sb.append(", collectorId=").append(collectorId);
sb.append(", channelCostRebate=").append(channelCostRebate);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", isValid=").append(isValid); sb.append(", isValid=").append(isValid);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
...@@ -60,6 +69,7 @@ public class CollectorWhiteList implements Entity { ...@@ -60,6 +69,7 @@ public class CollectorWhiteList implements Entity {
CollectorWhiteList other = (CollectorWhiteList) that; CollectorWhiteList other = (CollectorWhiteList) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCollectorId() == null ? other.getCollectorId() == null : this.getCollectorId().equals(other.getCollectorId())) && (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.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()));
} }
...@@ -70,6 +80,7 @@ public class CollectorWhiteList implements Entity { ...@@ -70,6 +80,7 @@ public class CollectorWhiteList implements Entity {
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCollectorId() == null) ? 0 : getCollectorId().hashCode()); result = prime * result + ((getCollectorId() == null) ? 0 : getCollectorId().hashCode());
result = prime * result + ((getChannelCostRebate() == null) ? 0 : getChannelCostRebate().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode()); result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
return result; return result;
...@@ -85,6 +96,7 @@ public class CollectorWhiteList implements Entity { ...@@ -85,6 +96,7 @@ public class CollectorWhiteList implements Entity {
public enum Column { public enum Column {
id("id", "id", "INTEGER", false), id("id", "id", "INTEGER", false),
collectorId("collector_id", "collectorId", "BIGINT", false), collectorId("collector_id", "collectorId", "BIGINT", false),
channelCostRebate("channel_cost_rebate", "channelCostRebate", "DECIMAL", false),
createTime("create_time", "createTime", "TIMESTAMP", false), createTime("create_time", "createTime", "TIMESTAMP", false),
isValid("is_valid", "isValid", "BIT", false); isValid("is_valid", "isValid", "BIT", false);
......
package com.wwdz.ch.db.domain; package com.wwdz.ch.db.domain;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -412,6 +413,138 @@ public class CollectorWhiteListExample { ...@@ -412,6 +413,138 @@ public class CollectorWhiteListExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andChannelCostRebateIsNull() {
addCriterion("channel_cost_rebate is null");
return (Criteria) this;
}
public Criteria andChannelCostRebateIsNotNull() {
addCriterion("channel_cost_rebate is not null");
return (Criteria) this;
}
public Criteria andChannelCostRebateEqualTo(BigDecimal value) {
addCriterion("channel_cost_rebate =", value, "channelCostRebate");
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 andChannelCostRebateEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateNotEqualTo(BigDecimal value) {
addCriterion("channel_cost_rebate <>", value, "channelCostRebate");
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 andChannelCostRebateNotEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateGreaterThan(BigDecimal value) {
addCriterion("channel_cost_rebate >", value, "channelCostRebate");
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 andChannelCostRebateGreaterThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("channel_cost_rebate >=", value, "channelCostRebate");
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 andChannelCostRebateGreaterThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateLessThan(BigDecimal value) {
addCriterion("channel_cost_rebate <", value, "channelCostRebate");
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 andChannelCostRebateLessThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateLessThanOrEqualTo(BigDecimal value) {
addCriterion("channel_cost_rebate <=", value, "channelCostRebate");
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 andChannelCostRebateLessThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("channel_cost_rebate <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andChannelCostRebateIn(List<BigDecimal> values) {
addCriterion("channel_cost_rebate in", values, "channelCostRebate");
return (Criteria) this;
}
public Criteria andChannelCostRebateNotIn(List<BigDecimal> values) {
addCriterion("channel_cost_rebate not in", values, "channelCostRebate");
return (Criteria) this;
}
public Criteria andChannelCostRebateBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("channel_cost_rebate between", value1, value2, "channelCostRebate");
return (Criteria) this;
}
public Criteria andChannelCostRebateNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("channel_cost_rebate not between", value1, value2, "channelCostRebate");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -37,4 +37,13 @@ public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao { ...@@ -37,4 +37,13 @@ public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao {
collectorWhiteListMapper.insert(collectorWhiteList); collectorWhiteListMapper.insert(collectorWhiteList);
} }
} }
@Override
public CollectorWhiteList findById(long collectorId) {
CollectorWhiteListExample example = new CollectorWhiteListExample();
CollectorWhiteListExample.Criteria criteria = example.createCriteria();
criteria.andCollectorIdEqualTo(collectorId);
criteria.andIsValidEqualTo(true);
return collectorWhiteListMapper.selectOneByExample(example);
}
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.CollectorWhiteList"> <resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.CollectorWhiteList">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="collector_id" jdbcType="BIGINT" property="collectorId" /> <result column="collector_id" jdbcType="BIGINT" property="collectorId" />
<result column="channel_cost_rebate" jdbcType="DECIMAL" property="channelCostRebate" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="is_valid" jdbcType="BIT" property="isValid" /> <result column="is_valid" jdbcType="BIT" property="isValid" />
</resultMap> </resultMap>
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, collector_id, create_time, is_valid id, collector_id, channel_cost_rebate, create_time, is_valid
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap">
select select
...@@ -95,13 +96,13 @@ ...@@ -95,13 +96,13 @@
distinct distinct
</if> </if>
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, create_time, is_valid id, collector_id, channel_cost_rebate, create_time, is_valid
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
...@@ -126,13 +127,13 @@ ...@@ -126,13 +127,13 @@
--> -->
select select
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, create_time, is_valid id, collector_id, channel_cost_rebate, create_time, is_valid
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
...@@ -152,10 +153,10 @@ ...@@ -152,10 +153,10 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into collector_white_list (collector_id, create_time, is_valid insert into collector_white_list (collector_id, channel_cost_rebate, create_time,
) is_valid)
values (#{collectorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=BIT} values (#{collectorId,jdbcType=BIGINT}, #{channelCostRebate,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
) #{isValid,jdbcType=BIT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -166,6 +167,9 @@ ...@@ -166,6 +167,9 @@
<if test="collectorId != null"> <if test="collectorId != null">
collector_id, collector_id,
</if> </if>
<if test="channelCostRebate != null">
channel_cost_rebate,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
...@@ -177,6 +181,9 @@ ...@@ -177,6 +181,9 @@
<if test="collectorId != null"> <if test="collectorId != null">
#{collectorId,jdbcType=BIGINT}, #{collectorId,jdbcType=BIGINT},
</if> </if>
<if test="channelCostRebate != null">
#{channelCostRebate,jdbcType=DECIMAL},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -200,6 +207,9 @@ ...@@ -200,6 +207,9 @@
<if test="record.collectorId != null"> <if test="record.collectorId != null">
collector_id = #{record.collectorId,jdbcType=BIGINT}, collector_id = #{record.collectorId,jdbcType=BIGINT},
</if> </if>
<if test="record.channelCostRebate != null">
channel_cost_rebate = #{record.channelCostRebate,jdbcType=DECIMAL},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -215,6 +225,7 @@ ...@@ -215,6 +225,7 @@
update collector_white_list update collector_white_list
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
collector_id = #{record.collectorId,jdbcType=BIGINT}, collector_id = #{record.collectorId,jdbcType=BIGINT},
channel_cost_rebate = #{record.channelCostRebate,jdbcType=DECIMAL},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
is_valid = #{record.isValid,jdbcType=BIT} is_valid = #{record.isValid,jdbcType=BIT}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -227,6 +238,9 @@ ...@@ -227,6 +238,9 @@
<if test="collectorId != null"> <if test="collectorId != null">
collector_id = #{collectorId,jdbcType=BIGINT}, collector_id = #{collectorId,jdbcType=BIGINT},
</if> </if>
<if test="channelCostRebate != null">
channel_cost_rebate = #{channelCostRebate,jdbcType=DECIMAL},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -239,6 +253,7 @@ ...@@ -239,6 +253,7 @@
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList"> <update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList">
update collector_white_list update collector_white_list
set collector_id = #{collectorId,jdbcType=BIGINT}, set collector_id = #{collectorId,jdbcType=BIGINT},
channel_cost_rebate = #{channelCostRebate,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
is_valid = #{isValid,jdbcType=BIT} is_valid = #{isValid,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -270,13 +285,13 @@ ...@@ -270,13 +285,13 @@
select select
'true' as QUERYID, 'true' as QUERYID,
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, create_time, is_valid id, collector_id, channel_cost_rebate, create_time, is_valid
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
......
...@@ -63,16 +63,16 @@ ...@@ -63,16 +63,16 @@
<!--生成Model类存放位置--> <!--生成Model类存放位置-->
<javaModelGenerator targetPackage="com.wwdz.ch.db.domain.distribution" targetProject="ch-dao/src/main/java"> <javaModelGenerator targetPackage="com.wwdz.ch.db.domain" targetProject="ch-dao/src/main/java">
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/> <property name="trimStrings" value="true"/>
</javaModelGenerator> </javaModelGenerator>
<sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper.distribution" targetProject="ch-dao/src/main/resources"/> <sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper" targetProject="ch-dao/src/main/resources"/>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="distribution_order" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="collector_white_list" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -11,8 +11,10 @@ import com.wwdz.ch.core.notify.AliSmsSender; ...@@ -11,8 +11,10 @@ import com.wwdz.ch.core.notify.AliSmsSender;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.*; import com.wwdz.ch.core.util.*;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.dao.FollowFansRecordDao; import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.distribution.*; import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.CollectorWhiteList;
import com.wwdz.ch.db.domain.FollowFansRecord; import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.domain.distribution.*; import com.wwdz.ch.db.domain.distribution.*;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto; import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
...@@ -120,6 +122,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -120,6 +122,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired @Autowired
IdentifyOrderService identifyOrderService; IdentifyOrderService identifyOrderService;
@Autowired
CollectorWhiteListDao collectorWhiteListDao;
@Transactional @Transactional
@Override @Override
public Result createDistributionOrder(DistributionOrderRequestDto dto) { public Result createDistributionOrder(DistributionOrderRequestDto dto) {
...@@ -470,7 +475,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -470,7 +475,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//计算分销商的利润 //计算分销商的利润
DistributorProfit distributorProfit = new DistributorProfit(); DistributorProfit distributorProfit = new DistributorProfit();
//平台服务费,默认15% //平台服务费,默认15%
double channelServiceCost = distributionOrder.getAmount().doubleValue() * 0.15; CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(supplierItem.getCreatorId());
double channelCostRebate = 0.15;
if (collectorWhiteList != null) {
BigDecimal channelCost = collectorWhiteList.getChannelCostRebate();
channelCost = PriceUtil.convertToDivide(channelCost);
channelCostRebate = channelCost.doubleValue();
}
logger.info("藏家id:{} 生成新订单,平台服务费比例:{}", supplierItem.getCreatorId(), channelCostRebate);
double channelServiceCost = distributionOrder.getAmount().doubleValue() * channelCostRebate;
//介绍人分佣,自己推荐获得的订单无需计算介绍佣金 //介绍人分佣,自己推荐获得的订单无需计算介绍佣金
// double introduceCost = 0; // double introduceCost = 0;
// if (supplierItem.getCreatorId() != introducerId) { // if (supplierItem.getCreatorId() != introducerId) {
...@@ -1318,4 +1331,10 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -1318,4 +1331,10 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
} }
return Result.failed(); return Result.failed();
} }
public static void main(String[] args) {
BigDecimal bigDecimal = new BigDecimal("15.00");
bigDecimal = PriceUtil.convertToDivide(bigDecimal);
System.out.println(bigDecimal.doubleValue());
}
} }
...@@ -199,6 +199,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -199,6 +199,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
try { try {
List<SupplierItemVo> supplierItemVos = new ArrayList<>(); List<SupplierItemVo> supplierItemVos = new ArrayList<>();
List<SupplierItem> supplierItemList = supplierItemDao.findList(dto); List<SupplierItem> supplierItemList = supplierItemDao.findList(dto);
PageInfo pageInfo = new PageInfo(supplierItemList);
for (SupplierItem supplierItem : supplierItemList) { for (SupplierItem supplierItem : supplierItemList) {
SupplierItemVo supplierItemVo = new SupplierItemVo(); SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo); EntityMapper.copyAttribute(supplierItem, supplierItemVo);
...@@ -208,7 +209,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -208,7 +209,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVos.add(supplierItemVo); supplierItemVos.add(supplierItemVo);
} }
return Result.success(supplierItemVos); return Result.success(PageSearchResult.of(pageInfo, supplierItemVos));
} catch (Exception e) { } catch (Exception e) {
logger.error("查询商品列表失败 error : {}", e); logger.error("查询商品列表失败 error : {}", e);
} }
......
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