You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
3.0 KiB

​
​
​
6 days ago
6 days ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 days ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 days ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package com.gaotao.modules.autoWareHourceHaian.controller;
  2. import com.gaotao.common.utils.PageUtils;
  3. import com.gaotao.common.utils.R;
  4. import com.gaotao.modules.autoWareHourceHaian.entity.HaiAnLabelQuerySplitCheckData;
  5. import com.gaotao.modules.autoWareHourceHaian.service.HaiAnLabelQueryService;
  6. import com.gaotao.modules.autoWareHourceHaian.service.HaiAnPdaLabelSplitService;
  7. import com.gaotao.modules.handlingunit.entity.dto.HandlingUnitDto;
  8. import org.apache.commons.lang.StringUtils;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. /**
  15. * @author rqrq
  16. * @Description 海安标签位置查询控制器,复刻labelQueryLocation并切换海安托盘关联链路 - rqrq
  17. */
  18. @RestController
  19. @RequestMapping("/autoWareHourceHaian/haiAnLabelQuery")
  20. public class HaiAnLabelQueryController {
  21. @Autowired
  22. private HaiAnLabelQueryService haiAnLabelQueryService;
  23. @Autowired
  24. private HaiAnPdaLabelSplitService haiAnPdaLabelSplitService;
  25. /**
  26. * @author rqrq
  27. * @Description 分页查询海安标签位置列表,site必填用于主厂和子站点汇总过滤 - rqrq
  28. * @param data 查询条件 - rqrq
  29. * @return page分页结果 - rqrq
  30. */
  31. @PostMapping("/getHandlingUnitLabelListLocation")
  32. public R getHandlingUnitLabelListLocation(@RequestBody HandlingUnitDto data) {
  33. if (data == null || StringUtils.isBlank(data.getSite())) {
  34. return R.error("工厂编码不能为空");
  35. }
  36. // 调用海安标签服务执行位置查询,关键入参site用于隔离当前工厂;失败会影响标签位置追踪 - rqrq
  37. PageUtils page = haiAnLabelQueryService.getHandlingUnitLabelListLocation(data);
  38. return R.ok().put("page", page);
  39. }
  40. /**
  41. * @author rqrq
  42. * @Description 标签查询点击拆分前的门禁。命中54子工厂且标签仍在立库区域A01托盘上时抛错,页面不打开拆分弹窗。人工分拣不调用本接口。 - rqrq
  43. * @param data 标签自身工厂和标签号 - rqrq
  44. * @return 允许拆分时返回成功;拒绝时由异常返回业务错误 - rqrq
  45. */
  46. @PostMapping("/checkLabelQuerySplit")
  47. public R checkLabelQuerySplit(@RequestBody HaiAnLabelQuerySplitCheckData data) {
  48. // 空请求无法判断标签工厂,直接失败,避免漏校验后打开拆分弹窗 - rqrq
  49. if (data == null || StringUtils.isBlank(data.getSite()) || StringUtils.isBlank(data.getUnitId())) {
  50. return R.error("标签工厂和标签号不能为空");
  51. }
  52. // 调用立库在盘门禁:入参是标签自身工厂和标签号;命中A01在盘会抛出业务错误,未命中则允许继续拆分 - rqrq
  53. haiAnPdaLabelSplitService.assertLabelQuerySplitAllowed(data.getSite(), data.getUnitId());
  54. return R.ok();
  55. }
  56. }