作者 tangxvhui

日常保存

package service
import (
"github.com/linmadan/egglib-go/core/application"
"github.com/xuri/excelize/v2"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
)
//数据导出
func (srv *StaffAssessServeice) ExportUserAssess2V2(param *query.ExportUserAssess2Commad) (*excelize.File, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// hrbp, err := srv.getHRBP(transactionContext, param.CompanyId, param.OperatorId)
// if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// 按照cycleId 获取项目
// 按照项目获取指标项
// 按照项目获取填写的内容
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
return nil, nil
}
... ...
... ... @@ -31,31 +31,6 @@ func (h *HeaderLevel) addChild(name string) (child *HeaderLevel) {
return &h.Child[cIndex]
}
// 获取表头的所有列表名
// func (h *HeaderLevel) collectAllColumn(all *[][]string) {
// for _, v := range h.Child {
// v.collectColumn(&v, all, nil)
// }
// }
// func (h *HeaderLevel) collectColumn(child *HeaderLevel, columns *[][]string, column *[]string) {
// if column == nil {
// column = &[]string{}
// }
// *column = append(*column, h.Name)
// for _, v := range child.Child {
// if len(v.Child) > 0 {
// v.collectColumn(&v, columns, column)
// }
// if len(v.Child) == 0 {
// item := make([]string, len(*column))
// copy(item, *column)
// item = append(item, v.Name)
// *columns = append(*columns, item)
// }
// }
// }
type exportData struct {
userName []string //员工的名称列表 ,对应excel文件的多个sheet
usrIdMap map[string]string
... ...
package dao
// SearchStaffAssessByCycle 按照周期id获取评估任务,并进行人员可查看权限的过滤
// companyId 公司id
// cycleId 周期id
// operaterId 操作人、查看人的id
// hrbp 操作人、查看人是否hrbp 1:是;-1:否
func (d *StaffAssessDao) SearchStaffAssessByCycle(companyId int, cycleId int, operaterId int, hrbp int, exportUserIds []string) {
}
// sql 语句片段
// 按照人员可查看权限的过滤
func (d *StaffAssessDao) catchProjectByPermission(companyId int, cycleId int, operaterId int, hrbp int) string {
return ""
}
... ...