订单领取:过期处理(确认和过期 状态处理),增加状态过期(需要将数据库字段加长)
实验室选中问题
仓库领取的仓库不存在问题
| | |
| | | @Value("${institute.name}") |
| | | String instituteName; |
| | | |
| | | private boolean isExpired; |
| | | |
| | | private Hashtable printTable; |
| | | |
| | | public Hashtable getPrintTable() { |
| | |
| | | if(selectWarehouseReserve.getFlag()==1){ |
| | | list.add(selectWarehouseReserve); |
| | | }else{ |
| | | if (selectWarehouseReserve.getWarehouseId() == null) { |
| | | FacesUtils.warn("仓库不存在。"); |
| | | return; |
| | | } |
| | | list2.add(selectWarehouseReserve); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | try { |
| | | int count = opeApplyService.getOpeApplyReserveTotalCountByNameFor(id, reagentId, userName, productSn, applyCode, status, isAllApply); |
| | | int count = opeApplyService.getOpeApplyReserveTotalCountByNameFor(id, reagentId, userName, productSn, applyCode, status, isAllApply,isExpired); |
| | | this.setRowCount(count); |
| | | if (count > 0) { |
| | | list = opeApplyService.getOpeApplyReserveListByNameFor(id, reagentId, userName, first, |
| | | pageSize, productSn, applyCode, status, isAllApply); |
| | | pageSize, productSn, applyCode, status, isAllApply,isExpired); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | |
| | | realDataList=selectedListForPerson; |
| | | }else { |
| | | realDataList = opeApplyService.getOpeApplyReserveListByNameFor(id,reagentId, userName, null, |
| | | null,productSn,applyCode,status,isAllApply); |
| | | null,productSn,applyCode,status,isAllApply,isExpired); |
| | | } |
| | | List<String> headerList = new ArrayList<>(); |
| | | headerList.add("申购编号"); |
| | |
| | | |
| | | public void resetLaboratory(){ |
| | | laboratory = null; |
| | | laboratoryId = null; |
| | | laboratoryContainers = null; |
| | | //getLaboratory(); |
| | | //getLaboratoryContainers(); |
| | |
| | | public void setIsAllApply(Integer isAllApply) { |
| | | this.isAllApply = isAllApply; |
| | | } |
| | | |
| | | public boolean getIsExpired() { |
| | | return isExpired; |
| | | } |
| | | |
| | | public void setIsExpired(boolean isExpired) { |
| | | this.isExpired = isExpired; |
| | | } |
| | | |
| | | //过期处理 |
| | | public void expireOrder() { |
| | | //1.判断当前订单是否是已入库的状态 |
| | | if (this.selectedListForPerson.size() < 1) { |
| | | FacesUtils.warn("请选择数据。"); |
| | | return; |
| | | } |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (OpeApplyReserve oa : this.selectedListForPerson) { |
| | | ids.add(oa.getId()); |
| | | if (oa.getStatus() != ApplyStatus.SUPPLIER_CONFIRM) { |
| | | FacesUtils.warn("只能让已确认状态的单子过期。"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | opeApplyService.updateOpeApplyStatus(ApplyStatus.EXPIRED, null, ids); |
| | | FacesUtils.warn("操作成功。"); |
| | | |
| | | |
| | | } |
| | | |
| | | public void recoverOrder(){ |
| | | if (this.selectedListForPerson.size() < 1) { |
| | | FacesUtils.warn("请选择数据。"); |
| | | return; |
| | | } |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (OpeApplyReserve oa : this.selectedListForPerson) { |
| | | ids.add(oa.getId()); |
| | | if (oa.getStatus() != ApplyStatus.EXPIRED) { |
| | | FacesUtils.warn("只能让过期单子恢复确认。"); |
| | | return; |
| | | } |
| | | } |
| | | opeApplyService.updateOpeApplyStatus(ApplyStatus.SUPPLIER_CONFIRM, null, ids); |
| | | FacesUtils.warn("操作成功。"); |
| | | } |
| | | } |
| | |
| | | </update> |
| | | |
| | | <update id="updateOpeApplyStatus" parameterType="java.util.Map" > |
| | | update ope_apply set status=#{status}, memo=#{memo}, update_time=now() |
| | | update ope_apply set status=#{status}, |
| | | <if test="memo !=null and memo != ''"> |
| | | memo=#{memo}, |
| | | </if> |
| | | update_time=now() |
| | | where id in |
| | | <foreach collection="applyIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | LEFT JOIN base_meta AS bm1 ON sr.product_home = bm1.id |
| | | LEFT JOIN sys_project as project on project.project = su.project |
| | | LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id |
| | | where oa.valid_flag = 1 and (oa.status=4 or oa.status=6) |
| | | where oa.valid_flag = 1 and (oa.status=4 or oa.status=6 or oa.status = 10) |
| | | <include refid="getOpeApplyReserveList_queryWhereSql" /> |
| | | <if test="isAllApply != null"> |
| | | <choose> |
| | |
| | | LEFT JOIN base_meta AS bm1 ON sr.product_home = bm1.id |
| | | LEFT JOIN sys_project as project on project.project = su.project |
| | | LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id |
| | | where oa.valid_flag = 1 and (oa.status=4 or oa.status=6) |
| | | <include refid="getOpeApplyReserveList_queryWhereSql" /> |
| | | where oa.valid_flag = 1 and ( |
| | | <choose> |
| | | <when test="status == @com.nanometer.smartlab.entity.enumtype.ApplyStatus@EXPIRED"> |
| | | oa.status = 10 |
| | | </when> |
| | | <otherwise> |
| | | oa.status=4 or oa.status=6 |
| | | </otherwise> |
| | | </choose> |
| | | ) |
| | | <if test="reagentName != null and reagentName != ''"> |
| | | and sr.name like concat('%',#{reagentName},'%') |
| | | </if> |
| | | <if test="personName != null and personName != ''"> |
| | | and su.name like concat('%',#{personName},'%') |
| | | </if> |
| | | <if test="userId != null and userId != ''"> |
| | | and oa.apply_user_id =#{userId} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | and oa.status =#{status} |
| | | </if> |
| | | <if test="productSn != null and productSn != ''"> |
| | | and sr.product_sn like concat('%',#{productSn},'%') |
| | | </if> |
| | | <if test="applyCode != null and applyCode != ''"> |
| | | and oa.apply_code = #{applyCode} |
| | | </if> |
| | | <if test="isAllApply != null"> |
| | | <choose> |
| | | <when test="isAllApply == 1"> |
| | |
| | | import java.util.HashMap; |
| | | |
| | | public enum ApplyStatus { |
| | | REFUSE(0, "拒绝"), PENDING_APPROVAL(1, "待审批"), APPROVED(2, "已审批"), PENDING_PURCHASE(3, "待采购"), STORAGE(4, "已入库"), CANCEL(5, "取消"),SUPPLIER_CONFIRM(6,"已确认"),SUPPLIER_CANCEL(7,"已取消"),FINISHED(8,"已完成"),UNCOMPLETED(9,"未完成"); |
| | | REFUSE(0, "拒绝"), |
| | | PENDING_APPROVAL(1, "待审批"), |
| | | APPROVED(2, "已审批"), |
| | | PENDING_PURCHASE(3, "待采购"), |
| | | STORAGE(4, "已入库"), |
| | | CANCEL(5, "取消"), |
| | | SUPPLIER_CONFIRM(6,"已确认"), |
| | | SUPPLIER_CANCEL(7,"已取消"), |
| | | FINISHED(8,"已完成"), |
| | | UNCOMPLETED(9,"未完成"), |
| | | |
| | | |
| | | EXPIRED(10,"过期"),; |
| | | private int key; |
| | | |
| | | private String text; |
| | |
| | | int getOpeApplyReserveTotalCountByName(String id,String reagentName, String personName); |
| | | List<OpeApplyReserve> getOpeApplyReserveListByName(String id,String reagentName, String personName, Integer first, |
| | | Integer pageSize); |
| | | int getOpeApplyReserveTotalCountByNameFor(String id,String reagentName, String personName,String productSn,String applyCode,Integer status,Integer isAllApply); |
| | | int getOpeApplyReserveTotalCountByNameFor(String id,String reagentName, String personName,String productSn,String applyCode,Integer status,Integer isAllApply,boolean isExpired); |
| | | List<OpeApplyReserve> getOpeApplyReserveListByNameFor(String id,String reagentName, String personName, Integer first, |
| | | Integer pageSize,String productSn,String applyCode,Integer status,Integer isAllApply); |
| | | Integer pageSize,String productSn,String applyCode,Integer status,Integer isAllApply,boolean isExpired); |
| | | public boolean updaetOpeApplyPrice(BigDecimal applyPrice,String id); |
| | | public boolean updaetOpeApplyStockFlag(int stockFlag,String id); |
| | | public boolean cancelApply(ApplyStatus status,String id); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int getOpeApplyReserveTotalCountByNameFor(String id,String reagentName, String personName,String productSn,String applyCode,Integer status,Integer isAllApply) { |
| | | public int getOpeApplyReserveTotalCountByNameFor(String id,String reagentName, String personName,String productSn,String applyCode,Integer status,Integer isAllApply,boolean isExpired) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("reagentName", reagentName); |
| | |
| | | params.put("userId",id); |
| | | params.put("productSn",productSn); |
| | | params.put("applyCode",applyCode); |
| | | if (isExpired) { |
| | | params.put("status",ApplyStatus.EXPIRED); |
| | | }else{ |
| | | params.put("status",status); |
| | | } |
| | | params.put("isAllApply",isAllApply); |
| | | return this.opeApplyDao.getOpeApplyReserveTotalCountFor(params); |
| | | } catch (DataAccessException e) { |
| | |
| | | } |
| | | @Override |
| | | public List<OpeApplyReserve> getOpeApplyReserveListByNameFor(String id,String reagentName, String personName, Integer first, |
| | | Integer pageSize,String productSn,String applyCode,Integer status,Integer isAllApply) { |
| | | Integer pageSize,String productSn,String applyCode,Integer status,Integer isAllApply,boolean isExpired) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("reagentName", reagentName); |
| | |
| | | params.put("pageSize", pageSize); |
| | | params.put("productSn",productSn); |
| | | params.put("applyCode",applyCode); |
| | | if (isExpired) { |
| | | params.put("status",ApplyStatus.EXPIRED); |
| | | }else{ |
| | | params.put("status",status); |
| | | } |
| | | params.put("isAllApply",isAllApply); |
| | | return this.opeApplyDao.getOpeApplyReserveListFor(params); |
| | | } catch (DataAccessException e) { |
| | |
| | | <p:outputLabel value="实验室试剂柜:"></p:outputLabel> |
| | | <p:selectOneMenu value="#{warehouseStockMngController.laboratoryContainerId}" id="stacks" |
| | | > |
| | | <!-- <f:ajax listener="#{warehouseStockMngController.setContainerId}"/>--> |
| | | <f:selectItems value="#{warehouseStockMngController.laboratoryContainers}" |
| | | var="item" itemLabel="#{item.name}" itemValue="#{item.id}"></f:selectItems> |
| | | </p:selectOneMenu> |
| | |
| | | <p:outputLabel value="实验室试剂柜:"></p:outputLabel> |
| | | <p:selectOneMenu value="#{warehouseStockMngController.laboratoryContainerId}" id="stacks" |
| | | > |
| | | <f:ajax listener="#{warehouseStockMngController.setContainerId}"/> |
| | | <f:selectItems value="#{warehouseStockMngController.laboratoryContainers}" |
| | | var="item" itemLabel="#{item.name}" itemValue="#{item.id}"></f:selectItems> |
| | | </p:selectOneMenu> |
| | |
| | | <br/> |
| | | <h:form id="warehouseStockMngFormForPerson"> |
| | | <p:panel styleClass="center-header" style="border-bottom:none;"> |
| | | <p:panelGrid styleClass="filter" columns="14"> |
| | | <p:panelGrid styleClass="filter" columns="16"> |
| | | <style type="text/css"> |
| | | .ui-selectonemenu.ui-widget.ui-state-default.ui-corner-all{ |
| | | min-width: 60px !important; |
| | |
| | | <f:selectItems value="#{warehouseStockMngController.statusSelectList}" var="item" |
| | | itemLabel="#{item.text}" itemValue="#{item.key}"></f:selectItems> |
| | | </p:selectOneMenu> |
| | | <p:outputLabel value="过期:"></p:outputLabel> |
| | | <p:selectBooleanCheckbox value="#{warehouseStockMngController.isExpired}" |
| | | itemLabel=""/> |
| | | |
| | | <p:outputLabel value="已领用:"></p:outputLabel> |
| | | <p:selectOneMenu value="#{warehouseStockMngController.isAllApply}" style="width: 60px;"> |
| | |
| | | |
| | | <p:panel styleClass="center-body"> |
| | | |
| | | <p:panelGrid columns="3" styleClass="btn" rendered="#{warehouseStockMngController.editFlag==1}"> |
| | | <p:panelGrid columns="7" styleClass="btn" rendered="#{warehouseStockMngController.editFlag==1}"> |
| | | <p:commandButton value="入库" styleClass="edit-btn" process="@form" |
| | | actionListener="#{warehouseStockMngController.addInputStorageOrder}" |
| | | disabled="#{warehouseStockMngController.editFlag==0}" |
| | |
| | | oncomplete="$('#showTabOrder').css('display','block');$('#putInStorage').css('display','none');" |
| | | update="@(.tmpOrder)" |
| | | ></p:commandButton> |
| | | |
| | | <p:commandButton value="过期处理" styleClass="edit-btn" process="@form" |
| | | actionListener="#{warehouseStockMngController.expireOrder}" |
| | | disabled="#{warehouseStockMngController.editFlag==0}" |
| | | update=":centerRootPanel" |
| | | ></p:commandButton> |
| | | <p:commandButton value="恢复处理" styleClass="edit-btn" process="@form" |
| | | actionListener="#{warehouseStockMngController.recoverOrder}" |
| | | disabled="#{warehouseStockMngController.editFlag==0}" |
| | | update=":centerRootPanel" |
| | | ></p:commandButton> |
| | | <p:commandButton update=":centerRootPanel" actionListener="#{warehouseStockMngController.onExportFileBtnClickOrder}" |
| | | ajax="false" value="导出" styleClass="new-btn" /> |
| | | </p:panelGrid> |