作者 tangxvhui

调整

... ... @@ -17,7 +17,6 @@ type Chance struct {
CompanyId int64 `orm:"column(company_id)" description:"表company.id 公司编号"`
AuditTemplateId int64 `orm:"column(audit_template_id)" description:"表audit_template.id 所属审批模板编号"`
AuditTemplateConfig string `orm:"column(audit_template_config);size(255);null" description:"模板配置 (存旧的配置信息,对新改动的不影响)"`
Content string `orm:"column(content)" description:"格式化后的文本内容"`
SourceContent string `orm:"column(source_content)" description:"原始表单内容 json"`
ViewTotal int `orm:"column(view_total)" description:"查看总数"`
CommentTotal int `orm:"column(comment_total)" description:"评论总数"`
... ... @@ -39,7 +38,7 @@ type Chance struct {
CheckResultStatus int8 ` orm:"column(check_result_status)"`
CheckTime time.Time `orm:"column(check_time);type(timestamp);"`
CheckResult string `orm:"column(check_result)" description:"自查内容筛选结果"`
ChanceType int8 `orm:"column(type)" description:"机会类别:0:机会池 1:储备池"`
StoreType int8 `orm:"column(type)" description:"机会类别:0:机会池 1:储备池"`
ReserveTypeId int `orm:"column(reserve_type_id)" description:"储备类型编号"`
}
... ... @@ -115,6 +114,17 @@ var CheckResultStatusMap = map[int8]string{
CheckResultStatusNOPass: "未通过",
}
// StoreType int8 `orm:"column(type)" description:"机会类别:0:机会池 1:储备池"`
const (
ChanceStoreTypeDefault int8 = 0
ChanceStoreTypeReserve int8 = 1
)
var ChanceStoreTypeMap = map[int8]string{
ChanceStoreTypeDefault: "机会池",
ChanceStoreTypeReserve: "储备池",
}
//ChanceSelfCheck chance表中SelfChecks字段的json结构
type ChanceSelfCheckData struct {
CheckItem string `json:"checkItem"`
... ...
... ... @@ -153,6 +153,8 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
DiscoveryScore string `orm:"column(discovery_score)"`
CommentTotal string `orm:"column(comment_total)"`
Code string `orm:"column(code)"`
StoreType int8 `orm:"column(type)"`
ReserveTypeId int `orm:"column(reserve_type_id)"`
}
var (
datasql = strings.Builder{}
... ... @@ -180,6 +182,7 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
s1 := `SELECT a.id,a.department_id,a.audit_template_id,a.chance_type_id
,a.publish_status,a.create_at,a.review_status,a.status
,a.discovery_score,a.comment_total ,a.code,d.nick_name,d.id as user_id
,a.type,a.reserve_type_id
FROM chance AS a
JOIN user_company AS c ON c.id = a.user_id
JOIN user AS d ON c.user_id = d.id
... ... @@ -298,6 +301,9 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
CommentTotal: v.CommentTotal,
UserName: v.NickName,
CreateTime: 0,
ReserveType: "",
StoreType: v.StoreType,
StoreTypeName: models.ChanceStoreTypeMap[v.StoreType],
}
t, err := time.ParseInLocation("2006-01-02 15:04:05", v.CreateAt, time.Local)
if err == nil {
... ... @@ -312,6 +318,9 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
if tp, err := models.GetAuditTemplateById(v.AuditTemplateId); err == nil {
item.TemplateName = tp.Name
}
if rt, err := models.GetChanceReserveTypeById(v.ReserveTypeId); err == nil {
item.ReserveType = rt.Name
}
returnData.List = append(returnData.List, item)
}
... ...