|
@@ -80,7 +80,11 @@ func AttendanceToAttendance_R(t Attendance) (r Attendance_R) {
|
|
|
r.Id = t.Id
|
|
|
r.T_uid = t.T_uid
|
|
|
r.T_type = t.T_type
|
|
|
- r.T_type_name = Read_AttendanceType_Get(t.T_type)
|
|
|
+ T_type_name := Read_AttendanceType_Get(t.T_type)
|
|
|
+ if t.T_type > 100 {
|
|
|
+ T_type_name = "扣除-" + Read_AttendanceType_Get(t.T_type-100)
|
|
|
+ }
|
|
|
+ r.T_type_name = T_type_name
|
|
|
r.T_user_name = Account.Read_User_T_name_Get(t.T_uid)
|
|
|
r.T_start_time = t.T_start_time.Format("2006-01-02 15:04:05")
|
|
|
r.T_prove_img = t.T_prove_img
|
|
@@ -91,13 +95,21 @@ func AttendanceToAttendance_R(t Attendance) (r Attendance_R) {
|
|
|
r.T_approver_name = Account.Read_User_T_name_Get(t.T_approver)
|
|
|
r.T_State = t.T_State
|
|
|
r.UpdateTime = t.UpdateTime.Format("2006-01-02 15:04:05")
|
|
|
+ if t.T_type > 100 {
|
|
|
+ r.T_start_time = "-"
|
|
|
+ r.T_end_time = "-"
|
|
|
+ }
|
|
|
return r
|
|
|
}
|
|
|
|
|
|
func AttendanceToAttendance_S(t Attendance) (r Attendance_S) {
|
|
|
r.Id = t.Id
|
|
|
r.T_type = t.T_type
|
|
|
- r.T_type_name = Read_AttendanceType_Get(t.T_type)
|
|
|
+ T_type_name := Read_AttendanceType_Get(t.T_type)
|
|
|
+ if t.T_type > 100 {
|
|
|
+ T_type_name = "扣除-" + Read_AttendanceType_Get(t.T_type-100)
|
|
|
+ }
|
|
|
+ r.T_type_name = T_type_name
|
|
|
r.T_duration = t.T_duration
|
|
|
r.T_text = t.T_text
|
|
|
r.T_approver = t.T_approver
|
|
@@ -268,7 +280,8 @@ func Read_Attendance_List_For_Finance(T_uid, T_month string) (r []Attendance_R)
|
|
|
}
|
|
|
|
|
|
list := Get_LeaveType_List()
|
|
|
- cond = cond.And("T_State", AttendancePass).And("T_uid", T_uid).And("T_type__in", list).
|
|
|
+ cond = cond.And("T_State", AttendancePass).And("T_uid", T_uid).
|
|
|
+ AndCond(cond.Or("T_type__in", list).Or("T_type__gt", 100)).
|
|
|
AndCond(cond.Or("T_start_time__startswith", T_month).Or("T_end_time__startswith", T_month))
|
|
|
|
|
|
_, err := qs.SetCond((*orm2.Condition)(cond)).OrderBy("Id").All(&map_r)
|
|
@@ -323,13 +336,13 @@ func Read_Attendance_List_For_Stat(T_uid string, page, page_z int) (r []Attendan
|
|
|
var T_type_list = []int{AttendanceOvertime, AttendanceDaysOff, AttendanceShiftPerf}
|
|
|
|
|
|
cond := orm.NewCondition()
|
|
|
- cond = cond.And("T_State__gt", AttendanceDelete).And("T_uid", T_uid).And("T_State", AttendancePass).And("T_type__in", T_type_list)
|
|
|
+ cond = cond.And("T_uid", T_uid).And("T_State", AttendancePass).
|
|
|
+ AndCond(cond.Or("T_type__in", T_type_list).Or("T_type__gt", 100))
|
|
|
|
|
|
var err error
|
|
|
if page_z == 9999 {
|
|
|
_, err = qs.SetCond((*orm2.Condition)(cond)).OrderBy("Id").All(&map_r)
|
|
|
} else {
|
|
|
-
|
|
|
_, err = qs.Limit(page_z, offset).SetCond((*orm2.Condition)(cond)).OrderBy("Id").All(&map_r)
|
|
|
}
|
|
|
|
|
@@ -356,7 +369,7 @@ func GetRemainingDaysOff(T_uuid string) int {
|
|
|
var duration int
|
|
|
for i := 0; i < len(attendance); i++ {
|
|
|
// 调休,转绩效 减时长
|
|
|
- if attendance[i].T_type == AttendanceDaysOff || attendance[i].T_type == AttendanceShiftPerf {
|
|
|
+ if attendance[i].T_type == AttendanceDaysOff || attendance[i].T_type == AttendanceShiftPerf || attendance[i].T_type > 100 {
|
|
|
duration -= attendance[i].T_duration
|
|
|
} else {
|
|
|
// 加班 加时长
|