李宇
2021-06-15 d00d1d584875b5b38c70c235963b46543a3eba28
src/main/java/com/nanometer/smartlab/controller/ReagentMngController.java
@@ -25,6 +25,7 @@
import javax.annotation.Resource;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionListener;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -912,4 +913,33 @@
    public void setProductSn(String productSn) {
        this.productSn = productSn;
    }
    public void openUpdateSafetyNumDialog() {
        if (this.selectedList == null
                || this.selectedList.size() == 0) {
            FacesUtils.warn("请选择数据。");
            return;
        }
        if (this.selectedList.size() > 1) {
            FacesUtils.warn("只能选择一个数据进行修改。");
            return;
        }
        this.sysReagent = this.sysReagentService.getSysReagent(this.selectedList.get(0).getId());
        if (this.sysReagent.getType() != 1) {
            FacesUtils.warn("只能选择试剂设置安全库存。");
            return;
        }
        RequestContext.getCurrentInstance().execute("PF('dialog-setSafetynum').show()");
    }
    public void updateSafetyNum(){
        if (this.sysReagent.getSafetynum() == null) {
            FacesUtils.warn("请输入安全库存。");
            return;
        }
        sysReagentService.updateSafetyNum(this.sysReagent);
        FacesUtils.warn("修改成功。");
        RequestContext.getCurrentInstance().execute("PF('dialog-setSafetynum').hide()");
    }
}