[Java]/*** the latest version to the page for generating a warehouse receiving ticket * @ return */public String saveIn () {getCapacity (duoStr); epcList = new ArrayList <Map <String, object> (); int k = 0; // k indicates the first stack. 0 indicates the first stack (default). // assign the remaining stack capacity to j, after assigning a stack to the epc, j minus 1 int j = Integer. parseInt (targetList. get (k ). get ("capacity "). toString (); // The id String x = (String) targetList of the current stack. get (k ). get ("id"); if (epcArray! = Null & epcArray. length> 0) {for (int I = 0; I <epcArray. length; I ++) {Map <String, Object> epcMap = new HashMap <String, Object> (); epcMap. put ("epc", epcArray [I]); epcMap. put ("storage", x); epcMap. put ("libId", libId); epcMap. put ("areaId", areaId); epcList. add (epcMap); // start to process the stack capacity j --; if (j = 0) {// if the stack is full, start to allocate the next stack k ++; j = Integer. parseInt (targetList. get (k ). get ("capacity "). toString (); x = (String) targetList. get (k ). get ("id") ;}}// Save the package information to the database for (Map <String, Object> epc: epcList) {inDAO. addEpc (Integer. parseInt (epc. get ("storage "). toString (), epc. get ("epc "). toString (), Integer. parseInt (epc. get ("libId "). toString (), Integer. parseInt (epc. get ("areaId "). toString (); inDAO. updateStatus (epc. get ("epc "). toString () ;}}// the logic before the smoke package exists // The interface for generating the warehouse receiving ticket must be filled in: structureList = queryMeta (table); for (Map <String, object> st: structureList) {// if metadate is of the drop-down list type, locate the drop-down list and add the if (st. get ("INPUT_TYPE "). toString (). equals ("3") {String SQL = st. get ("OWNER_ID "). toString (); List <Map <String, Object> list = inCenterDAO. querySelect (SQL); st. put ("SELECT_LIST", list) ;}return "saveIn" ;}and go to the jsp page to automatically generate a form [html] <table> <c: forEach items = "$ {structureList}" var = "st"> <c: if test = "$ {tdCount % 2 = 0}"> <tr> </c: if> <th >$ {st. meta_name} </th> <td> <c: if test = "$ {st. input_type = 1} "> <input type =" text "name =" $ {st. meta_key} "value =" $ {pa [st. meta_key]} "/> </c: if> <c: if test =" $ {st. input_type = 2} "> <input type =" text "name =" $ {st. meta_key} "value =" $ {pa [st. meta_key]} "onfocus =" WdatePicker ({skin: 'whygreen', dateFmt: 'yyyy-MM-dd HH: mm: ss', maxDate: '% y-% M-% d'}) "class =" Wdate "/> </c: if> <c: if test =" $ {st. input_type = 3} "> <select name =" $ {st. meta_key} "> <option value =" "> -- select -- </option> <c: forEach items =" $ {st. select_list} "var =" op "> <option value =" $ {op. id} ">$ {op. name} </option> </c: forEach> </select> </c: if> <c: if test = "$ {st. nullable = 0} "> <strong> * </strong> </c: if> </td> <c: set var = "tdCount" value = "$ {tdCount + 1}"> </c: set> <c: if test = "$ {tdCount % 2 = 0}"> </tr> </c: if> </c: forEach> </table> In February 23, the system worked overtime to automatically determine the number of packages that can be placed in each stack. There are many small Logics: [java] js. util. attachEvent (window, "load", freshData); js. util. attachEvent (window, "load", bindInterval); [java] function freshData () {js. ajax. post ("$ {path}/page/in/refreshIn. action ", {}, function (data) {var list = eval (data. responseText); for (var I in list) {createRow (list [I]) ;}}); // after processing the latest 10 lists, total reprocessing freshTotal ();} function createRow (item) {var table = js. util. byId ("data"); var classObj; if (table. rows. length % 2 = 1) {classObj = {className: "stagger"};} var tr = table. insertRow (table. rows. length); for (var I = 0; I <structure. length; I ++) {var td = tr. insertCell (tr. cells. length); td. innerHTML = item [structure [I]. key]; if (structure [I]. key = "epc") {js. util. create (window, 'input', {type: 'den den ', name: 'pcarray', value: item [structure [I]. key]}, null, td) ;}} function bindInterval () {setInterval (function () {// process the latest 10 lists var table = js. util. byId ("data"); var rows = table. rows; for (var I = rows. length-1; I> = 1; I --) {table. deleteRow (I) ;}freshdata (); ///// process the total number of incoming packets // freshTotal (); //}, 5000 );} [java] function freshTotal () {js. ajax. post ("$ {path}/page/in/totalIn. action ", {}, function (data) {var already = data. responseText; js. util. byId ("already "). innerHTML = already; var duoStr = "$ {duoStr}"; var targetName = "$ {targetName}"; var restStr = ""; // var restNum = already; // total number of warehouse receiving-total capacity of the traversed stacks var duoArray = duoStr. split ("$"); var duoNameArray = targetName. split ("|"); for (var I = 0; I <duoArray. length; I ++) {// print "Stack-3: You can put" This screenshot restStr + = duoNameArray [I] + ": can be put "; ///// calculate the capacity of the current stack var duoRest; // after the current smoke package is shelved, the size of the database (that is, the information to be displayed) var duoNum = duoArray [I]. split ("|") [1]; if (restNum> 0) // if the current stack has a stack (because the stack has not completed the inventory of the cigarette package) {// restNum or duoNum is considered as a string // if (restNum <= duoNum) {if (restNum-duoNum <= 0) {// if the current stack can complete the remaining cigarette package duoRest = duoNum-restNum;} else {duoRest = 0;} restNum-= duoNum ;} else {// The Current cigarette package has not started to be placed in this stack. // the total remaining capacity duoRest = duoNum for the current stack ;} // Add the information to the string restStr + = duoRest + "package;" //} js. util. byId ("rest "). innerHTML = restStr ;});}