| | |
| | | import com.zy.asrs.wms.apis.wcs.services.WcsApiService; |
| | | import com.zy.asrs.wms.asrs.entity.CacheSite; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.entity.WaveSeed; |
| | | import com.zy.asrs.wms.asrs.entity.param.BindPlatformParam; |
| | | import com.zy.asrs.wms.asrs.service.CacheSiteService; |
| | | import com.zy.asrs.wms.asrs.service.PlatformService; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.zy.asrs.wms.asrs.service.WaveSeedService; |
| | | import com.zy.asrs.wms.asrs.service.impl.WaveSeedServiceImpl; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import io.netty.util.internal.StringUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | |
| | | @Resource |
| | | private TaskService taskService; |
| | | |
| | | @Autowired |
| | | private WaveSeedService waveSeedService; |
| | | |
| | | |
| | | /** |
| | |
| | | * 播种墙拍灯,ESS调用 |
| | | */ |
| | | @PostMapping("/light/off") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R lightOff(@RequestBody Map<String, Object> request) { |
| | | if (Objects.isNull(request)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | |
| | | if (Objects.isNull(cacheSite)) { |
| | | throw new CoolException("当前站点不存在!!"); |
| | | } |
| | | |
| | | WaveSeed waveSeed = waveSeedService.getOne(new LambdaQueryWrapper<WaveSeed>() |
| | | .eq(WaveSeed::getExceStatus, 1) |
| | | .eq(WaveSeed::getSiteNo, request.get("tagCode").toString()), false); |
| | | if (Objects.isNull(waveSeed)) { |
| | | throw new CoolException("播种墙地标未绑定!!"); |
| | | } |
| | | |
| | | // 根据播种站点信息条码,查任务 |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, cacheSite.getBarcode())); |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, waveSeed.getTaskId())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("当前站点任务不存在!!"); |
| | | } |
| | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("taskNo", task.getTaskNo()); |
| | | param.put("siteNo", cacheSite.getSiteNo()); |
| | | param.put("weedId", waveSeed.getId()); |
| | | param.put("orderNo",cacheSite.getOrderNo()); |
| | | |
| | | waveSeed.setExceStatus(0); |
| | | if (!waveSeedService.updateById(waveSeed)) { |
| | | throw new CoolException("播种状态修改失败!!"); |
| | | } |
| | | |
| | | return wcsApiService.slapLightLogic(param); |
| | | } |
| | | |