Commit 046c95c5 by wutong

自动周转根据采购单付款类型, 调整周转天数; SKU接口调整.

parent 299f2e6c
...@@ -78,7 +78,7 @@ public class OmsOrderTest { ...@@ -78,7 +78,7 @@ public class OmsOrderTest {
LinkedHashMap<String, String> map = new LinkedHashMap<>(4); LinkedHashMap<String, String> map = new LinkedHashMap<>(4);
map.put("pageIndex", "1"); map.put("pageIndex", "1");
map.put("pageCount", "100"); map.put("pageCount", "100");
map.put("OriginOrderNo", "405-1430822-7337124"); map.put("OriginOrderNo", "263334209922-2394744359016");
Request request = new Request.Builder() Request request = new Request.Builder()
.get() .get()
.url(OkHttpUtil.attachHttpGetParams("http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders", map)) .url(OkHttpUtil.attachHttpGetParams("http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders", map))
......
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.TypeReference; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.TypeReference;
import com.bailuntec.domain.constant.CommonConstant; import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.entity.DcBaseSku; import com.bailuntec.domain.entity.DcBaseSku;
import com.bailuntec.domain.entity.JobPointLog; import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBaseSkuExample;
import com.bailuntec.domain.pojo.CommonSkuCondition; import com.bailuntec.domain.pojo.CommonSkuCondition;
import com.bailuntec.domain.pojo.CommonSkuProductInfo; import com.bailuntec.domain.pojo.CommonSkuProductInfo;
import com.bailuntec.domain.pojo.SkuData; import com.bailuntec.domain.pojo.SkuData;
...@@ -155,8 +156,10 @@ public class SkuJsonHandle { ...@@ -155,8 +156,10 @@ public class SkuJsonHandle {
dcBaseSku.setHeight((split != null && split.length > 2 && CommonConstant.NUMBER_AND_DECIMAL.matcher(split[2]).matches()) ? new BigDecimal(split[2]) : BigDecimal.ZERO); dcBaseSku.setHeight((split != null && split.length > 2 && CommonConstant.NUMBER_AND_DECIMAL.matcher(split[2]).matches()) ? new BigDecimal(split[2]) : BigDecimal.ZERO);
dcBaseSku.setWeight(skuProductInfo.getWeight() != null ? skuProductInfo.getWeight() : BigDecimal.ZERO.add(skuProductInfo.getPackingWeight() != null ? skuProductInfo.getPackingWeight() : BigDecimal.ZERO)); dcBaseSku.setWeight(skuProductInfo.getWeight() != null ? skuProductInfo.getWeight() : BigDecimal.ZERO.add(skuProductInfo.getPackingWeight() != null ? skuProductInfo.getPackingWeight() : BigDecimal.ZERO));
dcBaseSku.setGmtModified(LocalDateTime.now()); dcBaseSku.setGmtModified(LocalDateTime.now());
dcBaseSkuMapper.upsertSelective(dcBaseSku); int i = dcBaseSkuMapper.updateByExampleSelective(dcBaseSku, DcBaseSkuExample.newAndCreateCriteria().andBailunSkuEqualTo(dcBaseSku.getBailunSku()).example());
SessionUtil.getSession().commit(); if (i == 0) {
dcBaseSkuMapper.insertSelective(dcBaseSku);
}
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -17,8 +17,6 @@ public class SkuSyncJob extends PointJob { ...@@ -17,8 +17,6 @@ public class SkuSyncJob extends PointJob {
skuConditionDto.setIsFinish(-1); skuConditionDto.setIsFinish(-1);
//有ResultWare返回发货仓库信息 //有ResultWare返回发货仓库信息
skuConditionDto.setIsResultWare(1); skuConditionDto.setIsResultWare(1);
// skuConditionDto.setSortField("id");
// skuConditionDto.setSort("asc");
//有SKU只查提供的SKU //有SKU只查提供的SKU
// skuConditionDto.setSkus("909117825"); // skuConditionDto.setSkus("909117825");
//有UpdateDate只查当天更新的数据-增量更新 //有UpdateDate只查当天更新的数据-增量更新
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
import com.bailuntec.job.WarehouseSyncJob;
import org.junit.jupiter.api.Test;
public class SyncWarehouseTest {
@Test
public void test() {
WarehouseSyncJob warehouseSyncJob = new WarehouseSyncJob();
warehouseSyncJob.execute(null);
}
}
...@@ -485,6 +485,15 @@ public class DcAutoTurnover { ...@@ -485,6 +485,15 @@ public class DcAutoTurnover {
private Integer stockUpDays; private Integer stockUpDays;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_turnover.payment_before_delivery
*
* @mbg.generated
*/
private Integer paymentBeforeDelivery;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover * This method corresponds to the database table dc_auto_turnover
* *
...@@ -549,6 +558,7 @@ public class DcAutoTurnover { ...@@ -549,6 +558,7 @@ public class DcAutoTurnover {
sb.append(", stockUpSales=").append(stockUpSales); sb.append(", stockUpSales=").append(stockUpSales);
sb.append(", quantityBeginAdvise=").append(quantityBeginAdvise); sb.append(", quantityBeginAdvise=").append(quantityBeginAdvise);
sb.append(", stockUpDays=").append(stockUpDays); sb.append(", stockUpDays=").append(stockUpDays);
sb.append(", paymentBeforeDelivery=").append(paymentBeforeDelivery);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -623,7 +633,8 @@ public class DcAutoTurnover { ...@@ -623,7 +633,8 @@ public class DcAutoTurnover {
&& (this.getForecastTurnoverdaySales() == null ? other.getForecastTurnoverdaySales() == null : this.getForecastTurnoverdaySales().equals(other.getForecastTurnoverdaySales())) && (this.getForecastTurnoverdaySales() == null ? other.getForecastTurnoverdaySales() == null : this.getForecastTurnoverdaySales().equals(other.getForecastTurnoverdaySales()))
&& (this.getStockUpSales() == null ? other.getStockUpSales() == null : this.getStockUpSales().equals(other.getStockUpSales())) && (this.getStockUpSales() == null ? other.getStockUpSales() == null : this.getStockUpSales().equals(other.getStockUpSales()))
&& (this.getQuantityBeginAdvise() == null ? other.getQuantityBeginAdvise() == null : this.getQuantityBeginAdvise().equals(other.getQuantityBeginAdvise())) && (this.getQuantityBeginAdvise() == null ? other.getQuantityBeginAdvise() == null : this.getQuantityBeginAdvise().equals(other.getQuantityBeginAdvise()))
&& (this.getStockUpDays() == null ? other.getStockUpDays() == null : this.getStockUpDays().equals(other.getStockUpDays())); && (this.getStockUpDays() == null ? other.getStockUpDays() == null : this.getStockUpDays().equals(other.getStockUpDays()))
&& (this.getPaymentBeforeDelivery() == null ? other.getPaymentBeforeDelivery() == null : this.getPaymentBeforeDelivery().equals(other.getPaymentBeforeDelivery()));
} }
/** /**
...@@ -689,6 +700,7 @@ public class DcAutoTurnover { ...@@ -689,6 +700,7 @@ public class DcAutoTurnover {
result = prime * result + ((getStockUpSales() == null) ? 0 : getStockUpSales().hashCode()); result = prime * result + ((getStockUpSales() == null) ? 0 : getStockUpSales().hashCode());
result = prime * result + ((getQuantityBeginAdvise() == null) ? 0 : getQuantityBeginAdvise().hashCode()); result = prime * result + ((getQuantityBeginAdvise() == null) ? 0 : getQuantityBeginAdvise().hashCode());
result = prime * result + ((getStockUpDays() == null) ? 0 : getStockUpDays().hashCode()); result = prime * result + ((getStockUpDays() == null) ? 0 : getStockUpDays().hashCode());
result = prime * result + ((getPaymentBeforeDelivery() == null) ? 0 : getPaymentBeforeDelivery().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -89,6 +89,15 @@ public class DcAveragePurchase { ...@@ -89,6 +89,15 @@ public class DcAveragePurchase {
private LocalDateTime updateTime; private LocalDateTime updateTime;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_average_purchase.payment_type
*
* @mbg.generated
*/
private Integer paymentType;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase * This method corresponds to the database table dc_average_purchase
* *
...@@ -109,6 +118,7 @@ public class DcAveragePurchase { ...@@ -109,6 +118,7 @@ public class DcAveragePurchase {
sb.append(", deliveryDays=").append(deliveryDays); sb.append(", deliveryDays=").append(deliveryDays);
sb.append(", inboundDays=").append(inboundDays); sb.append(", inboundDays=").append(inboundDays);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", paymentType=").append(paymentType);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -139,7 +149,8 @@ public class DcAveragePurchase { ...@@ -139,7 +149,8 @@ public class DcAveragePurchase {
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getDeliveryDays() == null ? other.getDeliveryDays() == null : this.getDeliveryDays().equals(other.getDeliveryDays())) && (this.getDeliveryDays() == null ? other.getDeliveryDays() == null : this.getDeliveryDays().equals(other.getDeliveryDays()))
&& (this.getInboundDays() == null ? other.getInboundDays() == null : this.getInboundDays().equals(other.getInboundDays())) && (this.getInboundDays() == null ? other.getInboundDays() == null : this.getInboundDays().equals(other.getInboundDays()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getPaymentType() == null ? other.getPaymentType() == null : this.getPaymentType().equals(other.getPaymentType()));
} }
/** /**
...@@ -161,6 +172,7 @@ public class DcAveragePurchase { ...@@ -161,6 +172,7 @@ public class DcAveragePurchase {
result = prime * result + ((getDeliveryDays() == null) ? 0 : getDeliveryDays().hashCode()); result = prime * result + ((getDeliveryDays() == null) ? 0 : getDeliveryDays().hashCode());
result = prime * result + ((getInboundDays() == null) ? 0 : getInboundDays().hashCode()); result = prime * result + ((getInboundDays() == null) ? 0 : getInboundDays().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getPaymentType() == null) ? 0 : getPaymentType().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -3680,6 +3680,66 @@ public class DcAutoTurnoverExample { ...@@ -3680,6 +3680,66 @@ public class DcAutoTurnoverExample {
addCriterion("stock_up_days not between", value1, value2, "stockUpDays"); addCriterion("stock_up_days not between", value1, value2, "stockUpDays");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPaymentBeforeDeliveryIsNull() {
addCriterion("payment_before_delivery is null");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryIsNotNull() {
addCriterion("payment_before_delivery is not null");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryEqualTo(Integer value) {
addCriterion("payment_before_delivery =", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryNotEqualTo(Integer value) {
addCriterion("payment_before_delivery <>", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryGreaterThan(Integer value) {
addCriterion("payment_before_delivery >", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryGreaterThanOrEqualTo(Integer value) {
addCriterion("payment_before_delivery >=", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryLessThan(Integer value) {
addCriterion("payment_before_delivery <", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryLessThanOrEqualTo(Integer value) {
addCriterion("payment_before_delivery <=", value, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryIn(List<Integer> values) {
addCriterion("payment_before_delivery in", values, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryNotIn(List<Integer> values) {
addCriterion("payment_before_delivery not in", values, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryBetween(Integer value1, Integer value2) {
addCriterion("payment_before_delivery between", value1, value2, "paymentBeforeDelivery");
return (Criteria) this;
}
public Criteria andPaymentBeforeDeliveryNotBetween(Integer value1, Integer value2) {
addCriterion("payment_before_delivery not between", value1, value2, "paymentBeforeDelivery");
return (Criteria) this;
}
} }
/** /**
......
...@@ -219,6 +219,36 @@ public class DcAveragePurchaseExample { ...@@ -219,6 +219,36 @@ public class DcAveragePurchaseExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public DcAveragePurchaseExample when(boolean condition, IExampleWhen then) {
if (condition) {
then.example(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public DcAveragePurchaseExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) {
if (condition) {
then.example(this);
} else {
otherwise.example(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public void setOffset(Integer offset) { public void setOffset(Integer offset) {
this.offset = offset; this.offset = offset;
} }
...@@ -910,6 +940,66 @@ public class DcAveragePurchaseExample { ...@@ -910,6 +940,66 @@ public class DcAveragePurchaseExample {
addCriterion("update_time not between", value1, value2, "updateTime"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPaymentTypeIsNull() {
addCriterion("payment_type is null");
return (Criteria) this;
}
public Criteria andPaymentTypeIsNotNull() {
addCriterion("payment_type is not null");
return (Criteria) this;
}
public Criteria andPaymentTypeEqualTo(Integer value) {
addCriterion("payment_type =", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeNotEqualTo(Integer value) {
addCriterion("payment_type <>", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeGreaterThan(Integer value) {
addCriterion("payment_type >", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("payment_type >=", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeLessThan(Integer value) {
addCriterion("payment_type <", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeLessThanOrEqualTo(Integer value) {
addCriterion("payment_type <=", value, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeIn(List<Integer> values) {
addCriterion("payment_type in", values, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeNotIn(List<Integer> values) {
addCriterion("payment_type not in", values, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeBetween(Integer value1, Integer value2) {
addCriterion("payment_type between", value1, value2, "paymentType");
return (Criteria) this;
}
public Criteria andPaymentTypeNotBetween(Integer value1, Integer value2) {
addCriterion("payment_type not between", value1, value2, "paymentType");
return (Criteria) this;
}
} }
/** /**
...@@ -958,6 +1048,7 @@ public class DcAveragePurchaseExample { ...@@ -958,6 +1048,7 @@ public class DcAveragePurchaseExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
@Deprecated
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) { if (ifAdd) {
add.add(this); add.add(this);
...@@ -966,12 +1057,43 @@ public class DcAveragePurchaseExample { ...@@ -966,12 +1057,43 @@ public class DcAveragePurchaseExample {
} }
/** /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria when(boolean condition, ICriteriaWhen then) {
if (condition) {
then.criteria(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) {
if (condition) {
then.criteria(this);
} else {
otherwise.criteria(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator. * This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_average_purchase * This interface corresponds to the database table dc_average_purchase
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
@Deprecated
public interface ICriteriaAdd { public interface ICriteriaAdd {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
...@@ -1075,4 +1197,40 @@ public class DcAveragePurchaseExample { ...@@ -1075,4 +1197,40 @@ public class DcAveragePurchaseExample {
this(condition, value, secondValue, null); this(condition, value, secondValue, null);
} }
} }
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaWhen {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void criteria(Criteria criteria);
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface IExampleWhen {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_average_purchase
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void example(DcAveragePurchaseExample example);
}
} }
\ No newline at end of file
...@@ -171,6 +171,8 @@ public class AutoTurnoverJob extends PointJob { ...@@ -171,6 +171,8 @@ public class AutoTurnoverJob extends PointJob {
//从采购平均指标,仓库平均指标拿周转天数, 拿不到的或者数值异常的, 才按上面的来 //从采购平均指标,仓库平均指标拿周转天数, 拿不到的或者数值异常的, 才按上面的来
DcAveragePurchase dcAveragePurchase = null; DcAveragePurchase dcAveragePurchase = null;
DcAverageWarehouse dcAverageWarehouse = null; DcAverageWarehouse dcAverageWarehouse = null;
//是否先款后货? 先款后货供应链长度加一天paymentBeforeDelivery = 1;
Integer paymentBeforeDelivery = null;
try { try {
DcBaseSkuMapper baseSkuMapper = SessionUtil.getSession().getMapper(DcBaseSkuMapper.class); DcBaseSkuMapper baseSkuMapper = SessionUtil.getSession().getMapper(DcBaseSkuMapper.class);
turnoverSku = baseSkuMapper.getTurnoverSku(bailunSku); turnoverSku = baseSkuMapper.getTurnoverSku(bailunSku);
...@@ -180,6 +182,9 @@ public class AutoTurnoverJob extends PointJob { ...@@ -180,6 +182,9 @@ public class AutoTurnoverJob extends PointJob {
dcAveragePurchase = dcAveragePurchaseMapper.selectOneByExample(DcAveragePurchaseExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku).andWarehouseCodeEqualTo(warehouseCode).andSupplierIdEqualTo(turnoverSku.getSuppliersId()).example()); dcAveragePurchase = dcAveragePurchaseMapper.selectOneByExample(DcAveragePurchaseExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku).andWarehouseCodeEqualTo(warehouseCode).andSupplierIdEqualTo(turnoverSku.getSuppliersId()).example());
DcAverageWarehouseMapper dcAverageWarehouseMapper = SessionUtil.getSession().getMapper(DcAverageWarehouseMapper.class); DcAverageWarehouseMapper dcAverageWarehouseMapper = SessionUtil.getSession().getMapper(DcAverageWarehouseMapper.class);
dcAverageWarehouse = dcAverageWarehouseMapper.selectOneByExample(DcAverageWarehouseExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku).andWarehouseCodeEqualTo(warehouseCode).example()); dcAverageWarehouse = dcAverageWarehouseMapper.selectOneByExample(DcAverageWarehouseExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku).andWarehouseCodeEqualTo(warehouseCode).example());
if (dcAveragePurchase != null && dcAveragePurchase.getPaymentType().equals(1)) {
paymentBeforeDelivery = 1;
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("Mybatis操作DB失败", e); throw new RuntimeException("Mybatis操作DB失败", e);
...@@ -200,6 +205,9 @@ public class AutoTurnoverJob extends PointJob { ...@@ -200,6 +205,9 @@ public class AutoTurnoverJob extends PointJob {
DcAutoConfigDelivery dcAutoConfigDelivery = getDcAutoConfigDelivery(bailunSku,warehouseCode, dcBaseWarehouse, bailunFirstLevelCatagoryId); DcAutoConfigDelivery dcAutoConfigDelivery = getDcAutoConfigDelivery(bailunSku,warehouseCode, dcBaseWarehouse, bailunFirstLevelCatagoryId);
//获取周转天数计算配置, 数据来源于.net同事计算的均值 //获取周转天数计算配置, 数据来源于.net同事计算的均值
Integer turnoverDays = getTurnoverDelivery(turnoverSku,dcBaseWarehouse, dcAutoTurnover, dcAutoConfigDelivery, dcAveragePurchase, dcAverageWarehouse); Integer turnoverDays = getTurnoverDelivery(turnoverSku,dcBaseWarehouse, dcAutoTurnover, dcAutoConfigDelivery, dcAveragePurchase, dcAverageWarehouse);
if (paymentBeforeDelivery != null) {
turnoverDays += paymentBeforeDelivery;
}
/* /*
* 因为第一个周转期再补货已经来不及 * 因为第一个周转期再补货已经来不及
* 所以预测2倍周转期长度 * 所以预测2倍周转期长度
...@@ -434,7 +442,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -434,7 +442,7 @@ public class AutoTurnoverJob extends PointJob {
stockUpSales = stockUpSales.add(forecastSalesList.get(i + turnoverDays + 1)); stockUpSales = stockUpSales.add(forecastSalesList.get(i + turnoverDays + 1));
} }
} }
dcAutoTurnover.setPaymentBeforeDelivery(paymentBeforeDelivery);
dcAutoTurnover.setStockUpDays(stockUpDays); dcAutoTurnover.setStockUpDays(stockUpDays);
dcAutoTurnover.setStockUpSales(stockUpSales); dcAutoTurnover.setStockUpSales(stockUpSales);
dcAutoTurnover.setQuantityBeginAdvise(forecastPurchaseAdvisedList.get(0)); dcAutoTurnover.setQuantityBeginAdvise(forecastPurchaseAdvisedList.get(0));
......
package com.bailuntec.domain.entity;
import java.math.BigDecimal;
import lombok.Data;
@Data
public class DcMidCostFirst {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_cost_first.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_cost_first.cost_first
*
* @mbg.generated
*/
private BigDecimal costFirst;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_cost_first.bailun_sku
*
* @mbg.generated
*/
private String bailunSku;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_cost_first.warehouse_code
*
* @mbg.generated
*/
private String warehouseCode;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", costFirst=").append(costFirst);
sb.append(", bailunSku=").append(bailunSku);
sb.append(", warehouseCode=").append(warehouseCode);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
DcMidCostFirst other = (DcMidCostFirst) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCostFirst() == null ? other.getCostFirst() == null : this.getCostFirst().equals(other.getCostFirst()))
&& (this.getBailunSku() == null ? other.getBailunSku() == null : this.getBailunSku().equals(other.getBailunSku()))
&& (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCostFirst() == null) ? 0 : getCostFirst().hashCode());
result = prime * result + ((getBailunSku() == null) ? 0 : getBailunSku().hashCode());
result = prime * result + ((getWarehouseCode() == null) ? 0 : getWarehouseCode().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcMidCostFirst;
import com.bailuntec.domain.example.DcMidCostFirstExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DcMidCostFirstMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
long countByExample(DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int deleteByExample(DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int insert(DcMidCostFirst record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int insertSelective(DcMidCostFirst record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcMidCostFirst selectOneByExample(DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
List<DcMidCostFirst> selectByExample(DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
DcMidCostFirst selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcMidCostFirst record, @Param("example") DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcMidCostFirst record, @Param("example") DcMidCostFirstExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcMidCostFirst record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
*/
int updateByPrimaryKey(DcMidCostFirst record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcMidCostFirst record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcMidCostFirst record);
}
\ No newline at end of file
table-name=dc_mid_cost_first table-name=dc_auto_turnover
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