Commit 4598f9e8 by huluobin

update

parent 26151acd
......@@ -31,8 +31,8 @@ public class SalesDetailItem {
this.showSales = salesDayConfig;
}
if (weekCoefficient != null) {
this.showSales = showSales.multiply(weekCoefficient);
}
// if (weekCoefficient != null) {
// this.showSales = showSales.multiply(weekCoefficient);
// }
}
}
package com.bailuntec.domain.entity;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class DcAutoFastestStorage {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.bailun_sku
*
* @mbg.generated
*/
private String bailunSku;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.warehouse_code
*
* @mbg.generated
*/
private String warehouseCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.country_code
*
* @mbg.generated
*/
private String countryCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.purchase_days
*
* @mbg.generated
*/
private Integer purchaseDays;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.trans_days
*
* @mbg.generated
*/
private Integer transDays;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_fastest_storage.gmt_update_date
*
* @mbg.generated
*/
private LocalDateTime gmtUpdateDate;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @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(", bailunSku=").append(bailunSku);
sb.append(", warehouseCode=").append(warehouseCode);
sb.append(", countryCode=").append(countryCode);
sb.append(", purchaseDays=").append(purchaseDays);
sb.append(", transDays=").append(transDays);
sb.append(", gmtUpdateDate=").append(gmtUpdateDate);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
DcAutoFastestStorage other = (DcAutoFastestStorage) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getBailunSku() == null ? other.getBailunSku() == null : this.getBailunSku().equals(other.getBailunSku()))
&& (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode()))
&& (this.getCountryCode() == null ? other.getCountryCode() == null : this.getCountryCode().equals(other.getCountryCode()))
&& (this.getPurchaseDays() == null ? other.getPurchaseDays() == null : this.getPurchaseDays().equals(other.getPurchaseDays()))
&& (this.getTransDays() == null ? other.getTransDays() == null : this.getTransDays().equals(other.getTransDays()))
&& (this.getGmtUpdateDate() == null ? other.getGmtUpdateDate() == null : this.getGmtUpdateDate().equals(other.getGmtUpdateDate()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getBailunSku() == null) ? 0 : getBailunSku().hashCode());
result = prime * result + ((getWarehouseCode() == null) ? 0 : getWarehouseCode().hashCode());
result = prime * result + ((getCountryCode() == null) ? 0 : getCountryCode().hashCode());
result = prime * result + ((getPurchaseDays() == null) ? 0 : getPurchaseDays().hashCode());
result = prime * result + ((getTransDays() == null) ? 0 : getTransDays().hashCode());
result = prime * result + ((getGmtUpdateDate() == null) ? 0 : getGmtUpdateDate().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcAutoFastestStorage;
import com.bailuntec.domain.example.DcAutoFastestStorageExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DcAutoFastestStorageMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
long countByExample(DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int deleteByExample(DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int insert(DcAutoFastestStorage record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int insertSelective(DcAutoFastestStorage record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcAutoFastestStorage selectOneByExample(DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
List<DcAutoFastestStorage> selectByExample(DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
DcAutoFastestStorage selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcAutoFastestStorage record, @Param("example") DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcAutoFastestStorage record, @Param("example") DcAutoFastestStorageExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcAutoFastestStorage record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
*/
int updateByPrimaryKey(DcAutoFastestStorage record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcAutoFastestStorage record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_fastest_storage
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcAutoFastestStorage record);
}
\ No newline at end of file
......@@ -2926,8 +2926,7 @@
fourteenday_sales,
thridteenday_sales,
twelveday_sales,
elevenday_sales
,
elevenday_sales,
tenday_sales,
nineday_sales,
eightday_sales,
......
......@@ -133,7 +133,6 @@ public interface DcMidTransitMapper {
void calculateOutStock(@Param("list") List<OutStockQuantity> list, @Param("localDateTime") LocalDateTime localDateTime);
void insertMidDailyTransit();
List<OutStockQuantity> selectQuantityOutStock();
......@@ -142,10 +141,6 @@ public interface DcMidTransitMapper {
List<TransferTransitQuantity> selectQuantityTransferTransit();
@Select("select @@tx_isolation;")
String printTransactionLevel();
void updateOldTransferToZero(@Param("transferModified") String transferModified);
void updateOldPurchaseToZero(@Param("purchaseModified") String purchaseModified);
......@@ -162,7 +157,9 @@ public interface DcMidTransitMapper {
void updateOldUnshippedToZero(@Param("unshippedModified") LocalDateTime unshippedModified);
void calculateUnshipped();
void calculateUnShipped();
void updateSkuUnitPrice();
void selectUnShipped();
}
......@@ -808,7 +808,7 @@
when platform_type = 'Aliexpress'
then bailun_sku_quantity_ordered - bailun_sku_quantity_pushed
else 0 end) as aliexpress_quantity
FROM dc_base_oms_sku
FROM dc_base_oms_sku_30
WHERE bailun_order_status = 'Handling'
and bailun_interception_status in ('None', 'Failed')
and warehouse_code != ''
......@@ -860,7 +860,7 @@
price,
transport_type
FROM dc_base_purchase
WHERE buy_status IN (0, 1, 2, 3,9)
WHERE buy_status IN (0, 1, 2, 3, 9)
AND has_delete = 0
GROUP BY bailun_sku,
parent_id
......@@ -933,8 +933,9 @@
select max(gmt_unshipped_modified)
from dc_mid_transit
</select>
<select id="selectUnShipped"></select>
<insert id="calculateUnshipped">
<insert id="calculateUnShipped">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_unshipped, gmt_unshipped_modified,
bailun_order_ids)
SELECT t1.bailun_sku,
......@@ -949,7 +950,7 @@
SUM(bailun_sku_quantity_shipped) AS bailun_sku_quantity_shipped,
GROUP_CONCAT(DISTINCT
(case when warehouse_code = 'BLGZ03' then bailun_order_id else '' end)) as 'bailun_order_ids'
FROM dc_base_oms_sku
FROM dc_base_oms_sku_30
WHERE bailun_order_status = 'Handling'
and bailun_interception_status in ('None', 'Failed')
and warehouse_code != ''
......
......@@ -127,4 +127,6 @@ public interface SalesDayConfigMapper {
List<SalesDayConfig> selectByDays(@Param("salesDetailItemList") List<SalesDetailItem> salesDetailItemList,
@Param("bailunSku") String bailunSku,
@Param("warehouseCode") String warehouseCode);
List<SalesDayConfig> selectTarget();
}
......@@ -546,6 +546,9 @@
</foreach>
and t2.id is not null
</select>
<select id="selectTarget" resultType="com.bailuntec.domain.entity.SalesDayConfig">
select DISTINCT bailun_sku,warehouse_code from sales_day_config
</select>
</mapper>
table-name=dc_base_queue
table-name=dc_auto_fastest_storage
......@@ -18,7 +18,7 @@ public class CalculateUnshippedJob implements SimpleJob {
SqlSession sqlSession = SessionUtil.getFactory().openSession(TransactionIsolationLevel.READ_UNCOMMITTED);
try {
DcMidTransitMapper mapper = sqlSession.getMapper(DcMidTransitMapper.class);
mapper.calculateUnshipped();
mapper.calculateUnShipped();
sqlSession.commit();
} catch (Exception e) {
e.printStackTrace();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,9 +10,9 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE=data-center
JOB_NAME=show-auto-turnover20
#JOB_CRON=0 30 0 * * ?
JOB_CRON=0 10 12 * * ?
JOB_NAME=show-auto-turnover23
JOB_CRON=0 0 3 * * ?
#JOB_CRON=0 20 21 * * ?
SHARDING_TOTAL_COUNT=8
......
......@@ -2,11 +2,13 @@ import com.alibaba.excel.EasyExcel;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.entity.DcBaseStock;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.entity.SalesDayConfig;
import com.bailuntec.domain.example.DcBaseStockExample;
import com.bailuntec.excel.DcAutoTurnoverExcel;
import com.bailuntec.excel.ExcelListener;
import com.bailuntec.job.AutoTurnoverJob;
import com.bailuntec.mapper.DcBaseStockMapper;
import com.bailuntec.mapper.SalesDayConfigMapper;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
......@@ -147,6 +149,30 @@ public class AutoTurnoverTest {
//949406801 GZBLWH
@Test
public void testXX() {
DcBaseStockMapper dcBaseStockMapper = SessionUtil.getSession().getMapper(DcBaseStockMapper.class);
SalesDayConfigMapper salesDayConfigMapper = SessionUtil.getSession().getMapper(SalesDayConfigMapper.class);
AutoTurnoverJob autoTurnoverJob = new AutoTurnoverJob();
List<SalesDayConfig> salesDayConfigList = salesDayConfigMapper.selectTarget();
salesDayConfigList.parallelStream().forEach(salesDayConfig -> {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo(salesDayConfig.getBailunSku())
.andWarehouseCodeEqualTo(salesDayConfig.getWarehouseCode())
.example());
try {
autoTurnoverJob.autoTurnoverFromStock(DateTimeFormatter.ofPattern(CommonConstant.DATE_FORMAT).format(LocalDate.now()), dcBaseStock);
} catch (Exception e) {
e.printStackTrace();
}
});
}
@Test
public void testXX2() {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("N-S-BT")
......
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