自动化立体仓库 - WMS系统
野心家
2023-06-20 5ce6bfb2e237b9fbf092a03cf80e86d928ac7ca6
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
35
36
37
38
39
40
41
42
43
44
45
46
package com.zy.asrs.task.handler;
 
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.TestMast;
import com.zy.asrs.service.MobileService;
import com.zy.asrs.service.TestMastService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;
 
/**
 * Created by vincent on 2020/7/6
 */
@Service
@Slf4j
public class StarUpTestPACKHandler extends AbstractHandler<String> {
    @Autowired
    private MobileService mobileService;
    @Autowired
    private TestMastService testMastService;
 
    @Transactional
    public ReturnT<String> start() {
        try{
            List<TestMast> testMasts = testMastService.selectList(new EntityWrapper<TestMast>().eq("status", 2));
            if (Cools.isEmpty(testMasts)){
                return SUCCESS;
            }
            for (TestMast testMast : testMasts){
                mobileService.startUpTestPACK(testMast);
            }
 
        }catch (Exception e){
            log.error("申请测试异常,请联系管理员!");
        }
        return SUCCESS;
    }
 
}