Smart replenishment at random (compare current inventory and standard inventory regularly, and make up if it is small)

 First is null to obtain the set must have the maximum value. First get the maximum and then see if it is null, so there may not be a result 

 

If there is no result, it will not be imported, because is not null has been imported.

 

The latest record is updated to the order, whether it is the same old data or new data that is not the same as the original (need_num is larger anyway, which does not affect the accuracy of the data). I can only do this, I can't confirm whether it is new data or old data. (The newest old data is imported and added is duplicated, and the latest new data is imported and added, the number before the overlap is wrong. So I can only modify- The modification of the old data does not prevent the increase of the number of replenishments even if it is cumbersome, and the modification of the new data does not prevent the increase of the number of replenishments on the original basis. For example, the number of replenishment required 2 becomes the new 3) 10-8--"10-7 (stock 8 is reduced to 7)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326441098&siteId=291194637