| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- package contract
- import (
- "context"
- model "dashoo.cn/micro/app/model/contract"
- service "dashoo.cn/micro/app/service/contract"
- "dashoo.cn/common_definition/comm_def"
- "github.com/gogf/gf/frame/g"
- )
- type CtrContractCollectionPlan struct{}
- // 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)
- if err != nil {
- return err
- }
- ent, err := s.Get(ctx, req.Id)
- // _, err, code, msg := myerrors.CheckError(err)
- if err != nil {
- return err
- }
- //rsp.Code = code
- //rsp.Msg = msg
- rsp.Data = ent
- return nil
- }
- // 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)
- if err != nil {
- return err
- }
- total, ent, err := s.List(ctx, req)
- //_, err, code, msg := myerrors.CheckError(err)
- if err != nil {
- return err
- }
- if ent == nil {
- ent = []*model.CtrContractCollectionPlanListRsp{}
- }
- //rsp.Code = code
- //rsp.Msg = msg
- rsp.Data = map[string]interface{}{
- "total": total,
- "list": ent,
- }
- return nil
- }
- // 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)
- if err != nil {
- return err
- }
- id, err := s.Add(ctx, req)
- //_, err, code, msg := myerrors.CheckError(err)
- if err != nil {
- return err
- }
- //rsp.Code = code
- //rsp.Msg = msg
- rsp.Data = id
- return nil
- }
- // 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)
- if err != nil {
- return err
- }
- err = s.Update(ctx, req)
- //_, err, code, msg := myerrors.CheckError(err)
- if err != nil {
- return err
- }
- //rsp.Code = code
- //rsp.Msg = msg
- return nil
- }
- // 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)
- if err != nil {
- return err
- }
- err = s.Delete(ctx, req.Id)
- //_, err, code, msg := myerrors.CheckError(err)
- if err != nil {
- return err
- }
- //rsp.Code = code
- //rsp.Msg = msg
- return nil
- }
|