|
@ -117,7 +117,7 @@ public class ItemApplyRequestMainServiceImpl implements ItemApplyRequestMainServ |
|
|
detailsDo.setNumber(number); |
|
|
detailsDo.setNumber(number); |
|
|
List<ItemDO> itemDOS = itemMapper.selectList("number", detailsDo.getItemNumber()); |
|
|
List<ItemDO> itemDOS = itemMapper.selectList("number", detailsDo.getItemNumber()); |
|
|
BigDecimal qty = detailsDo.getQty(); |
|
|
BigDecimal qty = detailsDo.getQty(); |
|
|
sums = sums.add(itemDOS.get(0).getSinglePrice()==null?BigDecimal.ZERO:itemDOS.get(0).getSinglePrice().multiply(qty)); |
|
|
// sums = sums.add(itemDOS.get(0).getSinglePrice()==null?BigDecimal.ZERO:itemDOS.get(0).getSinglePrice().multiply(qty));
|
|
|
detailsDo.setItemNumber(detailsDo.getItemNumber());//备件号
|
|
|
detailsDo.setItemNumber(detailsDo.getItemNumber());//备件号
|
|
|
detailsDo.setQty(qty);//申领数量
|
|
|
detailsDo.setQty(qty);//申领数量
|
|
|
detailsDo.setMasterId(itemApplyMain.getId()); |
|
|
detailsDo.setMasterId(itemApplyMain.getId()); |
|
@ -166,7 +166,7 @@ public class ItemApplyRequestMainServiceImpl implements ItemApplyRequestMainServ |
|
|
detailsDo.setNumber(updateReqVO.getNumber()); |
|
|
detailsDo.setNumber(updateReqVO.getNumber()); |
|
|
List<ItemDO> itemDOS = itemMapper.selectList("number", detailsDo.getItemNumber()); |
|
|
List<ItemDO> itemDOS = itemMapper.selectList("number", detailsDo.getItemNumber()); |
|
|
BigDecimal qty = detailsDo.getQty(); |
|
|
BigDecimal qty = detailsDo.getQty(); |
|
|
sums = sums.add(itemDOS.get(0).getSinglePrice().multiply(qty)); |
|
|
// sums = sums.add(itemDOS.get(0).getSinglePrice().multiply(qty));
|
|
|
detailsDo.setItemNumber(detailsDo.getItemNumber());//备件号
|
|
|
detailsDo.setItemNumber(detailsDo.getItemNumber());//备件号
|
|
|
detailsDo.setQty(qty);//申领数量
|
|
|
detailsDo.setQty(qty);//申领数量
|
|
|
detailsDo.setType(detailsDo.getType());//设备模具类型
|
|
|
detailsDo.setType(detailsDo.getType());//设备模具类型
|
|
@ -211,7 +211,6 @@ public class ItemApplyRequestMainServiceImpl implements ItemApplyRequestMainServ |
|
|
String locationNumber = map.get("locationNumber").toString();//库位
|
|
|
String locationNumber = map.get("locationNumber").toString();//库位
|
|
|
LocationDO locationDO = locationMapper.scanCodeByNumber(locationNumber); |
|
|
LocationDO locationDO = locationMapper.scanCodeByNumber(locationNumber); |
|
|
String areaNumber = locationDO.getAreaNumber();//库区
|
|
|
String areaNumber = locationDO.getAreaNumber();//库区
|
|
|
String isInAccount = locationDO.getIsInAccount();//是否账内账外
|
|
|
|
|
|
BigDecimal qty2 = locationDO.getQty();//台账内库存数
|
|
|
BigDecimal qty2 = locationDO.getQty();//台账内库存数
|
|
|
if(new BigDecimal(qty).compareTo(qty2)>0){ |
|
|
if(new BigDecimal(qty).compareTo(qty2)>0){ |
|
|
throw exception(OUT_BIG_INVENTORY);// 出库数量大于库存
|
|
|
throw exception(OUT_BIG_INVENTORY);// 出库数量大于库存
|
|
@ -248,7 +247,6 @@ public class ItemApplyRequestMainServiceImpl implements ItemApplyRequestMainServ |
|
|
transactionCreateReqVO.setLocationNumber(locationNumber); |
|
|
transactionCreateReqVO.setLocationNumber(locationNumber); |
|
|
transactionCreateReqVO.setAreaNumber(areaNumber); |
|
|
transactionCreateReqVO.setAreaNumber(areaNumber); |
|
|
transactionCreateReqVO.setTransactionType("OUT"); |
|
|
transactionCreateReqVO.setTransactionType("OUT"); |
|
|
transactionCreateReqVO.setIsInAccount(isInAccount); |
|
|
|
|
|
transactionCreateReqVO.setQty(new BigDecimal(qty)); |
|
|
transactionCreateReqVO.setQty(new BigDecimal(qty)); |
|
|
transactionCreateReqVO.setDescribes(reavo.getDescribes()); |
|
|
transactionCreateReqVO.setDescribes(reavo.getDescribes()); |
|
|
transactionCreateReqVO.setAssociatedNumber(applyMainDO1.getNumber()); |
|
|
transactionCreateReqVO.setAssociatedNumber(applyMainDO1.getNumber()); |
|
@ -301,18 +299,14 @@ public class ItemApplyRequestMainServiceImpl implements ItemApplyRequestMainServ |
|
|
String qty = map.get("qty").toString();//归还数量
|
|
|
String qty = map.get("qty").toString();//归还数量
|
|
|
String locationNumber = map.get("locationNumber").toString();//库位
|
|
|
String locationNumber = map.get("locationNumber").toString();//库位
|
|
|
LocationDO locationDO = locationMapper.scanCodeByNumber(locationNumber); |
|
|
LocationDO locationDO = locationMapper.scanCodeByNumber(locationNumber); |
|
|
if(!"FALSE".equals(locationDO.getIsInAccount())){//备件归还的库位必须是账外库
|
|
|
|
|
|
throw exception(ITEM_RETURN_FALSE); |
|
|
|
|
|
} |
|
|
|
|
|
String areaNumber = locationDO.getAreaNumber(); |
|
|
String areaNumber = locationDO.getAreaNumber(); |
|
|
String isInAccount = locationDO.getIsInAccount(); |
|
|
|
|
|
//添加库存事务
|
|
|
//添加库存事务
|
|
|
TransactionCreateReqVO transactionCreateReqVO = new TransactionCreateReqVO(); |
|
|
TransactionCreateReqVO transactionCreateReqVO = new TransactionCreateReqVO(); |
|
|
transactionCreateReqVO.setItemNumber(itemNumber); |
|
|
transactionCreateReqVO.setItemNumber(itemNumber); |
|
|
transactionCreateReqVO.setLocationNumber(locationNumber); |
|
|
transactionCreateReqVO.setLocationNumber(locationNumber); |
|
|
transactionCreateReqVO.setAreaNumber(areaNumber); |
|
|
transactionCreateReqVO.setAreaNumber(areaNumber); |
|
|
transactionCreateReqVO.setTransactionType("IN"); |
|
|
transactionCreateReqVO.setTransactionType("IN"); |
|
|
transactionCreateReqVO.setIsInAccount(isInAccount); |
|
|
|
|
|
transactionCreateReqVO.setQty(new BigDecimal(qty)); |
|
|
transactionCreateReqVO.setQty(new BigDecimal(qty)); |
|
|
transactionCreateReqVO.setDescribes(reavo.getDescribes());//描述
|
|
|
transactionCreateReqVO.setDescribes(reavo.getDescribes());//描述
|
|
|
transactionCreateReqVO.setOperator(reavo.getReverterId()); |
|
|
transactionCreateReqVO.setOperator(reavo.getReverterId()); |
|
|