|
|
|
@ -37,6 +37,8 @@ import com.glxp.sale.admin.service.info.CompanyProductRelevanceService;
|
|
|
|
|
import com.glxp.sale.admin.service.info.CompanyService;
|
|
|
|
|
import com.glxp.sale.admin.service.inout.*;
|
|
|
|
|
import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService;
|
|
|
|
|
import com.glxp.sale.admin.service.inventory.InvPreProductDetailService;
|
|
|
|
|
import com.glxp.sale.admin.service.inventory.InvProductDetailService;
|
|
|
|
|
import com.glxp.sale.admin.service.inventory.InvWarehouseService;
|
|
|
|
|
import com.glxp.sale.admin.service.param.SystemParamConfigService;
|
|
|
|
|
import com.glxp.sale.admin.thread.IoTransInoutService;
|
|
|
|
@ -538,6 +540,12 @@ public class WareHouseController {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreProductDetailService invPreProductDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvProductDetailService invProductDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//网页端数据上传调用接口
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("warehouse/inout/addOrderWeb")
|
|
|
|
@ -585,7 +593,7 @@ public class WareHouseController {
|
|
|
|
|
// String isCheck = systemParamConfigService.selectValueByParamKey("code_fill_check");
|
|
|
|
|
|
|
|
|
|
//三期校验
|
|
|
|
|
if (bussinessTypeEntity.isCodeFillCheck()) {
|
|
|
|
|
if (addOrderRequest.isCodeFillCheck()) {
|
|
|
|
|
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
|
|
|
|
|
if (checkOriginCodeRes != null)
|
|
|
|
|
return checkOriginCodeRes;
|
|
|
|
@ -650,7 +658,20 @@ public class WareHouseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else //是否查询库存
|
|
|
|
|
if (addOrderRequest.isVailInv()) {
|
|
|
|
|
if (bussinessTypeEntity.isAdvanceType()) {
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = invPreProductDetailService.statInvPreInDetail(code);
|
|
|
|
|
if (invProductDetailEntity == null) {
|
|
|
|
|
addCodeResult.setErrMsg("库存不存在此产品!");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = invProductDetailService.statInvPreInDetail(code);
|
|
|
|
|
if (invProductDetailEntity == null) {
|
|
|
|
|
addCodeResult.setErrMsg("库存不存在此产品!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (addOrderRequest.getCustomerId() != null && (addOrderRequest.getFromCorpId() == null || "".equals(addOrderRequest.getFromCorpId()))) {
|
|
|
|
@ -683,19 +704,25 @@ public class WareHouseController {
|
|
|
|
|
|
|
|
|
|
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
|
|
|
|
|
warehouseQueryRequest.setOrderId(orderId);
|
|
|
|
|
warehouseQueryRequest.setCode(code);
|
|
|
|
|
// warehouseQueryRequest.setCode(code);
|
|
|
|
|
List<WarehouseEntity> warehouseEntitys = codesTempService.findByOrderIdAndCode(warehouseQueryRequest);
|
|
|
|
|
WarehouseEntity warehouseEntity = new WarehouseEntity();
|
|
|
|
|
WarehouseEntity exitLocalEntity = null;
|
|
|
|
|
if (warehouseEntitys.size() > 0) {
|
|
|
|
|
warehouseEntity = warehouseEntitys.get(0);
|
|
|
|
|
warehouseEntity.setCount(warehouseEntity.getCount() + 1);
|
|
|
|
|
if (StringUtils.isBlank(warehouseEntity.getSerialNo())) {
|
|
|
|
|
codesTempService.updateById(warehouseEntity);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
|
|
|
|
exitLocalEntity = isExitLocal(code, warehouseEntitys);
|
|
|
|
|
if (exitLocalEntity != null) {
|
|
|
|
|
warehouseEntity = exitLocalEntity;
|
|
|
|
|
warehouseEntity.setCount(warehouseEntity.getCount() + 1);
|
|
|
|
|
if (StringUtils.isBlank(warehouseEntity.getSerialNo())) {
|
|
|
|
|
codesTempService.updateById(warehouseEntity);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (exitLocalEntity == null) {
|
|
|
|
|
warehouseEntity.setCode(code);
|
|
|
|
|
warehouseEntity.setOrderId(orderId);
|
|
|
|
|
warehouseEntity.setCorpOrderId(addOrderRequest.getCorpOrderId());
|
|
|
|
@ -797,6 +824,35 @@ public class WareHouseController {
|
|
|
|
|
return ResultVOUtils.success(addCodeResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断本单是否存在
|
|
|
|
|
public WarehouseEntity isExitLocal(String code, List<WarehouseEntity> warehouseEntityList) {
|
|
|
|
|
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
|
|
|
|
|
for (int i = 0; i < warehouseEntityList.size(); i++) {
|
|
|
|
|
WarehouseEntity drugCodeSelectEntity = warehouseEntityList.get(i);
|
|
|
|
|
if (warehouseEntityList.get(i).getCode().equals(code)) {
|
|
|
|
|
return drugCodeSelectEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getNameCode()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getBatchNo()).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getProduceDate()).equals(StrUtil.emptyIfNull(udiEntity.getProduceDate()))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getExpireDate()).equals(StrUtil.emptyIfNull(udiEntity.getExpireDate()))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
return drugCodeSelectEntity;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验供应商是否配送此产品
|
|
|
|
|
public BaseResponse checkCorp(WarehouseEntity warehouseEntity, BussinessTypeEntity bussinessTypeEntity) {
|
|
|
|
|
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) {
|
|
|
|
|