From e5dfb45c796d8181cfa20d0779a61e3bc0f73d23 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Oct 2023 01:17:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=9D=90=E5=B8=AD=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=87=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/web/task_schedule/package.json | 2 +- .../xim/mybatis/pojo/TelsalerFromJYGL.java | 341 ++++++++++++++++++ .../com/cpic/xim/utils/data/TelsalerData.java | 64 ++++ .../dataimport/ImportController.java | 2 +- 4 files changed, 407 insertions(+), 2 deletions(-) create mode 100644 code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java create mode 100644 code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java diff --git a/code/web/task_schedule/package.json b/code/web/task_schedule/package.json index e6a4f69..2e4096c 100644 --- a/code/web/task_schedule/package.json +++ b/code/web/task_schedule/package.json @@ -29,7 +29,7 @@ "axios": "^1.5.1", "babel": "^6.23.0", "eslint-config-recommended": "^4.1.0", - "eslint-config-standard-with-typescript": "^39.1.0", + "eslint-config-standard-with-typescript": "^39.1.1", "eslint-plugin-vue": "^9.17.0", "node-sass": "^9.0.0", "sass": "^1.69.0", diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java new file mode 100644 index 0000000..32665ac --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java @@ -0,0 +1,341 @@ +/* + * @Author: Kane + * @Date: 2023-10-07 23:29:22 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java + * @Description: 经营管理系统中导出的电销坐席数据记录。 + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.mybatis.pojo; + +import java.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 经营管理系统中导出的电销坐席数据记录。 + * @author Kane + */ +public class TelsalerFromJYGL +{ + // 名称 + @JsonProperty("telsalerName") + private String telsalerName; + + // 坐席工号 + @JsonProperty("telsalerCode") + private String telsalerCode; + + // 籍贯 + @JsonProperty("nativePlace") + private String nativePlace; + + // 参加工作时间 + @JsonProperty("startWorkingDate") + private LocalDate startWorkingDate; + + // 入司时间 + @JsonProperty("employmentDate") + private LocalDate employmentDate; + + // 业务类型 + @JsonProperty("business") + private String business; + + // 办公地省 + @JsonProperty("province") + private String province; + + // 办公地市 + @JsonProperty("city") + private String city; + + // 人员类别 + @JsonProperty("employmentType") + private String employmentType; + + // 现任岗位 + @JsonProperty("quarters") + private String quarters; + + // 现任职级 + @JsonProperty("rank") + private String rank; + + // 机构名称 + @JsonProperty("branchName") + private String branchName; + + // 职场分类 + @JsonProperty("workPlaceType") + private String workPlaceType; + + public TelsalerFromJYGL() {} + + @Override + public String toString() + { + return "TelsalerFromJYGL [telsalerName=" + telsalerName + ", telsalerCode=" + telsalerCode + + ", nativePlace=" + nativePlace + ", startWorkingDate=" + startWorkingDate + + ", employmentDate=" + employmentDate + ", business=" + business + ", province=" + + province + ", city=" + city + ", employmentType=" + employmentType + ", quarters=" + + quarters + ", rank=" + rank + ", branchName=" + branchName + ", workPlaceType=" + + workPlaceType + "]"; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode()); + result = prime * result + ((telsalerCode == null) ? 0 : telsalerCode.hashCode()); + result = prime * result + ((nativePlace == null) ? 0 : nativePlace.hashCode()); + result = prime * result + ((startWorkingDate == null) ? 0 : startWorkingDate.hashCode()); + result = prime * result + ((employmentDate == null) ? 0 : employmentDate.hashCode()); + result = prime * result + ((business == null) ? 0 : business.hashCode()); + result = prime * result + ((province == null) ? 0 : province.hashCode()); + result = prime * result + ((city == null) ? 0 : city.hashCode()); + result = prime * result + ((employmentType == null) ? 0 : employmentType.hashCode()); + result = prime * result + ((quarters == null) ? 0 : quarters.hashCode()); + result = prime * result + ((rank == null) ? 0 : rank.hashCode()); + result = prime * result + ((branchName == null) ? 0 : branchName.hashCode()); + result = prime * result + ((workPlaceType == null) ? 0 : workPlaceType.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; + TelsalerFromJYGL other = (TelsalerFromJYGL) obj; + if ( telsalerName == null ) + { + if ( other.telsalerName != null ) + return false; + } + else if ( !telsalerName.equals( other.telsalerName ) ) + return false; + if ( telsalerCode == null ) + { + if ( other.telsalerCode != null ) + return false; + } + else if ( !telsalerCode.equals( other.telsalerCode ) ) + return false; + if ( nativePlace == null ) + { + if ( other.nativePlace != null ) + return false; + } + else if ( !nativePlace.equals( other.nativePlace ) ) + return false; + if ( startWorkingDate == null ) + { + if ( other.startWorkingDate != null ) + return false; + } + else if ( !startWorkingDate.equals( other.startWorkingDate ) ) + return false; + if ( employmentDate == null ) + { + if ( other.employmentDate != null ) + return false; + } + else if ( !employmentDate.equals( other.employmentDate ) ) + return false; + if ( business == null ) + { + if ( other.business != null ) + return false; + } + else if ( !business.equals( other.business ) ) + return false; + if ( province == null ) + { + if ( other.province != null ) + return false; + } + else if ( !province.equals( other.province ) ) + return false; + if ( city == null ) + { + if ( other.city != null ) + return false; + } + else if ( !city.equals( other.city ) ) + return false; + if ( employmentType == null ) + { + if ( other.employmentType != null ) + return false; + } + else if ( !employmentType.equals( other.employmentType ) ) + return false; + if ( quarters == null ) + { + if ( other.quarters != null ) + return false; + } + else if ( !quarters.equals( other.quarters ) ) + return false; + if ( rank == null ) + { + if ( other.rank != null ) + return false; + } + else if ( !rank.equals( other.rank ) ) + return false; + if ( branchName == null ) + { + if ( other.branchName != null ) + return false; + } + else if ( !branchName.equals( other.branchName ) ) + return false; + if ( workPlaceType == null ) + { + if ( other.workPlaceType != null ) + return false; + } + else if ( !workPlaceType.equals( other.workPlaceType ) ) + return false; + return true; + } + + public String getTelsalerName() + { + return telsalerName; + } + + public void setTelsalerName( String telsalerName ) + { + this.telsalerName = telsalerName; + } + + public String getTelsalerCode() + { + return telsalerCode; + } + + public void setTelsalerCode( String telsalerCode ) + { + this.telsalerCode = telsalerCode; + } + + public String getNativePlace() + { + return nativePlace; + } + + public void setNativePlace( String nativePlace ) + { + this.nativePlace = nativePlace; + } + + public LocalDate getStartWorkingDate() + { + return startWorkingDate; + } + + public void setStartWorkingDate( LocalDate startWorkingDate ) + { + this.startWorkingDate = startWorkingDate; + } + + public LocalDate getEmploymentDate() + { + return employmentDate; + } + + public void setEmploymentDate( LocalDate employmentDate ) + { + this.employmentDate = employmentDate; + } + + public String getBusiness() + { + return business; + } + + public void setBusiness( String business ) + { + this.business = business; + } + + public String getProvince() + { + return province; + } + + + public void setProvince( String province ) + { + this.province = province; + } + + public String getCity() + { + return city; + } + + public void setCity( String city ) + { + this.city = city; + } + + public String getEmploymentType() + { + return employmentType; + } + + public void setEmploymentType( String employmentType ) + { + this.employmentType = employmentType; + } + + public String getQuarters() + { + return quarters; + } + + public void setQuarters( String quarters ) + { + this.quarters = quarters; + } + + public String getRank() + { + return rank; + } + + public void setRank( String rank ) + { + this.rank = rank; + } + + public String getBranchName() + { + return branchName; + } + + public void setBranchName( String branchName ) + { + this.branchName = branchName; + } + + public String getWorkPlaceType() + { + return workPlaceType; + } + + public void setWorkPlaceType( String workPlaceType ) + { + this.workPlaceType = workPlaceType; + } +} \ No newline at end of file diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java new file mode 100644 index 0000000..e47dd77 --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java @@ -0,0 +1,64 @@ +/* + * @Author: Kane + * @Date: 2023-10-07 23:17:13 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java + * @Description: 电销坐席数据导入导出 + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.utils.data; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import com.cpic.xim.mybatis.pojo.TelsalerFromJYGL; + +public class TelsalerData +{ + /** + * + * @param filePath Xlsx文件路径。 + * @return + */ + public static ArrayList importTelsalersFromXlsx( String filePath ) + { + ArrayList telsalers = new ArrayList<>(); + + Workbook wb = null; + + try + { + wb = WorkbookFactory.create( new File( filePath ) ); + } + catch ( IOException error ) + { + + } + finally + { + try + { + if ( wb != null ) + { + wb.close(); + } + } + catch ( IOException error ) + { + error.printStackTrace(); + } + } + + return telsalers; + } + + public static int importTelsalers( ArrayList telsalers ) + { + int importedCount = 0; + + return importedCount; + } +} diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportController.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportController.java index 1c46d7b..3e349dd 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportController.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportController.java @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.ResponseBody; @RequestMapping( path = "/import", method = RequestMethod.POST ) public class ImportController { - @PostMapping( path = "/import_telsalers" ) + @PostMapping( path = "/import_telsalers.do" ) @ResponseBody public ImportTelsalersResponse importTelsalers( @RequestParam ImportTelsalersRequest request ) {