load default,load defaults是什么

  

     

  

  1.哈希表哈希表是一种可以快速定位的数据结构。哈希表的查找、插入和删除平均需要O(1)的时间,这当然意味着没有哈希冲突。但是哈希表最大的缺点就是哈希值得碰撞。   

  

  Hash:意味着hash桶有多个元素。哈希冲突的常见解决方案是在哈希桶后添加一个链表。   

  

     

  

  这里引入第一个问题:为什么Map的底层设计采用哈希表这种数据结构?   

  

  HashMap设计要求它的键不能重复。因此,每次为HashMap设置值时,都需要过滤HashMap当前容器中的所有键,以确保不会将同一个键设置为HashMap。   

  

  如果用普通的If和else来判断,搜索效率会很低。如果其中的元素数量达到几百个,程序的运行效率就会很低。而这种情况非常符合哈希表的解决场景。   

  

  哈希表的一种实现是数组链表。这也是java7HashMap底层哈希表的实现。   

  

  总结:HashMap是由数组链表/红黑树哈希表组成的数组。   

  

  长度是2的幂。如果它超过了loadFactory *的大小,它将会扩展。每次,数组都由2: hash(大小-1)寻址。二、JDK1.7的HashMap1,相关概念(1)初始容量。   

  

  /** *默认初始容量-必须是2的幂。*/static final int DEFAULT _ INITIAL _ CAPACITY=1 4;//aka 16(2)负载系数   

  

  /** *构造函数中未指定加载因子时使用的加载因子。*/静态最终浮点DEFAULT _ LOAD _ FACTOR=0.75f(3)阈值   

  

  /** *要调整大小的下一个大小值(容量*负载系数)。* @serial *///如果table==EMPTY_TABLE,则这是当达到inflated.int阈值时将创建//表的初始容量;(4)哈希种子   

  

  /** *与此实例关联的随机化值,该值应用于*键的哈希代码,以使哈希冲突更难发现。如果为0,则*禁用替代哈希。*///flag bit是jdk为了解决hashMap的隐患而做的补丁。瞬态int hash seed=0;2.源代码分析(1)put   

  

  Public put (k key,v value) {/* Hashmap默认延迟初始化,只有使用时才会打开空间*//如果哈希表为空,开始扩展哈希表If(table==empty _ table){ inflate table(threshold);}//相关操作if (key==null)为空键返回putfornullkey(value);//计算key的哈希值int hash=hash(key);//计算key哈希值对应的哈希桶的下标int I=indexfor (hash,table . length);//更新哈希桶中的链表:可以看到如果第一次插入,返回值为null for (EntryK,V e=tablee!=nulle=e . next){ Object k;if(e . hash==hash((k=e . key)==key | | key . equals(k))){ V old value=e . value;e.value=值;e . record access(this);返回旧值;} }}(2)inflateTable:扩展哈希表   

  

  私有void可膨胀表(int toSize)   

{ // Find a power of 2 >= toSize /* 这里会发现即使你输入hashMap容量不是2的n次方,这里也会强制变成2的n次方 */ // 计算哈希表桶的个数 int capacity = roundUpToPowerOf2(toSize); threshold = (int) Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1); table = new Entry; // 按需初始化hash种子,也是解决hashMap安全隐患做的补丁 initHashSeedAsNeeded(capacity);}(3)indexFor:计算key在哈希桶的下标

  

static int indexFor(int h, int length) { // assert Integer.bitCount(length) == 1 : "length must be a non-zero power of 2"; return h & (length-1);}这个方法就是为什么hashMap的初始值要设置2的n次方的原因。它可以快速得到key要放在hash桶的下标。

  

(4)扩容方法当hashMap的size大于threshold时,就会扩容。而threshold = 容量 * 阈值

  

低效线程不安全void resize(int newCapacity) { Entry<> oldTable = table; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { threshold = Integer.MAX_VALUE; return; } Entry<> newTable = new Entry; // 将旧哈希表的元素转移到新的哈希表;这里是死锁的原因 transfer(newTable, initHashSeedAsNeeded(newCapacity)); table = newTable; threshold = (int)Math.min(newCapacity * loadFactor, MAXIMUM_CAPACITY + 1);}3、jdk1.7的HashMap中的缺点(1)死锁问题死锁问题是因为用户将HashMap应用到多线程的环境下。详情参考:https://coolshell.cn/articles/9606.html死锁问题是由于HashMap在扩容时,里面元素的顺序可能没有按照之前顺序排列,从而导致环形链表,造成死锁情况。(2)潜在的安全隐患tomcat底层接收参数是使用hashTable接收,假设黑客使用特意组合的参数,使用所有的参数都挂载在同一个哈希桶中。这就会使得哈希表退化成链表。这其实就是由于哈希碰撞的导致。如果黑客使用精心设计的参数(这些参数可以根据jdk公开的哈希算法测试出来),通过HTTP请求,使用tomcat内部产生大量链表,消耗服务器的CPU,就会产生DoS(Denial of Service)。因此:

  

Tomcat也对这种情况进行讨论。tomcat邮件jdk1.7也对这种情况做了处理。例如:在initHashSeedAsNeeded方法中,不使用jdk中String公开的哈希算法,而是使用其他的哈希算法来避免上述出现的问题。final boolean initHashSeedAsNeeded(int capacity) { // 判断是否需要使用hash算法 boolean currentAltHashing = hashSeed != 0; boolean useAltHashing = sun.misc.VM.isBooted() && (capacity >= Holder.ALTERNATIVE_HASHING_THRESHOLD); boolean switching = currentAltHashing ^ useAltHashing; if (switching) { // 初始化hash种子 hashSeed = useAltHashing ? sun.misc.Hashing.randomHashSeed(this) : 0; } return switching; }三、JDK1.8的HashMap源码JDK1.8中对HashMap进行了很大优化:

  

使用数组+链表/红黑树的数据结构,解决了底层哈希表的安全隐患;在扩容时,通过对插入顺序的改进优化了死锁问题;1、新增概念(1)树化的阙值

  

/** * The bin count threshold for using a tree rather than list for a * bin. Bins are converted to trees when adding an element to a * bin with at least this many nodes. The value must be greater * than 2 and should be at least 8 to mesh with assumptions in * tree removal about conversion back to plain bins upon * shrinkage. */ static final int TREEIFY_THRESHOLD = 8;(2)退树化的阈值

  

/** * The bin count threshold for untreeifying a (split) bin during a * resize operation. Should be less than TREEIFY_THRESHOLD, and at * most 6 to mesh with shrinkage detection under removal. */ static final int UNTREEIFY_THRESHOLD = 6;2、源码阅读(1)putVal()

  

final V putVal(int hash, K key, V value, boolean onlyIfAbsent, boolean evict) { Node<K,V><> tab; Node<K,V> p; int n, i; // 判断哈希表是否为空,为空就创建 if ((tab = table) == null || (n = tab.length) == 0) n = (tab = resize()).length; // 如果是第一个节点,就往这个哈希桶添加一个元素 if ((p = tab) == null) tab = newNode(hash, key, value, null); else { // 如果不是第一个节点 Node<K,V> e; K k; // if (p.hash == hash && ((k = p.key) == key || (key != null && key.equals(k)))) e = p; // 判断节点是不是树节点 else if (p instanceof TreeNode) e = ((TreeNode<K,V>)p).putTreeVal(this, tab, hash, key, value); else { // 该节点就是链表 for (int binCount = 0; ; ++binCount) { if ((e = p.next) == null) { p.next = newNode(hash, key, value, null); // 如果达到可以红黑树化的量,就将链表转换为树 if (binCount >= TREEIFY_THRESHOLD - 1) // -1 for 1st treeifyBin(tab, hash); break; } if (e.hash == hash && ((k = e.key) == key || (key != null && key.equals(k)))) break; p = e; } } if (e != null) { // existing mapping for key V oldValue = e.value; if (!onlyIfAbsent || oldValue == null) e.value = value; afterNodeAccess(e); return oldValue; } } ++modCount; if (++size > threshold) resize(); afterNodeInsertion(evict); return null; }(2)resize:扩容方法

  

final Node<K,V><> resize() { Node<K,V><> oldTab = table; int oldCap = (oldTab == null) ? 0 : oldTab.length; int oldThr = threshold; int newCap, newThr = 0; if (oldCap > 0) { if (oldCap >= MAXIMUM_CAPACITY) { threshold = Integer.MAX_VALUE; return oldTab; } else if ((newCap = oldCap << 1) < MAXIMUM_CAPACITY && oldCap >= DEFAULT_INITIAL_CAPACITY) newThr = oldThr << 1; // double threshold } else if (oldThr > 0) // initial capacity was placed in threshold newCap = oldThr; else { // zero initial threshold signifies using defaults newCap = DEFAULT_INITIAL_CAPACITY; newThr = (int)(DEFAULT_LOAD_FACTOR * DEFAULT_INITIAL_CAPACITY); } if (newThr == 0) { float ft = (float)newCap * loadFactor; newThr = (newCap < MAXIMUM_CAPACITY && ft < (float)MAXIMUM_CAPACITY ? (int)ft : Integer.MAX_VALUE); } threshold = newThr; @SuppressWarnings({"rawtypes","unchecked"}) Node<K,V><> newTab = (Node<K,V><>)new Node; table = newTab; if (oldTab != null) { for (int j = 0; j < oldCap; ++j) { Node<K,V> e; if ((e = oldTab) != null) { oldTab = null; if (e.next == null) newTab = e; else if (e instanceof TreeNode) ((TreeNode<K,V>)e).split(this, newTab, j, oldCap); else { // preserve order:保持顺序,这里仅仅是降低死锁的概率,并没有完全解决死锁问题 // 低位链表 Node<K,V> loHead = null, loTail = null; // 高位链表 Node<K,V> hiHead = null, hiTail = null; Node<K,V> next; do { next = e.next; if ((e.hash & oldCap) == 0) { if (loTail == null) loHead = e; else loTail.next = e; loTail = e; } else { if (hiTail == null) hiHead = e; else hiTail.next = e; hiTail = e; } } while ((e = next) != null); if (loTail != null) { loTail.next = null; newTab = loHead; } if (hiTail != null) { hiTail.next = null; newTab = hiHead; } } } } } return newTab; }四、相关面试题分析HashMap默认容量HashMap如何扩容为什么HashMap的容量必须是2的n次方?1、即使你在构造函数时,不传2的n次方,在后来的初始化方法中,也会强制变成2的n次方

  

1.7:put => inflateTable1.8:HashMap => tableSizeFor2、让元素能够快速定位哈希桶;让Hash表元素分布均匀,减少哈希碰撞的几率(1)快速定位哈希桶在哈希表实现中,有一个很重要的问题:如何将hash值映射到几个哈希桶里呢?对应java来说,就是int范围的数如何映射到哈希桶里呢?很常见的解决方案是:取模,即int % n。但是这种方案有俩个缺点:

  

负数取模仍然是负数,这里要确保hash值一定是正数;相比较HashMap的实现,这种方案性能稍微差一点;1.7:indexFor(int h, int length){ return h & (length - 1);// 记住这行代码,java8是直接用这段代码的}(2)为什么能让Hash表元素分布均匀,减少哈希碰撞的几率?leng - 1 等价于2n - 1,其值格式是:11111...,这样它与hash计算时,得到哈希桶下标,完全取决于hash,只要确保hash算法比较均衡,那么哈希表元素就会比较均衡了。

  

indexFor方法除了HashMap的实现方式,还有其他方式吗?跟HashMap的实现方式相比,有哪些不足?我们知道java中对哈希值的实现是根据每个对象的hashCode方法,而这个方法会可能返回42亿个可能性。而我们可以通过indexFor方法将这些42亿个可能性引入到16个哈希桶中。除了HashMap内部的实现方式,还可以使用取模方法来达到效果。但要注意取模中负号的可能性!!!

  

static int indexFor(int hash) { if (hash < 0) { hash = -hash; } return hash % 16; }这种方式想比较HashMap原生的实现方式比较,就是低效。不仅仅是在这里计算时低效,而且还有可能会造成严重的哈希碰撞。

  

jdk1.8后,为什么要以8作为转化树的阙值?【待补充】

  

为什么要选择0.75作为负载因子?【待补充】算法,在空间和时间的折中问题

  

五、相关应用我在项目遇到要依次匹配method然后引入对应的处理类。相关代码如下:

  

public class AppRestFactory { private static final String METHOD_WO_ = "";//方法名 /** * 工作中心人员的查询 */ private static final String METHOD_WORKCENTER_CONTACT = "getWorkCenterInfoByContact"; /** * 工作中心人员的查询 */ private static final String METHOD_TODOINFOLIST = "getTodoInfoList"; /** * APP查询工单类型 */ private static final String METHOD_WO_TYPES_QUERY = "getEventTypeInfo"; /** * 查询待处理的服务申请单 */ private static final String METHOD_SR_QUERY = "getToDoSRInfo"; /** * APP端-查询待分派的任务 */ private static final String METHOD_GET_TOASSIGNED_INFO_LIST = "getToassignedInfolist"; /** * APP端-查询待改派的工序 */ private static final String METHOD_GET_TOSEND_INFO_LIST = "getToSendInfoList"; /** * 查询工单检查项信息 */ private static final String METHOD_WO_CHECKLIST = "getWOChecklistsInfo"; /** * 编辑更新工单检查项 */ private static final String METHOD_CHECK_LIST_SAVE = "setCheckListsInfo"; /** * 复制标准检查组 */ private static final String METHOD_CHECKLIST_GROUPS_COPY = "copyHAMACTInspectGroup"; /** * APP端-查询待接事项 */ private static final String METHOD_GET_TO_ACCEPT_INFO_LIST = "getToAcceptInfoList"; /** * APP端 - 查询正在执行中的任务 */ private static final String METHOD_GET_INPROG_INFO_LIST = "getInprogInfoList"; /** * APP端-查询工单状态 */ private static final String METHOD_GET_STATUS_LIST_INFO = "getStatusListInfo"; /** * APP端 - 查询标准作业 */ private static final String METHOD_ACT_GETACTLIST = "getActList"; /** * APP端 - 查询工作中心 */ private static final String METHOD_WORKCENTERS_GETWORKCENTERINFO = "getWorkCenterInfo"; /** * APP端 - 创建或更新工单 */ private static final String METHOD_WO_SETWOINFO = "setWOInfo"; /** * APP端 - 查询工单任务<工序> */ private static final String METHOD_WOOP_GETWOOPINFO = "getWOOPInfo"; /** * APP端 - 创建更新工单任务<工序> */ private static final String METHOD_WOOP_SETWOOPINFO = "setWOOPInfo"; /** * APP端 - 查询工单 服务申请单优先级 */ private static final String METHOD_PRIORITY_GETPRIORITYINF = "getPriorityInfo"; /** * APP端-物料汇总信息查询 */ private static final String METHOD_GET_ALL_PRODUCTS = "getAllProductsList"; /** * APP端 - 查询故障集 */ private static final String METHOD_ASMTCODES_GETASSETFAILURES = "getAssetFailures"; /** * APP端--查询标准检查组列表 */ private static final String METHOD_GET_HAMACTINSPECTGROUP = "getHAMACTInspectGroup"; /** * APP端--查询实际检查组列表 */ private static final String METHOD_GET_HAMACT_ACTUAL_INSPECTGROUP="getHAMActualInspectGroup"; /** * APP端 -- 查询工单故障信息 */ private static final String METHOD_WOMALFUNCTION_GETHAMWOFAILURES = "getHamWoFailures"; /** * APP端 -- 查询工单工序物料需求 */ private static final String METHOD_MATERIALS_INFO = "getMaterialsInfo"; /** * APP端 --查询组织 */ private static final String METHOD_ORGANIZATION_GETACCOUNTINFO = "getAccountInfo"; /** * APP端 - 查询货位 */ private static final String METHOD_LOCATORS_GETLOCATORSLIST = "getLocatorsList"; /** * APP端 - 查询服务区域 */ private static final String METHOD_MAINTSITES_GETSITEINFO = "getSiteInfo"; /** * 查询日历任务 */ private static final String METHOD_TASK_SET_INFO_QUERY = "getTaskSetInfo"; /** * 查询技能类型 */ private static final String METHOD_WORK_CENTER_RES_QUERY = "getWorkCenterResInfo"; /** * 查询工作中心人员 */ private static final String METHOD_WORK_CENTER_PEOPLE_QUERY = "getWorkCenterPeopleInfo"; /** * 查询位置 */ private static final String METHOD_LOCATION_INFO_QUERY = "getLocationInfo"; /** * 查询设备/资产 */ private static final String METHOD_ASSET_QUERY = "getAssetInfo"; /** * 查询工单 */ private static final String METHOD_WO_QUERY = "getWOInfo"; /** * 登陆接口 */ private static final String METHOD_GETLOGININFO = "getLoginInfo"; /** * 首页KPI显示 */ private static final String METHOD_GETKPIDISPLAYINFO = "getKPIdisplayInfo"; /** * 查询服务申请单(SR) */ private static final String METHOD_GETAPPROVESRINFOLIST = "getApproveSRInfoList"; /** * 工单查询方法 */ private static final String METHOD_GETWOINFOLIST = "getWOInfoList"; /** * 位置接口 */ private static final String METHOD_POSITION = "getLocationInfo"; /** * 获取逻辑处理实例 * * @param method * @return */ public static AppRestService createService(String method) { if (METHOD_POSITION.equalsIgnoreCase(method)){ return SpringUtils.getBean(LocationServiceImpl.class); } if (METHOD_GETWOINFOLIST.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkOrderServiceImpl.class); } if (METHOD_GETAPPROVESRINFOLIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(SrServiceImpl.class); } if (METHOD_GETKPIDISPLAYINFO.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkOrderServiceImpl.class); } if (METHOD_ASSET_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(CallOtherServersImpl.class); } if (METHOD_WO_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkOrderServiceImpl.class); } if (METHOD_GETLOGININFO.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkCenterPeopleServiceImpl.class); } if (METHOD_WORK_CENTER_PEOPLE_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkCenterPeopleServiceImpl.class); } if (METHOD_WORK_CENTER_RES_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(WorkCenterResServiceImpl.class); } if (METHOD_MAINTSITES_GETSITEINFO.equalsIgnoreCase(method) || METHOD_LOCATION_INFO_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(CallOtherServersImpl.class); } if (METHOD_LOCATORS_GETLOCATORSLIST.equalsIgnoreCase(method)){ return SpringUtils.getBean(CallOtherServersImpl.class); } if (METHOD_ORGANIZATION_GETACCOUNTINFO.equalsIgnoreCase(method)){ return SpringUtils.getBean(CallOtherServersImpl.class); } if (METHOD_WOMALFUNCTION_GETHAMWOFAILURES.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoMalfunctionServiceImpl.class); } if (METHOD_ASMTCODES_GETASSETFAILURES.equalsIgnoreCase(method)) { return SpringUtils.getBean(AsmtCodesServiceImpl.class); } if (METHOD_PRIORITY_GETPRIORITYINF.equalsIgnoreCase(method)) { return SpringUtils.getBean(PrioritiesServiceImpl.class); } if (METHOD_WOOP_SETWOOPINFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_WOOP_GETWOOPINFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_WO_SETWOINFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WorkOrderServiceImpl.class); } if (METHOD_WORKCENTERS_GETWORKCENTERINFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WorkCentersServiceImpl.class); } if (METHOD_ACT_GETACTLIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(ActServiceImpl.class); } if (METHOD_GET_INPROG_INFO_LIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_GET_TO_ACCEPT_INFO_LIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_GET_TOSEND_INFO_LIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_GET_TOASSIGNED_INFO_LIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_WO_.equalsIgnoreCase(method)) {// return SpringUtils.getBean(BpmApplyForStartProjectServiceImpl.class); } if (METHOD_WORKCENTER_CONTACT.equalsIgnoreCase(method)) { return SpringUtils.getBean(WorkCentersServiceImpl.class); } if (METHOD_TODOINFOLIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_WO_TYPES_QUERY.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoTypesServiceImpl.class); } if (METHOD_SR_QUERY.equalsIgnoreCase(method)) { return SpringUtils.getBean(SrServiceImpl.class); } if (METHOD_WO_CHECKLIST.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoChecklistsServiceImpl.class); } if (METHOD_CHECK_LIST_SAVE.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoChecklistsServiceImpl.class); } if (METHOD_CHECKLIST_GROUPS_COPY.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoChecklistGroupsServiceImpl.class); } if (METHOD_GET_STATUS_LIST_INFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WorkOrderServiceImpl.class); } if (METHOD_GET_ALL_PRODUCTS.equalsIgnoreCase(method)) { return SpringUtils.getBean(CallOtherServersImpl.class); } if (METHOD_GET_HAMACTINSPECTGROUP.equalsIgnoreCase(method)) { return SpringUtils.getBean(ActChecklistGroupsServiceImpl.class); } if (METHOD_TASK_SET_INFO_QUERY.equalsIgnoreCase(method)){ return SpringUtils.getBean(WoopServiceImpl.class); } if (METHOD_MATERIALS_INFO.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoMaterialServiceImpl.class); } if (METHOD_GET_HAMACT_ACTUAL_INSPECTGROUP.equalsIgnoreCase(method)) { return SpringUtils.getBean(WoChecklistGroupsServiceImpl.class); } return null; }}这里就可能存在if、else查找效率问题。假设最后一个if才是要找method的话,那么程序的运行效率就会非常低。这还是未完成的情况,假设后期这个method被补充到上百个,那效率就会及其低下。这里其实就可以使用HashMap底层的哈希表的数据结构来优化。代码如下:

  

public class AppRestFactory { /** * 存储APP端方法method得映射关系 * todo:API数量确定后,固定HashMap得长度,防止hashMao扩容时,发生错误 */ private static final Map<String, Class> mapper = new HashMap<>(100); // 初始化method与其工作类得映射关系 static { // 添加退回物料的信息 mapper.put("addMaterialsReturnInfo", WoMaterialServiceImpl.class); // mapper.put("getBomAosProductsList", BomServiceImpl.class); //更新或新增BOM结构清单行的产品列表字段 mapper.put("saveBomAosProductsInfo", BomServiceImpl.class); // 新增或更新工单备件 mapper.put("saveWoMaterialsInfo", WoMaterialServiceImpl.class); // 工作中心人员的查询 mapper.put("getWorkCenterInfoByContact", WorkCentersServiceImpl.class); //工作中心人员的查询 mapper.put("getTodoInfoList", WoopServiceImpl.class); //APP查询工单类型 mapper.put("getEventTypeInfo", WoTypesServiceImpl.class); //查询待处理的服务申请单 mapper.put("getToDoSRInfo", SrServiceImpl.class); // APP端-查询待分派的任务 mapper.put("getToassignedInfolist", WoopServiceImpl.class); // APP端-查询待改派的工序 mapper.put("getToSendInfoList", WoopServiceImpl.class); //查询工单检查项信息 mapper.put("getWOChecklistsInfo", WoChecklistsServiceImpl.class); // 编辑更新工单检查项 mapper.put("setCheckListsInfo", WoChecklistsServiceImpl.class); // 复制标准检查组 mapper.put("copyHAMACTInspectGroup", WoChecklistGroupsServiceImpl.class); // APP端-查询待接事项 mapper.put("getToAcceptInfoList", WoopServiceImpl.class); // APP端 - 查询正在执行中的任务 mapper.put("getInprogInfoList", WoopServiceImpl.class); // APP端-查询工单状态 mapper.put("getStatusListInfo", WorkOrderServiceImpl.class); // APP端 - 查询标准作业 mapper.put("getActList", ActServiceImpl.class); // APP端 - 查询工作中心 mapper.put("getWorkCenterInfo", WorkCentersServiceImpl.class); // APP端 - 创建或更新工单 mapper.put("setWOInfo", WorkOrderServiceImpl.class); // APP端 - 查询工单任务<工序> mapper.put("getWOOPInfo", WoopServiceImpl.class); // APP端 - 创建更新工单任务<工序> mapper.put("setWOOPInfo", WoopServiceImpl.class); // APP端 - 查询工单 服务申请单优先级 mapper.put("getPriorityInfo", PrioritiesServiceImpl.class); // APP端-物料汇总信息查询 mapper.put("getAllProductsList", CallOtherServersImpl.class); // APP端 - 查询故障集 mapper.put("getAssetFailures", AsmtCodesServiceImpl.class); // APP端--查询标准检查组列表 mapper.put("getHAMACTInspectGroup", ActChecklistGroupsServiceImpl.class); // APP端--查询实际检查组列表 mapper.put("getHAMActualInspectGroup", WoChecklistGroupsServiceImpl.class); //APP端 -- 查询工单故障信息 mapper.put("getHamWoFailures", WoMalfunctionServiceImpl.class); // APP端 -- 查询工单工序物料需求 mapper.put("getMaterialsInfo", WoMaterialServiceImpl.class); // APP端 --查询组织 mapper.put("getAccountInfo", CallOtherServersImpl.class); // APP端 - 查询货位 mapper.put("getLocatorsList", CallOtherServersImpl.class); // APP端 - 查询服务区域 mapper.put("getSiteInfo", CallOtherServersImpl.class); // 查询日历任务 mapper.put("getTaskSetInfo", WoopServiceImpl.class); // 查询技能类型 mapper.put("getWorkCenterResInfo", WorkCenterResServiceImpl.class); // 查询工作中心人员 mapper.put("getWorkCenterPeopleInfo", WorkCenterPeopleServiceImpl.class); // 查询位置 mapper.put("getLocationInfo", LocationServiceImpl.class); // 查询设备/资产 mapper.put("getAssetInfo", CallOtherServersImpl.class); // 查询工单 mapper.put("getWOInfo", WorkOrderServiceImpl.class); // 登陆接口 mapper.put("getLoginInfo", WorkCenterPeopleServiceImpl.class); // 首页KPI显示 mapper.put("getKPIdisplayInfo", WorkOrderServiceImpl.class); // 查询服务申请单(SR) mapper.put("getApproveSRInfoList", SrServiceImpl.class); //工单查询方法 mapper.put("getWOInfoList", WorkOrderServiceImpl.class); // 位置接口 mapper.put("getLocationInfo", CallOtherServersImpl.class); // 查询工单工序备件退回字段 mapper.put("getMaterialsReturnList", WoMaterialServiceImpl.class); // 单位信息汇总查询 mapper.put("getUomList", WorkOrderServiceImpl.class); } /** * 获取逻辑处理实例 * * @param method * @return */ public static AppRestService createService(String method) { return (AppRestService) SpringUtils.getBean(mapper.get(method)); }}

相关文章