Commit e2ef7148 by yinyong

自动周转--重跑计算漏数据

parent fed8fdef
...@@ -136,12 +136,16 @@ public interface DcBaseStockMapper { ...@@ -136,12 +136,16 @@ public interface DcBaseStockMapper {
List<DcBaseStock> listParameterStockById(@Param("jobParameter")String jobParameter,@Param("v1") int v1, @Param("v2") int v2); List<DcBaseStock> listParameterStockById(@Param("jobParameter")String jobParameter,@Param("v1") int v1, @Param("v2") int v2);
List<DcBaseStock> listAllStock(@Param("v1") int v1, @Param("v2") int v2);
List<DcBaseStock> listWarehouseStockById(@Param("warehouseCode")String warehouseCode,@Param("v1") int v1, @Param("v2") int v2); List<DcBaseStock> listWarehouseStockById(@Param("warehouseCode")String warehouseCode,@Param("v1") int v1, @Param("v2") int v2);
List<DcBaseStock> listInStockNotInAutoTurnover(); List<DcBaseStock> listInStockNotInAutoTurnover();
long countByParam(@Param("jobParameter") String jobParameter); long countByParam(@Param("jobParameter") String jobParameter);
long countAll();
long countByWarehouseCode(@Param("warehouseCode")String warehouseCode); long countByWarehouseCode(@Param("warehouseCode")String warehouseCode);
void updateSkuUnitPrice(); void updateSkuUnitPrice();
......
...@@ -1250,6 +1250,12 @@ ...@@ -1250,6 +1250,12 @@
where tb2.warehouse_code is not null and tb3.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2} where tb2.warehouse_code is not null and tb3.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2}
</select> </select>
<select id="listAllStock" resultType="com.bailuntec.domain.entity.DcBaseStock">
select * from dc_base_stock tb1
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where tb3.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2}
</select>
<select id="listWarehouseStockById" resultType="com.bailuntec.domain.entity.DcBaseStock"> <select id="listWarehouseStockById" resultType="com.bailuntec.domain.entity.DcBaseStock">
select * from dc_base_stock tb1 select * from dc_base_stock tb1
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
...@@ -1269,6 +1275,13 @@ ...@@ -1269,6 +1275,13 @@
where tb2.warehouse_code is not null and tb3.bailun_sku is null where tb2.warehouse_code is not null and tb3.bailun_sku is null
</select> </select>
<select id="countAll" resultType="long">
select count(*)
from dc_base_stock tb1
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where tb3.bailun_sku is null
</select>
<select id="countByWarehouseCode" resultType="long"> <select id="countByWarehouseCode" resultType="long">
select count(*) select count(*)
from dc_base_stock tb1 from dc_base_stock tb1
......
...@@ -74,6 +74,9 @@ public class AutoTurnoverJob extends PointJob { ...@@ -74,6 +74,9 @@ public class AutoTurnoverJob extends PointJob {
case "耗材仓": case "耗材仓":
dcBaseStockList = baseStockMapperFor.listParameterStockById(shardingContext.getJobParameter(),page * jobPointLog.getPageSize(), jobPointLog.getPageSize()); dcBaseStockList = baseStockMapperFor.listParameterStockById(shardingContext.getJobParameter(),page * jobPointLog.getPageSize(), jobPointLog.getPageSize());
break; break;
case "ALL":
dcBaseStockList = baseStockMapperFor.listAllStock(page * jobPointLog.getPageSize(), jobPointLog.getPageSize());
break;
default: default:
dcBaseStockList = baseStockMapperFor.listWarehouseStockById(shardingContext.getJobParameter(),page * jobPointLog.getPageSize(), jobPointLog.getPageSize()); dcBaseStockList = baseStockMapperFor.listWarehouseStockById(shardingContext.getJobParameter(),page * jobPointLog.getPageSize(), jobPointLog.getPageSize());
} }
...@@ -122,6 +125,8 @@ public class AutoTurnoverJob extends PointJob { ...@@ -122,6 +125,8 @@ public class AutoTurnoverJob extends PointJob {
case "第三方仓库": case "第三方仓库":
case "耗材仓": case "耗材仓":
return baseStockMapper.countByParam(jobParameter); return baseStockMapper.countByParam(jobParameter);
case "ALL":
return baseStockMapper.countAll();
default: default:
return baseStockMapper.countByWarehouseCode(jobParameter); return baseStockMapper.countByWarehouseCode(jobParameter);
} }
......
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