1. <service verb="get" noun="Products">
  2. <implements service="sang.product.ProductServices.get#ProductsWithPagination"/>
  3. <in-parameters>
  4. <parameter name="productCategoryId" required="true"/>
  5. <parameter name="geoId" required="true"/>
  6. <parameter name="level" type="Integer" default-value="1"/>
  7. </in-parameters>
  8. <actions>
  9. <set field="cacheKeyName" from="productCategoryId + '_' + level + '_' + geoId + '_' + pageIndex + '_' + pageSize + '_' + pageNoLimit + '_' + orderByField"/>
  10. <script>
  11. def categoryGeoProductCache = ec.cache.getCache('Product_List_By_Category_Geo')
  12. productList = (List) categoryGeoProductCache.get(cacheKeyName)
  13. </script>
  14. <if condition="productList != null"><return/></if>
  15. <service-call name="sang.moqui.extend.BasicServices.get#ChildGeoIds" in-map="[ geoId: geoId, level: 20 ]" out-map="context"/>
  16. <set field="geoIds" from="geoIds + [geoId]"/>
  17. <service-call name="sang.product.CategoryServices.get#ChildProductCategoryIds" out-map="context"
  18. in-map="[ productCategoryId: productCategoryId, level: level ]"/>
  19.  
  20. <set field="paginateMap" from="[pageIndex: pageIndex, pageSize: pageSize, pageNoLimit: pageNoLimit, orderByField: orderByField]"/>
  21. <entity-find entity-name="sang.product.ProductAndCategoryAndGeo" list="pList" distinct="true" cache="true">
  22. <search-form-inputs input-fields-map="paginateMap"/>
  23. <date-filter/>
  24. <econdition field-name="statusId" value="ProductOnShelf"/>
  25. <econdition field-name="geoId" operator="in" from="geoIds"/>
  26. <econdition field-name="productCategoryId" operator="in" from="productCategoryIds"/>
  27. <select-field field-name="productId"/>
  28. </entity-find>
  29.  
  30. <service-call name="sang.product.ProductServices.get#ProductsByIds" in-map="[productIds: pList.productId]" out-map="context"/>
  31. <service-call name="sang.common.CommonServices.add#PaginateResponseHeaders"
  32. in-map="[ pageIndex: pageIndex, pageSize: pageSize, totalCount: pListCount, pageMaxIndex: pListPageMaxIndex,
  33. pageRangeLow: pListPageRangeLow, pageRangeHigh: pListPageRangeHigh ]"/>
  34. <script>
  35. categoryGeoProductCache.put(cacheKeyName, productList)
  36. </script>
  37. </actions>
  38. </service>
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <moqui-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/moqui-conf-2.0.xsd">
  3.  
  4. <cache-list warm-on-start="false">
  5. <cache name="Product_List_By_Category_Geo" expire-time-live="60" value-type="List"/>
  6. </cache-list>
  7. <webapp-list>
  8. <webapp name="webroot" https-enabled="false" require-session-token="false">
  9. <after-login><actions>
  10. </actions></after-login>
  11. </webapp>
  12. </webapp-list>
  13. </moqui-conf>

