<?xml version="1.0" encoding="UTF-8"?>

<application port="46100" lib="">

    <resources>
        <group name="ERP_SERVICE_REMOTE">
            <node addr="127.0.0.1" port="46101"/>
        </group>

        <properties load="redis.properties;alidy.properties;invoke.properties">
            <property name="orderFileRoot" value="${APP_HOME}/orderFiles"/>
            <!--注入sql脚本的目录-->
            <property name="sqlroot" value="${APP_HOME}/conf/sqlroot/"/>

            <!--注入初始化id配置文件-->
            <property name="tableIdFile" value="${APP_HOME}/conf/KeyId.xml"/>
            <!--注入初始化code配置文件-->
            <property name="tableCodeFile" value="${APP_HOME}/conf/KeyCode.xml"/>

            <property name="tableIdPrefix" value="sdtool:mall:tableid:"/>
            <property name="tableCodePrefix" value="sdtool:mall:tablecode:"/>

            <!--session过期时间-->
            <property name="sessionExpireSeconds" value="3600"/>

            <property name="passwordSalt" value="gas@FeeCenteR@PassWord"/>
            <property name="menuResourcerRoleIds" value="1"/>

            <!--登录token加密key-->
            <!--根据userFrom分类，防止开发时登录错误-->
            <property name="PC.ERP.Admin.commonkey" value="4c72865cf224465393e3eecb38fc8685"/>
            <property name="PC.Mall.Admin.commonkey" value="6f6a288f58d14a009406e8d32af9ecd3"/>
            <property name="PC.Mall.Front.commonkey" value="d92156d842fb47a3-9bf3d78f6bec36c6"/>
            <property name="PC.Product.Center.commonkey" value="fb0a6911f6334511bb1298c602f0dffc"/>
            <property name="PC.QD.Mall.commonkey" value="b6150f443b034694884bbd2011853563"/>
            <property name="PC.QD.Admin.commonkey" value="94f7984bf2f64826a254a50725d6c057"/>
            <property name="PC.Client.ThirdPart.commonkey" value="7ec2ff203d0949c692e2348835f31a5a"/>
            <property name="Mini.Mall.commonkey" value="574e143e4f8548b9b185d723671fef1a"/>
            <property name="Mini.ERP.commonkey" value="107a4add4eda-4888-a0e9bf293780b7ec"/>
            <property name="App.ERP.Admin.commonkey" value="6bda3445b2b74cb4baf1ef53a80db96e"/>
            <property name="API.ERP.Client.commonkey" value="1c49c9aaee874091b7c61230f1adba2d"/>

            <property name="baiduKey" value="r8bLF3qzzYxVpPACZaxbaWSgYDyihz0d"/>

            <!--数据的起始年份和结束年份，影响缓存索引的建立和数据库中的分表-->
            <property name="bookStartYear" value="2010"/>
            <property name="bookEndYear" value="2030"/>
            <property name="bookSplitKind" value="1"/>

            <!--物料库存在redis中的分片数，提高hscan性能-->
            <property name="materialStockShards" value="20"/>

            <property name="webSocketServerName" value="aws"/>

            <!--分厂维护服务地址-->
            <property name="erpDataMain.url" value="http://192.168.1.24:8080/apis"/>

            <property name="orderImportRoot" value="${APP_HOME}/importOrder"/>

            <property name="bucketFileRoot" value="${APP_HOME}/erpfiles"/>

            <!--支付超时分钟-->
            <property name="payTimeOutMinutes" value="30"/>
            <!--订单未支付超时分钟-->
            <property name="orderTimeOutMinutes" value="1440"/>

            <!--系统运行模式，区分ERP和商城完全靠脚本理论是可行的，就是一些档案增删改的代码也需要调整到脚本执行，前期懒得处理，用此字段区分一下算了-->
            <!--ERP：印刷ERP-->
            <!--Mall：印刷商城,注意商城的后台理论上有两个版本，一个是带有简易ERP，一个是不带ERP的，这个最好是通过ConfigValue来实现，避免在SAAS中调用-->
            <!--ProductCenter：产品中心-->
            <property name="sysRunMode" value="Mall"/>

            <property name="saasHostName" value="yinjieai.com"/>

            <!--  redis任务通知队列的命名空间，一定要和RedisJobConsumer节点的namespace对应上-->
            <property name="redisJobNameSpace" value="sdtool_jobmain"/>
        </properties>
    </resources>

    <server protocol="HTTP" host="127.0.0.1" port="46102" maxbody="5m" aliveTimeoutSeconds="0">
        <!-- 前端配置了nginx，需要配置才能获取客户端真实的IP地址 -->
        <request>
            <remoteaddr value="request.headers.X-Forwarded-For"/>
        </request>

        <services autoload="false" includes="">
            <service value="com.sdtool.webcore.rest.ERPRest"/>
            <service value="com.sdtool.webcore.rest.AdminRest">
                <isUseScriptService value="true"/>
            </service>
            <service value="com.sdtool.webcore.rest.ERPUpdateRest"/>
            <service value="com.sdtool.webcore.rest.SystemRest"/>
            <service value="com.sdtool.webcore.rest.DocInfoRest">
                <isUseScriptService value="true"/>
            </service>
            <service value="com.sdtool.webcore.rest.SiteRest"/>
            <service value="com.sdtool.webcore.rest.MallAdminRest"/>
            <service value="com.sdtool.webcore.rest.MallFrontRest"/>
            <service value="com.sdtool.webcore.rest.AddressRest"/>
            <service value="com.sdtool.webcore.rest.DesignRest"/>
            <service value="com.sdtool.webcore.rest.InvokeRest"/>
        </services>

        <resource-servlet webroot="root" index="index.html">
            <cache limit="1M" lengthmax="2M" watch="true"/>
        </resource-servlet>

        <!--http过滤器-->
        <filters autoload="false" includes="" excludes="">
            <filter value="com.sdtool.webcore.servlet.ERPSessionFilter"/>
        </filters>

        <!-- 管理提供给管理用户的接口 -->
        <!-- 注意项目划为，如果是商城后台管理，则 PCERPAdminHttpServlet需要更换为 PCMallAdminHttpServlet -->
        <!-- 其实理论上目前rest的父类可以不严格区分，主要分两种，一种是使用了权限管理的服务，比如ERP，商城管理，产品中心等，一种是不需要权限管理的服务，比如商城购物前端等，这两种BaseHttpServlet已经处理了 -->
        <rest autoload="false" base="com.sdtool.common.base.PCERPAdminHttpServlet">
            <service value="com.sdtool.webcore.rest.ERPRest"/>
            <service value="com.sdtool.webcore.rest.AdminRest">
                <isUseScriptService value="true"/>
            </service>
            <service value="com.sdtool.webcore.rest.ERPUpdateRest"/>
            <service value="com.sdtool.webcore.rest.SystemRest"/>
            <service value="com.sdtool.webcore.rest.DocInfoRest">
                <isUseScriptService value="true"/>
            </service>
            <service value="com.sdtool.webcore.rest.SiteRest"/>
            <service value="com.sdtool.webcore.rest.DesignRest"/>
            <service value="com.sdtool.webcore.rest.InvokeRest"/>

            <websocket value="com.sdtool.webcore.websocket.ERPWebSocket" name="aws" groups="ERP_SERVICE_REMOTE"/>
        </rest>

        <rest autoload="false" base="com.sdtool.common.base.PCMallAdminHttpServlet">
            <service value="com.sdtool.webcore.rest.MallAdminRest"/>
        </rest>

        <rest autoload="false" base="com.sdtool.common.base.PCMallFrontHttpServlet">
            <service value="com.sdtool.webcore.rest.MallFrontRest"/>
            <service value="com.sdtool.webcore.rest.AddressRest"/>
        </rest>

        <servlets autoload="false">
            <servlet value="com.sdtool.webcore.servlet.ERPCallServlet"/>
            <servlet value="com.sdtool.webcore.servlet.MallCallServlet"/>
            <servlet value="com.sdtool.common.servlet.apidoc.ApiDocServlet">
                <environment value="dev"/>
            </servlet>
            <servlet value="com.sdtool.common.servlet.file.FileUploadServlet"/>

            <servlet value="com.sdtool.webcore.servlet.PayNotifyServlet"/>
        </servlets>
    </server>

    <server protocol="SNCP" host="127.0.0.1" port="46101" aliveTimeoutSeconds="0">
        <services autoload="false" includes="">
            <service value="com.dySweetFishPlugin.sql.SqlService" groups="ERP_SERVICE_REMOTE"/>
            <service value="com.dySweetFishPlugin.sql.DBService" groups="ERP_SERVICE_REMOTE">
                <!--封装rexdb数据库操作服务，maxsize缓存最大查询结果数量，expireminutes缓存超时时间，分钟单位-->
                <maxsize value="100"/>
                <expireminutes value="1"/>
            </service>

            <service value="com.dySweetFishPlugin.redis.RedisService" groups="ERP_SERVICE_REMOTE"/>
            <service value="com.dySweetFishPlugin.sql.TableIdService" groups="ERP_SERVICE_REMOTE">
                <tableSharding value="com.sdtool.business.dao.TableIdShardingStrategy"/>
                <!--多数据源-->
                <dataBaseMulti value="true"/>
            </service>

            <service value="com.dySweetFishPlugin.sql.dao.TunaDaoService" groups="ERP_SERVICE_REMOTE"/>
            <service value="com.dySweetFishPlugin.sql.dao.TunaService" groups="ERP_SERVICE_REMOTE">
                <dao value="com.sdtool.business.dao.LoginDao"/>
                <dao value="com.sdtool.business.dao.SystemDao"/>
                <dao value="com.sdtool.business.dao.DocDao"/>
                <dao value="com.sdtool.business.dao.MallDao"/>
                <dao value="com.sdtool.business.dao.DesignDao"/>
            </service>

            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJQService" groups="ERP_SERVICE_REMOTE"/>
            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobProducer" groups="ERP_SERVICE_REMOTE"/>
            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobConsumer" groups="ERP_SERVICE_REMOTE">
                <namespace value="sdtool_jobmain"/>
                <!--                <queue name="ClientDataJob" jobclass="com.sdtool.common.entity.doc.ClientDataJob"-->
                <!--                       execclass="com.sdtool.business.service.erp.ClientDataJobExecutor"/>-->
                <!--                <queue name="PayDataJob" jobclass="com.sdtool.common.entity.pay.RedisPayJob"-->
                <!--                       execclass="com.sdtool.business.service.pay.RedisPayJobExecutor"/>-->
                <!--                <queue name="OrderTimeOutJob" jobclass="com.sdtool.common.entity.order.MallOrderDataJob"-->
                <!--                       execclass="com.sdtool.business.service.mall.MallOrderTimeOutExecutor"/>-->
            </service>

            <service value="com.sdtool.common.api.NoSqlKeysService" load="rediskeys.properties;eskeys.properties"
                     groups="ERP_SERVICE_REMOTE"/>

            <service value="com.sdtool.common.api.TypeTokenConvertService" groups="ERP_SERVICE_REMOTE"/>

            <service value="com.dySweetFishPlugin.elasticsearch.ESClient" groups="ERP_SERVICE_REMOTE">
                <clusterName value="elasticsearch"/>
                <host value="192.168.1.4"/>
                <port value="9300"/>
            </service>

            <service value="com.sdtool.common.tool.AliSmsService" groups="ERP_SERVICE_REMOTE"/>

            <service value="com.sdtool.common.api.ERPLockDataService" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
            </service>

            <service value="com.sdtool.common.tool.CodeGenerate" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
            </service>

            <service value="com.sdtool.business.service.ImagePuzzleCaptchaImpl" groups="ERP_SERVICE_REMOTE"/>

            <service value="com.sdtool.common.api.OpLogService" groups="ERP_SERVICE_REMOTE"/>

            <service name="aws" value="com.sweetfish.source.CacheMemorySource" groups="ERP_SERVICE_REMOTE">
            </service>
            <service name="aws" value="com.sweetfish.service.WebSocketNodeService" groups="ERP_SERVICE_REMOTE"/>

            <service value="com.sdtool.business.service.SupplierInitImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <environment value="dev"/>
                <resetClientInfo value="false"/>
                <clearESData value="false"/>
                <resetAccountTradeBill value="false"/>
                <resetPaperInfo value="false"/> <!-- 每次启动载入纸张6秒多，为提高效率，加了这个，如果不合适改成true或者删了都行-->
                <initScriptPathName value="init"/>
            </service>

            <service value="com.sdtool.business.service.ERPServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
            </service>

            <service value="com.sdtool.business.service.SysMessageServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
            </service>

            <service value="com.sdtool.common.api.ERPLockDataService" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
            </service>

            <service value="com.sdtool.business.service.DocInfoServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <!--使用业务脚本-->
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.SystemServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
                <!--                <preCompiler value="1000/business/BE_System_TestListExt.groovy"/>-->
            </service>

            <service value="com.sdtool.business.service.LoginServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.LoginUserServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.PermissionServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.RoleServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.ConfigServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.DictServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.MenuServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.DeptServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="false"/>
            </service>

            <service value="com.sdtool.business.service.mall.MallAdminServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.mall.MallFrontServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.AddressServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.mall.MallApiCallServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.DataSyncServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <!--使用业务脚本-->
                <isUseScriptService value="true"/>
            </service>

            <service value="com.sdtool.business.service.mall.DesignServiceImpl" groups="ERP_SERVICE_REMOTE">
                <master value="true"/>
                <!--使用业务脚本-->
                <isUseScriptService value="true"/>
            </service>
        </services>
    </server>
</application>
