This commit is contained in:
jiangyong 2025-03-16 22:09:02 +08:00
parent e110515255
commit ce3256c390
1 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,10 @@ func (s *StaffUser) Create(sess *session.AdminSession, req *api.StaffCreateReq)
staffUser.Idno = staffInfo.Idno
staffUser.EntryDate = staffInfo.EntryDate
staffUser.OfficialDate = staffInfo.OfficialDate
payee := staffUser.GetPayee()
payee.BankName = staffInfo.BankName
payee.BankCard = staffInfo.BankCard
staffUser.Payee = goutil.EncodeJSON(payee)
}
staffUser.CorpId = sess.GetAdmin().CorpId
@ -129,6 +133,10 @@ func (s *StaffUser) Update(sess *session.AdminSession, req *api.StaffUpdateReq)
staffUser.Idno = goutil.If(staffUser.Idno == "", staffInfo.Idno, staffUser.Idno)
staffUser.OfficialDate = goutil.If(staffUser.OfficialDate == "" || staffUser.OfficialDate == "NaN-NaN-NaN", staffInfo.OfficialDate, staffUser.OfficialDate)
staffUser.EntryDate = goutil.If(staffUser.EntryDate == "" || staffUser.EntryDate == "NaN-NaN-NaN", staffInfo.EntryDate, staffUser.EntryDate)
payee := staffUser.GetPayee()
payee.BankName = goutil.If(payee.BankName == "", staffInfo.BankName, payee.BankName)
payee.BankCard = goutil.If(payee.BankCard == "", staffInfo.BankCard, payee.BankCard)
staffUser.Payee = goutil.EncodeJSON(payee)
}
staffUser.Username = goutil.If(req.Username != "", req.Username, staffUser.Username)