|
@@ -27,6 +27,7 @@ const (
|
|
|
type EmPloyService struct{}
|
|
|
type PersonSmmary struct {
|
|
|
EntUserId int64
|
|
|
+ EntDeptId int64
|
|
|
Summary map[int64]*roaring.Bitmap
|
|
|
}
|
|
|
|
|
@@ -107,6 +108,7 @@ func (e *EmPloyService) EmployOperate(in *types.EmployOperateReq) (bool, string)
|
|
|
data["position_id"] = in.PositionId
|
|
|
data["ent_id"] = in.EntId
|
|
|
data["ent_dept_id"] = in.EntDeptId
|
|
|
+ data["ent_user_id"] = in.EntDeptId
|
|
|
ok := MC.CrmMysql.InsertByTx(tx, table, data)
|
|
|
if ok <= 0 {
|
|
|
log.Println(v1, id, in.EmployType, "收录失败")
|
|
@@ -384,6 +386,7 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
|
|
|
for _, person := range in.Person {
|
|
|
personMap[person.PositionId] = PersonSmmary{
|
|
|
EntUserId: person.EntUserId,
|
|
|
+ EntDeptId: person.EntDeptId,
|
|
|
}
|
|
|
}
|
|
|
//分发数据处理
|
|
@@ -436,6 +439,7 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
|
|
|
if MC.CrmMysql.Count(entity.EMPLOY_INFO, findMap) == 0 {
|
|
|
//新增
|
|
|
v["ent_user_id"] = personSmmary.EntUserId
|
|
|
+ v["ent_dept_id"] = personSmmary.EntDeptId
|
|
|
v["position_id"] = positionId
|
|
|
MC.CrmMysql.InsertByTx(tx, entity.EMPLOY_INFO, v)
|
|
|
}
|
|
@@ -457,6 +461,7 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
|
|
|
v["ent_user_id"] = in.EntUserId
|
|
|
v["position_id"] = in.PositionId
|
|
|
v["is_handle"] = 1
|
|
|
+ v["ent_dept_id"] = in.EntDeptId
|
|
|
MC.CrmMysql.InsertByTx(tx, entity.EMPLOY_INFO, v)
|
|
|
} else {
|
|
|
MC.CrmMysql.UpdateByTx(tx, entity.EMPLOY_INFO, findMap, map[string]interface{}{
|