修改逻辑:销售出库单(如果是批次商品,则要根据批号去找之前的采购价)
This commit is contained in:
@@ -525,10 +525,13 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果是销售出库单则给采购单价字段赋值
|
//如果是销售出库单则给采购单价字段赋值(如果是批次商品,则要根据批号去找之前的采购价)
|
||||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) &&
|
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) &&
|
||||||
BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) {
|
BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) {
|
||||||
depotItem.setPurchaseUnitPrice(materialExtend.getPurchaseDecimal());
|
depotItem.setPurchaseUnitPrice(materialExtend.getPurchaseDecimal());
|
||||||
|
if(StringUtil.isNotEmpty(depotItem.getBatchNumber())) {
|
||||||
|
depotItem.setPurchaseUnitPrice(getDepotItemByBatchNumber(depotItem.getBatchNumber()).getUnitPrice());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (StringUtil.isExist(rowObj.get("taxUnitPrice"))) {
|
if (StringUtil.isExist(rowObj.get("taxUnitPrice"))) {
|
||||||
depotItem.setTaxUnitPrice(rowObj.getBigDecimal("taxUnitPrice"));
|
depotItem.setTaxUnitPrice(rowObj.getBigDecimal("taxUnitPrice"));
|
||||||
@@ -698,6 +701,22 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批号查询单据明细信息
|
||||||
|
* @param batchNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public DepotItem getDepotItemByBatchNumber(String batchNumber) {
|
||||||
|
DepotItem depotItem = new DepotItem();
|
||||||
|
DepotItemExample example = new DepotItemExample();
|
||||||
|
example.createCriteria().andBatchNumberEqualTo(batchNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
|
List<DepotItem> depotItemList = depotItemMapper.selectByExample(example);
|
||||||
|
if(null != depotItemList && depotItemList.size() > 0){
|
||||||
|
depotItem = depotItemList.get(0);
|
||||||
|
}
|
||||||
|
return depotItem;
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void deleteDepotItemHeadId(Long headerId)throws Exception {
|
public void deleteDepotItemHeadId(Long headerId)throws Exception {
|
||||||
try{
|
try{
|
||||||
|
|||||||
Reference in New Issue
Block a user