| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.WebSocketServer; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private WorkService workService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private WebSocketServer webSocketServer; |
| | | |
| | | @PostMapping("/led/getError") |
| | | @ResponseBody |
| | | public synchronized R getLocNo(@RequestBody Map<String, String> param) { |
| | | String sta = param.get("sta"); |
| | | String message = param.get("msg"); |
| | | if (Cools.isEmpty(sta) || Cools.isEmpty(message)) { |
| | | return R.error(); |
| | | } |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | map.put("to",sta); |
| | | map.put("message",Cools.add("type", "error").add("errMsg",message)); |
| | | webSocketServer.onMessage(JSONObject.toJSONString(map),null,sta); |
| | | |
| | | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | | public synchronized StartupDto getLocNo3(@RequestBody SearchLocParam param){ |
| | | log.info("收到WCS拣料入库接口请求====>>入参:{}", param); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | throw new CoolException("未找到任务"); |
| | | } |
| | | StartupDto dto = null; |
| | | StartupDto dto = new StartupDto(); |
| | | // 获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", wrkMast.getIoType() - 50) |
| | |
| | | wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | wrkMast.setSourceLocNo(""); // 源库位清空 |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 更新明细档io_time (历史档关联使用) |
| | |
| | | } |
| | | WrkMast wrkMastPakin = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("barcode", param.getBarcode()) |
| | | .eq("io_type", 103) |
| | | .in("io_type", 103,53) |
| | | .eq("wrk_sts",14)); |
| | | if (!Cools.isEmpty(wrkMastPakin)){ |
| | | StartupDto locNo3 = getLocNo3(param); |