|
|
@ -90,9 +90,11 @@ public class StackCodeService {
|
|
|
|
public StackCodeResponse addCode(AddStackCodeRequest addStackCodeRequest) {
|
|
|
|
public StackCodeResponse addCode(AddStackCodeRequest addStackCodeRequest) {
|
|
|
|
StackCode stackCode = new StackCode();
|
|
|
|
StackCode stackCode = new StackCode();
|
|
|
|
stackCode.setCode(addStackCodeRequest.getCode());
|
|
|
|
stackCode.setCode(addStackCodeRequest.getCode());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String stackId = addStackCodeRequest.getOrderId();
|
|
|
|
if (StrUtil.isBlank(addStackCodeRequest.getOrderId())) {
|
|
|
|
if (StrUtil.isBlank(addStackCodeRequest.getOrderId())) {
|
|
|
|
//垛号为空,此条码为这个垛的第一个条码数据,先生垛号和垛数据,再添加条码
|
|
|
|
//垛号为空,此条码为这个垛的第一个条码数据,先生垛号和垛数据,再添加条码
|
|
|
|
String stackId = idUtil.getStackId(addStackCodeRequest.getCustomerId());
|
|
|
|
stackId = idUtil.getStackId(addStackCodeRequest.getCustomerId());
|
|
|
|
//创建垛数据
|
|
|
|
//创建垛数据
|
|
|
|
StackOrder stackOrder = new StackOrder();
|
|
|
|
StackOrder stackOrder = new StackOrder();
|
|
|
|
//垛码
|
|
|
|
//垛码
|
|
|
@ -104,7 +106,9 @@ public class StackCodeService {
|
|
|
|
stackOrderDao.insert(stackOrder);
|
|
|
|
stackOrderDao.insert(stackOrder);
|
|
|
|
stackCode.setOrderIdFk(String.valueOf(stackOrder.getId()));
|
|
|
|
stackCode.setOrderIdFk(String.valueOf(stackOrder.getId()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
stackCode.setOrderIdFk(addStackCodeRequest.getOrderId());
|
|
|
|
//查询此垛号的id
|
|
|
|
|
|
|
|
Integer orderIdFk = stackOrderDao.selectId(stackId, Long.valueOf(addStackCodeRequest.getCustomerId()));
|
|
|
|
|
|
|
|
stackCode.setOrderIdFk(String.valueOf(orderIdFk));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UdiEntity udi = FilterUdiUtils.getUdi(stackCode.getCode());
|
|
|
|
UdiEntity udi = FilterUdiUtils.getUdi(stackCode.getCode());
|
|
|
|
BeanUtil.copyProperties(udi, stackCode);
|
|
|
|
BeanUtil.copyProperties(udi, stackCode);
|
|
|
@ -113,7 +117,7 @@ public class StackCodeService {
|
|
|
|
|
|
|
|
|
|
|
|
StackCodeResponse response = new StackCodeResponse();
|
|
|
|
StackCodeResponse response = new StackCodeResponse();
|
|
|
|
BeanUtil.copyProperties(stackCode, response);
|
|
|
|
BeanUtil.copyProperties(stackCode, response);
|
|
|
|
response.setStackId(stackOrderDao.selectOrderIdById(Integer.valueOf(stackCode.getOrderIdFk())));
|
|
|
|
response.setStackId(stackId);
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|