staffinfo

This commit is contained in:
jiangyong27 2025-04-07 19:05:40 +08:00
parent 62c6809a93
commit d45ac685eb
1 changed files with 1 additions and 9 deletions

View File

@ -26,15 +26,11 @@ type StaffInfo struct {
Phone string
StaffType string
Idno string
Salary float64
PerfSalary float64
Stock float64
EntryDate string
BirthDate string
OfficialDate string
BankName string
BankCard string
AlipayUid string
}
func NewAppHr(cfg *AppConfig) *AppHr {
@ -76,8 +72,7 @@ func (h *AppHr) GetStaffInfo(userId string) (*StaffInfo, error) {
staff.UserName = userId
staff.RealName = userInfo.RealName
staff.Salary = cast.ToFloat64(h.getFieldValue(fieldMap["20001"]))
staff.Stock = cast.ToFloat64(h.getFieldValue(fieldMap["20002"]))
staff.Phone = cast.ToString(h.getFieldValue(fieldMap["17003"]))
staff.StaffType = cast.ToString(h.getFieldValue(fieldMap["12003"]))
staff.Idno = cast.ToString(h.getFieldValue(fieldMap["11015"]))
@ -86,10 +81,7 @@ func (h *AppHr) GetStaffInfo(userId string) (*StaffInfo, error) {
staff.EntryDate = time.Unix(cast.ToInt64(h.getFieldValue(fieldMap["12018"])), 0).Format("2006-01-02")
staff.BirthDate = time.Unix(cast.ToInt64(h.getFieldValue(fieldMap["11005"])), 0).Format("2006-01-02")
staff.OfficialDate = time.Unix(cast.ToInt64(h.getFieldValue(fieldMap["12023"])), 0).Format("2006-01-02")
staff.AlipayUid = cast.ToString(h.getFieldValue(fieldMap["20004"]))
staff.PerfSalary = cast.ToFloat64(h.getFieldValue(fieldMap["20004"]))
//fmt.Println(goutil.EncodeJSON(staff))
return staff, nil
}