src/main/java/com/nanometer/smartlab/controller/PersonalUseInfoController.java
@@ -9,6 +9,7 @@ import com.nanometer.smartlab.entity.SysLaboratory; import com.nanometer.smartlab.entity.dto.ApplyListDto; import com.nanometer.smartlab.entity.dto.PersonUseDetail; import com.nanometer.smartlab.entity.enumtype.ArrivalStatus; import com.nanometer.smartlab.service.SysLaboratoryService; import com.nanometer.smartlab.util.FacesUtils; import com.nanometer.smartlab.util.Utils; @@ -118,8 +119,28 @@ public void reagentReturn(){ try { List<OpeReagentStatus> list=this.selectedList; opeReagentStatusService.batchUpdateStatusByCode(list); if (selectOne == null) { FacesUtils.warn("请选择单号"); return; } //判断单子下的试剂是否全部 为 领用待入库-1,不是就不能取消领用 List<PersonUseDetail> applyList = opeUseFlowService.getApplyInfo(selectOne.getReceiptNumber()); boolean flag = applyList.stream().allMatch(pu -> opeReagentStatusService.getOpeReagentStatusByReagentCode(pu.getReagentCode() ).getStatus()== ArrivalStatus.NOREGISTER); if (!flag) { FacesUtils.warn("试剂当前状态不可以取消领用"); return; } //没有批次号不可以取消领用 boolean flag1 = applyList.stream().allMatch(pu -> pu.getArticleNumber() != null); if (!flag1) { FacesUtils.warn("没有批次号不可以取消领用"); return; } //取消领用 opeReagentStatusService.batchUpdateStatusByCode(applyList); FacesUtils.info("已取消试剂"); }catch (Exception e){ FacesUtils.info("请选择数据"); src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.java
@@ -44,4 +44,6 @@ List<PersonUseDetail> getApplyInfo(Map params); int getApplyInfoSize(Map params); int countOpeUseFlow(OpeUseFlow opeUseFlow); } src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml
@@ -198,6 +198,7 @@ </if> WHERE ouf.operatestate = #{operatestate} and LENGTH(trim(ouf.receipt_number))>0 and ouf.valid_flag = 1 <if test="reagentCode !=null and reagentCode != ''"> and ouf.reagent_code like concat("%",#{reagentCode},"%") </if> @@ -250,6 +251,7 @@ </if> WHERE ouf.operatestate = #{operatestate} and LENGTH(trim(ouf.receipt_number))>0 and ouf.valid_flag = 1 <if test="reagentCode !=null and reagentCode != ''"> and ouf.reagent_code like concat("%",#{reagentCode},"%") </if> @@ -300,6 +302,7 @@ LEFT JOIN base_meta bm3 on bm3.id = sr.control_products WHERE ouf.operatestate = #{operatestate} and ouf.receipt_number = #{receiptNumber} and ouf.valid_flag = 1 </select> @@ -315,6 +318,18 @@ LEFT JOIN base_meta bm3 on bm3.id = sr.control_products WHERE ouf.operatestate = #{operatestate} and ouf.receipt_number = #{receiptNumber} and ouf.valid_flag = 1 </select> <select id="countOpeUseFlow" resultType="java.lang.Integer" parameterType="com.nanometer.smartlab.entity.OpeUseFlow"> select count(0) from ope_use_flow where reagent_code = #{reagentCode} and status = #{status} and house_id = #{houseId} and container_id = #{containerId} and create_time = #{createTime} and operatestate =#{operateState} and valid_flag = 1 </select> <insert id="insertOpeUseFlow" parameterType="com.nanometer.smartlab.entity.OpeUseFlow"> src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml
@@ -216,6 +216,7 @@ <update id="updateCount" parameterType="java.util.Map"> update ope_warehouse_reserve set reserve=reserve+1 where reagent_id=#{reagentId} and article_number=#{articleNumber} and valid_flag = 1 </update> <update id="updateBtReserve"> UPDATE ope_warehouse_reserve src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java
@@ -1714,8 +1714,11 @@ continue; } } int count = opeUseFlowService.getOpeUseFlow(opeUseFlow); if (count < 1) { this.opeUseFlowService.insertOpeUseFlow(opeUseFlow); this.opeUseFlowService.insertOpeUseFlow(opeUseFlow); } } } src/main/java/com/nanometer/smartlab/service/OpeReagentStatusService.java
@@ -1,6 +1,7 @@ package com.nanometer.smartlab.service; import com.nanometer.smartlab.entity.*; import com.nanometer.smartlab.entity.dto.PersonUseDetail; import com.nanometer.smartlab.exception.BusinessException; import java.util.Date; @@ -88,7 +89,7 @@ void updateTimeByCode(String code); void batchUpdateStatusByCode(List<OpeReagentStatus> list) throws Exception; void batchUpdateStatusByCode(List<PersonUseDetail> list) throws Exception; public List<OpeReagentStatus> selectByReId(String id); public void updateByReId(String newReId,String oldReId); src/main/java/com/nanometer/smartlab/service/OpeReagentStatusServiceImpl.java
@@ -9,6 +9,7 @@ import com.google.common.collect.ImmutableMap; import com.nanometer.smartlab.dao.*; import com.nanometer.smartlab.entity.*; import com.nanometer.smartlab.entity.dto.PersonUseDetail; import com.nanometer.smartlab.entity.enumtype.ValidFlag; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; @@ -806,15 +807,15 @@ */ @Override @Transactional public void batchUpdateStatusByCode(List<OpeReagentStatus> list) throws Exception { if(list == null || list.size() <1){ throw new Exception("没有选择试剂"); } public void batchUpdateStatusByCode(List<PersonUseDetail> applyList) throws Exception { for (OpeReagentStatus opeReagentStatus : list) { for (PersonUseDetail pu : applyList) { //变更试剂状态为入库 Map<String, Object> params1 = new HashMap<>(); String reagentCode = opeReagentStatus.getReagentCode(); String reagentCode = pu.getReagentCode(); params1.put("code", reagentCode); params1.put("status",ArrivalStatus.WAREHOUSE); opeReagentStatusDao.updateStatusByCode(params1); @@ -828,8 +829,8 @@ //增加数据库存 Map<String, Object> params3 = new HashMap<>(); String reagentId = opeReagentStatus.getReagentId(); String articleNumber = opeReagentStatus.getArticleNumber(); String reagentId = pu.getReagentId(); String articleNumber = pu.getArticleNumber(); params3.put("reagentId", reagentId); params3.put("articleNumber", articleNumber); opeWarehouseReserveDao.updateCount(params3); src/main/java/com/nanometer/smartlab/service/OpeUseFlowService.java
@@ -56,4 +56,5 @@ int getApplyInfoSize(String receiptNumber); int getOpeUseFlow(OpeUseFlow opeUseFlow); } src/main/java/com/nanometer/smartlab/service/OpeUseFlowServiceImpl.java
@@ -539,4 +539,9 @@ } @Override public int getOpeUseFlow(OpeUseFlow opeUseFlow) { return opeUseFlowDao.countOpeUseFlow(opeUseFlow); } } src/main/webapp/laboratory_container_mng.xhtml
@@ -34,7 +34,7 @@ </p:panelGrid> </p:panel> <p:panel styleClass="center-body"> <p:panelGrid columns="5" styleClass="btn"> <p:panelGrid columns="6" styleClass="btn"> <p:commandButton value="新建" styleClass="new-btn" process="@form" actionListener="#{laboratoryContainerMngController.onNewBtnClick}" update=":dialog,:dialogForm"></p:commandButton> @@ -50,6 +50,8 @@ ></p:commandButton> <p:commandButton value="导出" styleClass="new-btn" ajax="false" actionListener="${laboratoryContainerMngController.export2Excel}" /> <a href="resources/template/实验室临时存储库导入模板.xlsx" style="display: inline-block;"><img src="resources/images/xlsx.png" width="30px;" alt=""/></a> <script> function importCon(){ $("#laboratoryContainerMngForm\\:importReagentBtn_input").click(); src/main/webapp/personal_use_info.xhtml
@@ -72,8 +72,16 @@ <p:commandLink styleClass="search" process="@form" update="@form"/> <p:commandButton value="生成领用单" <p:commandButton value="取消领用" style="background: #b94a48; border: 1px solid #b94a48" styleClass="store-btn" process="@form" actionListener="#{personalUseInfoController.reagentReturn}" update="@this"> <p:confirm header="确认" message="是否确认取消领用?"/> </p:commandButton> <p:commandButton value="生成领用单" styleClass="store-btn" process="@form" actionListener="#{personalUseInfoController.generateReceipt}" @@ -85,6 +93,7 @@ oncomplete="PF('dialog').show()"/> </p:panelGrid> </p:panel> </p:panel> src/main/webapp/resources/template/实验室临时存储库导入模板.xlsxBinary files differ