工作框架各种使用整理---使用Cache的更多相关文章

  1. 工作框架各种使用整理 -- 展示数据列表并做update

    <!--ProductCategory.xml--> <?xml version="1.0" encoding="UTF-8"?> &l ...

  2. myBatis+Spring+SpringMVC框架面试题整理

    myBatis+Spring+SpringMVC框架面试题整理(一) 2018年09月06日 13:36:01 新新许愿树 阅读数 14034更多 分类专栏: SSM   版权声明:本文为博主原创文章 ...

  3. C\C++ 框架和库整理(转)

    [本文系外部转贴,原文地址:http://coolshell.info/c/c++/2014/12/13/c-open-project.htm]留作存档 下次造轮子前先看看现有的轮子吧 值得学习的C语 ...

  4. 最全各种系统版本的XPosed框架资料下载整理

    由于XPosed在不同安卓系统版本中对应的版本不同,给很多新手造成极大困扰,本文作者经过几番努力,给大家整理了各个版本对应的xposed框架版本以及相关资料,并附上相关下载链接,希望对大伙有所帮助. ...

  5. Java集合框架 面试问题整理

    简介 java集合类是java.util 包中的重要内容.java集合框架包含了大量集合接口以及这些接口的实现类和操作他们的算法. java集合框架图 主要提供的数据结构 List 又称有序的Coll ...

  6. js页面跳转(含框架跳转)整理

    js方式的页面跳转1.window.location.href方式    <script language="javascript" type="text/java ...

  7. 一些站点使用的服务器软件、js 框架大收集 [ 整理中 ]

    Chrome 的扩展应用 ChromeSnifferPlus ( 开源中国地址:http://www.oschina.net/p/chromesnifferplus,GitHub 地址:https:/ ...

  8. Koa 框架常用知识点整理

    简介 Koa 就是一种简单好用的 Web 框架.它的特点是优雅.简洁.表达力强.自由度高.本身代码只有1000多行,所有功能都通过插件实现. 学前准备 检查Nodejs版本 打开cmd命令行窗口nod ...

  9. Java集合框架相关知识整理

    1.常见的集合有哪些? Collection接口和Map接口是所有集合框架的父接口    Collection接口的子接口包括:Set接口和List接口    Map接口的实现类主要有:HashMap ...

随机推荐

  1. mybatis 插入数据时返回主键

    在使用MyBatis做持久层时,insert语句默认是不返回记录的主键值,而是返回插入的记录条数:显然,假如主键是你生成后插入的,自然你已经有主键了,显然不需要我们再去获得,所以我们这里处理的是当主键 ...

  2. 虚拟机centos6.5 --ssh免密码登录

    说明:此处是以hadoop虚拟机3台机器为背景进行设置,即master.slave01.slave02 1.在master上,生成公钥.私钥 用hadoop用户登录系统,进入个人主目录,即/home/ ...

  3. 几种语言的CGI编程

    为了了解PHP.JSP.ASP出现之前人们写网站的方法,洒家研究了一波CGI,使用C.Python.batch.shell script语言写了几个简单的网页. CGI即通用网关接口,指web服务器调 ...

  4. IDEA使用(1)intellIJ idea 配置 svn

    以前开发工具一直用的是Eclipse/MyEclipse,虽然早就听说过Idea而且也尝试用过几次, 说实话一开始使用idea真是很不习惯,不只是快捷键不同:比如项目和模块.服务器(如Tomcat)配 ...

  5. 不就是抽个血吗,至于么-jQuery,Linux完结篇

    hi 趁着周一去抽血化验,真开心...下午报告才出来,不过早上来了就开始各种晕菜,叫错名字,说错话.....至于么.. 还有在教研室的30天就可以肥家了,凯森凯森.今天不想干活(哪天想干过我就问问), ...

  6. POJ3783Balls[DP 最坏情况最优解]

    Balls Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 907   Accepted: 598 Description T ...

  7. [No00005A]word多文档合一

    2个方法:法一,一个个插入,法二,一次性插入多个. 法一: 视图->大纲视图 点击 大纲 -> 显示文档 点击插入,逐个插入文档.. 最终 将视图调回页面视图..结束. 法二: 插入 - ...

  8. 如何在Kali Linux下编译Windows Exploit

    前言 微软的Windows在企业或是个人应用领域占据着最大的市场份额,在渗透测试过程中你会经常遇到很多Windows的工作站和服务器.另一方面,大多数渗透测试人员主要使用基于Linux的发行版渗透测试 ...

  9. [bzoj3289]Mato的文件管理

    Description Mato同学从各路神犇以各种方式(你们懂的)收集了许多资料,这些资料一共有n份,每份有一个大小和一个编号.为了防止他人偷拷,这些资料都是加密过的,只能用Mato自己写的程序才能 ...

  10. 1,字符是否为空,2,比较两个字符大小。String.Compare(String, String)。string.IsNullOrEmpty(string)

    1, String.Compare 方法 (String, String) 比较两个指定的 String 对象. 值 条件 小于零 strA 小于 strB. 零 strA 等于 strB. 大于零 ...