| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.annotations.OpenApiLog; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.cache.SlaveConnection; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | private String mainProcessPlugin; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createLocMoveTask(param); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "移库任务" |
| | | , "/createLocMoveTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , result ? 1 : 0 |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createInTask(param); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "入库任务" |
| | | , "/createInTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , result ? 1 : 0 |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createOutTask(param); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "出库任务" |
| | | , "/createOutTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , result ? 1 : 0 |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean completeTask = commonService.completeTask(param); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "任务完成" |
| | | , "/completeTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , completeTask ? 1 : 0 |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | if (completeTask) { |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean completeTask = commonService.cancelTask(param); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "任务取消" |
| | | , "/cancelTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , null |
| | | , null |
| | | , completeTask ? 1 : 0 |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | if (completeTask) { |
| | | return R.ok(); |
| | | } |
| | |
| | | wrapper.eq("io_type", ioType.id); |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(wrapper); |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "查询任务" |
| | | , "/queryTask" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , JSON.toJSONString(wrkMasts) |
| | | , null |
| | | , null |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | |
| | | return R.ok().add(wrkMasts); |
| | | } |
| | | |