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

package com.gaotao.modules.autoWareHourceHaian.controller;
import com.gaotao.common.utils.PageUtils;
import com.gaotao.common.utils.R;
import com.gaotao.modules.autoWareHourceHaian.entity.HaiAnLabelQuerySplitCheckData;
import com.gaotao.modules.autoWareHourceHaian.service.HaiAnLabelQueryService;
import com.gaotao.modules.autoWareHourceHaian.service.HaiAnPdaLabelSplitService;
import com.gaotao.modules.handlingunit.entity.dto.HandlingUnitDto;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author rqrq
* @Description 海安标签位置查询控制器,复刻labelQueryLocation并切换海安托盘关联链路 - rqrq
*/
@RestController
@RequestMapping("/autoWareHourceHaian/haiAnLabelQuery")
public class HaiAnLabelQueryController {
@Autowired
private HaiAnLabelQueryService haiAnLabelQueryService;
@Autowired
private HaiAnPdaLabelSplitService haiAnPdaLabelSplitService;
/**
* @author rqrq
* @Description 分页查询海安标签位置列表,site必填用于主厂和子站点汇总过滤 - rqrq
* @param data 查询条件 - rqrq
* @return page分页结果 - rqrq
*/
@PostMapping("/getHandlingUnitLabelListLocation")
public R getHandlingUnitLabelListLocation(@RequestBody HandlingUnitDto data) {
if (data == null || StringUtils.isBlank(data.getSite())) {
return R.error("工厂编码不能为空");
}
// 调用海安标签服务执行位置查询,关键入参site用于隔离当前工厂;失败会影响标签位置追踪 - rqrq
PageUtils page = haiAnLabelQueryService.getHandlingUnitLabelListLocation(data);
return R.ok().put("page", page);
}
/**
* @author rqrq
* @Description 标签查询点击拆分前的门禁。命中54子工厂且标签仍在立库区域A01托盘上时抛错,页面不打开拆分弹窗。人工分拣不调用本接口。 - rqrq
* @param data 标签自身工厂和标签号 - rqrq
* @return 允许拆分时返回成功;拒绝时由异常返回业务错误 - rqrq
*/
@PostMapping("/checkLabelQuerySplit")
public R checkLabelQuerySplit(@RequestBody HaiAnLabelQuerySplitCheckData data) {
// 空请求无法判断标签工厂,直接失败,避免漏校验后打开拆分弹窗 - rqrq
if (data == null || StringUtils.isBlank(data.getSite()) || StringUtils.isBlank(data.getUnitId())) {
return R.error("标签工厂和标签号不能为空");
}
// 调用立库在盘门禁:入参是标签自身工厂和标签号;命中A01在盘会抛出业务错误,未命中则允许继续拆分 - rqrq
haiAnPdaLabelSplitService.assertLabelQuerySplitAllowed(data.getSite(), data.getUnitId());
return R.ok();
}
}