|
@@ -15,6 +15,8 @@ import (
|
|
|
"github.com/RoaringBitmap/roaring"
|
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
|
"log"
|
|
|
+ "regexp"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
@@ -43,7 +45,8 @@ func (e *EmPloyService) InfoEmployinfo(in *types.InfoEmployinfoReq) []map[string
|
|
|
}
|
|
|
//有收录情况
|
|
|
summaryMap := SummaryFormat(in.PositionId)
|
|
|
- vint = mongodb.StringTOBsonId(id).Timestamp().Unix()
|
|
|
+ //vint = mongodb.StringTOBsonId(id).Timestamp().Unix()
|
|
|
+ vint = extractNumbers(id)
|
|
|
valueMap["isEmploy"] = summaryMap[in.EmployType].Contains(uint32(vint))
|
|
|
if len(strings.Split(in.IdArr, ",")) == 1 {
|
|
|
//列表查询
|
|
@@ -139,13 +142,13 @@ func (e *EmPloyService) EmployOperate(in *types.EmployOperateReq) bool {
|
|
|
}
|
|
|
}
|
|
|
//收录汇总表处理
|
|
|
+ vint := extractNumbers(id)
|
|
|
if in.IsEmploy {
|
|
|
- summaryMap[in.EmployType].Add(uint32(mongodb.StringTOBsonId(id).Timestamp().Unix()))
|
|
|
+ summaryMap[in.EmployType].Add(uint32(vint))
|
|
|
} else {
|
|
|
- summaryMap[in.EmployType].Remove(uint32(mongodb.StringTOBsonId(id).Timestamp().Unix()))
|
|
|
+ summaryMap[in.EmployType].Remove(uint32(vint))
|
|
|
}
|
|
|
fool = true
|
|
|
-
|
|
|
}
|
|
|
if fool {
|
|
|
return SummarySave(tx, in.PositionId, summaryMap)
|
|
@@ -160,7 +163,7 @@ func (e *EmPloyService) EmployOperate(in *types.EmployOperateReq) bool {
|
|
|
func CustomFind(id string, employType int64) map[string]interface{} {
|
|
|
data := map[string]interface{}{}
|
|
|
//company_id 企业id name户名称 address 地址
|
|
|
- if employType == 3 {
|
|
|
+ if employType == 2 {
|
|
|
//企业详情
|
|
|
entinfo, _ := MC.MgoEnt.FindOneByField("qyxy_std", map[string]interface{}{"_id": id}, map[string]interface{}{
|
|
|
"company_address": 1, //注册地
|
|
@@ -485,3 +488,21 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
|
|
|
return true
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+// 提取字符串中的数字
|
|
|
+func extractNumbers(str string) int64 {
|
|
|
+ re := regexp.MustCompile(`\d+`)
|
|
|
+ matches := re.FindAllString(str, -1)
|
|
|
+ numbers := make([]int, len(matches))
|
|
|
+ for i, match := range matches {
|
|
|
+ number, err := strconv.Atoi(match)
|
|
|
+ if err == nil {
|
|
|
+ numbers[i] = number
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result := 0
|
|
|
+ for _, number := range numbers {
|
|
|
+ result = result*10 + number
|
|
|
+ }
|
|
|
+ return int64(result)
|
|
|
+}
|