Commit 5d493cd1 by yinyong

JIT备货供应链长度统一改为2,累计销量=供应链长度*加权日均

退款新增发货状态
parent eecdf757
...@@ -55,4 +55,6 @@ public class RefundItem { ...@@ -55,4 +55,6 @@ public class RefundItem {
private BigDecimal amountRefundRmb; private BigDecimal amountRefundRmb;
@JSONField(name = "order_status") @JSONField(name = "order_status")
private String orderStatus; private String orderStatus;
@JSONField(name = "shipping_status")
private String shippingStatus;
} }
...@@ -84,10 +84,10 @@ public class CrmRefundSyncJob extends PointJob { ...@@ -84,10 +84,10 @@ public class CrmRefundSyncJob extends PointJob {
throw new RuntimeException("CRM退款BeanUtils.copyProperties失败", e); throw new RuntimeException("CRM退款BeanUtils.copyProperties失败", e);
} }
DcBaseCrmRefundMapper mapper = SessionUtil.getSession().getMapper(DcBaseCrmRefundMapper.class); DcBaseCrmRefundMapper mapper = SessionUtil.getSession().getMapper(DcBaseCrmRefundMapper.class);
/* int i = mapper.updateByExampleSelective(dcBaseCrmRefund, DcBaseCrmRefundExample.newAndCreateCriteria().andCrmIdEqualTo(dcBaseCrmRefund.getCrmId()).example()); int i = mapper.updateByExampleSelective(dcBaseCrmRefund, DcBaseCrmRefundExample.newAndCreateCriteria().andCrmIdEqualTo(dcBaseCrmRefund.getCrmId()).example());
if (i == 0) {*/ if (i == 0) {
mapper.insertSelective(dcBaseCrmRefund); mapper.insertSelective(dcBaseCrmRefund);
// } }
// SessionUtil.getSession().commit(); // SessionUtil.getSession().commit();
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -242,6 +242,15 @@ public class DcBaseCrmRefund { ...@@ -242,6 +242,15 @@ public class DcBaseCrmRefund {
private String orderStatus; private String orderStatus;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_crm_refund.shipping_status
*
* @mbg.generated
*/
private String shippingStatus;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_crm_refund * This method corresponds to the database table dc_base_crm_refund
* *
...@@ -279,6 +288,7 @@ public class DcBaseCrmRefund { ...@@ -279,6 +288,7 @@ public class DcBaseCrmRefund {
sb.append(", isDeleted=").append(isDeleted); sb.append(", isDeleted=").append(isDeleted);
sb.append(", isFreeze=").append(isFreeze); sb.append(", isFreeze=").append(isFreeze);
sb.append(", orderStatus=").append(orderStatus); sb.append(", orderStatus=").append(orderStatus);
sb.append(", shippingStatus=").append(shippingStatus);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -326,7 +336,8 @@ public class DcBaseCrmRefund { ...@@ -326,7 +336,8 @@ public class DcBaseCrmRefund {
&& (this.getProductSaleAmount() == null ? other.getProductSaleAmount() == null : this.getProductSaleAmount().equals(other.getProductSaleAmount())) && (this.getProductSaleAmount() == null ? other.getProductSaleAmount() == null : this.getProductSaleAmount().equals(other.getProductSaleAmount()))
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted())) && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
&& (this.getIsFreeze() == null ? other.getIsFreeze() == null : this.getIsFreeze().equals(other.getIsFreeze())) && (this.getIsFreeze() == null ? other.getIsFreeze() == null : this.getIsFreeze().equals(other.getIsFreeze()))
&& (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus())); && (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus()))
&& (this.getShippingStatus() == null ? other.getShippingStatus() == null : this.getShippingStatus().equals(other.getShippingStatus()));
} }
/** /**
...@@ -365,6 +376,7 @@ public class DcBaseCrmRefund { ...@@ -365,6 +376,7 @@ public class DcBaseCrmRefund {
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode()); result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
result = prime * result + ((getIsFreeze() == null) ? 0 : getIsFreeze().hashCode()); result = prime * result + ((getIsFreeze() == null) ? 0 : getIsFreeze().hashCode());
result = prime * result + ((getOrderStatus() == null) ? 0 : getOrderStatus().hashCode()); result = prime * result + ((getOrderStatus() == null) ? 0 : getOrderStatus().hashCode());
result = prime * result + ((getShippingStatus() == null) ? 0 : getShippingStatus().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -2010,6 +2010,76 @@ public class DcBaseCrmRefundExample { ...@@ -2010,6 +2010,76 @@ public class DcBaseCrmRefundExample {
addCriterion("order_status not between", value1, value2, "orderStatus"); addCriterion("order_status not between", value1, value2, "orderStatus");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andShippingStatusIsNull() {
addCriterion("shipping_status is null");
return (Criteria) this;
}
public Criteria andShippingStatusIsNotNull() {
addCriterion("shipping_status is not null");
return (Criteria) this;
}
public Criteria andShippingStatusEqualTo(String value) {
addCriterion("shipping_status =", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusNotEqualTo(String value) {
addCriterion("shipping_status <>", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusGreaterThan(String value) {
addCriterion("shipping_status >", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusGreaterThanOrEqualTo(String value) {
addCriterion("shipping_status >=", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusLessThan(String value) {
addCriterion("shipping_status <", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusLessThanOrEqualTo(String value) {
addCriterion("shipping_status <=", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusLike(String value) {
addCriterion("shipping_status like", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusNotLike(String value) {
addCriterion("shipping_status not like", value, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusIn(List<String> values) {
addCriterion("shipping_status in", values, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusNotIn(List<String> values) {
addCriterion("shipping_status not in", values, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusBetween(String value1, String value2) {
addCriterion("shipping_status between", value1, value2, "shippingStatus");
return (Criteria) this;
}
public Criteria andShippingStatusNotBetween(String value1, String value2) {
addCriterion("shipping_status not between", value1, value2, "shippingStatus");
return (Criteria) this;
}
} }
/** /**
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result column="is_deleted" jdbcType="BIT" property="isDeleted" /> <result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="is_freeze" jdbcType="BIT" property="isFreeze" /> <result column="is_freeze" jdbcType="BIT" property="isFreeze" />
<result column="order_status" jdbcType="VARCHAR" property="orderStatus" /> <result column="order_status" jdbcType="VARCHAR" property="orderStatus" />
<result column="shipping_status" jdbcType="VARCHAR" property="shippingStatus" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund, platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund,
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id, bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id,
amount_refund_usd, company_id, order_total_amount, usd_order_total_amount, product_sale_amount, amount_refund_usd, company_id, order_total_amount, usd_order_total_amount, product_sale_amount,
is_deleted, is_freeze, order_status is_deleted, is_freeze, order_status, shipping_status
</sql> </sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -177,8 +178,8 @@ ...@@ -177,8 +178,8 @@
linked, amount_refund_rmb, crm_id, linked, amount_refund_rmb, crm_id,
amount_refund_usd, company_id, order_total_amount, amount_refund_usd, company_id, order_total_amount,
usd_order_total_amount, product_sale_amount, usd_order_total_amount, product_sale_amount,
is_deleted, is_freeze, order_status is_deleted, is_freeze, order_status,
) shipping_status)
values (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR},
#{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR}, #{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR},
#{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL}, #{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL},
...@@ -187,8 +188,8 @@ ...@@ -187,8 +188,8 @@
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}, #{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER},
#{amountRefundUsd,jdbcType=DECIMAL}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL}, #{amountRefundUsd,jdbcType=DECIMAL}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL},
#{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL}, #{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL},
#{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR} #{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR},
) #{shippingStatus,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund"> <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
<!-- <!--
...@@ -275,6 +276,9 @@ ...@@ -275,6 +276,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
order_status, order_status,
</if> </if>
<if test="shippingStatus != null">
shipping_status,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -355,6 +359,9 @@ ...@@ -355,6 +359,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
#{orderStatus,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR},
</if> </if>
<if test="shippingStatus != null">
#{shippingStatus,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultType="java.lang.Long">
...@@ -452,6 +459,9 @@ ...@@ -452,6 +459,9 @@
<if test="record.orderStatus != null"> <if test="record.orderStatus != null">
order_status = #{record.orderStatus,jdbcType=VARCHAR}, order_status = #{record.orderStatus,jdbcType=VARCHAR},
</if> </if>
<if test="record.shippingStatus != null">
shipping_status = #{record.shippingStatus,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -488,7 +498,8 @@ ...@@ -488,7 +498,8 @@
product_sale_amount = #{record.productSaleAmount,jdbcType=DECIMAL}, product_sale_amount = #{record.productSaleAmount,jdbcType=DECIMAL},
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
is_freeze = #{record.isFreeze,jdbcType=BIT}, is_freeze = #{record.isFreeze,jdbcType=BIT},
order_status = #{record.orderStatus,jdbcType=VARCHAR} order_status = #{record.orderStatus,jdbcType=VARCHAR},
shipping_status = #{record.shippingStatus,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -575,6 +586,9 @@ ...@@ -575,6 +586,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
order_status = #{orderStatus,jdbcType=VARCHAR}, order_status = #{orderStatus,jdbcType=VARCHAR},
</if> </if>
<if test="shippingStatus != null">
shipping_status = #{shippingStatus,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -608,7 +622,8 @@ ...@@ -608,7 +622,8 @@
product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL}, product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL},
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
is_freeze = #{isFreeze,jdbcType=BIT}, is_freeze = #{isFreeze,jdbcType=BIT},
order_status = #{orderStatus,jdbcType=VARCHAR} order_status = #{orderStatus,jdbcType=VARCHAR},
shipping_status = #{shippingStatus,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund"> <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
...@@ -697,6 +712,9 @@ ...@@ -697,6 +712,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
order_status, order_status,
</if> </if>
<if test="shippingStatus != null">
shipping_status,
</if>
</trim> </trim>
values values
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -778,6 +796,9 @@ ...@@ -778,6 +796,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
#{orderStatus,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR},
</if> </if>
<if test="shippingStatus != null">
#{shippingStatus,jdbcType=VARCHAR},
</if>
</trim> </trim>
on duplicate key update on duplicate key update
<trim suffixOverrides=","> <trim suffixOverrides=",">
...@@ -859,6 +880,9 @@ ...@@ -859,6 +880,9 @@
<if test="orderStatus != null"> <if test="orderStatus != null">
order_status = #{orderStatus,jdbcType=VARCHAR}, order_status = #{orderStatus,jdbcType=VARCHAR},
</if> </if>
<if test="shippingStatus != null">
shipping_status = #{shippingStatus,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund"> <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
...@@ -872,7 +896,7 @@ ...@@ -872,7 +896,7 @@
bailun_sku, platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund, bailun_sku, platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund,
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id, bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id,
amount_refund_usd, company_id, order_total_amount, usd_order_total_amount, product_sale_amount, amount_refund_usd, company_id, order_total_amount, usd_order_total_amount, product_sale_amount,
is_deleted, is_freeze, order_status) is_deleted, is_freeze, order_status, shipping_status)
values values
(#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR}, (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR},
#{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR}, #{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR},
...@@ -882,8 +906,8 @@ ...@@ -882,8 +906,8 @@
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}, #{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER},
#{amountRefundUsd,jdbcType=DECIMAL}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL}, #{amountRefundUsd,jdbcType=DECIMAL}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL},
#{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL}, #{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL},
#{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR} #{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR},
) #{shippingStatus,jdbcType=VARCHAR})
on duplicate key update on duplicate key update
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
platform_type = #{platformType,jdbcType=VARCHAR}, platform_type = #{platformType,jdbcType=VARCHAR},
...@@ -910,7 +934,8 @@ ...@@ -910,7 +934,8 @@
product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL}, product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL},
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
is_freeze = #{isFreeze,jdbcType=BIT}, is_freeze = #{isFreeze,jdbcType=BIT},
order_status = #{orderStatus,jdbcType=VARCHAR} order_status = #{orderStatus,jdbcType=VARCHAR},
shipping_status = #{shippingStatus,jdbcType=VARCHAR}
</insert> </insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultMap="BaseResultMap">
<!-- <!--
......
...@@ -238,7 +238,11 @@ public class AutoTurnoverJob extends PointJob { ...@@ -238,7 +238,11 @@ public class AutoTurnoverJob extends PointJob {
if(saveDays.compareTo(new BigDecimal(4)) > -1) { if(saveDays.compareTo(new BigDecimal(4)) > -1) {
saveDays = BigDecimal.valueOf(4); saveDays = BigDecimal.valueOf(4);
}*/ }*/
turnoverDays = 4; if(turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_2)) {
turnoverDays = 2;
}else {
turnoverDays = 4;
}
} }
Integer autoForecastDay = turnoverDays * Constant.TURNOVER_MULTIPLE < Constant.MIN_AUTO_FORECAST_DAY ? Constant.MIN_AUTO_FORECAST_DAY : turnoverDays * 2; Integer autoForecastDay = turnoverDays * Constant.TURNOVER_MULTIPLE < Constant.MIN_AUTO_FORECAST_DAY ? Constant.MIN_AUTO_FORECAST_DAY : turnoverDays * 2;
...@@ -403,13 +407,13 @@ public class AutoTurnoverJob extends PointJob { ...@@ -403,13 +407,13 @@ public class AutoTurnoverJob extends PointJob {
* 3. 如果到货后有真实销量,迅速用真实销量的曲线替代这个7%递减的曲线,这个递减曲线的影响马上清0 * 3. 如果到货后有真实销量,迅速用真实销量的曲线替代这个7%递减的曲线,这个递减曲线的影响马上清0
* 4. 通常缺货后,我们会用一个sku跟卖,这个sku销量会很高   我们的处理方法是,对这个sku做特殊销售规则 (这个人为做就行) * 4. 通常缺货后,我们会用一个sku跟卖,这个sku销量会很高   我们的处理方法是,对这个sku做特殊销售规则 (这个人为做就行)
*/ */
inventoryAvailableDays = fbaAdvise(hasMonitorFluctuation, forecastFluctuationList, recordTime, dcAutoTurnover, turnoverDays, autoForecastDay, forecastInventoryList, forecastInboundList, forecastSalesList, forecastShortSupplyList, forecastPurchaseAdvisedList, moqPurchaseAdvisedList, realInventory, totalSafeInventory, outStock, inventoryAvailableDays, totalSales, totalInbound, moqDecimal, historySalesList, forecastSalesExplainList); inventoryAvailableDays = fbaAdvise(turnoverSku, warehouseCode, hasMonitorFluctuation, forecastFluctuationList, recordTime, dcAutoTurnover, turnoverDays, autoForecastDay, forecastInventoryList, forecastInboundList, forecastSalesList, forecastShortSupplyList, forecastPurchaseAdvisedList, moqPurchaseAdvisedList, realInventory, totalSafeInventory, outStock, inventoryAvailableDays, totalSales, totalInbound, moqDecimal, historySalesList, forecastSalesExplainList);
} else { } else {
/* /*
* 获取采购建议-普通仓库 * 获取采购建议-普通仓库
* 实际缺货 + 总销量 - 总预计入库 + (安全库存 - 预测库存) + 周转天的销量 * 实际缺货 + 总销量 - 总预计入库 + (安全库存 - 预测库存) + 周转天的销量
*/ */
inventoryAvailableDays = commonAdvise(hasMonitorFluctuation, forecastFluctuationList, recordTime, dcAutoTurnover, turnoverDays, autoForecastDay, forecastInventoryList, forecastInboundList, forecastSalesList, forecastShortSupplyList, forecastPurchaseAdvisedList, moqPurchaseAdvisedList, realInventory, totalSafeInventory, outStock, inventoryAvailableDays, totalSales, totalInbound, moqDecimal); inventoryAvailableDays = commonAdvise(turnoverSku, warehouseCode, hasMonitorFluctuation, forecastFluctuationList, recordTime, dcAutoTurnover, turnoverDays, autoForecastDay, forecastInventoryList, forecastInboundList, forecastSalesList, forecastShortSupplyList, forecastPurchaseAdvisedList, moqPurchaseAdvisedList, realInventory, totalSafeInventory, outStock, inventoryAvailableDays, totalSales, totalInbound, moqDecimal);
} }
/* /*
...@@ -1205,7 +1209,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1205,7 +1209,7 @@ public class AutoTurnoverJob extends PointJob {
} }
private Integer fbaAdvise(boolean hasMonitorFluctuation, List<DcAutoForecastFluctuation> forecastFluctuationList, LocalDate private Integer fbaAdvise(DcBaseSku turnoverSku, String warehouseCode, boolean hasMonitorFluctuation, List<DcAutoForecastFluctuation> forecastFluctuationList, LocalDate
recordTime, DcAutoTurnover dcAutoTurnover, Integer turnoverDays, Integer recordTime, DcAutoTurnover dcAutoTurnover, Integer turnoverDays, Integer
autoForecastDay, List<BigDecimal> forecastInventoryList, List<Integer> forecastInboundList, List<BigDecimal> forecastSalesList, List<BigDecimal> forecastShortSupplyList, List<BigDecimal> forecastPurchaseAdvisedList, List<BigDecimal> moqPurchaseAdvisedList, Integer autoForecastDay, List<BigDecimal> forecastInventoryList, List<Integer> forecastInboundList, List<BigDecimal> forecastSalesList, List<BigDecimal> forecastShortSupplyList, List<BigDecimal> forecastPurchaseAdvisedList, List<BigDecimal> moqPurchaseAdvisedList, Integer
realInventory, BigDecimal totalSafeInventory, Integer outStock, Integer inventoryAvailableDays, BigDecimal realInventory, BigDecimal totalSafeInventory, Integer outStock, Integer inventoryAvailableDays, BigDecimal
...@@ -1373,7 +1377,11 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1373,7 +1377,11 @@ public class AutoTurnoverJob extends PointJob {
//库存 - 销量, 继续跑, 这是周转期最后一天和周转期外的 //库存 - 销量, 继续跑, 这是周转期最后一天和周转期外的
if (j >= turnoverDays) { if (j >= turnoverDays) {
if (j == turnoverDays) { //周转期内总销量 if (j == turnoverDays) { //周转期内总销量
dcAutoTurnover.setTurnoverSales(totalSales); if (warehouseCode.equals(Constant.WAREHOUSE_JIT) && (turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_1) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_2))) {
dcAutoTurnover.setTurnoverSales(dcAutoTurnover.getDailyWeightedSales().multiply(BigDecimal.valueOf(turnoverDays)));
}else{
dcAutoTurnover.setTurnoverSales(totalSales);
}
} }
//采购建议 = 安全库存缺少值 + 今日的实际缺货 + 本次采购到货日期前一天的累计销量 - 本次采购到货日期累计到货数量 + 预计销量 - 今日的实际库存 //采购建议 = 安全库存缺少值 + 今日的实际缺货 + 本次采购到货日期前一天的累计销量 - 本次采购到货日期累计到货数量 + 预计销量 - 今日的实际库存
BigDecimal totalAdvised = totalSafeInventory.subtract(forecastInventoryList.get(j > 0 ? j - 1 : 0))//安全库存缺少值= 理论安全库存 - 预测库存 BigDecimal totalAdvised = totalSafeInventory.subtract(forecastInventoryList.get(j > 0 ? j - 1 : 0))//安全库存缺少值= 理论安全库存 - 预测库存
...@@ -1412,7 +1420,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1412,7 +1420,7 @@ public class AutoTurnoverJob extends PointJob {
forecastFluctuationList.add(forecastFluctuation); forecastFluctuationList.add(forecastFluctuation);
} }
private Integer commonAdvise(boolean hasMonitorFluctuation, List<DcAutoForecastFluctuation> forecastFluctuationList, LocalDate private Integer commonAdvise(DcBaseSku turnoverSku, String warehouseCode, boolean hasMonitorFluctuation, List<DcAutoForecastFluctuation> forecastFluctuationList, LocalDate
recordTime, DcAutoTurnover dcAutoTurnover, Integer turnoverDays, Integer recordTime, DcAutoTurnover dcAutoTurnover, Integer turnoverDays, Integer
autoForecastDay, List<BigDecimal> forecastInventoryList, List<Integer> forecastInboundList, List<BigDecimal> forecastSalesList, List<BigDecimal> forecastShortSupplyList, List<BigDecimal> forecastPurchaseAdvisedList, List<BigDecimal> moqPurchaseAdvisedList, Integer autoForecastDay, List<BigDecimal> forecastInventoryList, List<Integer> forecastInboundList, List<BigDecimal> forecastSalesList, List<BigDecimal> forecastShortSupplyList, List<BigDecimal> forecastPurchaseAdvisedList, List<BigDecimal> moqPurchaseAdvisedList, Integer
realInventory, BigDecimal totalSafeInventory, Integer outStock, Integer inventoryAvailableDays, BigDecimal realInventory, BigDecimal totalSafeInventory, Integer outStock, Integer inventoryAvailableDays, BigDecimal
...@@ -1472,7 +1480,11 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1472,7 +1480,11 @@ public class AutoTurnoverJob extends PointJob {
//库存 - 销量, 继续跑 //库存 - 销量, 继续跑
if (j >= turnoverDays) { if (j >= turnoverDays) {
if (j == turnoverDays) { if (j == turnoverDays) {
dcAutoTurnover.setTurnoverSales(totalSales); if (warehouseCode.equals(Constant.WAREHOUSE_JIT) && (turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_1) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_2))) {
dcAutoTurnover.setTurnoverSales(dcAutoTurnover.getDailyWeightedSales().multiply(BigDecimal.valueOf(turnoverDays)));
}else{
dcAutoTurnover.setTurnoverSales(totalSales);
}
} }
//采购建议 = 安全库存缺少值 + 今日的实际缺货 + 本次采购到货日期前一天的累计销量 - 本次采购到货日期累计到货数量 + 预计销量 //采购建议 = 安全库存缺少值 + 今日的实际缺货 + 本次采购到货日期前一天的累计销量 - 本次采购到货日期累计到货数量 + 预计销量
BigDecimal totalAdvised = totalSafeInventory.subtract(forecastInventoryList.get(j > 0 ? j - 1 : 0))//安全库存缺少值= 理论安全库存 - 预测库存 BigDecimal totalAdvised = totalSafeInventory.subtract(forecastInventoryList.get(j > 0 ? j - 1 : 0))//安全库存缺少值= 理论安全库存 - 预测库存
......
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