|
@@ -76,7 +76,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
@Resource
|
|
|
private LogService logService;
|
|
|
@Resource
|
|
|
- private MaterialExtendMapper materialExtendMapper;
|
|
|
+ private MaterialMapperEx materialMapperEx;
|
|
|
|
|
|
@Resource
|
|
|
private SyncTescoSystemService syncTescoSystemService;
|
|
@@ -129,6 +129,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
*/
|
|
|
@Override
|
|
|
public PDAPrintVo pdaPrintMaterial(Long depotItemId) {
|
|
|
+ materialMapperEx.pdaPrintMaterial(depotItemId);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -509,12 +510,12 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
checkAssembleWithMaterialType(rowArr, depotHead.getSubType());
|
|
|
for (int i = 0; i < rowArr.size(); i++) {
|
|
|
JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i));
|
|
|
- String batchNumber = rowObj.getString("barCode");
|
|
|
+ String barCode = rowObj.getString("barCode");
|
|
|
//根据条码获取商品信息
|
|
|
- MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(batchNumber);
|
|
|
+ MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode);
|
|
|
if(materialExtend == null) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_CODE,
|
|
|
- String.format(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_MSG, barCode));
|
|
|
}
|
|
|
//设置单据子表属性
|
|
|
DepotItem depotItem = new DepotItem();
|
|
@@ -552,18 +553,18 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
if(BusinessConstants.SUB_TYPE_ASSEMBLE.equals(depotHead.getSubType()) ||
|
|
|
BusinessConstants.SUB_TYPE_DISASSEMBLE.equals(depotHead.getSubType())) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_CODE,
|
|
|
- String.format(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_MSG, barCode));
|
|
|
}
|
|
|
//调拨单不能选择批号或序列号商品(该场景走出库和入库单)
|
|
|
if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_CODE,
|
|
|
- String.format(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_MSG, barCode));
|
|
|
}
|
|
|
//盘点业务不能选择批号或序列号商品(该场景走出库和入库单)
|
|
|
if(BusinessConstants.SUB_TYPE_CHECK_ENTER.equals(depotHead.getSubType())
|
|
|
||BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType())) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_CHECK_ERROR_CODE,
|
|
|
- String.format(ExceptionConstants.MATERIAL_STOCK_CHECK_ERROR_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.MATERIAL_STOCK_CHECK_ERROR_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
if (StringUtil.isExist(rowObj.get("snList"))) {
|
|
@@ -581,7 +582,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
depotHead.getNumber(), materialExtend.getMaterialId(), depotId, inPrice, depotItem.getSnList());
|
|
|
} else {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_SN_NUMBERE_FAILED_CODE,
|
|
|
- String.format(ExceptionConstants.DEPOT_HEAD_SN_NUMBERE_FAILED_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.DEPOT_HEAD_SN_NUMBERE_FAILED_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -599,7 +600,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
//跳过
|
|
|
} else {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_CODE,
|
|
|
- String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -622,7 +623,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
//跳过
|
|
|
} else {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE,
|
|
|
- String.format(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -674,7 +675,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
if(depotItem.getOperNumber().add(finishNumber).compareTo(preNumber)>0) {
|
|
|
if(!systemConfigService.getOverLinkBillFlag()) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
|
|
|
- String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
} else if("update".equals(actionType)) {
|
|
@@ -692,7 +693,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
if (depotItem.getOperNumber().add(realFinishNumber).compareTo(preNumber) > 0) {
|
|
|
if (!systemConfigService.getOverLinkBillFlag()) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
|
|
|
- String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -710,7 +711,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
if("零售".equals(depotHead.getSubType()) || "销售".equals(depotHead.getSubType())) {
|
|
|
if (unitPrice.compareTo(materialExtend.getLowDecimal()) < 0) {
|
|
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UNIT_PRICE_LOW_CODE,
|
|
|
- String.format(ExceptionConstants.DEPOT_HEAD_UNIT_PRICE_LOW_MSG, batchNumber));
|
|
|
+ String.format(ExceptionConstants.DEPOT_HEAD_UNIT_PRICE_LOW_MSG, barCode));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -782,7 +783,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
}
|
|
|
//出库时判断库存是否充足
|
|
|
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
|
|
- String stockMsg = material.getName() + "-" + batchNumber;
|
|
|
+ String stockMsg = material.getName() + "-" + barCode;
|
|
|
BigDecimal stock = getCurrentStockByParam(depotItem.getDepotId(),depotItem.getMaterialId());
|
|
|
if(StringUtil.isNotEmpty(depotItem.getSku())) {
|
|
|
//对于sku商品要换个方式计算库存
|
|
@@ -790,7 +791,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
}
|
|
|
if(StringUtil.isNotEmpty(depotItem.getBatchNumber())) {
|
|
|
//对于批次商品要换个方式计算库存
|
|
|
- stock = getOneBatchNumberStock(depotItem.getDepotId(), batchNumber, depotItem.getBatchNumber());
|
|
|
+ stock = getOneBatchNumberStock(depotItem.getDepotId(), barCode, depotItem.getBatchNumber());
|
|
|
stockMsg += "-批号" + depotItem.getBatchNumber();
|
|
|
}
|
|
|
BigDecimal thisRealNumber = depotItem.getBasicNumber()==null?BigDecimal.ZERO:depotItem.getBasicNumber();
|
|
@@ -822,14 +823,6 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
|
|
|
}
|
|
|
}
|
|
|
this.insertDepotItemWithObj(depotItem);
|
|
|
- if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType())){
|
|
|
- //表单入库,新增批次商品信息
|
|
|
- materialBatchService.generateMaterialBatchByDepotItemId(depotItem,depotHead.getOrganId());
|
|
|
- }else if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
|
|
- //表单出库,修改商品库存
|
|
|
- //materialExtend.setInventory(materialExtend.getInventory().subtract(depotItem.getBasicNumber()));
|
|
|
- materialBatchService.handleMaterialBatchByDepotItemId(depotItem.getId());
|
|
|
- }
|
|
|
//更新当前库存
|
|
|
updateCurrentStock(depotItem);
|
|
|
//更新当前成本价
|