订单领取:过期处理(确认和过期 状态处理),增加状态过期(需要将数据库字段加长)
实验室选中问题
仓库领取的仓库不存在问题
已修改8个文件
158 ■■■■ 文件已修改
src/main/java/com/nanometer/smartlab/controller/WarehouseStockMngController.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/OpeApplyService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/OpeApplyServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/warehouse_reagent_use.xhtml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/warehouse_reagent_use_person.xhtml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/warehouse_stock_mng.xhtml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/controller/WarehouseStockMngController.java
@@ -173,6 +173,8 @@
    @Value("${institute.name}")
    String instituteName;
    private boolean isExpired;
    private Hashtable printTable;
    public Hashtable getPrintTable() {
@@ -1518,6 +1520,10 @@
                if(selectWarehouseReserve.getFlag()==1){
                    list.add(selectWarehouseReserve);
                }else{
                    if (selectWarehouseReserve.getWarehouseId() == null) {
                        FacesUtils.warn("仓库不存在。");
                        return;
                    }
                    list2.add(selectWarehouseReserve);
                }
            }
@@ -1782,11 +1788,11 @@
                    }
                    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);
@@ -1891,7 +1897,7 @@
                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("申购编号");
@@ -2744,6 +2750,7 @@
    public void resetLaboratory(){
        laboratory = null;
        laboratoryId = null;
        laboratoryContainers = null;
        //getLaboratory();
        //getLaboratoryContainers();
@@ -3094,4 +3101,51 @@
    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("操作成功。");
    }
}
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
@@ -232,7 +232,11 @@
  </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}
@@ -360,7 +364,7 @@
        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>
@@ -426,8 +430,34 @@
        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">
src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java
@@ -3,7 +3,19 @@
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;
@@ -27,13 +39,13 @@
            map.put(d.key, d);
        }
    }
    public static ApplyStatus parse(Integer index) {
        if(map.containsKey(index)){
            return map.get(index);
        }
        return null;
    }
}
src/main/java/com/nanometer/smartlab/service/OpeApplyService.java
@@ -55,9 +55,9 @@
    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);
src/main/java/com/nanometer/smartlab/service/OpeApplyServiceImpl.java
@@ -530,7 +530,7 @@
    }
    @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);
@@ -538,7 +538,11 @@
            params.put("userId",id);
            params.put("productSn",productSn);
            params.put("applyCode",applyCode);
            params.put("status",status);
            if (isExpired) {
                params.put("status",ApplyStatus.EXPIRED);
            }else{
                params.put("status", status);
            }
            params.put("isAllApply",isAllApply);
            return this.opeApplyDao.getOpeApplyReserveTotalCountFor(params);
        } catch (DataAccessException e) {
@@ -549,7 +553,7 @@
    }
    @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);
@@ -559,7 +563,11 @@
            params.put("pageSize", pageSize);
            params.put("productSn",productSn);
            params.put("applyCode",applyCode);
            params.put("status",status);
            if (isExpired) {
                params.put("status",ApplyStatus.EXPIRED);
            }else{
                params.put("status", status);
            }
            params.put("isAllApply",isAllApply);
            return this.opeApplyDao.getOpeApplyReserveListFor(params);
        } catch (DataAccessException e) {
src/main/webapp/warehouse_reagent_use.xhtml
@@ -48,7 +48,6 @@
                    <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>
src/main/webapp/warehouse_reagent_use_person.xhtml
@@ -45,7 +45,6 @@
                    <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>
src/main/webapp/warehouse_stock_mng.xhtml
@@ -360,7 +360,7 @@
            <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;
@@ -384,6 +384,9 @@
                            <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;">
@@ -398,7 +401,7 @@
                <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}"
@@ -411,6 +414,17 @@
                                         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>