Commit 5692ca77 by liyanlin

fix

parent 4eaed01a
......@@ -8,7 +8,6 @@ import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
* <p>
......@@ -24,7 +23,7 @@ public interface DcSemiDailyStockMapper extends BaseMapper<DcSemiDailyStock> {
"select #{lastDay},l.final_stock * ifnull(ol.price,0),l.sku_code,l.sku_name,l.final_stock,ifnull(ol.price,0),l.warehouse_id,l.warehouse_name," +
"case when l.redundancy_stock is null then 0 when l.redundancy_stock < 0 then 0 else l.redundancy_stock end " +
"from dc_semi_stock_log l left join dc_semi_supplier_offer_log ol on l.sku_code = ol.sku_code")
void insertSemiDailyStock(@Param("lastDay") Date lastDay);
void insertSemiDailyStock(@Param("lastDay") LocalDate lastDay);
@Select("select ifnull(sum(inventory_amount),0) from dc_semi_daily_stock where day = #{lastDay}")
BigDecimal getSemiDailyStockSum(@Param("lastDay") LocalDate lastDay);
......
......@@ -49,43 +49,45 @@
<select id="selectOutStockQuantity" resultType="com.bailuntec.domain.DcMidTransit">
SELECT t1.bailun_sku as bailunSku,
t1.warehouse_code as warehouseCode,
t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_pushed - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0) as quantity_out_stock,
if((t1.aliexpress_quantity - t2.usable_stock - t2.occupy_stock + ifnull(t3.safe_stock, 0)) &lt; 0, 0,
(t1.aliexpress_quantity - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0))) as quantity_out_stock_aliexpress,
t4.id
FROM (
SELECT bailun_sku,
warehouse_code,
SUM(bailun_sku_quantity_ordered) AS bailun_sku_quantity_ordered,
SUM(bailun_sku_quantity_pushed) AS bailun_sku_quantity_pushed,
sum(IF(platform_type = 'Aliexpress', bailun_sku_quantity_ordered - bailun_sku_quantity_pushed,
0)) as aliexpress_quantity
FROM dc_base_oms_sku_30
WHERE bailun_order_status = 'Handling'
and company_id = 1
and has_delete = 0
and has_scalp = 0
and has_buyer_remark = 0
and has_platsku_remark = 0
and has_fba_s = 0
and has_innersale = 0
and paid_time >= '2019-03-01 12:00:00'
and bailun_sku_quantity_ordered > bailun_sku_quantity_shipped
and bailun_interception_status in ('None', 'Failed')
and warehouse_code != ''
and platform_type != 'FBA'
GROUP BY bailun_sku, warehouse_code
) t1
INNER JOIN dc_base_stock t2 ON t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
LEFT JOIN dc_auto_jit_inventory t3
ON t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code and t3.status = 1
left join dc_mid_transit t4 ON t1.bailun_sku = t4.bailun_sku and t1.warehouse_code = t4.warehouse_code
WHERE (t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_pushed - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0)) >= 0
SELECT t2.bailun_sku as bailunSku,
t2.warehouse_code as warehouseCode,
ifnull(t1.bailun_sku_quantity_ordered,0) - ifnull(t1.bailun_sku_quantity_pushed,0) - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0) as quantity_out_stock,
if((t1.aliexpress_quantity - t2.usable_stock - t2.occupy_stock + ifnull(t3.safe_stock, 0)) &lt; 0, 0,
(t1.aliexpress_quantity - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0))) as quantity_out_stock_aliexpress,
t4.id
FROM
dc_base_stock t2
left JOIN (
SELECT bailun_sku,
warehouse_code,
SUM(bailun_sku_quantity_ordered) AS bailun_sku_quantity_ordered,
SUM(bailun_sku_quantity_pushed) AS bailun_sku_quantity_pushed,
sum(IF(platform_type = 'Aliexpress', bailun_sku_quantity_ordered - bailun_sku_quantity_pushed,
0)) as aliexpress_quantity
FROM dc_base_oms_sku_30
WHERE bailun_order_status = 'Handling'
and company_id = 1
and has_delete = 0
and has_scalp = 0
and has_buyer_remark = 0
and has_platsku_remark = 0
and has_fba_s = 0
and has_innersale = 0
and paid_time >= '2019-03-01 12:00:00'
and bailun_sku_quantity_ordered > bailun_sku_quantity_shipped
and bailun_interception_status in ('None', 'Failed')
and warehouse_code != ''
and platform_type != 'FBA'
GROUP BY bailun_sku, warehouse_code
) t1
ON t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
LEFT JOIN dc_auto_jit_inventory t3
ON t2.bailun_sku = t3.bailun_sku and t2.warehouse_code = t3.warehouse_code and t3.status = 1
left join dc_mid_transit t4 ON t2.bailun_sku = t4.bailun_sku and t2.warehouse_code = t4.warehouse_code
WHERE (ifnull(t1.bailun_sku_quantity_ordered,0) - ifnull(t1.bailun_sku_quantity_pushed,0) - t2.usable_stock - t2.occupy_stock +
ifnull(t3.safe_stock, 0)) > 0
limit #{pageStart},#{pageOffset}
</select>
......
package com.bailuntec;
import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
@Configuration
public class FeignConfig {
@Bean
public Request.Options options() {
return new Request.Options(2L, TimeUnit.MINUTES,2,TimeUnit.MINUTES,true);
}
@Bean
public Retryer feignRetryer(){
Retryer retryer = new Retryer.Default(100, 2000, 5);
return retryer;
}
}
......@@ -139,7 +139,7 @@ public class BalanceSheetJob {
* </p>
* 数据来源
*/
@Scheduled(cron = "0 0 3 * * ?")
@Scheduled(cron = "0 0 8 * * ?")
public void generateBalanceSheet() {
try {
log.info("每天1点 生成资产负债表 开始");
......@@ -159,7 +159,7 @@ public class BalanceSheetJob {
* </p>
* 数据来源
*/
@Scheduled(cron = "0 0 4 * * ?")
@Scheduled(cron = "0 0 9 * * ?")
public void generateBalanceSheetNewResult() {
try {
log.info("每天1点 生成新资产负债结果表 开始");
......
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