完成业绩基本代码

This commit is contained in:
Kane Wang 2023-05-18 18:22:05 +08:00
parent fa79a8f8d1
commit e48e68d680
8 changed files with 162 additions and 139 deletions

View File

@ -11,7 +11,7 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
a_department_code IN VARCHAR2, a_department_code IN VARCHAR2,
a_attaching_rate OUT VARCHAR2, a_attaching_rate OUT VARCHAR2,
a_renewal_rate OUT VARCHAR2, a_renewal_rate OUT VARCHAR2,
a_total OUT VARCHAR2, a_total OUT INTEGER,
a_mensual_cur OUT cur_type a_mensual_cur OUT cur_type
); );
@ -25,7 +25,7 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
a_department_code IN VARCHAR2, a_department_code IN VARCHAR2,
a_attaching_rate OUT VARCHAR2, a_attaching_rate OUT VARCHAR2,
a_renewal_rate OUT VARCHAR2, a_renewal_rate OUT VARCHAR2,
a_total OUT VARCHAR2, a_total OUT INTEGER,
a_mensual_cur OUT cur_type a_mensual_cur OUT cur_type
) IS ) IS
l_this_month VARCHAR2(4); l_this_month VARCHAR2(4);
@ -78,7 +78,7 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
--每月业绩 --每月业绩
OPEN a_mensual_cur FOR OPEN a_mensual_cur FOR
SELECT cf.月份 mm, SELECT cf.月份 mm,
round(nvl(SUM(cf.车险个人客户保费 + cf.车非融合保费), round(nvl(SUM(cf.车险个人客户保费 + cf.车非融合保费) / 10000,
0), 0),
0) bf 0) bf
FROM 车非每日保费 cf FROM 车非每日保费 cf
@ -86,7 +86,9 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
AND 签单日期 >= to_date(to_char(SYSDATE, AND 签单日期 >= to_date(to_char(SYSDATE,
'yyyy') || '-01-01 00:00:00', 'yyyy') || '-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') 'yyyy-mm-dd hh24:mi:ss')
AND 签单日期 <= SYSDATE AND 签单日期 < to_date(to_char(SYSDATE,
'yyyy-mm') || '-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
GROUP BY cf.月份 GROUP BY cf.月份
ORDER BY cf.月份; ORDER BY cf.月份;
END; END;

View File

@ -17,7 +17,7 @@
"echarts": "^5.4.2", "echarts": "^5.4.2",
"element-plus": "^2.3.4", "element-plus": "^2.3.4",
"moment": "^2.29.4", "moment": "^2.29.4",
"vue": "^3.3.2", "vue": "^3.3.4",
"vue-router": "^4.2.0", "vue-router": "^4.2.0",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
@ -1951,36 +1951,36 @@
"dev": true "dev": true
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz",
"integrity": "sha512-CKZWo1dzsQYTNTft7whzjL0HsrEpMfiK7pjZ2WFE3bC1NA7caUjWioHSK+49y/LK7Bsm4poJZzAMnvZMQ7OTeg==", "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.21.3", "@babel/parser": "^7.21.3",
"@vue/shared": "3.3.2", "@vue/shared": "3.3.4",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"source-map-js": "^1.0.2" "source-map-js": "^1.0.2"
} }
}, },
"node_modules/@vue/compiler-dom": { "node_modules/@vue/compiler-dom": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz",
"integrity": "sha512-6gS3auANuKXLw0XH6QxkWqyPYPunziS2xb6VRenM3JY7gVfZcJvkCBHkb5RuNY1FCbBO3lkIi0CdXUCW1c7SXw==", "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==",
"dependencies": { "dependencies": {
"@vue/compiler-core": "3.3.2", "@vue/compiler-core": "3.3.4",
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/@vue/compiler-sfc": { "node_modules/@vue/compiler-sfc": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz",
"integrity": "sha512-jG4jQy28H4BqzEKsQqqW65BZgmo3vzdLHTBjF+35RwtDdlFE+Fk1VWJYUnDMMqkFBo6Ye1ltSKVOMPgkzYj7SQ==", "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.20.15",
"@vue/compiler-core": "3.3.2", "@vue/compiler-core": "3.3.4",
"@vue/compiler-dom": "3.3.2", "@vue/compiler-dom": "3.3.4",
"@vue/compiler-ssr": "3.3.2", "@vue/compiler-ssr": "3.3.4",
"@vue/reactivity-transform": "3.3.2", "@vue/reactivity-transform": "3.3.4",
"@vue/shared": "3.3.2", "@vue/shared": "3.3.4",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0", "magic-string": "^0.30.0",
"postcss": "^8.1.10", "postcss": "^8.1.10",
@ -1988,12 +1988,12 @@
} }
}, },
"node_modules/@vue/compiler-ssr": { "node_modules/@vue/compiler-ssr": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz",
"integrity": "sha512-K8OfY5FQtZaSOJHHe8xhEfIfLrefL/Y9frv4k4NsyQL3+0lRKxr9QuJhfdBDjkl7Fhz8CzKh63mULvmOfx3l2w==", "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.2", "@vue/compiler-dom": "3.3.4",
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/@vue/component-compiler-utils": { "node_modules/@vue/component-compiler-utils": {
@ -2068,60 +2068,60 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
}, },
"node_modules/@vue/reactivity": { "node_modules/@vue/reactivity": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz",
"integrity": "sha512-yX8C4uTgg2Tdj+512EEMnMKbLveoITl7YdQX35AYgx8vBvQGszKiiCN46g4RY6/deeo/5DLbeUUGxCq1qWMf5g==", "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==",
"dependencies": { "dependencies": {
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/@vue/reactivity-transform": { "node_modules/@vue/reactivity-transform": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz",
"integrity": "sha512-iu2WaQvlJHdnONrsyv4ibIEnSsuKF+aHFngGj/y1lwpHQtalpVhKg9wsKMoiKXS9zPNjG9mNKzJS9vudvjzvyg==", "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.20.15",
"@vue/compiler-core": "3.3.2", "@vue/compiler-core": "3.3.4",
"@vue/shared": "3.3.2", "@vue/shared": "3.3.4",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0" "magic-string": "^0.30.0"
} }
}, },
"node_modules/@vue/runtime-core": { "node_modules/@vue/runtime-core": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz",
"integrity": "sha512-qSl95qj0BvKfcsO+hICqFEoLhJn6++HtsPxmTkkadFbuhe3uQfJ8HmQwvEr7xbxBd2rcJB6XOJg7nWAn/ymC5A==", "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==",
"dependencies": { "dependencies": {
"@vue/reactivity": "3.3.2", "@vue/reactivity": "3.3.4",
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/@vue/runtime-dom": { "node_modules/@vue/runtime-dom": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz",
"integrity": "sha512-+drStsJT+0mtgHdarT7cXZReCcTFfm6ptxMrz0kAW5hms6UNBd8Q1pi4JKlncAhu+Ld/TevsSp7pqAZxBBoGng==", "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==",
"dependencies": { "dependencies": {
"@vue/runtime-core": "3.3.2", "@vue/runtime-core": "3.3.4",
"@vue/shared": "3.3.2", "@vue/shared": "3.3.4",
"csstype": "^3.1.1" "csstype": "^3.1.1"
} }
}, },
"node_modules/@vue/server-renderer": { "node_modules/@vue/server-renderer": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz",
"integrity": "sha512-QCwh6OGwJg6GDLE0fbQhRTR6tnU+XDJ1iCsTYHXBiezCXAhqMygFRij7BiLF4ytvvHcg5kX9joX5R5vP85++wg==", "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==",
"dependencies": { "dependencies": {
"@vue/compiler-ssr": "3.3.2", "@vue/compiler-ssr": "3.3.4",
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "3.3.2" "vue": "3.3.4"
} }
}, },
"node_modules/@vue/shared": { "node_modules/@vue/shared": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz",
"integrity": "sha512-0rFu3h8JbclbnvvKrs7Fe5FNGV9/5X2rPD7KmOzhLSUAiQH5//Hq437Gv0fR5Mev3u/nbtvmLl8XgwCU20/ZfQ==" "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ=="
}, },
"node_modules/@vue/vue-loader-v15": { "node_modules/@vue/vue-loader-v15": {
"name": "vue-loader", "name": "vue-loader",
@ -12095,15 +12095,15 @@
} }
}, },
"node_modules/vue": { "node_modules/vue": {
"version": "3.3.2", "version": "3.3.4",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.2.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz",
"integrity": "sha512-98hJcAhyDwZoOo2flAQBSPVYG/o0HA9ivIy2ktHshjE+6/q8IMQ+kvDKQzOZTFPxvnNMcGM+zS2A00xeZMA7tA==", "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.2", "@vue/compiler-dom": "3.3.4",
"@vue/compiler-sfc": "3.3.2", "@vue/compiler-sfc": "3.3.4",
"@vue/runtime-dom": "3.3.2", "@vue/runtime-dom": "3.3.4",
"@vue/server-renderer": "3.3.2", "@vue/server-renderer": "3.3.4",
"@vue/shared": "3.3.2" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/vue-eslint-parser": { "node_modules/vue-eslint-parser": {

View File

@ -18,7 +18,7 @@
"echarts": "^5.4.2", "echarts": "^5.4.2",
"element-plus": "^2.3.4", "element-plus": "^2.3.4",
"moment": "^2.29.4", "moment": "^2.29.4",
"vue": "^3.3.2", "vue": "^3.3.4",
"vue-router": "^4.2.0", "vue-router": "^4.2.0",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },

View File

@ -43,7 +43,7 @@ export default {
}, },
yAxis: { yAxis: {
type: "value", type: "value",
data: [200, 400, 600, 800, 1000,], data: [400, 600, 800, 1000, 1200,],
}, },
series: [ series: [
{ {

View File

@ -18,7 +18,7 @@ import java.sql.CallableStatement;
import java.util.Vector; import java.util.Vector;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleTypes; import oracle.jdbc.OracleTypes;
public class DepartmentArchievement public class DepartmentArchievement
@ -47,7 +47,7 @@ public class DepartmentArchievement
* @param insuranceRenewalRate * @param insuranceRenewalRate
* @param attachingRate * @param attachingRate
*/ */
public DepartmentArchievement( int totalArchievement, Vector<Integer> mensualArchievementList, public DepartmentArchievement( long totalArchievement, Vector<Long> mensualArchievementList,
String insuranceRenewalRate, String attachingRate) String insuranceRenewalRate, String attachingRate)
{ {
this.totalArchievement = totalArchievement; this.totalArchievement = totalArchievement;
@ -66,48 +66,102 @@ public class DepartmentArchievement
public static DepartmentArchievement queryDepartmentArchievement( String departmentCode ) public static DepartmentArchievement queryDepartmentArchievement( String departmentCode )
throws SQLException, ClassNotFoundException throws SQLException, ClassNotFoundException
{ {
DepartmentArchievement archievement = new DepartmentArchievement(); Connection connection = null;
java.sql.CallableStatement statement = null;
ResultSet menusual_cursor = null;
DepartmentArchievement archievement = null;
String sql = "{call telsale_archievement_pkg.department_archievement(?,?,?,?,?)}"; String sql = "{call telsale_archievement_pkg.department_archievement(?,?,?,?,?)}";
try
{
Class.forName( "oracle.jdbc.driver.OracleDriver" ); Class.forName( "oracle.jdbc.driver.OracleDriver" );
Connection connection = DriverManager.getConnection( jdbcURL, userName, password ); connection = DriverManager.getConnection( jdbcURL, userName, password );
java.sql.CallableStatement statement = connection.prepareCall( sql ); statement = connection.prepareCall( sql );
statement.setString( 1, departmentCode ); statement.setString( 1, departmentCode );
statement.registerOutParameter( 2, java.sql.Types.VARCHAR ); statement.registerOutParameter( 2, java.sql.Types.VARCHAR );
statement.registerOutParameter( 3, java.sql.Types.VARCHAR ); statement.registerOutParameter( 3, java.sql.Types.VARCHAR );
statement.registerOutParameter( 4, java.sql.Types.VARCHAR ); statement.registerOutParameter( 4, java.sql.Types.INTEGER );
statement.registerOutParameter( 5, OracleTypes.CURSOR ); statement.registerOutParameter( 5, OracleTypes.CURSOR );
statement.execute(); statement.execute();
Vector<Long> menusual_list = new Vector<Long>();
String attach_rate = statement.getString( 2 ); String attach_rate = statement.getString( 2 );
String renewal_rate = statement.getString( 3 ); String renewal_rate = statement.getString( 3 );
String totalArchievement = statement.getString( 4 ); long totalArchievement = statement.getInt( 4 );
archievement.setAttachingRate( attach_rate ); menusual_cursor = ((OracleCallableStatement) statement).getCursor( 5 );
archievement.setInsuranceRenewalRate( renewal_rate );
while ( menusual_cursor.next())
{
menusual_list.add( menusual_cursor.getLong( 2 ) );
}
archievement = new DepartmentArchievement( totalArchievement, menusual_list,
renewal_rate, attach_rate );
}
finally
{
try
{
if ( menusual_cursor != null )
{
menusual_cursor.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( statement != null )
{
statement.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( connection != null )
{
connection.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
}
return archievement; return archievement;
} }
public int getTotalArchievement() public long getTotalArchievement()
{ {
return totalArchievement; return totalArchievement;
} }
public void setTotalArchievement( int totalArchievement ) public void setTotalArchievement( long totalArchievement )
{ {
this.totalArchievement = totalArchievement; this.totalArchievement = totalArchievement;
} }
public Vector<Integer> getMensualArchievementList() public Vector<Long> getMensualArchievementList()
{ {
return mensualArchievementList; return mensualArchievementList;
} }
public void setMensualArchievementList( Vector<Integer> mensualArchievementList ) public void setMensualArchievementList( Vector<Long> mensualArchievementList )
{ {
this.mensualArchievementList = mensualArchievementList; this.mensualArchievementList = mensualArchievementList;
} }
@ -133,12 +187,12 @@ public class DepartmentArchievement
} }
@JsonProperty( "total_archievement" ) @JsonProperty( "total_archievement" )
private int totalArchievement; // 总业绩 private long totalArchievement; // 总业绩
// 每月业绩列表 // 每月业绩列表
// 要保证数据是按照月份排序 // 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" ) @JsonProperty( "mensual_archievement_list" )
private Vector<Integer> mensualArchievementList; private Vector<Long> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" ) @JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率 private String insuranceRenewalRate; // 续保率

View File

@ -55,25 +55,14 @@ public class ArchievementQueryController
departmentArch = DepartmentArchievement departmentArch = DepartmentArchievement
.queryDepartmentArchievement( request.getDepartmentCode() ); .queryDepartmentArchievement( request.getDepartmentCode() );
Vector<Integer> mensual_archievement = new Vector<Integer>(); result.setTotalArchievement( departmentArch.getTotalArchievement() );
mensual_archievement.add( 200 );
mensual_archievement.add( 213 );
mensual_archievement.add( 333 );
mensual_archievement.add( 444 );
mensual_archievement.add( 555 );
mensual_archievement.add( 666 );
result.setSuccess( true );
result.setMessage( "成功" );
result.setTotalArchievement( 1234567890 );
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() ); result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
result.setAttachingRate( departmentArch.getAttachingRate() ); result.setAttachingRate( departmentArch.getAttachingRate() );
result.addAdvanceRewardGainer( "沈群" ); result.addAdvanceRewardGainer( "沈群" );
result.addLeadingRewardGainer( "王鸿津" ); result.addLeadingRewardGainer( "王鸿津" );
result.addLeadingRewardGainer( "林宗泽" ); result.addLeadingRewardGainer( "林宗泽" );
result.addBackwardStaff( "王炜" ); result.addBackwardStaff( "王炜" );
result.setMensualArchievementList( mensual_archievement ); result.setMensualArchievementList( departmentArch.getMensualArchievementList() );
} }
catch ( SQLException error ) catch ( SQLException error )
{ {
@ -84,29 +73,9 @@ public class ArchievementQueryController
} }
result.setSuccess( true );
result.setMessage( "成功" );
return result; return result;
} }
void genTestDepartmentData( DepartmentArchievementQueryResult data )
{
Vector<Integer> mensual_archievement = new Vector<Integer>();
mensual_archievement.add( 200 );
mensual_archievement.add( 213 );
mensual_archievement.add( 333 );
mensual_archievement.add( 444 );
mensual_archievement.add( 555 );
mensual_archievement.add( 666 );
data.setSuccess( true );
data.setMessage( "成功" );
data.setTotalArchievement( 1234567890 );
data.setInsuranceRenewalRate( "65" );
data.setAttachingRate( "75" );
data.addAdvanceRewardGainer( "沈群" );
data.addLeadingRewardGainer( "王鸿津" );
data.addLeadingRewardGainer( "林宗泽" );
data.addBackwardStaff( "王炜" );
data.setMensualArchievementList( mensual_archievement );
}
} }

View File

@ -22,28 +22,28 @@ public class DepartmentArchievementQueryResult extends QueryResult
{ {
DepartmentArchievementQueryResult() DepartmentArchievementQueryResult()
{ {
mensualArchievementList = new Vector<Integer>(); mensualArchievementList = new Vector<Long>();
advanceRewardGainers = new Vector<String>(); advanceRewardGainers = new Vector<String>();
leadingRewardGainers = new Vector<String>(); leadingRewardGainers = new Vector<String>();
backwardList = new Vector<String>(); backwardList = new Vector<String>();
} }
public int getTotalArchievement() public long getTotalArchievement()
{ {
return totalArchievement; return totalArchievement;
} }
public void setTotalArchievement( int totalArchievement ) public void setTotalArchievement( long totalArchievement )
{ {
this.totalArchievement = totalArchievement; this.totalArchievement = totalArchievement;
} }
public Vector<Integer> getMensualArchievementList() public Vector<Long> getMensualArchievementList()
{ {
return mensualArchievementList; return mensualArchievementList;
} }
public void setMensualArchievementList( Vector<Integer> mensualArchievementList ) public void setMensualArchievementList( Vector<Long> mensualArchievementList )
{ {
this.mensualArchievementList = mensualArchievementList; this.mensualArchievementList = mensualArchievementList;
} }
@ -114,12 +114,12 @@ public class DepartmentArchievementQueryResult extends QueryResult
} }
@JsonProperty( "total_archievement" ) @JsonProperty( "total_archievement" )
private int totalArchievement; // 总业绩 private long totalArchievement; // 总业绩
// 每月业绩列表 // 每月业绩列表
// 要保证数据是按照月份排序 // 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" ) @JsonProperty( "mensual_archievement_list" )
private Vector<Integer> mensualArchievementList; private Vector<Long> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" ) @JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率 private String insuranceRenewalRate; // 续保率

View File

@ -28,20 +28,18 @@ public class CrosFilter implements Filter
HttpServletRequest request = (HttpServletRequest) req; HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp; HttpServletResponse response = (HttpServletResponse) resp;
String method = request.getMethod(); String method = request.getMethod();
String originHeader = null; String originHeader = request.getHeader( "Origin" );
// 如果是Options请求就直接返回200状态码 System.out.println( "收到" + method + "请求,来自" + originHeader);
if ( method.equals( HttpMethod.OPTIONS.toString() ) )
// 如果是Options请求
if ( method.equals(HttpMethod.OPTIONS.toString()) )
{ {
originHeader = "*"; originHeader = "*";
} }
else
{
originHeader = request.getHeader( "Origin" );
}
response.setHeader( "Access-Control-Allow-Origin", originHeader ); response.setHeader( "Access-Control-Allow-Origin", originHeader );
response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" ); response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT" );
response.setHeader( "Access-Control-Max-Age", "0" ); response.setHeader( "Access-Control-Max-Age", "0" );
response.setHeader( "Access-Control-Allow-Headers", response.setHeader( "Access-Control-Allow-Headers",
"Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" ); "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" );