ソースを参照

Merge remote-tracking branch 'origin/develop' into develop

ZZH-wl 3 年 前
コミット
9bf7a2e1fe

+ 7 - 7
opms_parent/app/handler/contract/ctr_contract.go

@@ -12,7 +12,7 @@ import (
 
 type CtrContract struct{}
 
-// swagger:route 合同,测试tag 合同详情
+// Swagger:CtrContract 合同,测试tag 合同详情
 func (c *CtrContract) Get(ctx context.Context, req *model.IdRequiredReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Get request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -31,7 +31,7 @@ func (c *CtrContract) Get(ctx context.Context, req *model.IdRequiredReq, rsp *co
 	return nil
 }
 
-// swagger:route 合同,测试tag 查询合同
+// Swagger:CtrContract 合同,测试tag 查询合同
 func (c *CtrContract) List(ctx context.Context, req *model.CtrContractListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.List request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -56,7 +56,7 @@ func (c *CtrContract) List(ctx context.Context, req *model.CtrContractListReq, r
 	return nil
 }
 
-// swagger:route 合同,测试tag 查询合同动态列表
+// Swagger:CtrContract 合同,测试tag 查询合同动态列表
 func (c *CtrContract) DynamicsList(ctx context.Context, req *model.CtrContractDynamicsListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.GetDynamicsList request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -81,7 +81,7 @@ func (c *CtrContract) DynamicsList(ctx context.Context, req *model.CtrContractDy
 	return nil
 }
 
-// swagger:route 合同,测试tag 新增合同
+// Swagger:CtrContract 合同,测试tag 新增合同
 func (c *CtrContract) Add(ctx context.Context, req *model.CtrContractAddReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Add request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -100,7 +100,7 @@ func (c *CtrContract) Add(ctx context.Context, req *model.CtrContractAddReq, rsp
 	return nil
 }
 
-// swagger:route 合同,测试tag 更新合同
+// Swagger:CtrContract 合同,测试tag 更新合同
 func (c *CtrContract) Update(ctx context.Context, req *model.CtrContractUpdateReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Update request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -117,7 +117,7 @@ func (c *CtrContract) Update(ctx context.Context, req *model.CtrContractUpdateRe
 	return nil
 }
 
-// swagger:route 合同,测试tag 转移合同
+// Swagger:CtrContract 合同,测试tag 转移合同
 func (c *CtrContract) Transfer(ctx context.Context, req *model.CtrContractTransferReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Transfer request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -135,7 +135,7 @@ func (c *CtrContract) Transfer(ctx context.Context, req *model.CtrContractTransf
 }
 
 // 多行注释测试
-// swagger:route 合同,测试tag 删除合同
+// Swagger:CtrContract 合同,测试tag 删除合同
 // 多行注释测试
 func (c *CtrContract) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Delete request %#v ", *req)

+ 4 - 4
opms_parent/app/handler/contract/ctr_contract_append.go

@@ -12,7 +12,7 @@ import (
 
 type CtrContractAppend struct{}
 
-// swagger:route 合同附件 查询合同附件
+// Swagger:CtrContractAppend 合同附件 查询合同附件
 func (c *CtrContractAppend) List(ctx context.Context, req *model.CtrContractAppendListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractAppend.List request %#v ", *req)
 	s, err := service.NewCtrContractAppendService(ctx)
@@ -36,7 +36,7 @@ func (c *CtrContractAppend) List(ctx context.Context, req *model.CtrContractAppe
 	return nil
 }
 
-// swagger:route 合同附件 添加合同附件
+// Swagger:CtrContractAppend 合同附件 添加合同附件
 func (c *CtrContractAppend) Add(ctx context.Context, req *model.CtrContractAppendAddReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractAppend.Add request %#v ", *req)
 	s, err := service.NewCtrContractAppendService(ctx)
@@ -54,7 +54,7 @@ func (c *CtrContractAppend) Add(ctx context.Context, req *model.CtrContractAppen
 	return nil
 }
 
-// swagger:route 合同附件 更新合同附件
+// Swagger:CtrContractAppend 合同附件 更新合同附件
 func (c *CtrContractAppend) Update(ctx context.Context, req *model.CtrContractAppendUpdateReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractAppend.Update request %#v ", *req)
 	s, err := service.NewCtrContractAppendService(ctx)
@@ -71,7 +71,7 @@ func (c *CtrContractAppend) Update(ctx context.Context, req *model.CtrContractAp
 	return nil
 }
 
-// swagger:route 合同附件 删除合同附件
+// Swagger:CtrContractAppend 合同附件 删除合同附件
 func (c *CtrContractAppend) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractAppend.Delete request %#v ", *req)
 	s, err := service.NewCtrContractAppendService(ctx)

+ 4 - 4
opms_parent/app/handler/contract/ctr_contract_collection.go

@@ -12,7 +12,7 @@ import (
 
 type CtrContractCollection struct{}
 
-// swagger:route 合同回款 查询合同回款
+// Swagger:CtrContractCollection 合同回款 查询合同回款
 func (c *CtrContractCollection) List(ctx context.Context, req *model.CtrContractCollectionListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollection.List request %#v ", *req)
 	s, err := service.NewCtrContractCollectionService(ctx)
@@ -36,7 +36,7 @@ func (c *CtrContractCollection) List(ctx context.Context, req *model.CtrContract
 	return nil
 }
 
-// swagger:route 合同回款 添加合同回款
+// Swagger:CtrContractCollection 合同回款 添加合同回款
 func (c *CtrContractCollection) Add(ctx context.Context, req *model.CtrContractCollectionAddReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollection.Add request %#v ", *req)
 	s, err := service.NewCtrContractCollectionService(ctx)
@@ -54,7 +54,7 @@ func (c *CtrContractCollection) Add(ctx context.Context, req *model.CtrContractC
 	return nil
 }
 
-// swagger:route 合同回款 更新合同回款
+// Swagger:CtrContractCollection 合同回款 更新合同回款
 func (c *CtrContractCollection) Update(ctx context.Context, req *model.CtrContractCollectionUpdateReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollection.Update request %#v ", *req)
 	s, err := service.NewCtrContractCollectionService(ctx)
@@ -71,7 +71,7 @@ func (c *CtrContractCollection) Update(ctx context.Context, req *model.CtrContra
 	return nil
 }
 
-// swagger:route 合同回款 删除合同回款
+// Swagger:CtrContractCollection 合同回款 删除合同回款
 func (c *CtrContractCollection) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollection.Delete request %#v ", *req)
 	s, err := service.NewCtrContractCollectionService(ctx)

+ 5 - 5
opms_parent/app/handler/contract/ctr_contract_collection_plan.go

@@ -12,7 +12,7 @@ import (
 
 type CtrContractCollectionPlan struct{}
 
-// swagger:route 合同回款计划 合同回款计划详情
+// Swagger:CtrContractCollectionPlan 合同回款计划 合同回款计划详情
 func (c *CtrContractCollectionPlan) Get(ctx context.Context, req *model.IdRequiredReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollectionPlan.Get request %#v ", *req)
 	s, err := service.NewCtrContractCollectionPlanService(ctx)
@@ -30,7 +30,7 @@ func (c *CtrContractCollectionPlan) Get(ctx context.Context, req *model.IdRequir
 	return nil
 }
 
-// swagger:route 合同回款计划 查询合同回款计划
+// Swagger:CtrContractCollectionPlan 合同回款计划 查询合同回款计划
 func (c *CtrContractCollectionPlan) List(ctx context.Context, req *model.CtrContractCollectionPlanListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollectionPlan.List request %#v ", *req)
 	s, err := service.NewCtrContractCollectionPlanService(ctx)
@@ -54,7 +54,7 @@ func (c *CtrContractCollectionPlan) List(ctx context.Context, req *model.CtrCont
 	return nil
 }
 
-// swagger:route 合同回款计划 添加合同回款计划
+// Swagger:CtrContractCollectionPlan 合同回款计划 添加合同回款计划
 func (c *CtrContractCollectionPlan) Add(ctx context.Context, req *model.CtrContractCollectionPlanAddReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollectionPlan.Add request %#v ", *req)
 	s, err := service.NewCtrContractCollectionPlanService(ctx)
@@ -72,7 +72,7 @@ func (c *CtrContractCollectionPlan) Add(ctx context.Context, req *model.CtrContr
 	return nil
 }
 
-// swagger:route 合同回款计划 更新合同回款计划
+// Swagger:CtrContractCollectionPlan 合同回款计划 更新合同回款计划
 func (c *CtrContractCollectionPlan) Update(ctx context.Context, req *model.CtrContractCollectionPlanUpdateReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollectionPlan.Update request %#v ", *req)
 	s, err := service.NewCtrContractCollectionPlanService(ctx)
@@ -89,7 +89,7 @@ func (c *CtrContractCollectionPlan) Update(ctx context.Context, req *model.CtrCo
 	return nil
 }
 
-// swagger:route 合同回款计划 删除合同回款计划
+// Swagger:CtrContractCollectionPlan 合同回款计划 删除合同回款计划
 func (c *CtrContractCollectionPlan) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractCollectionPlan.Delete request %#v ", *req)
 	s, err := service.NewCtrContractCollectionPlanService(ctx)

+ 4 - 4
opms_parent/app/handler/contract/ctr_contract_invoice.go

@@ -12,7 +12,7 @@ import (
 
 type CtrContractInvoice struct{}
 
-// swagger:route 合同发票 查询合同发票
+// Swagger:CtrContractInvoice 合同发票 查询合同发票
 func (c *CtrContractInvoice) List(ctx context.Context, req *model.CtrContractInvoiceListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractInvoice.List request %#v ", *req)
 	s, err := service.NewCtrContractInvoiceService(ctx)
@@ -36,7 +36,7 @@ func (c *CtrContractInvoice) List(ctx context.Context, req *model.CtrContractInv
 	return nil
 }
 
-// swagger:route 合同发票 添加合同发票
+// Swagger:CtrContractInvoice 合同发票 添加合同发票
 func (c *CtrContractInvoice) Add(ctx context.Context, req *model.CtrContractInvoiceAddReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractInvoice.Add request %#v ", *req)
 	s, err := service.NewCtrContractInvoiceService(ctx)
@@ -54,7 +54,7 @@ func (c *CtrContractInvoice) Add(ctx context.Context, req *model.CtrContractInvo
 	return nil
 }
 
-// swagger:route 合同发票 更新合同发票
+// Swagger:CtrContractInvoice 合同发票 更新合同发票
 func (c *CtrContractInvoice) Update(ctx context.Context, req *model.CtrContractInvoiceUpdateReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractInvoice.Update request %#v ", *req)
 	s, err := service.NewCtrContractInvoiceService(ctx)
@@ -68,7 +68,7 @@ func (c *CtrContractInvoice) Update(ctx context.Context, req *model.CtrContractI
 	return nil
 }
 
-// swagger:route 合同发票 删除合同发票
+// Swagger:CtrContractInvoice 合同发票 删除合同发票
 func (c *CtrContractInvoice) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContractInvoice.Delete request %#v ", *req)
 	s, err := service.NewCtrContractInvoiceService(ctx)

+ 13 - 14
opms_parent/app/handler/cust/customer.go

@@ -17,7 +17,7 @@ type CustomerHeader struct{}
 var isPublic, noPublic = "10", "20" // 公海,非公海
 var noCustomer = true               // 区分公海列表 和 客户列表 true  公海
 
-//GetList 客户列表
+//Swagger:Customer 客户,测试tag 客户列表
 func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
 	customerServer, err := server.NewCustomerService(ctx)
 	if err != nil {
@@ -32,7 +32,7 @@ func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSea
 
 }
 
-//PublicGetList 公海列表
+//Swagger:Customer 客户,测试tag 公海列表
 func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCustomerSearchReq, rsp *comm_def.CommonMsg) error {
 	customerServer, err := server.NewCustomerService(ctx)
 	if err != nil {
@@ -51,8 +51,7 @@ func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCusto
 	return nil
 
 }
-
-//Create 创建客户
+//Swagger:Customer 客户,测试tag 创建客户
 func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq, rsp *comm_def.CommonMsg) error {
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
 		return err
@@ -73,7 +72,7 @@ func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq,
 	return nil
 }
 
-//UpdateById 修改客户
+//Swagger:Customer 客户,测试tag 修改客户
 func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustomer, rsp *comm_def.CommonMsg) error {
 	s, err := server.NewCustomerService(ctx)
 	if err != nil {
@@ -89,7 +88,7 @@ func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustom
 	return nil
 }
 
-//GetEntityById  客户详情
+//Swagger:Customer 客户,测试tag 客户详情
 func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
 	if len(req.Ids) == 0 {
 		return myerrors.ValidError("参数有误")
@@ -107,7 +106,7 @@ func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq
 	return nil
 }
 
-//DeleteById 删除客户
+//Swagger:Customer 客户,测试tag 删除客户
 func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer, rsp *comm_def.CommonMsg) error {
 	if len(req.Ids) == 0 {
 		return myerrors.ValidError("参数有误")
@@ -125,7 +124,7 @@ func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer,
 	return nil
 }
 
-//GetCustNameIsExist 判断客户名称是否存在  bool
+//Swagger:Customer 客户,测试tag 判断客户名称是否存在
 func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsExistsCustName, rsp *comm_def.CommonMsg) error {
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
 		return err
@@ -142,7 +141,7 @@ func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsEx
 	return nil
 }
 
-//TransCustomer 转移客户
+// 客户,测试tag  转移客户
 func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
 	if len(req.Ids) == 0 || req.SalesId == 0 {
 		return myerrors.ValidError("参数有误")
@@ -161,7 +160,7 @@ func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCus
 	return nil
 }
 
-//AssignCustomer 分配,领取客户
+// 客户,测试tag  分配 领取客户
 func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
 	if len(req.Ids) == 0 || req.SalesId == 0 {
 		return myerrors.ValidError("参数有误")
@@ -185,7 +184,7 @@ func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCu
 
 }
 
-//MoveToPubic 移入公海
+// 客户,测试tag  移入公海
 func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubicRep, rsp *comm_def.CommonMsg) error {
 	if len(req.Ids) == 0 {
 		return myerrors.ValidError("参数有误")
@@ -206,7 +205,7 @@ func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubic
 	return nil
 }
 
-//GetDynamicsList 客户动态
+// 客户,测试tag  客户动态
 func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.CustomerDynameicsReq, rsp *comm_def.CommonMsg) error {
 	customerServer, err := server.NewCustomerService(ctx)
 	if err != nil {
@@ -220,7 +219,7 @@ func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.Custome
 	return nil
 }
 
-//MergeCustomer 合并客户
+// 客户,测试tag  合并客户
 func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCustomerRep, rsp *comm_def.CommonMsg) error {
 	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
 		return err
@@ -238,7 +237,7 @@ func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCust
 	return nil
 }
 
-//GetCustAbstract 客户摘要
+// 客户,测试tag  客户摘要
 func (c *CustomerHeader) GetCustAbstract(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
 	if req.Id == 0 {
 		return myerrors.ValidError("参数有误")

+ 2 - 2
opms_parent/app/handler/plat/schedule.go

@@ -20,7 +20,7 @@ func (h *ScheduleHeader) GetList(ctx context.Context, req *model.ScheduleSearchR
 		return err
 	}
 	total, list, err := s.GetList(req)
-	//_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+
 	if err != nil {
 		return err
 	}
@@ -39,7 +39,7 @@ func (h *ScheduleHeader) Create(ctx context.Context, req *model.AddScheduleSeq,
 		return err
 	}
 	id, err := s.Create(req)
-//	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+
 	if err != nil {
 
 		return err

+ 1 - 7
opms_parent/app/handler/work/workorder.go → opms_parent/app/handler/work/work_order.go

@@ -12,17 +12,15 @@ import (
 
 type WorkOrderHandler struct{}
 
-//工单列表
+// Swagger:WorkOrder 工单,测试tag 工单列表
 func (w *WorkOrderHandler) GetList(ctx context.Context, req *model.WorkOrderSearchReq, rsp *comm_def.CommonMsg) error {
 
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	total, list, err := orderServer.GetList(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": list, "total": total}
@@ -34,12 +32,10 @@ func (w *WorkOrderHandler) GetList(ctx context.Context, req *model.WorkOrderSear
 func (w *WorkOrderHandler) DeriveList(ctx context.Context, req *model.WorkOrderExport, rsp *comm_def.CommonMsg) error {
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	con, err := orderServer.DeriveList(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": con}
@@ -51,12 +47,10 @@ func (w *WorkOrderHandler) DeriveList(ctx context.Context, req *model.WorkOrderE
 func (w *WorkOrderHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
 	orderServer, err := server.NewOrderService(ctx)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	detail, err := orderServer.GetEntityById(req)
 	if err != nil {
-		g.Log().Error(err)
 		return err
 	}
 	rsp.Data = g.Map{"list": detail}

+ 2 - 2
opms_parent/app/model/contract/ctr_contract.go

@@ -55,8 +55,8 @@ type CtrAddProduct struct {
 }
 
 type CtrContractAddReq struct {
-	ContractCode string `json:"contractCode"` // 合同编号
-	ContractName string `json:"contractName"` // 合同名称
+	ContractCode string `json:"contractCode"`                      // 合同编号
+	ContractName string `json:"contractName" v:"required#请输入合同名称"` // 合同名称
 	// CustId            int         `json:"custId"`            // 关联客户
 	// CustName          string      `json:"custName"`          // 客户名称
 	NboId int `json:"nboId"` // 关联项目

+ 4 - 4
opms_parent/app/model/cust/cust_customer.go

@@ -46,18 +46,18 @@ type CustExport struct {
 
 //CustomerAddSeq 单表添加客户信息表
 type CustomerAddSeq struct {
-	CustName     string      `p:"custName"        json:"custName"      v:"required#客户名称不能为空"`
+	CustName     string      `p:"custName"        json:"custName"      v:"required#客户名称不能为空"` // 客户名称
 	AbbrName     string      `p:"abbrName"        json:"abbrName"   `                         // 助计名
 	CustLocation string      `p:"custLocation"    json:"custLocation"    `                    // 所在地区
 	CustAddress  string      `p:"custAddress"     json:"custAddress"   `                      // 详细地址
 	FollowUpDate *gtime.Time `p:"followUpDate"    json:"followUpDate"   `                     //跟进时间
 	CustIndustry string      `p:"custIndustry"    json:"custIndustry"  v:"required#客户行业不能为空"` //客户行业
 	CustLevel    string      `p:"custLevel"       json:"custLevel"     v:"required#客户级别不能为空"` //客户级别
-	CustSource   string      `p:"custSource"      json:"source"        v:"required#客户来源不能为空"`
+	CustSource   string      `p:"custSource"      json:"source"        v:"required#客户来源不能为空"` //客户来源
 	CustDistCode int         `p:"custDistCode"    json:"custDistCode"  v:"required#省份不能为空" ` // 省份Id
 	Remark       string      `p:"remark"          json:"remark""`                            //备注
-	SalesName    string      `p:"salesName"       json:"salesName"   `                       //
-	SalesId      int         `p:"salesId"         json:"salesId"   `                         //
+	SalesName    string      `p:"salesName"       json:"salesName"   `                       // 销售名称
+	SalesId      int         `p:"salesId"         json:"salesId"   `                         // 销售id
 }
 
 // 客户联系人信息

+ 2 - 2
opms_parent/app/model/work/work_order.go

@@ -8,11 +8,11 @@ import (
 	"dashoo.cn/opms_libary/request"
 	"github.com/gogf/gf/os/gtime"
 
-	internal2 "dashoo.cn/micro/app/model/work/internal"
+	 "dashoo.cn/micro/app/model/work/internal"
 )
 
 // WorkOrder is the golang structure for table work_order.
-type WorkOrder internal2.WorkOrder
+type WorkOrder internal.WorkOrder
 
 // Fill with you ideas below.
 

+ 2 - 2
opms_parent/app/service/plat/plat_schedule.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"strings"
 
+	"dashoo.cn/opms_libary/myerrors"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/util/gconv"
 
@@ -39,9 +40,8 @@ func (s *scheduleService) GetList(req *model.ScheduleSearchReq) (total int, sche
 	}
 	total, err = Model.Count()
 	if err != nil {
-
 		g.Log().Error(err)
-		//err = myerrors.DbError("获取总行数失败。")
+		err = myerrors.DbError("获取总行数失败。")
 		return
 	}
 	err = Model.Page(req.GetPage()).Order("id desc").Scan(&scheduleList)

+ 12 - 16
opms_parent/app/service/work/work_order.go

@@ -6,9 +6,8 @@ import (
 	"strconv"
 
 	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
 	"github.com/360EntSecGroup-Skylar/excelize"
-	"github.com/gogf/gf/errors/gerror"
-	"github.com/gogf/gf/frame/g"
 
 	"dashoo.cn/micro/app/dao/work"
 	model "dashoo.cn/micro/app/model/work"
@@ -34,21 +33,19 @@ func NewOrderService(ctx context.Context) (svc *OrderService, err error) {
 }
 
 //列表
-func (w *OrderService) GetList(req *model.WorkOrderSearchReq) (total int, OrderList []*model.WorkOrderList, err error) {
-	Model := w.Dao.M
-	Model.Where(w.Dao.Columns.DeletedTime + " is null ")
+func (s *OrderService) GetList(req *model.WorkOrderSearchReq) (total int, OrderList []*model.WorkOrderList, err error) {
+	Model := s.Dao
 	//工单类型
 	if req.OrderTypeId != 0 {
-		Model.Where(w.Dao.Columns.OrderTypeId, req.OrderTypeId)
+		Model.Where(s.Dao.Columns.OrderTypeId, req.OrderTypeId)
 	}
 	//工单状态
 	if req.OrderStatus != "" {
-		Model.Where(w.Dao.Columns.OrderStatus, req.OrderStatus)
+		Model.Where(s.Dao.Columns.OrderStatus, req.OrderStatus)
 	}
 	total, err = Model.Fields().Count()
 	if err != nil {
-		g.Log().Error(err)
-		err = gerror.New("获取总行数失败")
+		err = myerrors.DbError("获取总行数失败。")
 		return
 	}
 	if req.PageNum == 0 {
@@ -62,10 +59,10 @@ func (w *OrderService) GetList(req *model.WorkOrderSearchReq) (total int, OrderL
 }
 
 // 导出
-func (w *OrderService) DeriveList(req *model.WorkOrderExport) (content *model.WorkByteExport, err error) {
+func (s *OrderService) DeriveList(req *model.WorkOrderExport) (content *model.WorkByteExport, err error) {
 	var con model.WorkByteExport
 	req.WorkOrderSearchReq.PageSize = 10
-	total, data, err := w.GetList(&req.WorkOrderSearchReq)
+	total, data, err := s.GetList(&req.WorkOrderSearchReq)
 	if err != nil {
 		return
 	}
@@ -110,12 +107,11 @@ func (w *OrderService) DeriveList(req *model.WorkOrderExport) (content *model.Wo
 }
 
 //详情
-func (w *OrderService) GetEntityById(req *comm_def.IdReq) (detail *model.WorkDetail, err error) {
-	Model := w.Dao.M
-	err = Model.Where(w.Dao.Columns.DeletedTime+" is null ").Where(w.Dao.Columns.Id, req.Id).Scan(&detail)
+func (s *OrderService) GetEntityById(req *comm_def.IdReq) (detail *model.WorkDetail, err error) {
+	Model := s.Dao
+	err = Model.Where(s.Dao.Columns.Id, req.Id).Scan(&detail)
 	if err != nil {
-		g.Log().Error(err)
-		gerror.New("获取详情失败")
+		err = myerrors.DbError("获取详情失败。")
 		return
 	}
 	return

+ 1 - 0
opms_parent/config/config.toml

@@ -6,6 +6,7 @@
     need-advertise-addr = false
     srv-name = "dashoo.opms.parent-0.0.1"
     env = "dev"
+    swagger = true
 
 # 微服务注册中心配置
 [service_registry]

+ 6 - 4
opms_parent/main.go

@@ -2,9 +2,10 @@ package main
 
 import (
 	"context"
-	"dashoo.cn/opms_libary/myerrors"
 	"net/http"
 
+	"dashoo.cn/opms_libary/myerrors"
+
 	"dashoo.cn/opms_libary/micro_srv"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/os/glog"
@@ -15,6 +16,7 @@ import (
 	"dashoo.cn/micro/app/handler/cust"
 	"dashoo.cn/micro/app/handler/plat"
 	projHandler "dashoo.cn/micro/app/handler/proj"
+	"dashoo.cn/micro/app/handler/work"
 )
 
 func main() {
@@ -48,7 +50,7 @@ func main() {
 	s.RegisterName("CtrContractCollection", new(contract.CtrContractCollection), "")
 	s.RegisterName("CtrContractAppend", new(contract.CtrContractAppend), "")
 	s.RegisterName("CtrContractInvoice", new(contract.CtrContractInvoice), "")
-
+	s.RegisterName("WorkOrder", new(work.WorkOrderHandler), "")
 	s.RegisterName("Schedule", new(plat.ScheduleHeader), "")
 
 	// 注册服务对象
@@ -92,7 +94,7 @@ func swaggerui() {
 	if !g.Config().GetBool("setting.swagger") {
 		return
 	}
-	glog.Info("start swagger at :8080")
-	glog.Error(http.ListenAndServe(":8080",
+	glog.Info("start swagger at :18080")
+	glog.Error(http.ListenAndServe(":18080",
 		http.FileServer(http.Dir("./swaggerui/"))))
 }

+ 2 - 2
opms_parent/swaggerui/index.html

@@ -57,7 +57,7 @@
           }
           console.log(req)
           // let serviceUrl = "http://192.168.0.105:9981/dashoo.dev.lims.micro_learning-1.0"
-          let serviceUrl = "http://192.168.0.252:8100/dashoo.dev.opms.parent-0.0.1"
+          let serviceUrl = "http://192.168.0.83:9981/dashoo.opms.parent-0.0.1"
           let reqUrl = new URL(req.url)
           let urlInfo = reqUrl.pathname.substring(1).split('.')
           if (urlInfo.length < 2) {
@@ -68,7 +68,7 @@
           let token = req.headers.Authorization
           if (!token) {
             // token = "Bearer ajg7o1Dts1JrKCm6VtgyuuaYbUIiirXxI5+6WzYnC7gWl+43NdKq6LbWxU1zWhsBaL0A/CIkBoefM0vuu6h4ZA=="
-            token = "Bearer 5a9R22RiKGsqBigUbLyd6xpdKYbMJdTw9Aowx8cmbm2qH1V5W3xxR4gNAic8PuG/"
+            token = "Bearer zJi/xqrZflnSrapwY+wSWPJ3eWbfKWl4YSeZAGpxTXQn+Q00mDJXwfBawghR97AM"
             // token = "Bearer EyQWHd05nop+PL71oABt/1i0zoXd7bym1bFMWMXorORLmyDuyowEDoiKq8DhP2lbZo9XTSMe31d0Q7RRnkDNLA=="
             // token = "Bearer 7XrzVhU+ibTV/77q7h0ETY+bEWy4r4g9wteUr/43vNadbuWG5y8wucSmeU0BRd/1"
           }

+ 4 - 4
opms_parent/swaggerui/readme.md

@@ -1,12 +1,12 @@
 
 
-- 在 handler 中要生成文档的函数上添加注释
+- 在 handler 中要生成文档的函数上,按照以下格式添加注释
 
-    `// swagger:route tag1,tag2 接口名称`
+    `// Swagger:ServicePath tag1,tag2 接口名称`
 
     例如
 
-    `// swagger:route 合同 转移合同`
+    `// Swagger:CtrContract 合同 转移合同`
 
 - 然后运行下面的命令生成 swagger.yml
 
@@ -16,4 +16,4 @@
 
     `swagger = true`
 
-    启动服务即可在 8080 端口访问到 swagger 文档
+    启动服务即可在 18080 端口访问到 swagger 文档

+ 23 - 1
opms_parent/swaggerui/swagger.go

@@ -152,6 +152,7 @@ type SwaggerModel struct {
 	Items       *SwaggerModel            `yaml:"items,omitempty"`
 	Ref         string                   `yaml:"ref,omitempty"`
 	Embedded    bool                     `yaml:"embedded,omitempty"`
+	Required    []string                 `yaml:"required,omitempty"`
 }
 
 func RangeSwaggerModel(node *SwaggerModel) []*SwaggerModel {
@@ -402,7 +403,8 @@ func detectPath(fd *ast.FuncDecl) {
 	debugLog("//////////%v %s %s %s %s", fd, fname, recv, req, fd.Doc.Text())
 	commentText := fd.Doc.Text()
 	for _, c := range strings.Split(commentText, "\n") {
-		if !strings.HasPrefix(c, "swagger:route") {
+		c = strings.TrimSpace(c)
+		if !strings.HasPrefix(c, "Swagger:") {
 			continue
 		}
 		names := strings.Split(c, " ")
@@ -411,6 +413,10 @@ func detectPath(fd *ast.FuncDecl) {
 		if len(names) == 3 {
 			tags = strings.Split(names[1], ",")
 			summary = names[2]
+			recvNamed := strings.Split(names[0], ":")
+			if len(recvNamed) == 2 {
+				recv = recvNamed[1]
+			}
 		}
 		path := fmt.Sprintf("/%s.%s", recv, fname)
 		operationId := recv + fname
@@ -659,6 +665,7 @@ func buildFromStruct(declFile *ast.File, st *types.Struct, desc string) (error,
 	// 	}
 	// }
 
+	required := []string{}
 	properties := map[string]*SwaggerModel{}
 	for i := 0; i < st.NumFields(); i++ {
 		fld := st.Field(i)
@@ -711,6 +718,20 @@ func buildFromStruct(declFile *ast.File, st *types.Struct, desc string) (error,
 		if afld.Comment != nil {
 			commentText = afld.Comment.Text()
 		}
+
+		// if strings.Contains(commentText, "required") {
+		// 	required = append(required, name)
+		// }
+		if afld.Tag != nil {
+			tagstr := strings.Split(afld.Tag.Value, "v:")
+			if len(tagstr) > 1 {
+				if strings.Contains(tagstr[1], "required") {
+					required = append(required, name)
+				}
+			}
+			// debugLog("------------------------------%s", afld.Tag.Value)
+		}
+
 		err, ret := buildFromType(fld.Type(), declFile, commentText)
 		if err != nil {
 			return err, nil
@@ -734,6 +755,7 @@ func buildFromStruct(declFile *ast.File, st *types.Struct, desc string) (error,
 	return nil, &SwaggerModel{
 		Type:        "object",
 		Properties:  properties,
+		Required:    required,
 		Description: desc,
 	}
 }