| | |
| | | import com.zy.core.thread.StationThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import com.zy.system.service.HighPrivilegeGrantService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private DeviceConfigService deviceConfigService; |
| | | @Autowired |
| | | private HighPrivilegeGrantService highPrivilegeGrantService; |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | |
| | | // 移库任务 |
| | | @PostMapping("/createLocMoveTask") |
| | |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean directCancel = false; |
| | | try { |
| | | highPrivilegeGrantService.assertGranted(request.getHeader("token"), "取消任务"); |
| | | directCancel = true; |
| | | } catch (CoolException ignore) { |
| | | } |
| | | boolean completeTask = commonService.cancelTask(param, directCancel); |
| | | boolean completeTask = commonService.cancelTask(param); |
| | | if (completeTask) { |
| | | return R.ok(); |
| | | } |
| | |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean directCancel = false; |
| | | try { |
| | | highPrivilegeGrantService.assertGranted(request.getHeader("token"), "取消任务"); |
| | | directCancel = true; |
| | | } catch (CoolException ignore) { |
| | | } |
| | | CancelTaskBatchResult result = commonService.cancelTaskBatch(param, directCancel); |
| | | CancelTaskBatchResult result = commonService.cancelTaskBatch(param); |
| | | return R.ok().add(result); |
| | | } |
| | | |