|
@@ -235,7 +235,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 采购总单
|
|
//region 采购总单
|
|
|
- this.insertOrderMessageByEdit(inboundVO,inboundVO.getItemList());
|
|
|
|
|
|
|
+ this.insertOrderMessageByEdit(inboundVO, inboundVO.getItemList());
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 明细
|
|
//region 明细
|
|
@@ -344,12 +344,12 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 新建采购入库修改采购订单信息
|
|
|
|
|
- * @date : 2024/7/6 15:15
|
|
|
|
|
|
|
+ * @desc : 新建采购入库修改采购订单信息
|
|
|
|
|
+ * @date : 2024/7/6 15:15
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
- public void insertOrderMessageByEdit(InboundVO inboundVO , List<InboundItemVO> itemList){
|
|
|
|
|
|
|
+ public void insertOrderMessageByEdit(InboundVO inboundVO, List<InboundItemVO> itemList) {
|
|
|
//入库明细汇总
|
|
//入库明细汇总
|
|
|
Map<String, List<InboundItemVO>> purchaseIntoItemVOListMap = itemList.stream().collect(Collectors.groupingBy(InboundItemVO::getFromId));
|
|
Map<String, List<InboundItemVO>> purchaseIntoItemVOListMap = itemList.stream().collect(Collectors.groupingBy(InboundItemVO::getFromId));
|
|
|
//入库明细汇总循环
|
|
//入库明细汇总循环
|
|
@@ -759,12 +759,12 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 采购入库编辑修改订单信息
|
|
|
|
|
- * @date : 2024/7/8 9:12
|
|
|
|
|
|
|
+ * @desc : 采购入库编辑修改订单信息
|
|
|
|
|
+ * @date : 2024/7/8 9:12
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
- public void updateOrderMessageByEdit(InboundResponse inboundResponse, List<InboundItemVO> itemList, List<InboundItemVO> deleteItemList) {
|
|
|
|
|
|
|
+ public void updateOrderMessageByEdit(InboundResponse inboundResponse, List<InboundItemVO> itemList, List<InboundItemVO> deleteItemList) {
|
|
|
//入库明细汇总
|
|
//入库明细汇总
|
|
|
Map<String, List<InboundItemVO>> purchaseIntoItemVOListMap = itemList.stream().collect(Collectors.groupingBy(InboundItemVO::getFromId));
|
|
Map<String, List<InboundItemVO>> purchaseIntoItemVOListMap = itemList.stream().collect(Collectors.groupingBy(InboundItemVO::getFromId));
|
|
|
//入库明细删除汇总
|
|
//入库明细删除汇总
|
|
@@ -772,7 +772,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
//人库明细汇总循环
|
|
//人库明细汇总循环
|
|
|
for (String fromId : purchaseIntoItemVOListMap.keySet()) {
|
|
for (String fromId : purchaseIntoItemVOListMap.keySet()) {
|
|
|
//有需要删除的修改数据
|
|
//有需要删除的修改数据
|
|
|
- if(delPurchaseIntoItemVOListMap!=null && delPurchaseIntoItemVOListMap.keySet().size()>0){
|
|
|
|
|
|
|
+ if (delPurchaseIntoItemVOListMap != null && delPurchaseIntoItemVOListMap.keySet().size() > 0) {
|
|
|
//入库明细删除汇总循环
|
|
//入库明细删除汇总循环
|
|
|
for (String delFromId : delPurchaseIntoItemVOListMap.keySet()) {
|
|
for (String delFromId : delPurchaseIntoItemVOListMap.keySet()) {
|
|
|
//新建入库明细来源Id = 删除入库明细来源Id
|
|
//新建入库明细来源Id = 删除入库明细来源Id
|
|
@@ -792,13 +792,13 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
BigDecimal updatePurchaseIntoingAmt = BigDecimal.ZERO;
|
|
BigDecimal updatePurchaseIntoingAmt = BigDecimal.ZERO;
|
|
|
//已入库
|
|
//已入库
|
|
|
if (Constant.IntoStatus.YIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
|
|
if (Constant.IntoStatus.YIRUKU.getName().equals(inboundResponse.getIntoStatus())) {
|
|
|
- updatePurchaseIntoQty = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoQty()!=null).map(InboundItemVO::getUpdatePurchaseIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- updatePurchaseIntoAmt = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoAmt()!=null).map(InboundItemVO::getUpdatePurchaseIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
+ updatePurchaseIntoQty = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoQty() != null).map(InboundItemVO::getUpdatePurchaseIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ updatePurchaseIntoAmt = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoAmt() != null).map(InboundItemVO::getUpdatePurchaseIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
}
|
|
|
//入库中
|
|
//入库中
|
|
|
else {
|
|
else {
|
|
|
- updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingQty()!=null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingAmt()!=null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
+ updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingQty() != null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingAmt() != null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
@@ -856,7 +856,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//没有需要删除的修改数据
|
|
//没有需要删除的修改数据
|
|
|
- else{
|
|
|
|
|
|
|
+ else {
|
|
|
|
|
|
|
|
//region 提取新建分组后的明细
|
|
//region 提取新建分组后的明细
|
|
|
List<InboundItemVO> purchaseIntoItemVOListGroup = purchaseIntoItemVOListMap.get(fromId);
|
|
List<InboundItemVO> purchaseIntoItemVOListGroup = purchaseIntoItemVOListMap.get(fromId);
|
|
@@ -875,8 +875,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
//入库中
|
|
//入库中
|
|
|
else {
|
|
else {
|
|
|
- updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingQty()!=null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingAmt()!=null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
+ updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingQty() != null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingAmt() != null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
@@ -1073,8 +1073,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 采购入库作废修改采购订单信息
|
|
|
|
|
- * @date : 2024/7/6 15:27
|
|
|
|
|
|
|
+ * @desc : 采购入库作废修改采购订单信息
|
|
|
|
|
+ * @date : 2024/7/6 15:27
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@@ -1137,10 +1137,10 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 采购入库办理
|
|
|
|
|
- * @date : 2024/3/7 15:47
|
|
|
|
|
- * @author : 寇珊珊
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * @desc : 采购入库办理
|
|
|
|
|
+ * @date : 2024/3/7 15:47
|
|
|
|
|
+ * @author : 寇珊珊
|
|
|
|
|
+ */
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
public ResponseResultVO<?> purchaseHandleInbound(InboundVO inboundVO) {
|
|
public ResponseResultVO<?> purchaseHandleInbound(InboundVO inboundVO) {
|
|
|
|
|
|
|
@@ -1332,7 +1332,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 修改采购订单
|
|
//region 修改采购订单
|
|
|
- this.updateOrderMessageByHandle(inboundVO.getItemList(),inboundVO.getDeleteItemList());
|
|
|
|
|
|
|
+ this.updateOrderMessageByHandle(inboundVO.getItemList(), inboundVO.getDeleteItemList());
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 入账
|
|
//region 入账
|
|
@@ -1350,8 +1350,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 采购入库办理修改采购订单信息
|
|
|
|
|
- * @date : 2024/7/8 14:03
|
|
|
|
|
|
|
+ * @desc : 采购入库办理修改采购订单信息
|
|
|
|
|
+ * @date : 2024/7/8 14:03
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@@ -1374,8 +1374,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
BigDecimal purchaseSumQty = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal purchaseSumQty = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal purchaseSumAmt = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal purchaseSumAmt = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//分组后的明细 原入库数量和金额总和
|
|
//分组后的明细 原入库数量和金额总和
|
|
|
- BigDecimal updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingQty()!=null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- BigDecimal updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingAmt()!=null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
+ BigDecimal updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingQty() != null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ BigDecimal updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingAmt() != null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 提取删除分组后的明细
|
|
//region 提取删除分组后的明细
|
|
@@ -1417,8 +1417,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
BigDecimal purchaseSumQty = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal purchaseSumQty = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal purchaseSumAmt = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal purchaseSumAmt = purchaseIntoItemVOListGroup.stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//分组后的明细 原入库数量和金额总和
|
|
//分组后的明细 原入库数量和金额总和
|
|
|
- BigDecimal updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingQty()!=null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- BigDecimal updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it->it.getUpdatePurchaseIntoingAmt()!=null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
+ BigDecimal updatePurchaseIntoingQty = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingQty() != null).map(InboundItemVO::getUpdatePurchaseIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ BigDecimal updatePurchaseIntoingAmt = purchaseIntoItemVOListGroup.stream().filter(it -> it.getUpdatePurchaseIntoingAmt() != null).map(InboundItemVO::getUpdatePurchaseIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 反写订单数据
|
|
//region 反写订单数据
|
|
@@ -1555,8 +1555,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 采购入库撤销修改采购订单信息
|
|
|
|
|
- * @date : 2024/7/8 16:50
|
|
|
|
|
|
|
+ * @desc : 采购入库撤销修改采购订单信息
|
|
|
|
|
+ * @date : 2024/7/8 16:50
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@@ -1597,8 +1597,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @desc : 校验库存是否存在和库存量是否足够本次退货作废
|
|
|
|
|
- * @date : 2024/7/6 10:52
|
|
|
|
|
|
|
+ * @desc : 校验库存是否存在和库存量是否足够本次退货作废
|
|
|
|
|
+ * @date : 2024/7/6 10:52
|
|
|
* @author : 寇珊珊
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
*/
|
|
|
@Transactional(
|
|
@Transactional(
|
|
@@ -1655,10 +1655,10 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
this.checkInventoryExist(inboundItemResponseList);
|
|
this.checkInventoryExist(inboundItemResponseList);
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
- //region 退账
|
|
|
|
|
- if (inboundResponse.getReceivableId() != null) {
|
|
|
|
|
- accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //region 退账 不需要判断,判断反而不对,周兴 202407020
|
|
|
|
|
+// if (inboundResponse.getReceivableId() != null) {
|
|
|
|
|
+ accountService.reversePayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
|
|
+// }
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 修改明细
|
|
//region 修改明细
|
|
@@ -1695,10 +1695,10 @@ public class InboundPurchaseService extends BaseService<Inbound> {
|
|
|
);
|
|
);
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
- //region 入账
|
|
|
|
|
- if (inboundResponse.getReceivableId() != null) {
|
|
|
|
|
- accountService.accPayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //region 入账 作废把账作废就行,不要再入账了 周兴 202407020
|
|
|
|
|
+// if (inboundResponse.getReceivableId() != null) {
|
|
|
|
|
+// accountService.accPayable(inboundResponse.getIntoId(), Constant.InventoryDocCode.INTOBOUND.getTableName());
|
|
|
|
|
+// }
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 调用库存
|
|
//region 调用库存
|