作者 tangxvhui

更新评估内容导出

package query
type ListAssessContentCycleDay struct {
CompanyId int `json:"companyId"`
OperaterId int `json:"operaterId"`
CycleId int `json:"cycleId,string"`
BeginDay string `json:"beginDay"`
TargetUserName string `json:"targetUserName"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
CompanyId int `json:"companyId"`
OperaterId int `json:"operaterId"`
CycleId int `json:"cycleId,string"`
BeginDay string `json:"beginDay"`
TargetUserName string `json:"targetUserName"`
TargetUserId []string `json:"targetUserId"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
}
... ...
... ... @@ -426,13 +426,13 @@ func (srv StaffAssessServeice) ExportUserAssess(param *query.ListAssessContentCy
xlsxFile.MergeCell(sheetName, "B5", "B5")
//设置行高
for i := range tableRowSort {
xlsxFile.SetRowHeight(sheetName, i+6, 50)
xlsxFile.SetRowHeight(sheetName, i+5, 50)
}
//设置列宽
for i := range headerList {
colName, _ := excelize.ColumnNumberToName(i + 1)
if i == 0 {
xlsxFile.SetColWidth(sheetName, colName, colName, 70)
xlsxFile.SetColWidth(sheetName, colName, colName, 30)
}
}
return xlsxFile, nil
... ...
... ... @@ -169,15 +169,16 @@ type UserAssessContent struct {
}
type SearchConditin1 struct {
CompanyId int //公司id
AssessId int //评估任务id
CycleId int //周期id
BeginDay string //评估的日期
TargetUserName string //被评估人的名称
Limit int //分页
Offset int //分页
OperaterId int //用户的id是谁在搜索数据
Hrbp int //
CompanyId int //公司id
AssessId int //评估任务id
CycleId int //周期id
BeginDay string //评估的日期
TargetUserName string //被评估人的名称
TargetUserId []string //查询指定的人
Limit int //分页
Offset int //分页
OperaterId int //用户的id是谁在搜索数据
Hrbp int //
}
//项目管理-成员列表 根据周期的id和日期获取员工填写的评估内容
... ... @@ -203,11 +204,12 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
staff_assess_content.weight
from t_staff_assess_1
left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id
where 1=1
`
condition := []interface{}{}
if len(param.TargetUserName) > 0 {
sqlStr += ` where t_staff_assess_1.target_user_name like ? `
condition = append(condition, param.TargetUserName)
sqlStr += ` and t_staff_assess_1.target_user_name like ? `
condition = append(condition, "%"+param.TargetUserName+"%")
}
//加入排序
sqlStr += ` order by convert_to(t_staff_assess_1.target_user_name,'GBK'),staff_assess_content.sort_by `
... ... @@ -229,11 +231,11 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
//limit int, 分页条数
//offset int 分页偏移
func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) (int, error) {
sqlStr := ` select count(*) from t_staff_assess_1 `
sqlStr := ` select count(*) from t_staff_assess_1 where 1=1 `
condition := []interface{}{}
if len(param.TargetUserName) > 0 {
sqlStr += ` where t_staff_assess_1.target_user_name like ? `
condition = append(condition, param.TargetUserName)
sqlStr += ` and t_staff_assess_1.target_user_name like ? `
condition = append(condition, "%"+param.TargetUserName+"%")
}
//获取前置sql语句
sqlStr0 := d.useTStaffAssess(param.CompanyId, param.CycleId, param.OperaterId, param.BeginDay, param.Hrbp, 5000, 0)
... ... @@ -357,11 +359,16 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa
staff_assess_content.weight,staff_assess_content.prompt_text ,staff_assess_content.remark
from t_staff_assess_1
left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id
where 1=1
`
condition := []interface{}{}
if len(param.TargetUserName) > 0 {
sqlStr += ` where t_staff_assess_1.target_user_name like ? `
condition = append(condition, param.TargetUserName)
sqlStr += ` and t_staff_assess_1.target_user_name like ? `
condition = append(condition, "%"+param.TargetUserName+"%")
}
if len(param.TargetUserId) > 0 {
sqlStr += ` and t_staff_assess_1.target_user_id in (?) `
condition = append(condition, pg.In(param.TargetUserId))
}
//加入排序
sqlStr += ` order by convert_to(t_staff_assess_1.target_user_name,'GBK'),staff_assess_content.sort_by `
... ...