manifest.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package storehouse
  2. import (
  3. "server/dao/godown"
  4. "server/model/common/request"
  5. )
  6. type ManifestService struct {
  7. }
  8. func (ms *ManifestService) QueryAllManifest() ([]godown.Manifest, error) {
  9. return godown.QueryAllManifest()
  10. }
  11. func (ms *ManifestService) QueryManifestList(info request.SearchManifest) (list interface{}, total int64, err error) {
  12. limit := info.PageInfo.PageSize
  13. offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
  14. return godown.QueryManifestList(limit, offset, info.Genre, info.Title)
  15. }
  16. func (ms *ManifestService) CreateManifest(manifest godown.Manifest) error {
  17. return manifest.CreateManifest()
  18. }
  19. func (ms *ManifestService) UpdateManifest(manifest godown.Manifest) error {
  20. return manifest.UpdateManifest()
  21. }
  22. func (ms *ManifestService) DeleteManifest(id int) error {
  23. return godown.DeleteManifest(id)
  24. }
  25. func (ms *ManifestService) CreateInboundManifest(manifest godown.Manifest) error {
  26. manifest.ManifestGenre = "入库"
  27. return godown.CreateInboundManifest(manifest.ManifestGenre, manifest.Title, manifest.Custodian, manifest.Cargos)
  28. }
  29. func (ms *ManifestService) CreateOutboundManifest(manifest godown.Manifest) error {
  30. manifest.ManifestGenre = "出库"
  31. return godown.CreateOutboundManifest(manifest.ManifestGenre, manifest.Title, manifest.Custodian, manifest.Cargos)
  32. }