From 000be198cfb27a9809a03841c0ba762388f5331e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=8C=AE=E7=BB=B4?= Date: Thu, 16 Jan 2025 23:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AD=97=E5=85=B8=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- golang_learn/data_office/get_hy_jctj/main.go | 55 ++++++++++++++++---- golang_learn/go.mod | 1 + golang_learn/go.sum | 2 + 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/golang_learn/data_office/get_hy_jctj/main.go b/golang_learn/data_office/get_hy_jctj/main.go index 3f89577..e033a3d 100644 --- a/golang_learn/data_office/get_hy_jctj/main.go +++ b/golang_learn/data_office/get_hy_jctj/main.go @@ -491,18 +491,34 @@ func setDiffs( diffs = append(diffs, diff) } } else { - // 需要公共比较 - if jckMap[key][colName] != zjkMap[key][colName] { - diff = Diff{ - IDNumber: idNumber, - Name: name, - Work: work, - ColName: colName, - Jck: jckMap[key][colName], - Zjk: zjkMap[key][colName], - Gzk: gzkMap[key][colName], + if colName == "上年年度考核结果" { + v, e := khMap[zjkMap[key][colName]] + if !e || jckMap[key][colName] != v { + diff = Diff{ + IDNumber: idNumber, + Name: name, + Work: work, + ColName: colName, + Jck: jckMap[key][colName], + Zjk: zjkMap[key][colName], + Gzk: gzkMap[key][colName], + } + diffs = append(diffs, diff) + } + } else { + // 需要公共比较 + if jckMap[key][colName] != zjkMap[key][colName] { + diff = Diff{ + IDNumber: idNumber, + Name: name, + Work: work, + ColName: colName, + Jck: jckMap[key][colName], + Zjk: zjkMap[key][colName], + Gzk: gzkMap[key][colName], + } + diffs = append(diffs, diff) } - diffs = append(diffs, diff) } } } @@ -564,8 +580,25 @@ func mergeCzResults(peoplesCzk, peoplesBhb []CzPerson) []Diff { // 示例数组 var gzMap map[string]bool +var khMap map[string]string func init() { + // khMap 考核 + khMap = make(map[string]string) + khMap["不称职(连续两年)"] = "不称职" + khMap["不称职"] = "不称职" + khMap["不定等次(病事假半年以上)"] = "病、事假累计超过考核年度半年不确定等次" + khMap["不定等次(受处分)"] = "受政务处分期间年度考核不确定等次" + khMap["不定等次(新录用公务员)"] = "新录用人员试用期年度考核不确定等次" + khMap["不定等次(正在接受审查)"] = "被立案调查尚未结案年度考核不确定等次" + khMap["无考核"] = "不进行考核" + khMap["优秀(非连续三年)"] = "优秀" + khMap["优秀(连续三年)"] = "优秀" + khMap["称职"] = "称职" + khMap["不定等次"] = "不定等次" + khMap["基本称职"] = "基本称职" + + // ArrGz 不参与比较项 ArrGz := []string{"身份证号", "姓名", "最高学历", "现职务层次", "现职级层次"} // 将数组转换为 map gzMap = make(map[string]bool) diff --git a/golang_learn/go.mod b/golang_learn/go.mod index abc8d5b..88fc381 100644 --- a/golang_learn/go.mod +++ b/golang_learn/go.mod @@ -39,6 +39,7 @@ require ( github.com/russross/blackfriday v1.6.0 github.com/shirou/gopsutil v2.20.4+incompatible github.com/spf13/viper v1.8.1 + github.com/tealeg/xlsx v1.0.5 github.com/tidwall/gjson v1.13.0 github.com/tidwall/sjson v1.2.4 github.com/twgh/xcgui v1.3.360 diff --git a/golang_learn/go.sum b/golang_learn/go.sum index a1d933f..42d29f1 100644 --- a/golang_learn/go.sum +++ b/golang_learn/go.sum @@ -491,6 +491,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE= +github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM= github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg= github.com/temoto/robotstxt v1.1.2/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=