luxiaotao1123
2024-03-26 9c248839d8750db523fe6192101bfa085fe1305f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.zy.asrs.wcs.rcs.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
import com.zy.asrs.wcs.core.model.enums.MotionStsType;
import com.zy.asrs.wcs.core.service.DeviceCtgService;
import com.zy.asrs.wcs.rcs.mapper.MotionMapper;
import com.zy.asrs.wcs.rcs.entity.Motion;
import com.zy.asrs.wcs.rcs.service.MotionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.asrs.wcs.rcs.service.MotionStsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("motionService")
public class MotionServiceImpl extends ServiceImpl<MotionMapper, Motion> implements MotionService {
 
    @Autowired
    private DeviceCtgService deviceCtgService;
    @Autowired
    private MotionStsService motionStsService;
 
    @Override
    public List<Motion> selectUnCompleteByUuidAndDeviceCtg(String uuid, DeviceCtgType deviceCtgType) {
        return this.list(new LambdaQueryWrapper<Motion>()
                .eq(Motion::getUuid, uuid)
                .eq(Motion::getDeviceCtg, deviceCtgService.selectByFlag(deviceCtgType.toString()).getId())
                .lt(Motion::getMotionSts, motionStsService.selectByFlag(MotionStsType.COMPLETE.toString()).getId())
                .orderByDesc(Motion::getPriority)
        );
    }
}