| | |
| | | public List<SysReagent> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { |
| | | List<SysReagent> list = null; |
| | | try { |
| | | int count = sysReagentService.favorCount(getUser(), applyNewReagentName, applyNewCas, null, applyNewSn, 0); |
| | | int count = sysReagentService.reagentCount(getUser(), applyNewReagentName, applyNewCas, null, applyNewSn); |
| | | this.setRowCount(count); |
| | | if (count > 0) { |
| | | list = sysReagentService.favorList(getUser(), applyNewReagentName, applyNewCas, null, applyNewSn, 0, first, pageSize); |
| | | list = sysReagentService.reagentList(getUser(), applyNewReagentName, applyNewCas, null, applyNewSn, first, pageSize); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | |
| | | public List<SysReagent> query(); |
| | | //试剂库总数 |
| | | int reagentCount(Map params); |
| | | List<SysReagent> reagentList(Map params); |
| | | int favorCount(Map params); |
| | | List<SysReagent> favorList(Map params); |
| | | Map getSysReagentDetail(String id); |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="reagentList" parameterType="java.util.Map" resultType="int"> |
| | | <select id="reagentList" parameterType="java.util.Map" resultMap="SysReagent"> |
| | | select sr.*, ss.meta_value as product_home_name, bm.meta_value as control_products_name,supplier.name as supplierName,f.id favor,f.create_time favortime |
| | | from sys_reagent as sr |
| | | left join base_meta as ss on sr.product_home = ss.id |
| | |
| | | LEFT JOIN favor f on f.reagent_id = sr.id AND f.user_id = #{user} |
| | | where sr.valid_flag = 1 |
| | | <if test="cas != null and cas != ''"> |
| | | and sr.cas = #{cas} |
| | | and sr.cas like concat("%", #{cas} ,"%") |
| | | </if> |
| | | <if test="supplierId != null and supplierId != ''"> |
| | | and sr.supplier_id = #{supplierId} |
| | |
| | | and sr.name like concat("%", #{name} ,"%") |
| | | </if> |
| | | <if test="productSn != null and productSn != ''"> |
| | | and sr.product_sn = #{productSn} |
| | | and sr.product_sn like concat("%", #{productSn} ,"%") |
| | | </if> |
| | | ORDER BY sr.create_time desc |
| | | ORDER BY f.create_time desc,sr.create_time desc |
| | | <if test="first != null and pageSize != null"> |
| | | limit #{first}, #{pageSize} |
| | | </if> |
| | |
| | | from sys_reagent as sr |
| | | left join base_meta as ss on sr.product_home = ss.id |
| | | left join base_meta bm on bm.id = sr.control_products |
| | | left join (select reagent_id, sum(reserve) reserve from ope_warehouse_reserve where valid_flag = 1 group by reagent_id) w on w.reagent_id = sr.id |
| | | |
| | | left join sys_supplier supplier on supplier.id = sr.supplier_id |
| | | LEFT JOIN favor f on f.reagent_id = sr.id AND f.user_id = #{user} |
| | | where sr.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | <if test="favor != null and favor != '' "> |
| | | and f.id is not null |
| | | <if test="cas != null and cas != ''"> |
| | | and sr.cas like concat("%", #{cas} ,"%") |
| | | </if> |
| | | <if test="supplierId != null and supplierId != ''"> |
| | | and sr.supplier_id = #{supplierId} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and sr.name like concat("%", #{name} ,"%") |
| | | </if> |
| | | <if test="productSn != null and productSn != ''"> |
| | | and sr.product_sn like concat("%", #{productSn} ,"%") |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | int favorCount(SysUser user, String name, String cas, String supplierId, String productSn,Integer favorFlag); |
| | | |
| | | List<SysReagent> favorList(SysUser user, String name, String cas, String supplierId, String productSn,Integer favorFlag, Integer first, Integer pageSize); |
| | | |
| | | int reagentCount(SysUser user, String name, String cas, String supplierId, String productSn); |
| | | |
| | | List<SysReagent> reagentList(SysUser user, String name, String cas, String supplierId, String productSn, int first, int pageSize); |
| | | } |
| | |
| | | return sysReagentDao.favorList(params); |
| | | } |
| | | |
| | | @Override |
| | | public int reagentCount(SysUser user, String name, String cas, String supplierId, String productSn) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("supplierId", supplierId); |
| | | params.put("productSn", productSn); |
| | | return sysReagentDao.reagentCount(params); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysReagent> reagentList(SysUser user, String name, String cas, String supplierId, String productSn, int first, int pageSize) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("supplierId", supplierId); |
| | | params.put("productSn", productSn); |
| | | params.put("first", first); |
| | | params.put("pageSize", pageSize); |
| | | return sysReagentDao.reagentList(params); |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysReagentTotalCount(String name, String cas, String supplierId,Integer type) { |
| | |
| | | </h:form> |
| | | <br/> |
| | | <p:tabView dynamic="true" style="margin-left: 26px"> |
| | | <p:tab title="我的收藏"> |
| | | <h:form id="myFavor"> |
| | | <p:panelGrid style="margin: 5px"> |
| | | <div class="label-tip" style="margin-left: 5px; ">注意:已经收藏的试剂不会再出现在<span style="font-weight: 900;">*试剂库*</span>页面中</div> |
| | | </p:panelGrid> |
| | | <p:dataTable id="favorDataTable" styleClass="data-table" style="margin-left: 2px" |
| | | resizableColumns="true" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" |
| | | lazy="true" value="#{applyMngController.reagentFavorDataModel}" var="row" rowKey="#{row.id}" |
| | | emptyMessage="请添加收藏" selectionMode="single" |
| | | rows="50" pageLinks="5"> |
| | | |
| | | <p:ajax event="rowDblselect" listener="#{applyMngController.onReagentRowSelect}" update=":applyMngNewForm,:applyDialog"></p:ajax> |
| | | <p:column headerText="产品编号"> |
| | | <h:outputText value="#{row.productSn}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="试剂名称"> |
| | | <h:outputText value="#{row.name}"></h:outputText> |
| | | <h:outputText value="收藏" readonly="true" rendered="#{row.favor!=null}" styleClass="favor"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="管制品"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.controlProducts)}"></h:outputText> |
| | | </p:column> |
| | | <!--<p:column headerText="试剂类型">--> |
| | | <!--<h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentType)}"></h:outputText>--> |
| | | <!--</p:column>--> |
| | | <!--<p:column headerText="危险性质">--> |
| | | <!--<h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentCharacter)}"></h:outputText>--> |
| | | <!--</p:column>--> |
| | | <!-- <p:column headerText="供应商"> |
| | | <h:outputText value="#{row.supplierName}"></h:outputText> |
| | | </p:column>--> |
| | | <p:column headerText="规格型号"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentFormat)}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="包装"> |
| | | <h:outputText value="#{''.concat(row.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagentUnit))}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="含税售价"> |
| | | <h:outputText value="#{row.price}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="CAS号"> |
| | | <h:outputText value="#{row.cas}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="危险性质"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentCharacter)}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="厂家"> |
| | | <h:outputText value="#{row.productHomeName}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="试剂类型"> |
| | | <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"> |
| | | <f:setPropertyActionListener value="#{row}" target="#{applyMngController.selectReagent}" /> |
| | | </h:commandButton> |
| | | |
| | | </p:column> |
| | | </p:dataTable> |
| | | </h:form> |
| | | |
| | | </p:tab> |
| | | <p:tab title="试剂库"> |
| | | <h:form id="applyMngNewReagentForm"> |
| | | <p:panelGrid styleClass="apply-mng-new-reagent-filter" columns="9" style="margin-left: -18px"> |
| | |
| | | </p:dataTable> |
| | | </h:form> |
| | | </p:tab> |
| | | <p:tab title="我的收藏"> |
| | | <h:form id="myFavor"> |
| | | <!-- <p:panelGrid style="margin: 5px">--> |
| | | <!-- <div class="label-tip" style="margin-left: 5px; ">注意:已经收藏的试剂不会再出现在<span style="font-weight: 900;">*试剂库*</span>页面中</div>--> |
| | | <!-- </p:panelGrid>--> |
| | | <p:dataTable id="favorDataTable" styleClass="data-table" style="margin-left: 2px" |
| | | resizableColumns="true" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom" |
| | | lazy="true" value="#{applyMngController.reagentFavorDataModel}" var="row" rowKey="#{row.id}" |
| | | emptyMessage="请添加收藏" selectionMode="single" |
| | | rows="50" pageLinks="5"> |
| | | |
| | | <p:ajax event="rowDblselect" listener="#{applyMngController.onReagentRowSelect}" update=":applyMngNewForm,:applyDialog"></p:ajax> |
| | | <p:column headerText="产品编号"> |
| | | <h:outputText value="#{row.productSn}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="试剂名称"> |
| | | <h:outputText value="#{row.name}"></h:outputText> |
| | | <h:outputText value="收藏" readonly="true" rendered="#{row.favor!=null}" styleClass="favor"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="管制品"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.controlProducts)}"></h:outputText> |
| | | </p:column> |
| | | <!--<p:column headerText="试剂类型">--> |
| | | <!--<h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentType)}"></h:outputText>--> |
| | | <!--</p:column>--> |
| | | <!--<p:column headerText="危险性质">--> |
| | | <!--<h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentCharacter)}"></h:outputText>--> |
| | | <!--</p:column>--> |
| | | <!-- <p:column headerText="供应商"> |
| | | <h:outputText value="#{row.supplierName}"></h:outputText> |
| | | </p:column>--> |
| | | <p:column headerText="规格型号"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentFormat)}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="包装"> |
| | | <h:outputText value="#{''.concat(row.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagentUnit))}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="含税售价"> |
| | | <h:outputText value="#{row.price}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="CAS号"> |
| | | <h:outputText value="#{row.cas}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="危险性质"> |
| | | <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagentCharacter)}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="厂家"> |
| | | <h:outputText value="#{row.productHomeName}"></h:outputText> |
| | | </p:column> |
| | | <p:column headerText="试剂类型"> |
| | | <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"> |
| | | <f:setPropertyActionListener value="#{row}" target="#{applyMngController.selectReagent}" /> |
| | | </h:commandButton> |
| | | |
| | | </p:column> |
| | | </p:dataTable> |
| | | </h:form> |
| | | |
| | | </p:tab> |
| | | </p:tabView> |
| | | </p:panel> |
| | | </ui:composition> |