npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

get-book-inventory

v0.1.2

Published

get book inventroy information from Mysql to MongoDB

Downloads

4

Readme

What

get the books inventory list .

config

  • BaseUrl: http://domain/books/
  • strat: 0
  • end: 100

combine the params to http://domain/books/?start=xx&end=yy

通过参数设定从url地址获取所有的book纪录的json个数的数据,这些数据只取从start到end这么多个,太多了处理不过来

  • model: 对应MongoDB中的那个数据模型
  • callback: 回调函数

model

获取的数据sample:

{
		"err": false,
		"books": {
        "19": {
            "count": 5,
            "left_count": 5,
            "pcode": "11242172",
            "tag": null,
            "isbn": "7539105002112",
            "name": "不一样的卡梅拉·第二季(套装全12册)",
            "sub_number": 1,
            "in_time": "2014-09-30T05:46:55Z",
            "location": "1-1"
        },
        "20": {
            "count": 1,
            "left_count": 0,
            "pcode": "11242172",
            "tag": null,
            "isbn": "7539105002112",
            "name": "不一样的卡梅拉·第二季(套装全12册)",
            "sub_number": 2,
            "in_time": "2014-09-30T05:47:12Z",
            "location": "1-23-1"
        }
		},
		"err": false,
}

** model in MongoDB **

- "inv_id"     // 入库原来id
- "count"      // 同一本书总数, 大于1的,统计了一共90个。
- "left_count" // 库存余数
+ "in_time"  // 入库时间
+ "location" // 对应的格子位置
+ "inv_code" // 入库条码 format: 10410000xxxx
+ "isRented"   // 是否借出
+ "book"     // 对应另一个Model: Book

Book中:
"name"
"pcode"
"isbn"
... by jd-book module.

与原来数据库改变的地方

  • 一模一样的书现在通过入库的自制的条形码来唯一地区分,不存在同一本书了。所以不需要统计同一本书的总数和库存余数。
  • 过渡阶段需要统计出哪些书的入库编号一样,但是数量不是1个的,需要每个都贴上自制的条形码。

过渡阶段,对接hbg系统的解决办法

  1. 所有inv_code合法的都直接转出进行操作
  2. 没有自制条码的,贴码,在系统中进行入库操作。
  3. 有自制条码,但是系统说找不到的或者图书信息错误的,登记本子上,技术员手动修改。

hbg

next()

  • store to mongoDB
  • use jd-book module
    • get the book's basic info from jd.com
    • store to MongoDB