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 { @Autowired private MobileService mobileService; @Autowired private TestMastService testMastService; @Transactional public ReturnT start() { try{ List testMasts = testMastService.selectList(new EntityWrapper().eq("status", 2)); if (Cools.isEmpty(testMasts)){ return SUCCESS; } for (TestMast testMast : testMasts){ mobileService.startUpTestPACK(testMast); } }catch (Exception e){ log.error("申请测试异常,请联系管理员!"); } return SUCCESS; } }