src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/nanometer/smartlab/controller/WarehouseStockMngController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/apply_mng_new.xhtml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/warehouse_stock_mng.xhtml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java
@@ -16,6 +16,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.primefaces.context.RequestContext; import org.primefaces.event.SelectEvent; import org.primefaces.event.TabChangeEvent; import org.primefaces.model.LazyDataModel; import org.primefaces.model.SortOrder; import org.springframework.context.annotation.Scope; @@ -77,6 +78,8 @@ private String applyNewCas; private String applyNewSn; private SysReagent selectReagent; private int tabValue; private boolean isFlush = false; @@ -88,6 +91,7 @@ public void setSelectReagent(SysReagent selectReagent) { try { sysUserService.updateUserFavor(selectReagent, getUser()); this.isFlush = true; } catch (Exception e) { e.printStackTrace(); FacesUtils.warn(e.getMessage()); @@ -417,6 +421,19 @@ } } public void onTabChange(TabChangeEvent event) { if ("reagent".equals(event.getTab().getId())) { tabValue = 0; if (isFlush){ RequestContext.getCurrentInstance().execute("document.querySelector('.reagentSearch').click()"); isFlush = false; } }else if ("applyHistory".equals(event.getTab().getId())){ tabValue = 1; }else{ tabValue = 2; } } public void onReagentNewBtnClick() { this.sysReagent = new SysReagent(); } @@ -949,5 +966,11 @@ } public int getTabValue() { return tabValue; } public void setTabValue(int tabValue) { this.tabValue = tabValue; } } src/main/java/com/nanometer/smartlab/controller/WarehouseStockMngController.java
@@ -18,6 +18,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.primefaces.context.RequestContext; import org.primefaces.event.SelectEvent; import org.primefaces.event.TabChangeEvent; import org.primefaces.model.LazyDataModel; import org.primefaces.model.SortOrder; import org.primefaces.model.StreamedContent; @@ -126,6 +127,7 @@ private String reagentLogId; private String userName; private Integer tabValue = 0; private List<SysReagent> reagentSelectList; private List<String> showCodes; @@ -436,19 +438,18 @@ return; } ArrayList<Integer> indexs = new ArrayList<>(); for (int i =0;i<trulySelectedList.size();i++){ for (int j = 0; j < selectedTmpList.size(); j++) { if(trulySelectedList.get(i).getId().equals(selectedTmpList.get(j).getId())) { indexs.add(i); ArrayList<Object> indexs = new ArrayList<>(); for (OpeWarehouseReserve warehouseReserve : trulySelectedList) { for (OpeWarehouseReserve opeWarehouseReserve : selectedTmpList) { if (warehouseReserve.getId().equals(opeWarehouseReserve.getId())) { indexs.add(warehouseReserve); } } } if (indexs.size()>0){ indexs.forEach(index -> { selectedTmpList.remove(selectedTmpList.get(index)); indexs.forEach(obj -> { selectedTmpList.remove(obj); }); } @@ -465,19 +466,18 @@ return; } ArrayList<Integer> indexs = new ArrayList<>(); for (int i =0;i<trulySelectedOrderList.size();i++){ for (int j = 0; j < selectedTmpOrderList.size(); j++) { if(trulySelectedOrderList.get(i).getId().equals(selectedTmpOrderList.get(j).getId())) { indexs.add(i); ArrayList<Object> indexs = new ArrayList<>(); for (OpeApplyReserve opeApplyReserve : trulySelectedOrderList) { for (OpeApplyReserve applyReserve : selectedTmpOrderList) { if (opeApplyReserve.getId().equals(applyReserve.getId())) { indexs.add(opeApplyReserve); } } } if (indexs.size()>0){ indexs.forEach(index -> { selectedTmpOrderList.remove(selectedTmpOrderList.get(index)); indexs.forEach(obj -> { selectedTmpOrderList.remove(obj); }); } @@ -566,7 +566,7 @@ } } // 将当前选择条形码保存到库存中 for (OpeApplyReserve opeApplyReserve : this.selectedListForPerson) { for (OpeApplyReserve opeApplyReserve : this.selectedTmpOrderList) { if (opeApplyReserve.getId().equals(this.selectedOpeApplyReserve.getId())) { OpeWarehouseReserve wa=opeWarehouseReserveService.getOpeWarehouseReserve(opeApplyReserve.getReagent().getId(),opeApplyReserve.getArticleNumber()); if(this.useNum > wa.getReserve()) @@ -650,14 +650,18 @@ List<String> codeList=new ArrayList<>(); for (OpeApplyReserve opeApplyReserve : this.selectedTmpOrderList) { if (opeApplyReserve.getId().equals(this.selectedOpeApplyReserve.getId())) { OpeWarehouseReserve wa=opeWarehouseReserveService.getOpeWarehouseReserve(opeApplyReserve.getReagent().getId(),opeApplyReserve.getArticleNumber()); if(wa==null){ wa=new OpeWarehouseReserve(); wa.setReserve(0); } if(this.useNum > wa.getReserve()) { FacesUtils.warn("库存不够,请确认或申购!"); // OpeWarehouseReserve wa=opeWarehouseReserveService.getOpeWarehouseReserve(opeApplyReserve.getReagent().getId(),opeApplyReserve.getArticleNumber()); // if(wa==null){ // wa=new OpeWarehouseReserve(); // wa.setReserve(0); // } // if(this.useNum > wa.getReserve()) // { // FacesUtils.warn("库存不够,请确认或申购!"); // return; // } if (this.useNum+opeApplyReserve.getUsed() > opeApplyReserve.getNum()){ FacesUtils.warn("领用数量超出申请数量!"); return; } opeApplyReserve.setSelectNum(useNum); @@ -783,7 +787,7 @@ System.out.println("====onYesBtnClick======"); // 将当前选择条形码保存到库存中 for (OpeWarehouseReserve opeWarehouseReserve : this.selectedList) { for (OpeWarehouseReserve opeWarehouseReserve : this.selectedTmpList) { if (opeWarehouseReserve.getId().equals(this.selectedOpeWarehouseReserve.getId())) { if(this.useNum > opeWarehouseReserve.getReserve()) { @@ -807,11 +811,23 @@ } } public void onTabChange(TabChangeEvent event) { if ("firstTab".equals(event.getTab().getId())) { tabValue = 0; }else{ tabValue = 1; } } public void onCancelBtnClick() { this.selectedTmpOrderList = null; this.selectedTmpList = null; this.menuController.backToPage(); } public void onClose(){ this.selectedTmpOrderList = null; this.selectedTmpList = null; this.menuController.backToPage(); } @@ -824,7 +840,7 @@ public void onSaveBtnClickForPerson(){ try { if (this.selectedListForPerson == null || this.selectedListForPerson.size() == 0) { if (this.selectedTmpOrderList == null || this.selectedTmpOrderList.size() == 0) { FacesUtils.warn("请选择申领试剂。"); return; } @@ -836,7 +852,7 @@ List<OpeApplyReserve> list=new ArrayList<>(); List<OpeApplyReserve> list2=new ArrayList<>(); //int size = 0; for(OpeApplyReserve app:this.selectedListForPerson){ for(OpeApplyReserve app:this.selectedTmpOrderList){ if(app.getFlag()==1){ list.add(app); }else { @@ -1040,7 +1056,7 @@ } public void onSaveBtnClick() { try { if (this.selectedList == null || this.selectedList.size() == 0) { if (this.selectedTmpList == null || this.selectedTmpList.size() == 0) { FacesUtils.warn("请选择申领试剂。"); return; } @@ -1065,7 +1081,7 @@ int sum = 0; List<OpeWarehouseReserve> list=new ArrayList<>(); List<OpeWarehouseReserve> list2=new ArrayList<>(); for (OpeWarehouseReserve selectWarehouseReserve : this.selectedList) { for (OpeWarehouseReserve selectWarehouseReserve : this.selectedTmpList) { if(selectWarehouseReserve.getFlag()==1){ list.add(selectWarehouseReserve); }else{ @@ -2206,4 +2222,13 @@ public void setTrulySelectedOrderList(List<OpeApplyReserve> trulySelectedOrderList) { this.trulySelectedOrderList = trulySelectedOrderList; } public Integer getTabValue() { return tabValue; } public void setTabValue(Integer tabValue) { this.tabValue = tabValue; } } src/main/webapp/apply_mng_new.xhtml
@@ -282,9 +282,9 @@ </p:panel> </h:form> <br/> <p:tabView dynamic="true" style="margin-left: 26px"> <p:tab title="试剂库"> <p:tabView dynamic="true" style="margin-left: 26px" activeIndex="#{applyMngController.tabValue}"> <p:ajax event="tabChange" listener="#{applyMngController.onTabChange}"/> <p:tab title="试剂库" id="reagent"> <h:form id="applyMngNewReagentForm"> <p:panelGrid styleClass="apply-mng-new-reagent-filter" columns="9" style="margin-left: -18px"> <p:outputLabel value="试剂名称:"></p:outputLabel> @@ -294,7 +294,7 @@ <p:inputText value="#{applyMngController.applyNewCas}"></p:inputText> <p:outputLabel value="产品编号:"></p:outputLabel> <p:inputText value="#{applyMngController.applyNewSn}"></p:inputText> <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink> <p:commandLink styleClass="search reagentSearch" process="@form" update="@form"></p:commandLink> </p:panelGrid> <p:commandButton value="新增试剂" process="@this" @@ -437,7 +437,7 @@ </h:form> </p:dialog> </p:tab> <p:tab title="申请履历">` <p:tab title="申请履历" id="applyHistory"> <h:form id="applyMngNewHistoryForm"> <p:panelGrid styleClass="apply-mng-new-reagent-filter" columns="5" style="margin-left: -18px"> @@ -528,8 +528,8 @@ </p:dataTable> </h:form> </p:tab> <p:tab title="我的收藏"> <h:form id="myFavor"> <p:tab title="我的收藏" id="favor"> <h:form id="myFavor" styleClass="myFavor"> <!-- <p:panelGrid style="margin: 5px">--> <!-- <div class="label-tip" style="margin-left: 5px; ">注意:已经收藏的试剂不会再出现在<span style="font-weight: 900;">*试剂库*</span>页面中</div>--> <!-- </p:panelGrid>--> @@ -581,9 +581,11 @@ <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentType)}"></h:outputText> </p:column> <p:column headerText="操作" style="text-align: center;"> <h:commandButton styleClass="favor-btn-common #{row.favor == null?'favor-btn':'not-favor-btn'}" value="#{row.favor == null?'加入收藏':'取消收藏'}" update="@this"> <p:commandButton styleClass="favor-btn-common #{row.favor == null?'favor-btn':'not-favor-btn'}" style="background-image:unset;background-color: #1b9aee;color:#ffffff;border: unset" value="#{row.favor == null?'加入收藏':'取消收藏'}" update="@(.myFavor)"> <f:setPropertyActionListener value="#{row}" target="#{applyMngController.selectReagent}" /> </h:commandButton> </p:commandButton> </p:column> </p:dataTable> src/main/webapp/warehouse_stock_mng.xhtml
@@ -9,8 +9,9 @@ xmlns:c="http://java.sun.com/jsp/jstl/core"> <head></head> <ui:composition> <p:tabView dynamic="true"> <p:tab title="备货领取"> <p:tabView dynamic="true" id="tabView" activeIndex="#{warehouseStockMngController.tabValue}"> <p:ajax event="tabChange" listener="#{warehouseStockMngController.onTabChange}"/> <p:tab title="备货领取" id="firstTab"> <div id ="showTab" style="display: none"> <h:form id="tmp"> <p:panel styleClass="center-body"> @@ -177,6 +178,166 @@ </div> </h:form> </p:tab> <p:tab title="订单领取" id="secondTab"> <div id ="showTabOrder" style="display: none"> <h:form id="tmpOrder" styleClass="tmpOrder"> <p:panel styleClass="center-body"> <p:panelGrid columns="3" styleClass="btn"> <p:commandButton value="删除" styleClass="del-btn" process="@form" actionListener="#{warehouseStockMngController.cancelOrderTmp}" update="@(.tmpOrder)" /> <p:commandButton value="清空" styleClass="del-btn" process="@form" actionListener="#{warehouseStockMngController.clearOrderTmp}" update="@(.tmpOrder)" /> <p:commandButton value="提交" styleClass="edit-btn" process="@form" actionListener="#{warehouseStockMngController.onUseBtnClickOrderTmp}" update=":centerRootPanel"/> </p:panelGrid> <p:dataTable id="tempOrderTable" styleClass="data-table" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" lazy="true" value="#{warehouseStockMngController.selectedTmpOrderList}" var="row" selection="#{warehouseStockMngController.trulySelectedOrderList}" rowKey="#{row.id}" emptyMessage="无数据" rows="20" pageLinks="5"> <p:column selectionMode="multiple" style="width: 30px;text-align: center;" /> <p:column headerText="试剂名称"> <h:outputText value="#{row.reagent.name}"/> </p:column> <p:column headerText="产品编号"> <h:outputText value="#{row.reagent.productSn}"/> </p:column> <p:column headerText="CAS"> <h:outputText value="#{row.reagent.cas}"/> </p:column> <p:column headerText="规格"> <h:outputText value="#{row.reagent.reagentFormat}"/> </p:column> <p:column headerText="危险性质"> <h:outputText value="#{row.reagent.reagentCharacter}"/> </p:column> <p:column headerText="价格"> <h:outputText value="#{row.reagent.price}"/> </p:column> <p:column headerText="厂商"> <h:outputText value="#{row.reagent.productHome}"/> </p:column> <p:column headerText="包装"> <h:outputText value="#{''.concat(row.reagent.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagent.reagentUnit))}"/> </p:column> <p:column headerText="批号"> <h:outputText value="#{row.articleNumber}"/> </p:column> </p:dataTable> </p:panel> </h:form> </div> <h:form id="warehouseStockMngFormForPerson"> <p:panel styleClass="center-header" style="border-bottom:none;"> <p:panelGrid styleClass="filter" columns="5"> <p:outputLabel value="试剂名称:"></p:outputLabel> <p:inputText value="#{warehouseStockMngController.reagentId}"></p:inputText> <p:outputLabel value="申领人:"></p:outputLabel> <p:inputText value="#{warehouseStockMngController.userName}"></p:inputText> <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink> </p:panelGrid> </p:panel> <p:panel styleClass="center-body"> <p:panelGrid columns="2" styleClass="btn" rendered="#{warehouseStockMngController.editFlag==1}"> <p:commandButton value="领用" styleClass="edit-btn" process="@form" actionListener="#{warehouseStockMngController.addOrder}" disabled="#{warehouseStockMngController.editFlag==0}" oncomplete="$('#showTabOrder').css('display','block');" update="@(.tmpOrder)" ></p:commandButton> </p:panelGrid> <p:dataTable id="warehouseStockMngDataTableForPerson" styleClass="data-table" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" lazy="true" value="#{warehouseStockMngController.dataModelForPerson}" var="row" selection="#{warehouseStockMngController.selectedListForPerson}" rowKey="#{row.id}" emptyMessage="无数据" rows="20" pageLinks="5"> <p:column selectionMode="multiple" style="width: 30px;text-align: center;" /> <p:column headerText="申购编号" width="150"> <h:outputText value="#{row.applyCode}"></h:outputText> </p:column> <p:column headerText="产品编号"> <h:outputText value="#{row.reagent.productSn}"></h:outputText> </p:column> <p:column headerText="试剂名称"> <h:outputText value="#{row.reagent.name}"></h:outputText> </p:column> <p:column headerText="管制品"> <h:outputText value="#{row.reagent.controlProducts}"></h:outputText> </p:column> <p:column headerText="规格型号"> <h:outputText value="#{row.reagent.reagentFormat}"></h:outputText> </p:column> <p:column headerText="包装"> <h:outputText value="#{row.reagent.mainMetering}"></h:outputText> </p:column> <p:column headerText="价格"> <h:outputText value="#{row.reagent.price}"></h:outputText> </p:column> <p:column headerText="CAS"> <h:outputText value="#{row.reagent.cas}"></h:outputText> </p:column> <p:column headerText="危险性质"> <h:outputText value="#{row.reagent.reagentCharacter}"></h:outputText> </p:column> <p:column headerText="厂家"> <h:outputText value="#{row.reagent.productHome}"></h:outputText> </p:column> <p:column headerText="申请数量"> <h:outputText value="#{row.num}"></h:outputText> </p:column> <p:column headerText="已领用数量"> <h:outputText value="#{row.used}"></h:outputText> </p:column> <p:column headerText="申领人"> <h:outputText value="#{row.applyUserId}" /> </p:column> <p:column headerText="订单状态"> <h:outputText value="#{row.status!=null?row.status.text:''}"></h:outputText> </p:column> </p:dataTable> </p:panel> </h:form> </p:tab> <!-- 目前领取记录查询是最新状态试剂表,应该是试剂履历表。目前客户不太需要这个画面,所以先去掉了 --> <!-- <p:tab title="领取记录"> @@ -333,165 +494,6 @@ </p:tab> --> <p:tab title="订单领取"> <div id ="showTabOrder" style="display: none"> <h:form id="tmpOrder" styleClass="tmpOrder"> <p:panel styleClass="center-body"> <p:panelGrid columns="3" styleClass="btn"> <p:commandButton value="删除" styleClass="del-btn" process="@form" actionListener="#{warehouseStockMngController.cancelOrderTmp}" update="@(.tmpOrder)" /> <p:commandButton value="清空" styleClass="del-btn" process="@form" actionListener="#{warehouseStockMngController.clearOrderTmp}" update="@(.tmpOrder)" /> <p:commandButton value="提交" styleClass="edit-btn" process="@form" actionListener="#{warehouseStockMngController.onUseBtnClickOrderTmp}" update=":centerRootPanel"/> </p:panelGrid> <p:dataTable id="tempOrderTable" styleClass="data-table" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" lazy="true" value="#{warehouseStockMngController.selectedTmpOrderList}" var="row" selection="#{warehouseStockMngController.trulySelectedOrderList}" rowKey="#{row.id}" emptyMessage="无数据" rows="20" pageLinks="5"> <p:column selectionMode="multiple" style="width: 30px;text-align: center;" /> <p:column headerText="试剂名称"> <h:outputText value="#{row.reagent.name}"/> </p:column> <p:column headerText="产品编号"> <h:outputText value="#{row.reagent.productSn}"/> </p:column> <p:column headerText="CAS"> <h:outputText value="#{row.reagent.cas}"/> </p:column> <p:column headerText="规格"> <h:outputText value="#{row.reagent.reagentFormat}"/> </p:column> <p:column headerText="危险性质"> <h:outputText value="#{row.reagent.reagentCharacter}"/> </p:column> <p:column headerText="价格"> <h:outputText value="#{row.reagent.price}"/> </p:column> <p:column headerText="厂商"> <h:outputText value="#{row.reagent.productHome}"/> </p:column> <p:column headerText="包装"> <h:outputText value="#{''.concat(row.reagent.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagent.reagentUnit))}"/> </p:column> <p:column headerText="批号"> <h:outputText value="#{row.articleNumber}"/> </p:column> </p:dataTable> </p:panel> </h:form> </div> <h:form id="warehouseStockMngFormForPerson"> <p:panel styleClass="center-header" style="border-bottom:none;"> <p:panelGrid styleClass="filter" columns="5"> <p:outputLabel value="试剂名称:"></p:outputLabel> <p:inputText value="#{warehouseStockMngController.reagentId}"></p:inputText> <p:outputLabel value="申领人:"></p:outputLabel> <p:inputText value="#{warehouseStockMngController.userName}"></p:inputText> <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink> </p:panelGrid> </p:panel> <p:panel styleClass="center-body"> <p:panelGrid columns="2" styleClass="btn" rendered="#{warehouseStockMngController.editFlag==1}"> <p:commandButton value="领用" styleClass="edit-btn" process="@form" actionListener="#{warehouseStockMngController.addOrder}" disabled="#{warehouseStockMngController.editFlag==0}" oncomplete="$('#showTabOrder').css('display','block');" update="@(.tmpOrder)" ></p:commandButton> </p:panelGrid> <p:dataTable id="warehouseStockMngDataTableForPerson" styleClass="data-table" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" lazy="true" value="#{warehouseStockMngController.dataModelForPerson}" var="row" selection="#{warehouseStockMngController.selectedListForPerson}" rowKey="#{row.id}" emptyMessage="无数据" rows="20" pageLinks="5"> <p:column selectionMode="multiple" style="width: 30px;text-align: center;" /> <p:column headerText="申购编号"> <h:outputText value="#{row.applyCode}"></h:outputText> </p:column> <p:column headerText="产品编号"> <h:outputText value="#{row.reagent.productSn}"></h:outputText> </p:column> <p:column headerText="试剂名称"> <h:outputText value="#{row.reagent.name}"></h:outputText> </p:column> <p:column headerText="管制品"> <h:outputText value="#{row.reagent.controlProducts}"></h:outputText> </p:column> <p:column headerText="规格型号"> <h:outputText value="#{row.reagent.reagentFormat}"></h:outputText> </p:column> <p:column headerText="包装"> <h:outputText value="#{row.reagent.mainMetering}"></h:outputText> </p:column> <p:column headerText="价格"> <h:outputText value="#{row.reagent.price}"></h:outputText> </p:column> <p:column headerText="CAS"> <h:outputText value="#{row.reagent.cas}"></h:outputText> </p:column> <p:column headerText="危险性质"> <h:outputText value="#{row.reagent.reagentCharacter}"></h:outputText> </p:column> <p:column headerText="厂家"> <h:outputText value="#{row.reagent.productHome}"></h:outputText> </p:column> <p:column headerText="申请数量"> <h:outputText value="#{row.num}"></h:outputText> </p:column> <p:column headerText="已领用数量"> <h:outputText value="#{row.used}"></h:outputText> </p:column> <p:column headerText="申领人"> <h:outputText value="#{row.applyUserId}" /> </p:column> <p:column headerText="订单状态"> <h:outputText value="#{row.status!=null?row.status.text:''}"></h:outputText> </p:column> </p:dataTable> </p:panel> </h:form> </p:tab> </p:tabView> </ui:composition> </html>