From 6da78396a3923118f2f54b5dc0bd8cd1f1c1ae51 Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Thu, 6 Apr 2023 18:20:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/db/常用语句.sql | 14 ++ .../cpic/xim/utils/account/TeleSalerInfo.java | 190 ++++++++++++++++++ .../account/StaffInfoQueryController.java | 15 ++ .../account/StaffInfoQueryResult.java | 3 +- .../account/TeleSalerQueryResult.java | 103 +++++++++- 5 files changed, 319 insertions(+), 6 deletions(-) create mode 100644 code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/account/TeleSalerInfo.java diff --git a/code/db/常用语句.sql b/code/db/常用语句.sql index 37b0c61..36efb08 100644 --- a/code/db/常用语句.sql +++ b/code/db/常用语句.sql @@ -8,6 +8,20 @@ SELECT b.reward_name, reward_projects b WHERE a.reward_index = b.reward_index; +--ϯ +SELECT s.saler_code, + s.saler_name, + t.team_code, + t.team, + bm.department_code, + bm.department_name + FROM tele_saler s, + tele_saler_team t, + idst0.bm_t bm + WHERE s.team_code = t.team_code + AND t.department_code = bm.department_code + AND s.saler_name = 'ŵ'; + SELECT , SUM FROM ÿձ diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/account/TeleSalerInfo.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/account/TeleSalerInfo.java new file mode 100644 index 0000000..40c4c7a --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/account/TeleSalerInfo.java @@ -0,0 +1,190 @@ +/* + * @Author: Kane + * @Date: 2023-04-06 14:14:23 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/account/TeleSalerInfo.java + * @Description: + * + * Copyright (c) ${2022} by Kane, All Rights Reserved. + */ + +package com.cpic.xim.utils.account; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public final class TeleSalerInfo +{ + /** + * @description: 构造函数 + * @param code: 坐席工号 + * @param name: 坐席名称 + * @param teamCode: 团队代码 + * @param teamName: 团队名称 + * @param departmentCode: 部门代码 + * @param departmentName: 部门名称 + */ + private TeleSalerInfo( String code, String name, String teamCode, String teamName, + String departmentCode, String departmentName) + { + this.code = code; + this.name = name; + this.teamCode = teamCode; + this.teamName = teamName; + this.departmentCode = departmentCode; + this.departmentName = departmentName; + } + + public static TeleSalerInfo queryTeleSalerInfo( String code ) + { + TeleSalerInfo info = null; + + // 到时要改 + String userName = "desktop_archievement_admin"; + String password = "Cpic123456"; + String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1"; + + return info; + } + + public String getCode() + { + return code; + } + + public void setCode( String code ) + { + this.code = code; + } + + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + public String getTeamCode() + { + return teamCode; + } + + public void setTeamCode( String teamCode ) + { + this.teamCode = teamCode; + } + + public String getTeamName() + { + return teamName; + } + + public void setTeamName( String teamName ) + { + this.teamName = teamName; + } + + public String getDepartmentCode() + { + return departmentCode; + } + + public void setDepartmentCode( String departmentCode ) + { + this.departmentCode = departmentCode; + } + + public String getDepartmentName() + { + return departmentName; + } + + public void setDepartmentName( String departmentName ) + { + this.departmentName = departmentName; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((code == null) ? 0 : code.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((teamCode == null) ? 0 : teamCode.hashCode()); + result = prime * result + ((teamName == null) ? 0 : teamName.hashCode()); + result = prime * result + ((departmentCode == null) ? 0 : departmentCode.hashCode()); + result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode()); + return result; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + return true; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + TeleSalerInfo other = (TeleSalerInfo) obj; + if ( code == null ) + { + if ( other.code != null ) + return false; + } else if ( !code.equals( other.code ) ) + return false; + if ( name == null ) + { + if ( other.name != null ) + return false; + } else if ( !name.equals( other.name ) ) + return false; + if ( teamCode == null ) + { + if ( other.teamCode != null ) + return false; + } else if ( !teamCode.equals( other.teamCode ) ) + return false; + if ( teamName == null ) + { + if ( other.teamName != null ) + return false; + } else if ( !teamName.equals( other.teamName ) ) + return false; + if ( departmentCode == null ) + { + if ( other.departmentCode != null ) + return false; + } else if ( !departmentCode.equals( other.departmentCode ) ) + return false; + if ( departmentName == null ) + { + if ( other.departmentName != null ) + return false; + } else if ( !departmentName.equals( other.departmentName ) ) + return false; + return true; + } + + @Override + public String toString() + { + return "TeleSalerInfo [code=" + code + ", name=" + name + ", teamCode=" + teamCode + + ", teamName=" + teamName + ", departmentCode=" + departmentCode + + ", departmentName=" + departmentName + "]"; + } + + private String code; + private String name; + private String teamCode; + private String teamName; + private String departmentCode; + private String departmentName; +} diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryController.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryController.java index a8c1736..9153c91 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryController.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryController.java @@ -20,6 +20,11 @@ import com.cpic.xim.utils.account.CpicXIMStaffInfo; @RequestMapping( "/account" ) public class StaffInfoQueryController { + /** + * @description: + * @param {String} account: 前端发送的请求内容,员工的P13账号或P09工号。 + * @return {*} + */ @RequestMapping( "/query_staff_info.do" ) @ResponseBody public StaffInfoQueryResult queryStaffInfo( @RequestParam( "account" ) String account ) @@ -46,6 +51,16 @@ public class StaffInfoQueryController result.setMessage( error.getMessage() ); } + return result; + } + + @ResponseBody + public TeleSalerQueryResult queryTeleSalerInfo( String teleSalerCode ) + { + TeleSalerQueryResult result = new TeleSalerQueryResult(); + + + return result; } } diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryResult.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryResult.java index 309189a..eaf1a14 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryResult.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/StaffInfoQueryResult.java @@ -86,8 +86,7 @@ public class StaffInfoQueryResult { if ( other.message != null ) return false; - } - else if ( !message.equals( other.message ) ) + } else if ( !message.equals( other.message ) ) return false; return true; } diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TeleSalerQueryResult.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TeleSalerQueryResult.java index 9456702..22e755b 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TeleSalerQueryResult.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TeleSalerQueryResult.java @@ -1,11 +1,11 @@ /* * @Author: Kane - * @Date: 2023-04-05 22:40:20 + * @Date: 2023-04-06 09:25:25 * @LastEditors: Kane * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TeleSalerQueryResult.java - * @Description: - * - * Copyright (c) ${2022} by Kane, All Rights Reserved. + * @Description: + * + * Copyright (c) ${2022} by Kane, All Rights Reserved. */ package com.cpic.xim.web.controllers.account; @@ -20,17 +20,112 @@ public class TeleSalerQueryResult extends QueryResult super(); } + /** + * @description: 构造函数 + * @param success: 请求成功标志位 + * @param message: 请求结果提示信息 + * @param teleSalerCode: 坐席工号 + * @param teleSalerName: 坐席名称 + * @param teamCode: 团队代码 + * @param teamName: 团队名称 + * @param departmentCode: 部门代码 + * @param departmentName: 部门名称 + * @return {*} + */ public TeleSalerQueryResult( boolean success, String message, String teleSalerCode, String teleSalerName, String teamCode, String teamName, String departmentCode, String departmentName) { super( success, message ); + + this.teleSalerCode = teleSalerCode; + this.teleSalerName = teleSalerName; + this.teamCode = teamCode; + this.teamName = teamName; + this.departmentCode = departmentCode; + this.departmentName = departmentName; } + public String getTeleSalerCode() + { + return teleSalerCode; + } + + /** + * @description: + * @param {String} teleSalerCode + * @return {*} + */ + public void setTeleSalerCode( String teleSalerCode ) + { + this.teleSalerCode = teleSalerCode; + } + + public String getTeleSalerName() + { + return teleSalerName; + } + + public void setTeleSalerName( String teleSalerName ) + { + this.teleSalerName = teleSalerName; + } + + public String getTeamCode() + { + return teamCode; + } + + public void setTeamCode( String teamCode ) + { + this.teamCode = teamCode; + } + + public String getTeamName() + { + return teamName; + } + + public void setTeamName( String teamName ) + { + this.teamName = teamName; + } + + public String getDepartmentCode() + { + return departmentCode; + } + + public void setDepartmentCode( String departmentCode ) + { + this.departmentCode = departmentCode; + } + + public String getDepartmentName() + { + return departmentName; + } + + public void setDepartmentName( String departmentName ) + { + this.departmentName = departmentName; + } + + @JsonProperty( "tele_saler_code" ) private String teleSalerCode; + + @JsonProperty( "tele_saler_name" ) private String teleSalerName; + + @JsonProperty( "team_code" ) private String teamCode; + + @JsonProperty( "team_name" ) private String teamName; + + @JsonProperty( "department_code" ) private String departmentCode; + + @JsonProperty( "department_name" ) private String departmentName; }