| | |
| | | // lines = new String(lines.getBytes(), "utf-8"); |
| | | // sb.append(lines); |
| | | // } |
| | | logger.error("syncStocksFromSap---同步库存返回数据" + sb.toString()); |
| | | //解析json,更新库存 |
| | | JSONObject json = JSONObject.fromObject(sb.toString()); |
| | | String d = json.get("d").toString(); |
| | | JSONObject jsonItem = JSONObject.fromObject(d); |
| | | String results = jsonItem.get("results").toString(); |
| | | JSONArray array = JSONArray.fromObject(results); |
| | | |
| | | |
| | | result = locDetailService.delLocDetailByLocNo(loc_no); |
| | | if(array.size()>0) { |
| | | for(int i=0;i<array.size();i++){ |
| | |
| | | String altme = job.get("altme").toString(); |
| | | |
| | | LocDetailBean locDetl = new LocDetailBean(); |
| | | // logger.error("syncStocksFromSap---插入数据" + matnr+"-"+maktx+"-"+werks+"-"+gesme+"-"+altme); |
| | | locDetl.setLoc_no(loc_no); |
| | | locDetl.setMatnr(matnr); |
| | | locDetl.setLgnum("385"); |
| | |
| | | locDetl.setZpallet(barcode); |
| | | locDetl.setBname(""); |
| | | result = locDetailService.insertLocDetail(locDetl); |
| | | // logger.error("syncStocksFromSap---插入结果" + result); |
| | | |
| | | if(result<=0) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("sendSyncStockCmd Error----" + e.getMessage()); |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | return result; |