1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package logic
- import (
- "context"
- "GtDataStore/app/cmd/organization/internal/svc"
- "GtDataStore/app/cmd/organization/pb"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type FindWorkingUfByCycleLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewFindWorkingUfByCycleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindWorkingUfByCycleLogic {
- return &FindWorkingUfByCycleLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- func (l *FindWorkingUfByCycleLogic) FindWorkingUfByCycle(in *pb.FindWorkingUfByCycleReq) (*pb.FindWorkingUfByCycleResp, error) {
- res, err := l.svcCtx.WorkingUf.FindForCycleAndStep(l.ctx, in.ProjectId, in.DeviceCode, in.FilterCycle, in.Step, in.FilterTimeStart, in.FilterTimeEnd, in.Limit)
- if err != nil {
- return nil, err
- }
- list := make([]*pb.WorkingUf, len(res))
- for i, one := range res {
- list[i] = &pb.WorkingUf{
- Id: one.Id,
- ProjectId: one.ProjectId,
- DeviceCode: one.DeviceCode,
- WaterTemperature: one.WaterTemperature,
- FeedFlow: one.FeedFlow,
- ConFlow: one.ConFlow,
- ProductFlow: one.ProductFlow,
- FeedPressure: one.FeedPressure,
- ConPressure: one.ConPressure,
- ProductPressure: one.ProductPressure,
- Tmp: one.Tmp,
- Flux: one.Flux,
- FeedWqTurbidity: one.FeedWqTurbidity,
- FeedWqPh: one.FeedWqPh,
- ProductWqPh: one.ProductWqPh,
- FeedWqAl: one.FeedWqAl,
- ProductWqAl: one.ProductWqAl,
- FeedWqFe: one.FeedWqFe,
- ProductWqFe: one.ProductWqFe,
- FeedWqMn: one.FeedWqMn,
- ProductWqMn: one.ProductWqMn,
- FeedWqSio2: one.FeedWqSio2,
- ProductWqSio2: one.ProductWqSio2,
- FeedWqCod: one.FeedWqCod,
- ProductWqCod: one.ProductWqCod,
- FeedWqP: one.FeedWqP,
- ProductWqP: one.ProductWqP,
- Step: one.Step,
- FilterCycle: one.FilterCycle,
- FilterTime: one.FilterTime,
- CTime: one.CTime.Format("2006-01-02 15:04:05"),
- }
- }
- return &pb.FindWorkingUfByCycleResp{List: list}, nil
- }
|