Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-crm
提交
8cc4b0a0
O
o2oa-crm
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-crm
通知
0
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
o2oa-crm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8cc4b0a0
编写于
3月 16, 2022
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
dc051665
变更
26
展开全部
隐藏空白更改
内联
并排
Showing
26 changed file
with
451 addition
and
1428 deletion
+451
-1428
.gitignore
.gitignore
+182
-0
pom.xml
pom.xml
+29
-0
store/jars/x_base_core_project.jar
store/jars/x_base_core_project.jar
+0
-0
x_wcrm_assemble_control/pom.xml
x_wcrm_assemble_control/pom.xml
+71
-9
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/Business.java
...l/src/main/java/com/x/wcrm/assemble/control/Business.java
+5
-21
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/ConfigFactory.java
...va/com/x/wcrm/assemble/control/factory/ConfigFactory.java
+7
-35
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/ContactsFactory.java
.../com/x/wcrm/assemble/control/factory/ContactsFactory.java
+0
-1
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/CustomerFactory.java
.../com/x/wcrm/assemble/control/factory/CustomerFactory.java
+8
-9
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/OpportunityFactory.java
...m/x/wcrm/assemble/control/factory/OpportunityFactory.java
+0
-1
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionGetResult.java
...rm/assemble/control/jaxrs/inputleads/ActionGetResult.java
+12
-7
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
...x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
+5
-6
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
.../x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
+3
-5
x_wcrm_assemble_control/src/main/webapp/WEB-INF/web.xml
x_wcrm_assemble_control/src/main/webapp/WEB-INF/web.xml
+1
-1
x_wcrm_assemble_control/src/main/webapp/describe/describe.json
...m_assemble_control/src/main/webapp/describe/describe.json
+59
-167
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/Business.java
...escribe/sources/com/x/wcrm/assemble/control/Business.java
+5
-21
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/ConfigFactory.java
...es/com/x/wcrm/assemble/control/factory/ConfigFactory.java
+7
-35
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/ContactsFactory.java
.../com/x/wcrm/assemble/control/factory/ContactsFactory.java
+0
-1
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/CustomerFactory.java
.../com/x/wcrm/assemble/control/factory/CustomerFactory.java
+8
-9
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/OpportunityFactory.java
...m/x/wcrm/assemble/control/factory/OpportunityFactory.java
+0
-1
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionGetResult.java
...rm/assemble/control/jaxrs/inputleads/ActionGetResult.java
+12
-7
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
...x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
+5
-6
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
.../x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
+3
-5
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
+0
-295
x_wcrm_core_entity/pmd.html
x_wcrm_core_entity/pmd.html
+8
-476
x_wcrm_core_entity/pom.xml
x_wcrm_core_entity/pom.xml
+21
-28
x_wcrm_core_entity/x_wcrm_core_entity.iml
x_wcrm_core_entity/x_wcrm_core_entity.iml
+0
-282
未找到文件。
.gitignore
0 → 100644
浏览文件 @
8cc4b0a0
# Default ignored files
/workspace.xml
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/encodings.xml
.idea/encodings.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
.idea
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
*.iml
# eclipse
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
.project
.classpath
.log
# vscode
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
**/pmd.xml
**/cpd.xml
**/pmd.html
**/cpd.html
# custom
app/**/*.iml
app/**/.project
app/**/.settings/
app/**/.classpath
app/*.iml
app/.project
app/**/*.log
app/log/dsdh/*.log
*/src/main/webapp/describe/
assembly/.settings
assembly/.project
assembly/*.iml
pom.xml
0 → 100644
浏览文件 @
8cc4b0a0
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
o2oa
</groupId>
<artifactId>
o2server
</artifactId>
<version>
7.0
</version>
</parent>
<artifactId>
o2oa-crm
</artifactId>
<packaging>
pom
</packaging>
<modules>
<module>
x_wcrm_core_entity
</module>
<module>
x_wcrm_assemble_control
</module>
</modules>
<repositories>
<repository>
<id>
nexus-o2oa
</id>
<name>
nexus-o2oa
</name>
<url>
http://maven.o2oa.net/repository/maven-public/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
</repository>
</repositories>
</project>
store/jars/x_base_core_project.jar
0 → 100644
浏览文件 @
8cc4b0a0
文件已添加
x_wcrm_assemble_control/pom.xml
浏览文件 @
8cc4b0a0
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
o2oa
</groupId>
<groupId>
o2oa
</groupId>
<artifactId>
o2
server
</artifactId>
<artifactId>
o2
oa-crm
</artifactId>
<version>
5
</version>
<version>
7.0
</version>
</parent>
</parent>
<artifactId>
x_wcrm_assemble_control
</artifactId>
<artifactId>
x_wcrm_assemble_control
</artifactId>
<packaging>
war
</packaging>
<packaging>
war
</packaging>
...
@@ -27,9 +27,9 @@
...
@@ -27,9 +27,9 @@
<dependency>
<dependency>
<groupId>
o2oa
</groupId>
<groupId>
o2oa
</groupId>
<artifactId>
x_wcrm_core_entity
</artifactId>
<artifactId>
x_wcrm_core_entity
</artifactId>
<version>
5
</version>
<version>
7.0
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
@@ -37,6 +37,24 @@
...
@@ -37,6 +37,24 @@
<groupId>
org.codehaus.mojo
</groupId>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<artifactId>
exec-maven-plugin
</artifactId>
<executions>
<executions>
<execution>
<id>
DescribeWoBuilder
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
java
</goal>
</goals>
<configuration>
<addOutputToClasspath>
true
</addOutputToClasspath>
<includePluginDependencies>
true
</includePluginDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<mainClass>
com.x.base.core.project.annotation.DescribeWoBuilder
</mainClass>
<arguments>
<argument>
${basedir}
</argument>
<argument>
${project.build.sourceDirectory}
</argument>
</arguments>
</configuration>
</execution>
<execution>
<execution>
<id>
describeBuilder
</id>
<id>
describeBuilder
</id>
<phase>
prepare-package
</phase>
<phase>
prepare-package
</phase>
...
@@ -47,8 +65,25 @@
...
@@ -47,8 +65,25 @@
<addOutputToClasspath>
true
</addOutputToClasspath>
<addOutputToClasspath>
true
</addOutputToClasspath>
<includePluginDependencies>
true
</includePluginDependencies>
<includePluginDependencies>
true
</includePluginDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<mainClass>
com.x.base.core.project.annotation.DescribeBuilder
<mainClass>
com.x.base.core.project.annotation.DescribeBuilder
</mainClass>
</mainClass>
<arguments>
<argument>
${basedir}
</argument>
<argument>
${project.build.sourceDirectory}
</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>
apiBuilder
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
java
</goal>
</goals>
<configuration>
<addOutputToClasspath>
true
</addOutputToClasspath>
<includePluginDependencies>
true
</includePluginDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<mainClass>
com.x.base.core.project.annotation.ApiBuilder
</mainClass>
<arguments>
<arguments>
<argument>
${basedir}
</argument>
<argument>
${basedir}
</argument>
<argument>
${project.build.sourceDirectory}
</argument>
<argument>
${project.build.sourceDirectory}
</argument>
...
@@ -65,8 +100,7 @@
...
@@ -65,8 +100,7 @@
<addOutputToClasspath>
true
</addOutputToClasspath>
<addOutputToClasspath>
true
</addOutputToClasspath>
<includePluginDependencies>
true
</includePluginDependencies>
<includePluginDependencies>
true
</includePluginDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<mainClass>
com.x.base.core.project.build.CheckAssemble
<mainClass>
com.x.base.core.project.build.CheckAssemble
</mainClass>
</mainClass>
</configuration>
</configuration>
</execution>
</execution>
<execution>
<execution>
...
@@ -98,7 +132,7 @@
...
@@ -98,7 +132,7 @@
<goal>
copy-resources
</goal>
<goal>
copy-resources
</goal>
</goals>
</goals>
<configuration>
<configuration>
<outputDirectory>
../
../o2server/custom
</outputDirectory>
<outputDirectory>
../
store
</outputDirectory>
<resources>
<resources>
<resource>
<resource>
<directory>
target
</directory>
<directory>
target
</directory>
...
@@ -111,6 +145,34 @@
...
@@ -111,6 +145,34 @@
</execution>
</execution>
</executions>
</executions>
</plugin>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
3.2.3
</version>
<configuration>
<archive>
<addMavenDescriptor>
false
</addMavenDescriptor>
</archive>
<packagingExcludes>
persistence.xml,WEB-INF/lib/**,META-INF
</packagingExcludes>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
<webResources>
<resource>
<directory>
ext
</directory>
<includes>
<include>
**/*.jar
</include>
</includes>
<targetPath>
WEB-INF/ext
</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-deploy-plugin
</artifactId>
<configuration>
<skip>
true
</skip>
</configuration>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/Business.java
浏览文件 @
8cc4b0a0
...
@@ -192,26 +192,20 @@ public class Business {
...
@@ -192,26 +192,20 @@ public class Business {
/**
/**
* TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
* TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
*
*
* @param request
* @param request
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
boolean
isManager
(
HttpServletRequest
request
,
EffectivePerson
person
)
throws
Exception
{
public
boolean
isManager
(
HttpServletRequest
request
,
EffectivePerson
person
)
throws
Exception
{
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
if
(
"xadmin"
.
equalsIgnoreCase
(
person
.
getDistinguishedName
()
))
{
if
(
person
.
isManager
(
))
{
return
true
;
return
true
;
}
}
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
CRMManager_discription
))
{
OrganizationDefinition
.
CMSManager
))
{
return
true
;
}
/*if (person.isManager()) {
return
true
;
return
true
;
}
}
if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_CRMManager)) {
return true;
}*/
return
false
;
return
false
;
}
}
...
@@ -223,21 +217,11 @@ public class Business {
...
@@ -223,21 +217,11 @@ public class Business {
*/
*/
public
boolean
isManager
(
EffectivePerson
person
)
throws
Exception
{
public
boolean
isManager
(
EffectivePerson
person
)
throws
Exception
{
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
if
(
person
.
isManager
())
{
/*if (person.isManager()) {
return true;
}
if ("xadmin".equalsIgnoreCase(person.getDistinguishedName())) {
return true;
}
if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_CRMManager)) {
return true;
}*/
if
(
"xadmin"
.
equalsIgnoreCase
(
person
.
getDistinguishedName
()))
{
return
true
;
return
true
;
}
}
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
C
RMManager_discription
))
{
OrganizationDefinition
.
C
MSManager
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/ConfigFactory.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.factory
;
package
com.x.wcrm.assemble.control.factory
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.wcrm.assemble.control.AbstractFactory
;
import
com.x.wcrm.assemble.control.AbstractFactory
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.core.entity.WCrmConfig
;
import
com.x.wcrm.core.entity.WCrmConfig
;
...
@@ -12,7 +11,6 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -12,7 +11,6 @@ import org.apache.commons.lang3.StringUtils;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.*
;
import
javax.persistence.criteria.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,15 +29,7 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -31,15 +29,7 @@ public class ConfigFactory extends AbstractFactory {
public
WCrmConfig
get
(
String
id
)
throws
Exception
{
public
WCrmConfig
get
(
String
id
)
throws
Exception
{
return
this
.
entityManagerContainer
().
find
(
id
,
WCrmConfig
.
class
,
ExceptionWhen
.
none
);
return
this
.
entityManagerContainer
().
find
(
id
,
WCrmConfig
.
class
,
ExceptionWhen
.
none
);
}
}
/*public ProjectDetail getDetail(String id) throws Exception {
return this.entityManagerContainer().find( id, ProjectDetail.class, ExceptionWhen.none );
}*/
/**
/**
* 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
* 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
* @param maxCount
* @param maxCount
...
@@ -57,17 +47,9 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -57,17 +47,9 @@ public class ConfigFactory extends AbstractFactory {
CriteriaQuery
<
WCrmConfig
>
cq
=
cb
.
createQuery
(
WCrmConfig
.
class
);
CriteriaQuery
<
WCrmConfig
>
cq
=
cb
.
createQuery
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Predicate
p_permission
=
null
;
Predicate
p_permission
=
null
;
/*if( StringUtils.isNotEmpty( personName )) {
//可以管理的栏目,肯定可以发布信息
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
}*/
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
if
(
sequenceFieldValue
!=
null
&&
StringUtils
.
isNotEmpty
(
sequenceFieldValue
.
toString
()
))
{
if
(
sequenceFieldValue
!=
null
&&
StringUtils
.
isNotEmpty
(
sequenceFieldValue
.
toString
()
))
{
Predicate
p_seq
=
cb
.
isNotNull
(
root
.
get
(
WCrmConfig_
.
sequence
)
);
Predicate
p_seq
=
cb
.
isNotNull
(
root
.
get
(
WCrmConfig_
.
sequence
)
);
if
(
"desc"
.
equalsIgnoreCase
(
orderType
)){
if
(
"desc"
.
equalsIgnoreCase
(
orderType
)){
...
@@ -76,16 +58,15 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -76,16 +58,15 @@ public class ConfigFactory extends AbstractFactory {
p_seq
=
cb
.
and
(
p_seq
,
cb
.
greaterThan
(
root
.
get
(
WCrmConfig_
.
sequence
),
sequenceFieldValue
.
toString
()
));
p_seq
=
cb
.
and
(
p_seq
,
cb
.
greaterThan
(
root
.
get
(
WCrmConfig_
.
sequence
),
sequenceFieldValue
.
toString
()
));
}
}
p
=
cb
.
and
(
p
,
p_seq
);
p
=
cb
.
and
(
p
,
p_seq
);
}
}
Order
orderWithField
=
CriteriaBuilderTools
.
getOrder
(
cb
,
root
,
WCrmConfig_
.
class
,
orderField
,
orderType
);
Order
orderWithField
=
CriteriaBuilderTools
.
getOrder
(
cb
,
root
,
WCrmConfig_
.
class
,
orderField
,
orderType
);
if
(
orderWithField
!=
null
){
if
(
orderWithField
!=
null
){
cq
.
orderBy
(
orderWithField
);
cq
.
orderBy
(
orderWithField
);
}
}
System
.
out
.
println
(
">>>SQL:"
+
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
toString
()
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
}
}
/**
/**
* 根据条件查询所有符合条件的项目模板信息ID,项目信息不会很多 ,所以直接查询出来
* 根据条件查询所有符合条件的项目模板信息ID,项目信息不会很多 ,所以直接查询出来
* @param maxCount
* @param maxCount
...
@@ -100,16 +81,7 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -100,16 +81,7 @@ public class ConfigFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Predicate
p_permission
=
null
;
Predicate
p_permission
=
null
;
/*if( StringUtils.isNotEmpty( personName )) {
//可以管理的栏目,肯定可以发布信息
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( ProjectTemplate_.participantPersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.creatorPerson ), personName ) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.executor ), personName ) );
}*/
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
WCrmConfig_
.
id
)
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
WCrmConfig_
.
id
)
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
...
@@ -130,5 +102,5 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -130,5 +102,5 @@ public class ConfigFactory extends AbstractFactory {
Predicate
p
=
cb
.
equal
(
root
.
get
(
WCrmConfig_
.
configModule
),
configModule
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
WCrmConfig_
.
configModule
),
configModule
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
}
}
}
}
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/ContactsFactory.java
浏览文件 @
8cc4b0a0
...
@@ -129,7 +129,6 @@ public class ContactsFactory extends AbstractFactory {
...
@@ -129,7 +129,6 @@ public class ContactsFactory extends AbstractFactory {
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Contacts_
.
class
,
orderFieldName
,
orderType
);
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Contacts_
.
class
,
orderFieldName
,
orderType
);
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"cq="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
}
}
...
...
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/CustomerFactory.java
浏览文件 @
8cc4b0a0
...
@@ -299,7 +299,6 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -299,7 +299,6 @@ public class CustomerFactory extends AbstractFactory {
// cq.select(root).where(p).orderBy(cb.desc(root.get(Customer_.createTime)));
// cq.select(root).where(p).orderBy(cb.desc(root.get(Customer_.createTime)));
// return em.createQuery(cq).getResultList();
// return em.createQuery(cq).getResultList();
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"List_OwnerEqual_Or_ReadersMember_Or_WritesMember==="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
}
}
...
@@ -401,7 +400,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -401,7 +400,7 @@ public class CustomerFactory extends AbstractFactory {
//SELECT op.XCRMID,MAX(op.XLONGCREATETIME) FROM PUBLIC.WCRM_OPERATIONRECORD AS op WHERE op.XMODULE='customer' GROUP BY op.XCRMID;
//SELECT op.XCRMID,MAX(op.XLONGCREATETIME) FROM PUBLIC.WCRM_OPERATIONRECORD AS op WHERE op.XMODULE='customer' GROUP BY op.XCRMID;
/**
/**
* 列出,指定module类型的操作记录,按照crmid分组展示每组的最大值
* 列出,指定module类型的操作记录,按照crmid分组展示每组的最大值
*
*
* @param {_module}
* @param {_module}
* @return SimpleKV
* @return SimpleKV
*/
*/
...
@@ -426,7 +425,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -426,7 +425,7 @@ public class CustomerFactory extends AbstractFactory {
CustomerAndLastRecord
e
=
new
CustomerAndLastRecord
();
CustomerAndLastRecord
e
=
new
CustomerAndLastRecord
();
e
.
setLastRecord_Id
(
o
.
get
(
_path_oprecord_crmid
));
e
.
setLastRecord_Id
(
o
.
get
(
_path_oprecord_crmid
));
e
.
setLastRecord_LongTime
(
o
.
get
(
_path_oprecord_createtime
));
e
.
setLastRecord_LongTime
(
o
.
get
(
_path_oprecord_createtime
));
Date
date
=
new
Date
();
Date
date
=
new
Date
();
date
.
setTime
(
o
.
get
(
_path_oprecord_createtime
));
date
.
setTime
(
o
.
get
(
_path_oprecord_createtime
));
//o.get(_path_oprecord_createtime);
//o.get(_path_oprecord_createtime);
...
@@ -463,7 +462,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -463,7 +462,7 @@ public class CustomerFactory extends AbstractFactory {
/**
/**
* 根据计算每个省份的客户数量
* 根据计算每个省份的客户数量
*
*
* @throws Exception
* @throws Exception
*/
*/
public
List
<
SimpleKV
>
count_by_province
(
List
<
String
>
_distinguishNameList
,
Date
begintime
,
Date
endtime
)
throws
Exception
{
public
List
<
SimpleKV
>
count_by_province
(
List
<
String
>
_distinguishNameList
,
Date
begintime
,
Date
endtime
)
throws
Exception
{
...
@@ -546,7 +545,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -546,7 +545,7 @@ public class CustomerFactory extends AbstractFactory {
CriteriaQuery<Customer> cq = cb.createQuery(Customer.class);
CriteriaQuery<Customer> cq = cb.createQuery(Customer.class);
Root<Customer> root = cq.from(Customer.class);
Root<Customer> root = cq.from(Customer.class);
Predicate p = root.get(Customer_.owneruser).in(_distinguishNameList);
Predicate p = root.get(Customer_.owneruser).in(_distinguishNameList);
//跟进状态
//跟进状态
if (isflow) {
if (isflow) {
Predicate p_follow_followed = cb.equal(root.get(Customer_.follow), "已跟进");
Predicate p_follow_followed = cb.equal(root.get(Customer_.follow), "已跟进");
...
@@ -557,11 +556,11 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -557,11 +556,11 @@ public class CustomerFactory extends AbstractFactory {
Predicate p_follow = cb.or(p_follow_isnull, p_follow_unfollow);
Predicate p_follow = cb.or(p_follow_isnull, p_follow_unfollow);
p = cb.and(p, p_follow);
p = cb.and(p, p_follow);
}
}
//时间范围
//时间范围
Predicate p_between = cb.between(root.get(Customer_.nexttime), beginTime, endTime);
Predicate p_between = cb.between(root.get(Customer_.nexttime), beginTime, endTime);
p = cb.and(p, p_between);
p = cb.and(p, p_between);
//搜索关键字判断
//搜索关键字判断
if (!StringWCRMUtils.isEmptyKeyString(keyString)) {
if (!StringWCRMUtils.isEmptyKeyString(keyString)) {
String key = StringUtils.trim(StringUtils.replaceEach(keyString, new String[] { "\u3000", "?", "%" }, new String[] { " ", "", "" }));
String key = StringUtils.trim(StringUtils.replaceEach(keyString, new String[] { "\u3000", "?", "%" }, new String[] { " ", "", "" }));
...
@@ -570,7 +569,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -570,7 +569,7 @@ public class CustomerFactory extends AbstractFactory {
cb.like(root.get(Customer_.pinyinInitial), "%" + key + "%"), cb.like(root.get(Customer_.telephone), "%" + key + "%"));
cb.like(root.get(Customer_.pinyinInitial), "%" + key + "%"), cb.like(root.get(Customer_.telephone), "%" + key + "%"));
p = cb.and(p, p_like);
p = cb.and(p, p_like);
}
}
//排序值字段,升降序判断
//排序值字段,升降序判断
Order _order;
Order _order;
if (StringUtils.isEmpty(orderType) || StringUtils.isEmpty(orderFieldName) || null == orderType || null == orderFieldName) {
if (StringUtils.isEmpty(orderType) || StringUtils.isEmpty(orderFieldName) || null == orderType || null == orderFieldName) {
...
@@ -578,7 +577,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -578,7 +577,7 @@ public class CustomerFactory extends AbstractFactory {
} else {
} else {
_order = CriteriaQueryTools.setOrder(cb, root, Customer_.class, orderFieldName, orderType);
_order = CriteriaQueryTools.setOrder(cb, root, Customer_.class, orderFieldName, orderType);
}
}
cq.select(root).where(p).orderBy(_order);
cq.select(root).where(p).orderBy(_order);
return em.createQuery(cq).setFirstResult((adjustPage - 1) * adjustPageSize).setMaxResults(adjustPageSize).getResultList();
return em.createQuery(cq).setFirstResult((adjustPage - 1) * adjustPageSize).setMaxResults(adjustPageSize).getResultList();
}*/
}*/
...
...
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/OpportunityFactory.java
浏览文件 @
8cc4b0a0
...
@@ -217,7 +217,6 @@ public class OpportunityFactory extends AbstractFactory {
...
@@ -217,7 +217,6 @@ public class OpportunityFactory extends AbstractFactory {
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Opportunity_
.
class
,
orderFieldName
,
orderType
);
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Opportunity_
.
class
,
orderFieldName
,
orderType
);
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"cq="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
.
getResultList
();
}
}
...
...
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionGetResult.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
java.util.Optional
;
import
net.sf.ehcache.Element
;
/**
* @author sword
*/
public
class
ActionGetResult
extends
BaseAction
{
public
class
ActionGetResult
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionGetResult
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionGetResult
.
class
);
protected
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
protected
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
logger
.
debug
(
effectivePerson
,
"flag:{}."
,
flag
);
logger
.
debug
(
effectivePerson
.
getDistinguishedName
()
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Element
element
=
cache
.
get
(
flag
);
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
flag
);
if
(
null
==
element
||
(
null
==
element
.
getObjectValue
()))
{
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(!
optional
.
isPresent
())
{
throw
new
ExceptionResultNotFound
(
flag
);
throw
new
ExceptionResultNotFound
(
flag
);
}
}
CacheInputResult
o
=
(
CacheInputResult
)
element
.
getObjectValue
();
CacheInputResult
o
=
(
CacheInputResult
)
optional
.
get
();
Wo
wo
=
new
Wo
(
o
.
getBytes
(),
this
.
contentType
(
true
,
o
.
getName
()),
this
.
contentDisposition
(
true
,
o
.
getName
()));
Wo
wo
=
new
Wo
(
o
.
getBytes
(),
this
.
contentType
(
true
,
o
.
getName
()),
this
.
contentDisposition
(
true
,
o
.
getName
()));
result
.
setData
(
wo
);
result
.
setData
(
wo
);
return
result
;
return
result
;
...
@@ -33,4 +38,4 @@ public class ActionGetResult extends BaseAction {
...
@@ -33,4 +38,4 @@ public class ActionGetResult extends BaseAction {
}
}
}
}
\ No newline at end of file
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
浏览文件 @
8cc4b0a0
...
@@ -3,10 +3,10 @@ package com.x.wcrm.assemble.control.jaxrs.inputleads;
...
@@ -3,10 +3,10 @@ package com.x.wcrm.assemble.control.jaxrs.inputleads;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
...
@@ -30,11 +30,10 @@ import com.x.base.core.project.tools.StringTools;
...
@@ -30,11 +30,10 @@ import com.x.base.core.project.tools.StringTools;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.core.entity.Leads
;
import
com.x.wcrm.core.entity.Leads
;
import
net.sf.ehcache.Element
;
public
class
ActionInput
extends
BaseAction
{
public
class
ActionInput
extends
BaseAction
{
//这个功能还没有写完,暂时放下,写其他服务。
//这个功能还没有写完,暂时放下,写其他服务。
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionInput
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionInput
.
class
);
private
static
int
SHEET_NUMBER
=
0
;
//读取的数据sheet
private
static
int
SHEET_NUMBER
=
0
;
//读取的数据sheet
private
static
int
BEGINROW_NUMBER
=
1
;
//起始行
private
static
int
BEGINROW_NUMBER
=
1
;
//起始行
...
@@ -47,7 +46,6 @@ public class ActionInput extends BaseAction {
...
@@ -47,7 +46,6 @@ public class ActionInput extends BaseAction {
Business
business
=
new
Business
(
emc
);
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
String
name
=
"leads_result_"
+
DateTools
.
formatDate
(
new
Date
())
+
".xlsx"
;
String
name
=
"leads_result_"
+
DateTools
.
formatDate
(
new
Date
())
+
".xlsx"
;
//this.scanAndComment(business, workbook);
this
.
persist
(
business
,
workbook
,
effectivePerson
);
this
.
persist
(
business
,
workbook
,
effectivePerson
);
workbook
.
write
(
os
);
workbook
.
write
(
os
);
...
@@ -55,7 +53,8 @@ public class ActionInput extends BaseAction {
...
@@ -55,7 +53,8 @@ public class ActionInput extends BaseAction {
cacheInputResult
.
setName
(
name
);
cacheInputResult
.
setName
(
name
);
cacheInputResult
.
setBytes
(
os
.
toByteArray
());
cacheInputResult
.
setBytes
(
os
.
toByteArray
());
String
flag
=
StringTools
.
uniqueToken
();
String
flag
=
StringTools
.
uniqueToken
();
cache
.
put
(
new
Element
(
flag
,
cacheInputResult
));
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
flag
);
CacheManager
.
put
(
cache
,
cacheKey
,
cacheInputResult
);
Wo
wo
=
new
Wo
();
Wo
wo
=
new
Wo
();
wo
.
setFlag
(
flag
);
wo
.
setFlag
(
flag
);
...
...
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
import
com.x.base.core.project.cache.
Application
Cache
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.wcrm.assemble.control.service.LeadsService
;
import
com.x.wcrm.assemble.control.service.LeadsService
;
import
net.sf.ehcache.Ehcache
;
public
class
BaseAction
extends
StandardJaxrsAction
{
public
class
BaseAction
extends
StandardJaxrsAction
{
protected
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
CacheInputResult
.
class
);
protected
Cache
.
CacheCategory
cache
=
new
Cache
.
CacheCategory
(
CacheInputResult
.
class
);
protected
LeadsService
leadsService
=
new
LeadsService
();
protected
LeadsService
leadsService
=
new
LeadsService
();
public
static
class
CacheInputResult
{
public
static
class
CacheInputResult
{
private
String
name
;
private
String
name
;
...
...
x_wcrm_assemble_control/src/main/webapp/WEB-INF/web.xml
浏览文件 @
8cc4b0a0
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_wcrm_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_wcrm_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.wcrm.assemble.control.x_wcrm_assemble_control
</param-value></context-param></web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_wcrm_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_wcrm_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.wcrm.assemble.control.x_wcrm_assemble_control
</param-value></context-param><welcome-file-list><welcome-file>
/index.html
</welcome-file></welcome-file-list></web-app>
\ No newline at end of file
\ No newline at end of file
x_wcrm_assemble_control/src/main/webapp/describe/describe.json
浏览文件 @
8cc4b0a0
...
@@ -120,6 +120,18 @@
...
@@ -120,6 +120,18 @@
"type"
:
"byte[]"
,
"type"
:
"byte[]"
,
"isCollection"
:
false
,
"isCollection"
:
false
,
"description"
:
"字节内容."
"description"
:
"字节内容."
},
{
"name"
:
"streamingOutput"
,
"type"
:
"StreamingOutput"
,
"isCollection"
:
false
,
"description"
:
"附件流."
},
{
"name"
:
"contentLength"
,
"type"
:
"Long"
,
"isCollection"
:
false
,
"description"
:
"附件大小."
}
}
]
]
},
},
...
@@ -161,6 +173,18 @@
...
@@ -161,6 +173,18 @@
"type"
:
"byte[]"
,
"type"
:
"byte[]"
,
"isCollection"
:
false
,
"isCollection"
:
false
,
"description"
:
"字节内容."
"description"
:
"字节内容."
},
{
"name"
:
"streamingOutput"
,
"type"
:
"StreamingOutput"
,
"isCollection"
:
false
,
"description"
:
"附件流."
},
{
"name"
:
"contentLength"
,
"type"
:
"Long"
,
"isCollection"
:
false
,
"description"
:
"附件大小."
}
}
]
]
},
},
...
@@ -411,6 +435,29 @@
...
@@ -411,6 +435,29 @@
}
}
]
]
},
},
{
"name"
:
"detail"
,
"className"
:
"com.x.base.core.project.jaxrs.cache.ActionDetail"
,
"description"
:
"显示缓存状态."
,
"type"
:
"GET"
,
"path"
:
"jaxrs/cache/detail"
,
"contentType"
:
"application/json"
,
"resultContentType"
:
"application/json; charset
\u
003dUTF-8"
,
"useJsonElementParameter"
:
false
,
"useStringParameter"
:
false
,
"pathParameters"
:
[],
"formParameters"
:
[],
"queryParameters"
:
[],
"ins"
:
[],
"outs"
:
[
{
"name"
:
"value"
,
"type"
:
"String"
,
"isCollection"
:
false
,
"description"
:
"字符串值"
}
]
},
{
{
"name"
:
"receive"
,
"name"
:
"receive"
,
"className"
:
"com.x.base.core.project.jaxrs.cache.ActionReceive"
,
"className"
:
"com.x.base.core.project.jaxrs.cache.ActionReceive"
,
...
@@ -8867,6 +8914,18 @@
...
@@ -8867,6 +8914,18 @@
"type"
:
"byte[]"
,
"type"
:
"byte[]"
,
"isCollection"
:
false
,
"isCollection"
:
false
,
"description"
:
"字节内容."
"description"
:
"字节内容."
},
{
"name"
:
"streamingOutput"
,
"type"
:
"StreamingOutput"
,
"isCollection"
:
false
,
"description"
:
"附件流."
},
{
"name"
:
"contentLength"
,
"type"
:
"Long"
,
"isCollection"
:
false
,
"description"
:
"附件大小."
}
}
]
]
},
},
...
@@ -11485,128 +11544,6 @@
...
@@ -11485,128 +11544,6 @@
}
}
]
]
},
},
{
"name": "LoggerAction",
"className": "com.x.base.core.project.jaxrs.logger.LoggerAction",
"description": "日志操作",
"methods": [
{
"name": "debug",
"className": "com.x.base.core.project.jaxrs.logger.ActionDebug",
"description": "设置日志级别为DEBUG.",
"type": "GET",
"path": "jaxrs/logger/debug",
"contentType": "application/json",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": false,
"pathParameters": [],
"formParameters": [],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "Boolean",
"isCollection": false,
"description": "布尔值."
}
]
},
{
"name": "get",
"className": "com.x.base.core.project.jaxrs.logger.ActionGet",
"description": "获取当前日志级别.",
"type": "GET",
"path": "jaxrs/logger",
"contentType": "application/json",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": false,
"pathParameters": [],
"formParameters": [],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "String",
"isCollection": false,
"description": "字符串值"
}
]
},
{
"name": "info",
"className": "com.x.base.core.project.jaxrs.logger.ActionInfo",
"description": "设置日志级别为INFO",
"type": "GET",
"path": "jaxrs/logger/info",
"contentType": "application/json",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": false,
"pathParameters": [],
"formParameters": [],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "Boolean",
"isCollection": false,
"description": "布尔值."
}
]
},
{
"name": "trace",
"className": "com.x.base.core.project.jaxrs.logger.ActionTrace",
"description": "设置日志级别为TRACE.",
"type": "GET",
"path": "jaxrs/logger/trace",
"contentType": "application/json",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": false,
"pathParameters": [],
"formParameters": [],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "Boolean",
"isCollection": false,
"description": "布尔值."
}
]
},
{
"name": "warn",
"className": "com.x.base.core.project.jaxrs.logger.ActionWarn",
"description": "设置日志级别为WARN",
"type": "GET",
"path": "jaxrs/logger/warn",
"contentType": "application/json",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": false,
"pathParameters": [],
"formParameters": [],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "Boolean",
"isCollection": false,
"description": "布尔值."
}
]
}
]
},
{
{
"name"
:
"OperationRecordAction"
,
"name"
:
"OperationRecordAction"
,
"className"
:
"com.x.wcrm.assemble.control.jaxrs.operationrecord.OperationRecordAction"
,
"className"
:
"com.x.wcrm.assemble.control.jaxrs.operationrecord.OperationRecordAction"
,
...
@@ -17615,51 +17552,6 @@
...
@@ -17615,51 +17552,6 @@
"queryParameters"
:
[],
"queryParameters"
:
[],
"ins"
:
[],
"ins"
:
[],
"outs"
:
[]
"outs"
:
[]
},
{
"name": "uploadResource",
"className": "com.x.base.core.project.jaxrs.sysresource.ActionUploadResource",
"description": "上传静态资源(仅上传到当前服务器)",
"type": "POST",
"path": "jaxrs/sysresource/upload/resource/as/new/{asNew}",
"contentType": "multipart/form-data",
"resultContentType": "application/json; charset\u003dUTF-8",
"useJsonElementParameter": false,
"useStringParameter": true,
"pathParameters": [
{
"name": "asNew",
"type": "Boolean",
"description": "覆盖类型:true删除原文件然后上传,false覆盖原文件"
}
],
"formParameters": [
{
"name": "file",
"type": "File",
"description": "上传文件"
},
{
"name": "fileName",
"type": "String",
"description": "附件名称"
},
{
"name": "filePath",
"type": "String",
"description": "附件存放目录(可以为空)"
}
],
"queryParameters": [],
"ins": [],
"outs": [
{
"name": "value",
"type": "Boolean",
"isCollection": false,
"description": "布尔值."
}
]
}
}
]
]
}
}
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/Business.java
浏览文件 @
8cc4b0a0
...
@@ -192,26 +192,20 @@ public class Business {
...
@@ -192,26 +192,20 @@ public class Business {
/**
/**
* TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
* TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
*
*
* @param request
* @param request
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
boolean
isManager
(
HttpServletRequest
request
,
EffectivePerson
person
)
throws
Exception
{
public
boolean
isManager
(
HttpServletRequest
request
,
EffectivePerson
person
)
throws
Exception
{
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
if
(
"xadmin"
.
equalsIgnoreCase
(
person
.
getDistinguishedName
()
))
{
if
(
person
.
isManager
(
))
{
return
true
;
return
true
;
}
}
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
CRMManager_discription
))
{
OrganizationDefinition
.
CMSManager
))
{
return
true
;
}
/*if (person.isManager()) {
return
true
;
return
true
;
}
}
if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_CRMManager)) {
return true;
}*/
return
false
;
return
false
;
}
}
...
@@ -223,21 +217,11 @@ public class Business {
...
@@ -223,21 +217,11 @@ public class Business {
*/
*/
public
boolean
isManager
(
EffectivePerson
person
)
throws
Exception
{
public
boolean
isManager
(
EffectivePerson
person
)
throws
Exception
{
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
if
(
person
.
isManager
())
{
/*if (person.isManager()) {
return true;
}
if ("xadmin".equalsIgnoreCase(person.getDistinguishedName())) {
return true;
}
if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_CRMManager)) {
return true;
}*/
if
(
"xadmin"
.
equalsIgnoreCase
(
person
.
getDistinguishedName
()))
{
return
true
;
return
true
;
}
}
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
C
RMManager_discription
))
{
OrganizationDefinition
.
C
MSManager
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/ConfigFactory.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.factory
;
package
com.x.wcrm.assemble.control.factory
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.wcrm.assemble.control.AbstractFactory
;
import
com.x.wcrm.assemble.control.AbstractFactory
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.core.entity.WCrmConfig
;
import
com.x.wcrm.core.entity.WCrmConfig
;
...
@@ -12,7 +11,6 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -12,7 +11,6 @@ import org.apache.commons.lang3.StringUtils;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.*
;
import
javax.persistence.criteria.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,15 +29,7 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -31,15 +29,7 @@ public class ConfigFactory extends AbstractFactory {
public
WCrmConfig
get
(
String
id
)
throws
Exception
{
public
WCrmConfig
get
(
String
id
)
throws
Exception
{
return
this
.
entityManagerContainer
().
find
(
id
,
WCrmConfig
.
class
,
ExceptionWhen
.
none
);
return
this
.
entityManagerContainer
().
find
(
id
,
WCrmConfig
.
class
,
ExceptionWhen
.
none
);
}
}
/*public ProjectDetail getDetail(String id) throws Exception {
return this.entityManagerContainer().find( id, ProjectDetail.class, ExceptionWhen.none );
}*/
/**
/**
* 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
* 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
* @param maxCount
* @param maxCount
...
@@ -57,17 +47,9 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -57,17 +47,9 @@ public class ConfigFactory extends AbstractFactory {
CriteriaQuery
<
WCrmConfig
>
cq
=
cb
.
createQuery
(
WCrmConfig
.
class
);
CriteriaQuery
<
WCrmConfig
>
cq
=
cb
.
createQuery
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Predicate
p_permission
=
null
;
Predicate
p_permission
=
null
;
/*if( StringUtils.isNotEmpty( personName )) {
//可以管理的栏目,肯定可以发布信息
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
}*/
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
if
(
sequenceFieldValue
!=
null
&&
StringUtils
.
isNotEmpty
(
sequenceFieldValue
.
toString
()
))
{
if
(
sequenceFieldValue
!=
null
&&
StringUtils
.
isNotEmpty
(
sequenceFieldValue
.
toString
()
))
{
Predicate
p_seq
=
cb
.
isNotNull
(
root
.
get
(
WCrmConfig_
.
sequence
)
);
Predicate
p_seq
=
cb
.
isNotNull
(
root
.
get
(
WCrmConfig_
.
sequence
)
);
if
(
"desc"
.
equalsIgnoreCase
(
orderType
)){
if
(
"desc"
.
equalsIgnoreCase
(
orderType
)){
...
@@ -76,16 +58,15 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -76,16 +58,15 @@ public class ConfigFactory extends AbstractFactory {
p_seq
=
cb
.
and
(
p_seq
,
cb
.
greaterThan
(
root
.
get
(
WCrmConfig_
.
sequence
),
sequenceFieldValue
.
toString
()
));
p_seq
=
cb
.
and
(
p_seq
,
cb
.
greaterThan
(
root
.
get
(
WCrmConfig_
.
sequence
),
sequenceFieldValue
.
toString
()
));
}
}
p
=
cb
.
and
(
p
,
p_seq
);
p
=
cb
.
and
(
p
,
p_seq
);
}
}
Order
orderWithField
=
CriteriaBuilderTools
.
getOrder
(
cb
,
root
,
WCrmConfig_
.
class
,
orderField
,
orderType
);
Order
orderWithField
=
CriteriaBuilderTools
.
getOrder
(
cb
,
root
,
WCrmConfig_
.
class
,
orderField
,
orderType
);
if
(
orderWithField
!=
null
){
if
(
orderWithField
!=
null
){
cq
.
orderBy
(
orderWithField
);
cq
.
orderBy
(
orderWithField
);
}
}
System
.
out
.
println
(
">>>SQL:"
+
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
toString
()
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
}
}
/**
/**
* 根据条件查询所有符合条件的项目模板信息ID,项目信息不会很多 ,所以直接查询出来
* 根据条件查询所有符合条件的项目模板信息ID,项目信息不会很多 ,所以直接查询出来
* @param maxCount
* @param maxCount
...
@@ -100,16 +81,7 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -100,16 +81,7 @@ public class ConfigFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Root
<
WCrmConfig
>
root
=
cq
.
from
(
WCrmConfig
.
class
);
Predicate
p_permission
=
null
;
Predicate
p_permission
=
null
;
/*if( StringUtils.isNotEmpty( personName )) {
//可以管理的栏目,肯定可以发布信息
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( ProjectTemplate_.participantPersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.creatorPerson ), personName ) );
p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.executor ), personName ) );
}*/
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
Predicate
p
=
CriteriaBuilderTools
.
composePredicateWithQueryFilter
(
WCrmConfig_
.
class
,
cb
,
p_permission
,
root
,
queryFilter
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
WCrmConfig_
.
id
)
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
WCrmConfig_
.
id
)
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
...
@@ -130,5 +102,5 @@ public class ConfigFactory extends AbstractFactory {
...
@@ -130,5 +102,5 @@ public class ConfigFactory extends AbstractFactory {
Predicate
p
=
cb
.
equal
(
root
.
get
(
WCrmConfig_
.
configModule
),
configModule
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
WCrmConfig_
.
configModule
),
configModule
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
}
}
}
}
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/ContactsFactory.java
浏览文件 @
8cc4b0a0
...
@@ -129,7 +129,6 @@ public class ContactsFactory extends AbstractFactory {
...
@@ -129,7 +129,6 @@ public class ContactsFactory extends AbstractFactory {
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Contacts_
.
class
,
orderFieldName
,
orderType
);
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Contacts_
.
class
,
orderFieldName
,
orderType
);
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"cq="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
}
}
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/CustomerFactory.java
浏览文件 @
8cc4b0a0
...
@@ -299,7 +299,6 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -299,7 +299,6 @@ public class CustomerFactory extends AbstractFactory {
// cq.select(root).where(p).orderBy(cb.desc(root.get(Customer_.createTime)));
// cq.select(root).where(p).orderBy(cb.desc(root.get(Customer_.createTime)));
// return em.createQuery(cq).getResultList();
// return em.createQuery(cq).getResultList();
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"List_OwnerEqual_Or_ReadersMember_Or_WritesMember==="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
).
getResultList
();
}
}
...
@@ -401,7 +400,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -401,7 +400,7 @@ public class CustomerFactory extends AbstractFactory {
//SELECT op.XCRMID,MAX(op.XLONGCREATETIME) FROM PUBLIC.WCRM_OPERATIONRECORD AS op WHERE op.XMODULE='customer' GROUP BY op.XCRMID;
//SELECT op.XCRMID,MAX(op.XLONGCREATETIME) FROM PUBLIC.WCRM_OPERATIONRECORD AS op WHERE op.XMODULE='customer' GROUP BY op.XCRMID;
/**
/**
* 列出,指定module类型的操作记录,按照crmid分组展示每组的最大值
* 列出,指定module类型的操作记录,按照crmid分组展示每组的最大值
*
*
* @param {_module}
* @param {_module}
* @return SimpleKV
* @return SimpleKV
*/
*/
...
@@ -426,7 +425,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -426,7 +425,7 @@ public class CustomerFactory extends AbstractFactory {
CustomerAndLastRecord
e
=
new
CustomerAndLastRecord
();
CustomerAndLastRecord
e
=
new
CustomerAndLastRecord
();
e
.
setLastRecord_Id
(
o
.
get
(
_path_oprecord_crmid
));
e
.
setLastRecord_Id
(
o
.
get
(
_path_oprecord_crmid
));
e
.
setLastRecord_LongTime
(
o
.
get
(
_path_oprecord_createtime
));
e
.
setLastRecord_LongTime
(
o
.
get
(
_path_oprecord_createtime
));
Date
date
=
new
Date
();
Date
date
=
new
Date
();
date
.
setTime
(
o
.
get
(
_path_oprecord_createtime
));
date
.
setTime
(
o
.
get
(
_path_oprecord_createtime
));
//o.get(_path_oprecord_createtime);
//o.get(_path_oprecord_createtime);
...
@@ -463,7 +462,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -463,7 +462,7 @@ public class CustomerFactory extends AbstractFactory {
/**
/**
* 根据计算每个省份的客户数量
* 根据计算每个省份的客户数量
*
*
* @throws Exception
* @throws Exception
*/
*/
public
List
<
SimpleKV
>
count_by_province
(
List
<
String
>
_distinguishNameList
,
Date
begintime
,
Date
endtime
)
throws
Exception
{
public
List
<
SimpleKV
>
count_by_province
(
List
<
String
>
_distinguishNameList
,
Date
begintime
,
Date
endtime
)
throws
Exception
{
...
@@ -546,7 +545,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -546,7 +545,7 @@ public class CustomerFactory extends AbstractFactory {
CriteriaQuery<Customer> cq = cb.createQuery(Customer.class);
CriteriaQuery<Customer> cq = cb.createQuery(Customer.class);
Root<Customer> root = cq.from(Customer.class);
Root<Customer> root = cq.from(Customer.class);
Predicate p = root.get(Customer_.owneruser).in(_distinguishNameList);
Predicate p = root.get(Customer_.owneruser).in(_distinguishNameList);
//跟进状态
//跟进状态
if (isflow) {
if (isflow) {
Predicate p_follow_followed = cb.equal(root.get(Customer_.follow), "已跟进");
Predicate p_follow_followed = cb.equal(root.get(Customer_.follow), "已跟进");
...
@@ -557,11 +556,11 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -557,11 +556,11 @@ public class CustomerFactory extends AbstractFactory {
Predicate p_follow = cb.or(p_follow_isnull, p_follow_unfollow);
Predicate p_follow = cb.or(p_follow_isnull, p_follow_unfollow);
p = cb.and(p, p_follow);
p = cb.and(p, p_follow);
}
}
//时间范围
//时间范围
Predicate p_between = cb.between(root.get(Customer_.nexttime), beginTime, endTime);
Predicate p_between = cb.between(root.get(Customer_.nexttime), beginTime, endTime);
p = cb.and(p, p_between);
p = cb.and(p, p_between);
//搜索关键字判断
//搜索关键字判断
if (!StringWCRMUtils.isEmptyKeyString(keyString)) {
if (!StringWCRMUtils.isEmptyKeyString(keyString)) {
String key = StringUtils.trim(StringUtils.replaceEach(keyString, new String[] { "\u3000", "?", "%" }, new String[] { " ", "", "" }));
String key = StringUtils.trim(StringUtils.replaceEach(keyString, new String[] { "\u3000", "?", "%" }, new String[] { " ", "", "" }));
...
@@ -570,7 +569,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -570,7 +569,7 @@ public class CustomerFactory extends AbstractFactory {
cb.like(root.get(Customer_.pinyinInitial), "%" + key + "%"), cb.like(root.get(Customer_.telephone), "%" + key + "%"));
cb.like(root.get(Customer_.pinyinInitial), "%" + key + "%"), cb.like(root.get(Customer_.telephone), "%" + key + "%"));
p = cb.and(p, p_like);
p = cb.and(p, p_like);
}
}
//排序值字段,升降序判断
//排序值字段,升降序判断
Order _order;
Order _order;
if (StringUtils.isEmpty(orderType) || StringUtils.isEmpty(orderFieldName) || null == orderType || null == orderFieldName) {
if (StringUtils.isEmpty(orderType) || StringUtils.isEmpty(orderFieldName) || null == orderType || null == orderFieldName) {
...
@@ -578,7 +577,7 @@ public class CustomerFactory extends AbstractFactory {
...
@@ -578,7 +577,7 @@ public class CustomerFactory extends AbstractFactory {
} else {
} else {
_order = CriteriaQueryTools.setOrder(cb, root, Customer_.class, orderFieldName, orderType);
_order = CriteriaQueryTools.setOrder(cb, root, Customer_.class, orderFieldName, orderType);
}
}
cq.select(root).where(p).orderBy(_order);
cq.select(root).where(p).orderBy(_order);
return em.createQuery(cq).setFirstResult((adjustPage - 1) * adjustPageSize).setMaxResults(adjustPageSize).getResultList();
return em.createQuery(cq).setFirstResult((adjustPage - 1) * adjustPageSize).setMaxResults(adjustPageSize).getResultList();
}*/
}*/
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/factory/OpportunityFactory.java
浏览文件 @
8cc4b0a0
...
@@ -217,7 +217,6 @@ public class OpportunityFactory extends AbstractFactory {
...
@@ -217,7 +217,6 @@ public class OpportunityFactory extends AbstractFactory {
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Opportunity_
.
class
,
orderFieldName
,
orderType
);
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Opportunity_
.
class
,
orderFieldName
,
orderType
);
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
System
.
out
.
println
(
"cq="
+
cq
.
toString
());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
.
getResultList
();
}
}
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionGetResult.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
java.util.Optional
;
import
net.sf.ehcache.Element
;
/**
* @author sword
*/
public
class
ActionGetResult
extends
BaseAction
{
public
class
ActionGetResult
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionGetResult
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionGetResult
.
class
);
protected
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
protected
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
logger
.
debug
(
effectivePerson
,
"flag:{}."
,
flag
);
logger
.
debug
(
effectivePerson
.
getDistinguishedName
()
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Element
element
=
cache
.
get
(
flag
);
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
flag
);
if
(
null
==
element
||
(
null
==
element
.
getObjectValue
()))
{
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(!
optional
.
isPresent
())
{
throw
new
ExceptionResultNotFound
(
flag
);
throw
new
ExceptionResultNotFound
(
flag
);
}
}
CacheInputResult
o
=
(
CacheInputResult
)
element
.
getObjectValue
();
CacheInputResult
o
=
(
CacheInputResult
)
optional
.
get
();
Wo
wo
=
new
Wo
(
o
.
getBytes
(),
this
.
contentType
(
true
,
o
.
getName
()),
this
.
contentDisposition
(
true
,
o
.
getName
()));
Wo
wo
=
new
Wo
(
o
.
getBytes
(),
this
.
contentType
(
true
,
o
.
getName
()),
this
.
contentDisposition
(
true
,
o
.
getName
()));
result
.
setData
(
wo
);
result
.
setData
(
wo
);
return
result
;
return
result
;
...
@@ -33,4 +38,4 @@ public class ActionGetResult extends BaseAction {
...
@@ -33,4 +38,4 @@ public class ActionGetResult extends BaseAction {
}
}
}
}
\ No newline at end of file
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/ActionInput.java
浏览文件 @
8cc4b0a0
...
@@ -3,10 +3,10 @@ package com.x.wcrm.assemble.control.jaxrs.inputleads;
...
@@ -3,10 +3,10 @@ package com.x.wcrm.assemble.control.jaxrs.inputleads;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
...
@@ -30,11 +30,10 @@ import com.x.base.core.project.tools.StringTools;
...
@@ -30,11 +30,10 @@ import com.x.base.core.project.tools.StringTools;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.core.entity.Leads
;
import
com.x.wcrm.core.entity.Leads
;
import
net.sf.ehcache.Element
;
public
class
ActionInput
extends
BaseAction
{
public
class
ActionInput
extends
BaseAction
{
//这个功能还没有写完,暂时放下,写其他服务。
//这个功能还没有写完,暂时放下,写其他服务。
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionInput
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionInput
.
class
);
private
static
int
SHEET_NUMBER
=
0
;
//读取的数据sheet
private
static
int
SHEET_NUMBER
=
0
;
//读取的数据sheet
private
static
int
BEGINROW_NUMBER
=
1
;
//起始行
private
static
int
BEGINROW_NUMBER
=
1
;
//起始行
...
@@ -47,7 +46,6 @@ public class ActionInput extends BaseAction {
...
@@ -47,7 +46,6 @@ public class ActionInput extends BaseAction {
Business
business
=
new
Business
(
emc
);
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
String
name
=
"leads_result_"
+
DateTools
.
formatDate
(
new
Date
())
+
".xlsx"
;
String
name
=
"leads_result_"
+
DateTools
.
formatDate
(
new
Date
())
+
".xlsx"
;
//this.scanAndComment(business, workbook);
this
.
persist
(
business
,
workbook
,
effectivePerson
);
this
.
persist
(
business
,
workbook
,
effectivePerson
);
workbook
.
write
(
os
);
workbook
.
write
(
os
);
...
@@ -55,7 +53,8 @@ public class ActionInput extends BaseAction {
...
@@ -55,7 +53,8 @@ public class ActionInput extends BaseAction {
cacheInputResult
.
setName
(
name
);
cacheInputResult
.
setName
(
name
);
cacheInputResult
.
setBytes
(
os
.
toByteArray
());
cacheInputResult
.
setBytes
(
os
.
toByteArray
());
String
flag
=
StringTools
.
uniqueToken
();
String
flag
=
StringTools
.
uniqueToken
();
cache
.
put
(
new
Element
(
flag
,
cacheInputResult
));
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
flag
);
CacheManager
.
put
(
cache
,
cacheKey
,
cacheInputResult
);
Wo
wo
=
new
Wo
();
Wo
wo
=
new
Wo
();
wo
.
setFlag
(
flag
);
wo
.
setFlag
(
flag
);
...
...
x_wcrm_assemble_control/src/main/webapp/describe/sources/com/x/wcrm/assemble/control/jaxrs/inputleads/BaseAction.java
浏览文件 @
8cc4b0a0
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
package
com.x.wcrm.assemble.control.jaxrs.inputleads
;
import
com.x.base.core.project.cache.
Application
Cache
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.wcrm.assemble.control.service.LeadsService
;
import
com.x.wcrm.assemble.control.service.LeadsService
;
import
net.sf.ehcache.Ehcache
;
public
class
BaseAction
extends
StandardJaxrsAction
{
public
class
BaseAction
extends
StandardJaxrsAction
{
protected
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
CacheInputResult
.
class
);
protected
Cache
.
CacheCategory
cache
=
new
Cache
.
CacheCategory
(
CacheInputResult
.
class
);
protected
LeadsService
leadsService
=
new
LeadsService
();
protected
LeadsService
leadsService
=
new
LeadsService
();
public
static
class
CacheInputResult
{
public
static
class
CacheInputResult
{
private
String
name
;
private
String
name
;
...
...
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
已删除
100644 → 0
浏览文件 @
dc051665
此差异已折叠。
点击以展开。
x_wcrm_core_entity/pmd.html
浏览文件 @
8cc4b0a0
此差异已折叠。
点击以展开。
x_wcrm_core_entity/pom.xml
浏览文件 @
8cc4b0a0
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
o2oa
</groupId>
<groupId>
o2oa
</groupId>
<artifactId>
o2
server
</artifactId>
<artifactId>
o2
oa-crm
</artifactId>
<version>
5
</version>
<version>
7.0
</version>
</parent>
</parent>
<artifactId>
x_wcrm_core_entity
</artifactId>
<artifactId>
x_wcrm_core_entity
</artifactId>
...
@@ -18,30 +18,6 @@
...
@@ -18,30 +18,6 @@
<groupId>
o2oa
</groupId>
<groupId>
o2oa
</groupId>
<artifactId>
x_base_core_project
</artifactId>
<artifactId>
x_base_core_project
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_component_core_entity
</artifactId>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_file_core_entity
</artifactId>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_general_core_entity
</artifactId>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_message_core_entity
</artifactId>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_organization_core_entity
</artifactId>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
<artifactId>
x_organization_core_express
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
@@ -49,6 +25,23 @@
...
@@ -49,6 +25,23 @@
<groupId>
org.codehaus.mojo
</groupId>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<artifactId>
exec-maven-plugin
</artifactId>
<executions>
<executions>
<execution>
<id>
TableBuilder
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
java
</goal>
</goals>
<configuration>
<addOutputToClasspath>
true
</addOutputToClasspath>
<includePluginDependencies>
true
</includePluginDependencies>
<includeProjectDependencies>
true
</includeProjectDependencies>
<mainClass>
com.x.base.core.project.annotation.TableBuilder
</mainClass>
<arguments>
<argument>
${basedir}
</argument>
<argument>
${project.build.sourceDirectory}
</argument>
</arguments>
</configuration>
</execution>
<execution>
<execution>
<id>
metaModelBuilder
</id>
<id>
metaModelBuilder
</id>
<phase>
generate-sources
</phase>
<phase>
generate-sources
</phase>
...
@@ -109,7 +102,7 @@
...
@@ -109,7 +102,7 @@
<goal>
copy-resources
</goal>
<goal>
copy-resources
</goal>
</goals>
</goals>
<configuration>
<configuration>
<outputDirectory>
../
../o2server/custom
/jars
</outputDirectory>
<outputDirectory>
../
store
/jars
</outputDirectory>
<resources>
<resources>
<resource>
<resource>
<directory>
target
</directory>
<directory>
target
</directory>
...
@@ -135,4 +128,4 @@
...
@@ -135,4 +128,4 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
\ No newline at end of file
x_wcrm_core_entity/x_wcrm_core_entity.iml
已删除
100644 → 0
浏览文件 @
dc051665
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录