| 1234567891011121314151617181920212223242526272829303132333435363738 |
- package contract
- import (
- "context"
- "dashoo.cn/common_definition/comm_def"
- "dashoo.cn/opms_libary/myerrors"
- service "dashoo.cn/opms_parent/app/service/contract"
- model "dashoo.cn/opms_parent/app/model/contract"
- "github.com/gogf/gf/frame/g"
- )
- type CtrContractApplication struct{}
- func (c *CtrContractApplication) CreateFromBusiness(ctx context.Context, req *model.CreateFromBusinessReq, rsp *comm_def.CommonMsg) error {
- g.Log().Infof("CtrContractApplication.CreateFromBusiness request %#v ", *req)
- if req.NboId <= 0 {
- return myerrors.ValidError("项目ID不能为空")
- }
- if req.NboName == "" {
- return myerrors.ValidError("项目名称不能为空")
- }
- s, err := service.NewCtrContractApplicationService(ctx)
- if err != nil {
- return err
- }
- id, err := s.CreateFromBusiness(req)
- if err != nil {
- return err
- }
- rsp.Msg = "合同申请已提交"
- rsp.Data = g.Map{"id": id}
- return nil
- }
|