| package com.zy.asrs.wms.apis.wcs.controller; | 
|   | 
| import com.mysql.cj.util.StringUtils; | 
| import com.zy.asrs.framework.common.R; | 
| import com.zy.asrs.framework.exception.CoolException; | 
| import com.zy.asrs.wms.apis.wcs.entity.request.RfidSingalRequest; | 
| import com.zy.asrs.wms.apis.wcs.entity.response.CommonReponse; | 
| import com.zy.asrs.wms.apis.wcs.services.WaveManagentService; | 
| import com.zy.asrs.wms.asrs.entity.param.WaveSeedReviewParam; | 
| import com.zy.asrs.wms.system.controller.BaseController; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
| import org.springframework.web.context.request.RequestContextHolder; | 
| import org.springframework.web.context.request.ServletRequestAttributes; | 
|   | 
| import javax.servlet.http.HttpServletRequest; | 
| import java.util.Map; | 
| import java.util.Objects; | 
|   | 
| import static com.zy.asrs.wms.utils.HttpUtils.getClientIpAddress; | 
|   | 
| /** | 
|  * 大屏操作基本功能 | 
|  */ | 
| @Slf4j | 
| @RestController | 
| @RequestMapping("/wave") | 
| public class WaveManagentController extends BaseController { | 
|   | 
|     @Autowired | 
|     private WaveManagentService waveManagentService; | 
|   | 
|     /*** | 
|      * 获取处于播种状态的任务单据 | 
|      * @return | 
|      */ | 
|     @GetMapping("/sow/seeds") | 
|     public R sowSeeds() { | 
|       return  waveManagentService.getSowSeeds(); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 通过任务号拉取任务明细 | 
|      * @param taskNo | 
|      * @return | 
|      */ | 
|     @GetMapping("/sow/task/detl/{taskNo}") | 
|     public R getTaskDetl(@PathVariable String taskNo) { | 
|         if (StringUtils.isNullOrEmpty(taskNo)) { | 
|             throw new CoolException("任务编码不能为空!!"); | 
|         } | 
|         return waveManagentService.getTaskDetl(taskNo); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 大屏获取任务明细 | 
|      * 获取当前播种中具体任务明细 | 
|      * @param param | 
|      * @return | 
|      */ | 
|     @PostMapping("/task/detl/qutify") | 
|     public R getTaskDetlQutify(@RequestBody Map<String, Object> param) { | 
|         if (Objects.isNull(param)) { | 
|             throw new CoolException("参数不能为空!!"); | 
|         } | 
|         if (Objects.isNull(param.get("taskNo"))) { | 
|             throw new CoolException("请求参数:任务编码不能为空!!"); | 
|         } | 
|         String taskNoStr = (String) param.get("taskNo"); | 
| //        Long matnr = Long.valueOf(taskNo.get("matnr").toString()); | 
|   | 
|         return waveManagentService.getTaskDetlQutify(taskNoStr); | 
|     } | 
|   | 
|     /** | 
|      * 获取当前播种墙库位信息 | 
|      * @return | 
|      */ | 
|     @GetMapping("/seed/locs") | 
|     public R getSeedLoc() { | 
|         HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|         return waveManagentService.AllSeedLocs(request); | 
|     } | 
|   | 
|     /*** | 
|      * 大屏获取出库列表 | 
|      * 获取当前播种中执行数据 | 
|      * @return | 
|      */ | 
|     @GetMapping("/sow/tasks") | 
|     public R getTasks() { | 
|         HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|         return waveManagentService.getTask(request); | 
|     } | 
|   | 
|     /** | 
|      * 波次播种 | 
|      * 播种明细数量修改 | 
|      * @param reviewParam | 
|      * @return | 
|      */ | 
|     @PostMapping("/sow/review") | 
|     public R reviewSeeds(@RequestBody WaveSeedReviewParam reviewParam) { | 
|         if (Objects.isNull(reviewParam)) { | 
|             return R.error("播种参数不能为空!!"); | 
|         } | 
|         if (Objects.isNull(reviewParam.getReviewNum())) { | 
|             return R.error("播种数量不能为空!!"); | 
|         } | 
|         if (Objects.isNull(reviewParam.getWaveSeedId())) { | 
|             return R.error("播种明细标识不能为空!!"); | 
|         } | 
|         return waveManagentService.reviewSeeds(reviewParam); | 
|     } | 
|   | 
|     /** | 
|      * 删除播种 | 
|      * @param id | 
|      * @return | 
|      */ | 
|     @GetMapping("/sow/remove/{id}") | 
|     public R delSowSeeds(@PathVariable Long id) { | 
|          if (waveManagentService.removeSowSeed(id) > 0) { | 
|              return R.ok("删除成功!!"); | 
|          } else { | 
|              return R.error("删除失败!!"); | 
|          } | 
|     } | 
|   | 
|     /** | 
|      * 大屏获取波次所有订单信息 | 
|      * @param waveNo | 
|      * @return | 
|      */ | 
|     @GetMapping("/orders/{waveNo}") | 
|     public R getWaveOrders(@PathVariable String waveNo) { | 
|         if (StringUtils.isNullOrEmpty(waveNo)) { | 
|             return R.error("波次编码不能为空!!!"); | 
|         } | 
|         return waveManagentService.getAllOrders(waveNo); | 
|     } | 
|   | 
|   | 
|   | 
|   | 
| } |