Compare commits
No commits in common. "main" and "dev-lzh" have entirely different histories.
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,6 @@ service SecFilings{
|
||||
rpc IsSecFilingExist(IsSecFilingExistReq) returns (IsSecFilingExistResp) {}
|
||||
rpc UpdateSecFilingStatus(UpdateSecFilingStatusReq) returns(CommonResp) {}
|
||||
rpc ListFormType(ListFormTypeReq) returns (FormTypeListResp) {}
|
||||
rpc WebListSecFiling(WebListSecFilingReq) returns (WebListSecFilingResp) {}
|
||||
}
|
||||
message ListFormTypeReq{
|
||||
int32 page = 1;
|
||||
@ -110,18 +109,6 @@ message SecFilingListResp{
|
||||
uint32 total = 2 [json_name="total"];
|
||||
repeated SecFiling data = 3 [json_name="data"];
|
||||
}
|
||||
message WebListSecFilingReq{
|
||||
uint32 page = 1;
|
||||
uint32 pageSize = 2;
|
||||
string year = 3;
|
||||
string sortField = 4;
|
||||
string sortOrder = 5;
|
||||
}
|
||||
message WebListSecFilingResp{
|
||||
string msg = 1 [json_name="msg"];
|
||||
uint32 total = 2 [json_name="total"];
|
||||
repeated SecFiling data = 3 [json_name="data"];
|
||||
}
|
||||
message DeleteSecFilingReq {
|
||||
string filingKey = 1;
|
||||
string operator = 2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: secFilings.proto
|
||||
// source: api/secFilings/secFilings.proto
|
||||
|
||||
package secFilings
|
||||
|
||||
@ -97,19 +97,6 @@ func (this *SecFilingListResp) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *WebListSecFilingReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *WebListSecFilingResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DeleteSecFilingReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.20.3
|
||||
// source: secFilings.proto
|
||||
// - protoc v5.29.2
|
||||
// source: api/secFilings/secFilings.proto
|
||||
|
||||
package secFilings
|
||||
|
||||
@ -36,7 +36,6 @@ type SecFilingsClient interface {
|
||||
IsSecFilingExist(ctx context.Context, in *IsSecFilingExistReq, opts ...grpc_go.CallOption) (*IsSecFilingExistResp, common.ErrorWithAttachment)
|
||||
UpdateSecFilingStatus(ctx context.Context, in *UpdateSecFilingStatusReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
|
||||
ListFormType(ctx context.Context, in *ListFormTypeReq, opts ...grpc_go.CallOption) (*FormTypeListResp, common.ErrorWithAttachment)
|
||||
WebListSecFiling(ctx context.Context, in *WebListSecFilingReq, opts ...grpc_go.CallOption) (*WebListSecFilingResp, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type secFilingsClient struct {
|
||||
@ -52,7 +51,6 @@ type SecFilingsClientImpl struct {
|
||||
IsSecFilingExist func(ctx context.Context, in *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
|
||||
UpdateSecFilingStatus func(ctx context.Context, in *UpdateSecFilingStatusReq) (*CommonResp, error)
|
||||
ListFormType func(ctx context.Context, in *ListFormTypeReq) (*FormTypeListResp, error)
|
||||
WebListSecFiling func(ctx context.Context, in *WebListSecFilingReq) (*WebListSecFilingResp, error)
|
||||
}
|
||||
|
||||
func (c *SecFilingsClientImpl) GetDubboStub(cc *triple.TripleConn) SecFilingsClient {
|
||||
@ -115,12 +113,6 @@ func (c *secFilingsClient) ListFormType(ctx context.Context, in *ListFormTypeReq
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListFormType", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) WebListSecFiling(ctx context.Context, in *WebListSecFilingReq, opts ...grpc_go.CallOption) (*WebListSecFilingResp, common.ErrorWithAttachment) {
|
||||
out := new(WebListSecFilingResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WebListSecFiling", in, out)
|
||||
}
|
||||
|
||||
// SecFilingsServer is the server API for SecFilings service.
|
||||
// All implementations must embed UnimplementedSecFilingsServer
|
||||
// for forward compatibility
|
||||
@ -133,7 +125,6 @@ type SecFilingsServer interface {
|
||||
IsSecFilingExist(context.Context, *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
|
||||
UpdateSecFilingStatus(context.Context, *UpdateSecFilingStatusReq) (*CommonResp, error)
|
||||
ListFormType(context.Context, *ListFormTypeReq) (*FormTypeListResp, error)
|
||||
WebListSecFiling(context.Context, *WebListSecFilingReq) (*WebListSecFilingResp, error)
|
||||
mustEmbedUnimplementedSecFilingsServer()
|
||||
}
|
||||
|
||||
@ -166,9 +157,6 @@ func (UnimplementedSecFilingsServer) UpdateSecFilingStatus(context.Context, *Upd
|
||||
func (UnimplementedSecFilingsServer) ListFormType(context.Context, *ListFormTypeReq) (*FormTypeListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListFormType not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) WebListSecFiling(context.Context, *WebListSecFilingReq) (*WebListSecFilingResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method WebListSecFiling not implemented")
|
||||
}
|
||||
func (s *UnimplementedSecFilingsServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -429,35 +417,6 @@ func _SecFilings_ListFormType_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SecFilings_WebListSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(WebListSecFilingReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("WebListSecFiling", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SecFilings_ServiceDesc is the grpc_go.ServiceDesc for SecFilings service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -497,11 +456,7 @@ var SecFilings_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "ListFormType",
|
||||
Handler: _SecFilings_ListFormType_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "WebListSecFiling",
|
||||
Handler: _SecFilings_WebListSecFiling_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "secFilings.proto",
|
||||
Metadata: "api/secFilings/secFilings.proto",
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
docDb:
|
||||
host: net-11-fontree-mysql-service:3306
|
||||
user: fonchain_opv
|
||||
password: IhQmhg8HZjDmU=Ove5PnA^D
|
||||
dbName: micro-document
|
@ -1,20 +0,0 @@
|
||||
dubbo:
|
||||
registries:
|
||||
demoZK:
|
||||
protocol: zookeeper
|
||||
address: zookeeper:2181
|
||||
protocols:
|
||||
triple:
|
||||
name: tri
|
||||
port: 20028
|
||||
provider:
|
||||
services:
|
||||
GovernanceProvider:
|
||||
protocol: tri
|
||||
interface: governance.Governance # must be compatible with grpc or dubbo-java
|
||||
PressReleasesProvider:
|
||||
protocol: tri
|
||||
interface: pressreleases.PressReleases # must be compatible with grpc or dubbo-java
|
||||
SecFilingsProvider:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.fiee.SecFiling # must be compatible with grpc or dubbo-java
|
@ -34,6 +34,3 @@ func (SecFilingsProvider) UpdateSecFilingStatus(_ context.Context, req *secFilin
|
||||
func (SecFilingsProvider) ListFormType(_ context.Context, req *secFilings.ListFormTypeReq) (*secFilings.FormTypeListResp, error) {
|
||||
return logic.SecFilingsLogic.ListFormType(req)
|
||||
}
|
||||
func (SecFilingsProvider) WebListSecFiling(_ context.Context, req *secFilings.WebListSecFilingReq) (*secFilings.WebListSecFilingResp, error) {
|
||||
return logic.SecFilingsLogic.WebListSecFiling(req)
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package dao
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"micro-document/api/secFilings"
|
||||
"micro-document/internel/model"
|
||||
"micro-document/pkg/db"
|
||||
@ -30,7 +29,7 @@ func (secFilingsDao) CreateSecFiling(req *secFilings.CreateSecFilingReq) (*secFi
|
||||
}
|
||||
j, err := json.Marshal(dataFiles)
|
||||
if err != nil {
|
||||
return nil, errors.New("文件转换失败")
|
||||
return nil, errors.New("datafiles文件json转换失败: " + err.Error())
|
||||
}
|
||||
filingKey := model.GenFilingKey(req.FilingDate, req.Form, req.FileLink)
|
||||
var count int64
|
||||
@ -38,7 +37,7 @@ func (secFilingsDao) CreateSecFiling(req *secFilings.CreateSecFilingReq) (*secFi
|
||||
return nil, err
|
||||
}
|
||||
if count != 0 {
|
||||
return nil, errors.New("key已存在,创建失败")
|
||||
return nil, errors.New("filing_key已存在")
|
||||
}
|
||||
if err := db.DocDB.Model(&model.SecFilings{}).Create(&model.SecFilings{
|
||||
FilingKey: filingKey,
|
||||
@ -51,19 +50,20 @@ func (secFilingsDao) CreateSecFiling(req *secFilings.CreateSecFilingReq) (*secFi
|
||||
PdfFile: req.PdfFile,
|
||||
WordFile: req.WordFile,
|
||||
ExcelFile: req.ExcelFile,
|
||||
Operator: req.Operator,
|
||||
OperatorId: req.OperatorId,
|
||||
}).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.FilingKey = filingKey
|
||||
resp.Msg = "create success"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsDao) UpdateSecFiling(query map[string]string, column map[string]interface{}) (*secFilings.CommonResp, error) {
|
||||
resp := &secFilings.CommonResp{}
|
||||
if err := db.DocDB.Model(&model.SecFilings{}).Where("filing_key = ?", query["filing_key"]).Updates(column).Error; err != nil {
|
||||
if err := db.DocDB.Model(&model.SecFilings{}).Where("filing_key = ? and filing_date = ?", query["filing_key"], query["filing_date"]).Updates(column).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.FilingKey = query["filing_key"]
|
||||
resp.Msg = "update success"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsDao) ListSecFiling(req *secFilings.ListSecFilingReq) (res []*model.SecFilings, total int64, err error) {
|
||||
@ -73,7 +73,7 @@ func (secFilingsDao) ListSecFiling(req *secFilings.ListSecFilingReq) (res []*mod
|
||||
query = query.Where("form LIKE ?", "%"+form+"%")
|
||||
}
|
||||
if req.FilingDateBegin != "" && req.FilingDateEnd != "" && req.FilingDateBegin > req.FilingDateEnd {
|
||||
return nil, 0, errors.New("开始日期超过结束日期")
|
||||
return nil, 0, errors.New("开始日期不能大于结束日期")
|
||||
|
||||
}
|
||||
|
||||
@ -141,6 +141,7 @@ func (secFilingsDao) UpdateSecFilingStatus(query map[string]string, column map[s
|
||||
return nil, err
|
||||
}
|
||||
resp.FilingKey = query["filing_key"]
|
||||
resp.Msg = "update status success"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsDao) ListFormType(req *secFilings.ListFormTypeReq) (res []*model.FormType, total int64, err error) {
|
||||
@ -156,27 +157,3 @@ func (secFilingsDao) ListFormType(req *secFilings.ListFormTypeReq) (res []*model
|
||||
}
|
||||
return res, total, nil
|
||||
}
|
||||
func (secFilingsDao) WebListSecFiling(req *secFilings.WebListSecFilingReq) (res []*model.SecFilings, total int64, err error) {
|
||||
query := db.DocDB.Model(&model.SecFilings{}).Where("status = ?", 2)
|
||||
if req.Year != "" {
|
||||
start := fmt.Sprintf("%s-01-01", req.Year)
|
||||
end := fmt.Sprintf("%s-12-31", req.Year)
|
||||
query = query.Where("filing_date BETWEEN ? AND ?", start, end)
|
||||
|
||||
}
|
||||
if err := query.Count(&total).Error; err != nil {
|
||||
return nil, total, err
|
||||
}
|
||||
if req.Page != 0 && req.PageSize != 0 {
|
||||
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
||||
}
|
||||
if req.SortField != "" {
|
||||
query = query.Order(fmt.Sprintf("%s %s", req.SortField, req.SortOrder))
|
||||
} else {
|
||||
query = query.Order("filing_date DESC")
|
||||
}
|
||||
if err := query.Find(&res).Error; err != nil {
|
||||
return nil, total, err
|
||||
}
|
||||
return res, total, nil
|
||||
}
|
||||
|
@ -16,18 +16,16 @@ var SecFilingsLogic = new(secFilingsLogic)
|
||||
func (secFilingsLogic) CreateSecFiling(req *secFilings.CreateSecFilingReq) (*secFilings.CommonResp, error) {
|
||||
resp, err := dao.SecFilingsDao.CreateSecFiling(req)
|
||||
if err != nil {
|
||||
return nil, errors.New("创建失败")
|
||||
return nil, errors.New("创建失败:" + err.Error())
|
||||
}
|
||||
resp.Msg = "创建成功"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) UpdateSecFiling(req *secFilings.UpdateSecFilingReq) (*secFilings.CommonResp, error) {
|
||||
if req.FilingKey == "" {
|
||||
return nil, errors.New("参数缺失")
|
||||
return nil, errors.New("filing_key is empty")
|
||||
}
|
||||
filingKey := model.GenFilingKey(req.FilingDate, req.Form, req.FileLink)
|
||||
column := map[string]interface{}{
|
||||
"filing_key": filingKey,
|
||||
"filing_date": req.FilingDate,
|
||||
"form": req.Form,
|
||||
"description": req.Description,
|
||||
"form_description": req.Description,
|
||||
@ -39,13 +37,14 @@ func (secFilingsLogic) UpdateSecFiling(req *secFilings.UpdateSecFilingReq) (*sec
|
||||
"operator_id": req.OperatorId,
|
||||
}
|
||||
query := map[string]string{
|
||||
"filing_key": req.FilingKey,
|
||||
"filing_key": req.FilingKey,
|
||||
"filing_date": req.FilingDate,
|
||||
}
|
||||
resp, err := dao.SecFilingsDao.UpdateSecFiling(query, column)
|
||||
if err != nil {
|
||||
return nil, errors.New("更新失败")
|
||||
return nil, errors.New("更新失败:" + err.Error())
|
||||
}
|
||||
resp.FilingKey = filingKey
|
||||
resp.Msg = "更新成功"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) ListSecFiling(req *secFilings.ListSecFilingReq) (*secFilings.SecFilingListResp, error) {
|
||||
@ -53,13 +52,13 @@ func (secFilingsLogic) ListSecFiling(req *secFilings.ListSecFilingReq) (*secFili
|
||||
datas := []*secFilings.SecFiling{}
|
||||
list, total, err := dao.SecFilingsDao.ListSecFiling(req)
|
||||
if err != nil {
|
||||
return nil, errors.New("查询失败")
|
||||
return nil, errors.New("查询失败:" + err.Error())
|
||||
}
|
||||
for _, item := range list {
|
||||
dataFiles := []*secFilings.DataFiles{}
|
||||
if item.DataFiles != nil && len(item.DataFiles) != 0 {
|
||||
if err := json.Unmarshal(item.DataFiles, &dataFiles); err != nil {
|
||||
return nil, errors.New("文件转换失败")
|
||||
return nil, errors.New("datafiles文件json转换失败: " + err.Error())
|
||||
}
|
||||
}
|
||||
datas = append(datas, &secFilings.SecFiling{
|
||||
@ -82,6 +81,7 @@ func (secFilingsLogic) ListSecFiling(req *secFilings.ListSecFilingReq) (*secFili
|
||||
})
|
||||
}
|
||||
resp.Total = uint32(total)
|
||||
resp.Msg = "查询成功"
|
||||
resp.Data = datas
|
||||
return resp, nil
|
||||
|
||||
@ -89,15 +89,15 @@ func (secFilingsLogic) ListSecFiling(req *secFilings.ListSecFilingReq) (*secFili
|
||||
func (secFilingsLogic) DetailSecFiling(req *secFilings.DetailSecFilingReq) (*secFilings.SecFilingDetailResp, error) {
|
||||
resp := &secFilings.SecFilingDetailResp{}
|
||||
if req.FilingKey == "" {
|
||||
return nil, errors.New("参数缺失")
|
||||
return nil, errors.New("filing_key is empty")
|
||||
}
|
||||
detail, err := dao.SecFilingsDao.DetailSecFiling(req)
|
||||
if err != nil {
|
||||
return nil, errors.New("查询失败")
|
||||
return nil, errors.New("查询失败:" + err.Error())
|
||||
}
|
||||
var dataFiles []*secFilings.DataFiles
|
||||
if err := json.Unmarshal(detail.DataFiles, &dataFiles); err != nil {
|
||||
return nil, errors.New("文件转换失败")
|
||||
return nil, errors.New("datafiles文件json转换失败: " + err.Error())
|
||||
}
|
||||
data := &secFilings.SecFiling{
|
||||
FilingKey: detail.FilingKey,
|
||||
@ -116,39 +116,41 @@ func (secFilingsLogic) DetailSecFiling(req *secFilings.DetailSecFilingReq) (*sec
|
||||
CreatedAt: time.Unix(detail.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||
UpdatedAt: time.Unix(detail.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
resp.Msg = "查询成功"
|
||||
resp.Data = data
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) DeleteSecFiling(req *secFilings.DeleteSecFilingReq) (*secFilings.CommonResp, error) {
|
||||
resp := &secFilings.CommonResp{}
|
||||
if req.FilingKey == "" {
|
||||
return nil, errors.New("参数缺失")
|
||||
return nil, errors.New("filing_key is empty")
|
||||
}
|
||||
if err := dao.SecFilingsDao.DeleteSecFiling(req); err != nil {
|
||||
return nil, errors.New("删除失败")
|
||||
return nil, errors.New("删除失败:" + err.Error())
|
||||
}
|
||||
resp.Msg = "删除成功"
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (secFilingsLogic) IsSecFilingExist(req *secFilings.IsSecFilingExistReq) (*secFilings.IsSecFilingExistResp, error) {
|
||||
resp := &secFilings.IsSecFilingExistResp{}
|
||||
if req.FilingDate == "" || req.Form == "" || req.FinalLink == "" {
|
||||
return nil, errors.New("参数缺失")
|
||||
return nil, errors.New("filing_date or form_type or final_link is empty")
|
||||
}
|
||||
filingKey := model.GenFilingKey(req.FilingDate, req.Form, req.FinalLink)
|
||||
exist, err := dao.SecFilingsDao.IsSecFilingExist(filingKey, req.FilingDate)
|
||||
if err != nil {
|
||||
return nil, errors.New("查询失败")
|
||||
return nil, errors.New("查询失败:" + err.Error())
|
||||
}
|
||||
resp.Exist = exist
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) UpdateSecFilingStatus(req *secFilings.UpdateSecFilingStatusReq) (*secFilings.CommonResp, error) {
|
||||
if req.FilingKey == "" {
|
||||
return nil, errors.New("参数缺失")
|
||||
return nil, errors.New("filing_key is empty")
|
||||
}
|
||||
if req.Status != 1 && req.Status != 2 {
|
||||
return nil, errors.New("状态值无效")
|
||||
return nil, errors.New("invalid status value")
|
||||
}
|
||||
column := map[string]interface{}{
|
||||
"status": req.Status,
|
||||
@ -160,15 +162,16 @@ func (secFilingsLogic) UpdateSecFilingStatus(req *secFilings.UpdateSecFilingStat
|
||||
}
|
||||
resp, err := dao.SecFilingsDao.UpdateSecFilingStatus(query, column)
|
||||
if err != nil {
|
||||
return nil, errors.New("更新状态失败")
|
||||
return nil, errors.New("更新状态失败:" + err.Error())
|
||||
}
|
||||
resp.Msg = "状态更新成功"
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) ListFormType(req *secFilings.ListFormTypeReq) (*secFilings.FormTypeListResp, error) {
|
||||
resp := &secFilings.FormTypeListResp{}
|
||||
list, total, err := dao.SecFilingsDao.ListFormType(req)
|
||||
if err != nil {
|
||||
return nil, errors.New("查询失败")
|
||||
return nil, errors.New("查询失败:" + err.Error())
|
||||
}
|
||||
for _, item := range list {
|
||||
resp.FormType = append(resp.FormType, &secFilings.FormType{
|
||||
@ -179,40 +182,3 @@ func (secFilingsLogic) ListFormType(req *secFilings.ListFormTypeReq) (*secFiling
|
||||
resp.Total = total
|
||||
return resp, nil
|
||||
}
|
||||
func (secFilingsLogic) WebListSecFiling(req *secFilings.WebListSecFilingReq) (*secFilings.WebListSecFilingResp, error) {
|
||||
resp := &secFilings.WebListSecFilingResp{}
|
||||
datas := []*secFilings.SecFiling{}
|
||||
list, total, err := dao.SecFilingsDao.WebListSecFiling(req)
|
||||
if err != nil {
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
for _, item := range list {
|
||||
dataFiles := []*secFilings.DataFiles{}
|
||||
if item.DataFiles != nil && len(item.DataFiles) != 0 {
|
||||
if err := json.Unmarshal(item.DataFiles, &dataFiles); err != nil {
|
||||
return nil, errors.New("文件转换失败")
|
||||
}
|
||||
}
|
||||
datas = append(datas, &secFilings.SecFiling{
|
||||
Idx: item.Id,
|
||||
FilingKey: item.FilingKey,
|
||||
FilingDate: item.FilingDate,
|
||||
Form: item.Form,
|
||||
Description: item.Description,
|
||||
FormDescription: item.FormDescription,
|
||||
FileLink: item.FileLink,
|
||||
DataFiles: dataFiles,
|
||||
PdfFile: item.PdfFile,
|
||||
WordFile: item.WordFile,
|
||||
ExcelFile: item.ExcelFile,
|
||||
Status: item.Status,
|
||||
Operator: item.Operator,
|
||||
OperatorId: item.OperatorId,
|
||||
CreatedAt: time.Unix(item.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||
UpdatedAt: time.Unix(item.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||
})
|
||||
}
|
||||
resp.Total = uint32(total)
|
||||
resp.Data = datas
|
||||
return resp, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user