|
|
@@ -4,11 +4,11 @@ import (
|
|
|
"context"
|
|
|
"database/sql"
|
|
|
"fmt"
|
|
|
+ "lims_adapter/common"
|
|
|
dao "lims_adapter/dao/feedback"
|
|
|
"lims_adapter/model/feedback"
|
|
|
"strconv"
|
|
|
|
|
|
- "dashoo.cn/common_definition/admin/dict_def"
|
|
|
"dashoo.cn/common_definition/admin/permission_def"
|
|
|
"dashoo.cn/micro_libary/micro_srv"
|
|
|
"dashoo.cn/micro_libary/myerrors"
|
|
|
@@ -284,6 +284,7 @@ func (s FeedbackService) Reactivate(ctx context.Context, req *feedback.FeedbackR
|
|
|
"CurrentProcessorId": 0,
|
|
|
"CurrentProcessorName": nil,
|
|
|
"ProcessedAt": nil,
|
|
|
+ "ProcessType": nil,
|
|
|
}).Update()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -368,21 +369,16 @@ func (s FeedbackService) Export(ctx context.Context, req *feedback.FeedbackListR
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- dictService := micro_srv.InitMicroSrvClient("Dict", "micro_srv.admin")
|
|
|
- defer dictService.Close()
|
|
|
- rsp := &dict_def.DictDataResp{}
|
|
|
- err = dictService.Call(context.TODO(), "GetDictDataByType", &dict_def.DictReq{
|
|
|
- Tenant: s.Tenant,
|
|
|
- DictCode: "OpinionsContent",
|
|
|
- }, rsp)
|
|
|
+ typeMap, err := common.DictAsMap(s.Tenant, "OpinionsContent")
|
|
|
if err != nil {
|
|
|
- return nil, fmt.Errorf("获取反馈类型失败 %s", err.Error())
|
|
|
+ return nil, myerrors.NewMsgError(nil, fmt.Sprintf("获取字典数据错误 OpinionsContent %s", err.Error()))
|
|
|
}
|
|
|
|
|
|
- typeMap := map[string]string{}
|
|
|
- for _, i := range rsp.List {
|
|
|
- typeMap[i.Key] = i.Value
|
|
|
+ processTypeMap, err := common.DictAsMap(s.Tenant, "OPNHandleMethod")
|
|
|
+ if err != nil {
|
|
|
+ return nil, myerrors.NewMsgError(nil, fmt.Sprintf("获取字典数据错误 OPNHandleMethod %s", err.Error()))
|
|
|
}
|
|
|
+
|
|
|
statusMap := map[int]string{
|
|
|
1: "未处理",
|
|
|
2: "已处理",
|
|
|
@@ -391,10 +387,10 @@ func (s FeedbackService) Export(ctx context.Context, req *feedback.FeedbackListR
|
|
|
f := excelize.NewFile()
|
|
|
sheet := "Sheet1"
|
|
|
header := []string{
|
|
|
- "反馈人姓名", "反馈时间", "反馈类型", "反馈内容", "处理状态", "处理人", "处理时间",
|
|
|
+ "反馈人姓名", "反馈时间", "反馈类型", "反馈内容", "处理状态", "处理人", "处理方式", "处理时间",
|
|
|
}
|
|
|
colWidth := []float64{
|
|
|
- 12, 20, 12, 40, 12, 12, 20,
|
|
|
+ 12, 20, 12, 40, 12, 12, 12, 20,
|
|
|
}
|
|
|
|
|
|
colStyle, err := f.NewStyle(&excelize.Style{
|
|
|
@@ -470,7 +466,8 @@ func (s FeedbackService) Export(ctx context.Context, req *feedback.FeedbackListR
|
|
|
f.SetCellValue(sheet, "D"+rowName, item.Content)
|
|
|
f.SetCellValue(sheet, "E"+rowName, statusMap[item.Status])
|
|
|
f.SetCellValue(sheet, "F"+rowName, item.CurrentProcessorName)
|
|
|
- f.SetCellValue(sheet, "G"+rowName, item.ProcessedAt)
|
|
|
+ f.SetCellValue(sheet, "G"+rowName, processTypeMap[item.ProcessType])
|
|
|
+ f.SetCellValue(sheet, "H"+rowName, item.ProcessedAt)
|
|
|
}
|
|
|
|
|
|
index := f.NewSheet(sheet)
|