update 创建采购的到货单时更新订单数量
This commit is contained in:
parent
305d36b2e9
commit
1b7b8915f1
@ -152,4 +152,11 @@ public interface DeliveryDao {
|
|||||||
@MapKey("storeCharge")
|
@MapKey("storeCharge")
|
||||||
List<Map<String, Object>> getStoreChargeSort(@Param("siteName") String siteName,
|
List<Map<String, Object>> getStoreChargeSort(@Param("siteName") String siteName,
|
||||||
@Param("documentName") String documentName);
|
@Param("documentName") String documentName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新入库单数量
|
||||||
|
* @param receiveList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateMaterialReceiveRequestDetailQty(@Param("receiveList") List<DeliveryRelationDto> receiveList);
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,10 @@ public class DeliveryServiceImpl implements IDeliveryService {
|
|||||||
if (deliveryDao.createRelation(res) <= 0) {
|
if (deliveryDao.createRelation(res) <= 0) {
|
||||||
throw new GlobalException("添加到库单关系失败");
|
throw new GlobalException("添加到库单关系失败");
|
||||||
}
|
}
|
||||||
|
//更新采购订单行项的已入库数量
|
||||||
|
if (deliveryDao.updateMaterialReceiveRequestDetailQty(res) <= 0){
|
||||||
|
throw new GlobalException("更新采购单入库数量失败");
|
||||||
|
}
|
||||||
// 添加到库单
|
// 添加到库单
|
||||||
return deliveryDao.createDelivery(dto, DeliveryStateEnums.CREATE.getCode());
|
return deliveryDao.createDelivery(dto, DeliveryStateEnums.CREATE.getCode());
|
||||||
}
|
}
|
||||||
|
@ -501,4 +501,11 @@
|
|||||||
ORDER BY A.CHARGE
|
ORDER BY A.CHARGE
|
||||||
) TTT
|
) TTT
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateMaterialReceiveRequestDetailQty">
|
||||||
|
<foreach item="item" index="index" collection="receiveList">
|
||||||
|
update MATERIALRECEIVEREQUESTDETAIL set RECEIVEDQUANTITY = #{item.deliveryNum} where RECEIVEREQUESTNAME = #{item.receiveRequestName} and RECEIVEREQUESTDETAILNAME = #{item.receiveRequestDetailName} and MATERIALSPECNAME = #{item.materialSpecName}
|
||||||
|
INTO MATERIALDELIVERYRECEIVE (RECEIVEREQUESTNAME, DELIVERYNAME, DELIVERYNUM, MATERIALSPECNAME, RECEIVEREQUESTDETAILNAME) VALUES (#{item.receiveRequestName}, #{item.deliveryName}, #{item.deliveryNum}, #{item.materialSpecName}, #{item.receiveRequestDetailName})
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user