Commit 4b62b2e6 by wutong

修复同步WMS库存分页问题

parent 7043bbb0
......@@ -108,7 +108,7 @@ public class FbaStockJob extends PointJob {
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1);
} while (jobPointLog.getPageIndex() <= totalPage);
if (jobPointLog.getPageIndex() > totalPage) jobPointLog.setPageIndex(1);
jobPointLog.setPageIndex(1);
try {
DcBaseStockMapper mapper = SessionUtil.getSession().getMapper(DcBaseStockMapper.class);
hashmap.forEach(((skuWarehouse, dcBaseStock) -> {
......
......@@ -8,6 +8,7 @@ import com.bailuntec.domain.example.DcBaseStockExample;
import com.bailuntec.domain.pojo.*;
import com.bailuntec.mapper.DcBaseStockMapper;
import com.bailuntec.mapper.DcBaseWarehouseMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
......@@ -87,6 +88,10 @@ public class WmsStockJob extends PointJob {
mapper.insertSelective(dcBaseStock);
}
});
if (jobPointLog.getPageIndex() % 5 == 0) {
JobPointLogMapper jobPointLogMapper = SessionUtil.getSession().getMapper(JobPointLogMapper.class);
jobPointLogMapper.upsertSelective(jobPointLog);
}
} catch (Exception e) {
throw new RuntimeException("MYBATIS操作DB失败", e);
} finally {
......@@ -101,6 +106,7 @@ public class WmsStockJob extends PointJob {
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1);
} while (jobPointLog.getPageIndex() <= totalPage);
jobPointLog.setPageIndex(1);
jobPointLog.setStartTime(now);
jobPointLog.setEndTime(LocalDateTime.now());
}
......
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