pda单据复制问题

dev2.0
anthonywj 2 years ago
parent 4aa038d37d
commit 23bbe2166c

@ -204,9 +204,13 @@ public class LoginController extends BaseController {
LoginUserInfoResponse loginUserInfoResponse = new LoginUserInfoResponse();
BeanUtil.copyProperties(authAdmin, loginUserInfoResponse);
DeptEntity deptEntity = deptService.selectByCode(authAdmin.getLocDeptCode());
if (deptEntity != null) {
loginUserInfoResponse.setLocDeptName(deptEntity.getName());
}
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(authAdmin.getLocInvCode());
loginUserInfoResponse.setLocDeptName(deptEntity.getName());
loginUserInfoResponse.setLocInvName(invWarehouseEntity.getName());
if (invWarehouseEntity != null) {
loginUserInfoResponse.setLocInvName(invWarehouseEntity.getName());
}
return ResultVOUtils.success(loginUserInfoResponse);
}

@ -581,12 +581,7 @@ public class IoOrderReviewController extends BaseController {
*/
private String checkReviewAuth(String orderId, String userId, String action) {
IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
if (StrUtil.isNotEmpty(action)) {
if (!orderEntity.getAction().equals(action)) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(action);
return "非" + bussinessTypeEntity.getName() + "单据,无法审核!";
}
}
if (orderEntity == null) {
ReviewSpmsRequest reviewSpmsRequest = new ReviewSpmsRequest();
@ -598,7 +593,12 @@ public class IoOrderReviewController extends BaseController {
return "单据不存在!";
}
}
if (StrUtil.isNotEmpty(action)) {
if (!orderEntity.getAction().equals(action)) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(action);
return "非" + bussinessTypeEntity.getName() + "单据,无法审核!";
}
}
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW && orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
return "单据非未审核状态,无法审核!";
@ -636,6 +636,26 @@ public class IoOrderReviewController extends BaseController {
}
/**
* PDA
*/
@AuthRuleAnnotation("")
@GetMapping("/udiwms/pda/order/copy/getOrder")
public BaseResponse getPdaCopyOrder(PdaCheckRequest pdaCheckRequest) {
IoOrderResponse orderEntity = orderService.findGroupBillNo(pdaCheckRequest.getBillNo());
if (orderEntity == null) {
return ResultVOUtils.error(500, "单据不存在!");
}
boolean isExit = invBusUserService.exitBus(getUserId() + "", orderEntity.getAction());
if (!isExit) {
return ResultVOUtils.error(500, "无复制权限!");
}
return ResultVOUtils.success(orderEntity);
}
/**
* PDA-
*/

@ -436,7 +436,7 @@ public class IoAddInoutService {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
BaseResponse baseResponse = checkInv(bussinessTypeEntity, pdaPostOrderRequest.getOrderDetailCodeEntities(), orderEntity, pdaPostOrderRequest.getCodeTempEntities());
BaseResponse baseResponse = checkInv(bussinessTypeEntity, pdaPostOrderRequest.getOrderDetailBizEntities(), orderEntity, pdaPostOrderRequest.getCodeTempEntities());
if (baseResponse != null)
return baseResponse;
@ -823,7 +823,7 @@ public class IoAddInoutService {
/**
*
*/
public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, List<IoOrderDetailCodeEntity> orderDetailCodeEntities, IoOrderEntity orderEntity, List<IoCodeTempEntity> codeTempEntities) {
public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, List<IoOrderDetailBizEntity> orderDetailBizEntities, IoOrderEntity orderEntity, List<IoCodeTempEntity> codeTempEntities) {
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN);
@ -840,35 +840,35 @@ public class IoAddInoutService {
} else
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode());
}
if (count <= 0) {
if (count < IntUtil.value(codeTempEntity.getReCount())) {
return ResultVOUtils.error(500, "UDI码" + codeTempEntity.getCode() + "预验收库存数量不足!");
}
}
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE);
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
for (IoOrderDetailBizEntity orderDetailCodeEntity : orderDetailBizEntities) {
int count = 0;
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
count = invPreProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
count = invPreProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, invWarehouseEntity.getCode(), orderEntity.getPreCurSpaceCode());
}
if (count <= 0) {
if (count < orderDetailCodeEntity.getScanCount()) {
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
}
}
} else { //校验普通库存
if (bussinessTypeEntity.isVailInv() && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
for (IoOrderDetailBizEntity orderDetailCodeEntity : orderDetailBizEntities) {
int count = 0;
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), null);
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), orderEntity.getCurSpaceCode());
}
if (count <= 0) {
if (count < orderDetailCodeEntity.getScanCount()) {
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
}
}

Loading…
Cancel
Save