| | |
| | | package com.consum.base.core; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName WhBusinessEnum |
| | | * @Author cy |
| | | * @Date 2023/10/24 |
| | | * @Description 单据类型 |
| | | * @Version 1.0 |
| | |
| | | /** |
| | | * 报废 |
| | | */ |
| | | BAOFEI((short) 5); |
| | | BAOFEI((short) 5), |
| | | /** |
| | | * 部门物品回退仓库 |
| | | */ |
| | | BUMENTUIHUI((short) 6), |
| | | /** |
| | | * 物品盘点 |
| | | */ |
| | | PANDIAN((short) 7), |
| | | ; |
| | | |
| | | private short value; |
| | | |
| | |
| | | public short getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * flowType转为 进出库流水总表[L_WAREHOUSE_FLOW] 的 THIS_TYPE:本次调整类型 和 BUSINESS_TYPE:单据类型 |
| | | * |
| | | * @param flowType 同码表,1采购入库 2退还入库 3调拨入库 4盘盈入库 5申领出库 6调拨出库 7盘亏出库 8报废出库 9其他出库 |
| | | * @return flowThisType:本次调整类型(1=调增;2=调减) |
| | | * flowBusinessType:单据类型 1 采购2 调拨 3出库4部门分发5报废6部门物品回退仓库7物品盘点 |
| | | */ |
| | | public static Map<String, Short> getTypeByFlowType(Short flowType) { |
| | | //单据类型 1 采购2 调拨 3出库4部门分发5报废6部门物品回退仓库7物品盘点 |
| | | Short flowBusinessType = null; |
| | | //1=调增;2=调减 |
| | | Short flowThisType = null; |
| | | //单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | Short transferBusinessType = null; |
| | | switch (flowType) { |
| | | //1采购入库 |
| | | case 1: |
| | | flowThisType = 1; |
| | | flowBusinessType = 1; |
| | | break; |
| | | //2退还入库 |
| | | case 2: |
| | | flowThisType = 1; |
| | | flowBusinessType = 2; |
| | | break; |
| | | //3调拨入库 |
| | | case 3: |
| | | flowThisType = 1; |
| | | flowBusinessType = 3; |
| | | break; |
| | | // 4盘盈入库 |
| | | case 4: |
| | | flowThisType = 1; |
| | | flowBusinessType = 7; |
| | | break; |
| | | //5申领出库 |
| | | case 5: |
| | | flowThisType = 2; |
| | | flowBusinessType = 4; |
| | | // transferBusinessType = 1; |
| | | break; |
| | | // 6调拨出库 |
| | | case 6: |
| | | flowThisType = 2; |
| | | flowBusinessType = 2; |
| | | // transferBusinessType = 1; |
| | | break; |
| | | //7盘亏出库 |
| | | case 7: |
| | | flowThisType = 2; |
| | | flowBusinessType = 7; |
| | | break; |
| | | // 8报废出库 |
| | | case 8: |
| | | flowThisType = 2; |
| | | flowBusinessType = 5; |
| | | break; |
| | | // 9其他出库 |
| | | case 9: |
| | | flowThisType = 2; |
| | | flowBusinessType = 3; |
| | | break; |
| | | } |
| | | Map<String, Short> rtnMap = new HashMap<>(); |
| | | rtnMap.put("flowBusinessType", flowBusinessType); |
| | | rtnMap.put("flowThisType", flowThisType); |
| | | return rtnMap; |
| | | } |
| | | |
| | | /** |
| | | * flowType转为 进出库流水总表[L_WAREHOUSE_FLOW] 的 THIS_TYPE:本次调整类型 和 BUSINESS_TYPE:单据类型 |
| | | * |
| | | * @param deptFlowType // 同码表,1 物品申领 2 物品分发 3 物品退还 4 物品报废 |
| | | * @return flowThisType:本次调整类型(1=调增;2=调减) |
| | | * flowBusinessType:单据类型 1 采购2 调拨 3出库4部门分发5报废6部门物品回退仓库7物品盘点 |
| | | */ |
| | | public static Map<String, Short> getTypeByDeptFlowType(Short deptFlowType) { |
| | | //单据类型 1 采购 2 调拨 3出库4部门分发5报废6部门物品回退仓库7物品盘点 |
| | | Short flowBusinessType = null; |
| | | //1=调增;2=调减 |
| | | Short flowThisType = null; |
| | | //单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | Short transferBusinessType = null; |
| | | switch (deptFlowType) { |
| | | //物品申领 |
| | | case 1: |
| | | // flowThisType = 2; |
| | | // flowBusinessType = 2; |
| | | break; |
| | | //2 物品分发 |
| | | case 2: |
| | | flowThisType = 1; |
| | | flowBusinessType = 4; |
| | | // transferBusinessType = 1; |
| | | break; |
| | | //3 物品退还 |
| | | case 3: |
| | | flowThisType = 2; |
| | | flowBusinessType = 6; |
| | | // transferBusinessType = 2; |
| | | break; |
| | | // 4 物品报废 |
| | | case 4: |
| | | flowThisType = 2; |
| | | flowBusinessType = 5; |
| | | break; |
| | | } |
| | | Map<String, Short> rtnMap = new HashMap<>(); |
| | | rtnMap.put("flowBusinessType", flowBusinessType); |
| | | rtnMap.put("flowThisType", flowThisType); |
| | | // rtnMap.put("transferBusinessType", transferBusinessType); |
| | | return rtnMap; |
| | | } |
| | | } |