public void getppcInfo(){ String hql="from EL_PickListTable where recId=1"; String hql2="from EL_PickListLine where pickListTableRecId=1"; List<EL_PickListTable>list =this.hibernateTemplate.find(hql); List<EL_PickListLine>list2 = this.hibernateTemplate.find(hql2); Iterator ita =list.iterator(); System.out.println("---------------"+list.size()); System.out.println("---------------"+list2.size()); EL_PickListTable elp=(EL_PickListTable)ita.next(); Iterator ita2=list2.iterator(); while(ita2.hasNext()){ ppcPickList ppc=new ppcPickList(); EL_PickListLine elp2=(EL_PickListLine)ita2.next(); ppc.setRefId(elp.getRefId()); ppc.setPickListNum(elp2.getPickListNum()); ppc.setItemId(elp2.getItemId()); ppc.setFrmWarehouse(elp2.getFrmWarehouse()); ppc.setFrmLocation(elp2.getFrmLocation()); ppc.setFrmProjId(elp2.getFrmProjId()); ppc.setFrmSKU(elp2.getFrmSKU()); ppc.setFrmBatchId(elp2.getFrmBatchId()); ppc.setToWarehouse(elp2.getToWarehouse()); ppc.setToLocation(elp2.getToLocation()); ppc.setToProjId(elp2.getToProjId()); ppc.setToSKU(elp2.getToSKU()); ppc.setToBatchId(elp2.getToBatchId()); ppc.setInputQty(elp2.getInputQty()); ppc.setInputUnit(elp2.getInputUnit()); ppc.setCreatedBy(elp.getCreatedBy()); ppc.setCreatedDate(new java.sql.Date(new java.util.Date().getTime()) ); //ppc.setTransId("test001"); //獲取transId String transId =this.el_TransIdTableController.returnTransId(); ppc.setTransId(transId); //獲取幾名 Map map = System.getenv(); String cName = map.get("COMPUTERNAME").toString(); ppc.setDeviceId(cName); ppc.setLineRefId(elp2.getRefId()); ppc.setLinePickListNum(elp2.getPickListNum()); ppc.setExFactoryNo(elp2.getExFactoryNo()); ppc.setLevelQty(elp2.getLevelQty()); ppc.setInputWeight(elp2.getInputWeight()); ppc.setRemarks(elp2.getRemarks()); ppc.setContainerType(elp2.getContainerType()); ppc.setContainerQty(elp2.getContainerQty()); ppc.setMouldId(elp2.getMouldId()); ppc.setMouldRefNum(elp2.getMouldRefNum()); ppc.setMouldVersion(elp2.getMouldVersion()); ppc.setDataAreaId(elp2.getDataareaId()); ppc.setRecId(elp2.getRecId()); System.out.println("執行保存數據--------###------"); this.saveInfo(ppc); elp.printInfo(); System.out.println("保存數據成功--------使transId+1-----"); this.el_TransIdTableController.updateInforById(); System.out.println("將上載單頭插入臨時表裏面"); ppcPickListLogin ppcLogin=new ppcPickListLogin(); ppcLogin.setTransId(ppc.getTransId()); System.out.println("打印測試信息+++++++++++++++"+ppc.getTransId()); ppcLogin.setUserName(ppc.getCreatedBy());//應該插入當前登陸用戶 ppcLogin.setErrorMessage(""); ppcLogin.setPassword(""); this.ppcpickListLoginDAO.saveppcLoginInfo(ppcLogin); System.out.println("更改EL_PickListTable表中的---上載狀態0-1 修改TransId 同時修改上載時間"); elp.setUploadStatus(1); elp.setTransId(ppc.getTransId()); elp.setUploadDate(new java.sql.Date(new java.util.Date().getTime())); this.el_PickListTableDAO.updateInfo(elp); } }
我不会代码设计--看着自己写的稀烂的代码 想哭了都。。
最新推荐文章于 2024-11-12 21:14:07 发布